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.
@@ -1,93 +1,88 @@
1
1
  import * as n from "react";
2
2
  import { useControllableState as T } from "@radix-ui/react-use-controllable-state";
3
3
  import { readIsIrisChatWindowPlacement as te } from "./iris-chat-context.js";
4
- import { createDefaultIrisChatFrame as I, readIrisChatMaxFrameSize as ne, clampIrisChatFrame as re, IRIS_CHAT_FRAME_DEFAULT_HEIGHT_PX as ae, IRIS_CHAT_FRAME_DEFAULT_WIDTH_PX as oe, createCompactIrisChatFrame as se, readIrisChatViewport as z } from "./iris-chat-frame.js";
5
- import { readIrisChatFrameIsLarge as ie, createIrisChatSnapFrame as ce } from "./iris-chat-snap-presets.js";
4
+ import { createDefaultIrisChatFrame as g, readIrisChatMaxFrameSize as ne, readIrisChatFrameWithSizeAnchoredAtBottomRight as re, IRIS_CHAT_FRAME_DEFAULT_HEIGHT_PX as ae, IRIS_CHAT_FRAME_DEFAULT_WIDTH_PX as oe, createCompactIrisChatFrame as se, readIrisChatViewport as x } from "./iris-chat-frame.js";
5
+ import { readIrisChatFrameIsCompact as ie, createIrisChatSnapFrame as ce } from "./iris-chat-snap-presets.js";
6
6
  import { readIrisChatCloseTransform as le, IRIS_CHAT_CLOSE_ANIMATION_MS as ue, readIrisChatCloseAnimationStyle as me } from "./iris-chat-close-animation.js";
7
- import { readIrisChatLaunchAnimationEnabled as N, runIrisChatOpenFromLaunchTarget as fe } from "./iris-chat-launch-animation.js";
8
- function Ie(D) {
7
+ import { readIrisChatLaunchAnimationEnabled as z, runIrisChatOpenFromLaunchTarget as fe } from "./iris-chat-launch-animation.js";
8
+ function Fe(N) {
9
9
  const {
10
10
  open: W,
11
11
  defaultOpen: E = !0,
12
- onOpenChange: q,
13
- placement: B,
14
- defaultPlacement: w = "dock-right",
15
- onPlacementChange: U,
16
- frame: V,
17
- defaultFrame: S,
18
- onFrameChange: X,
12
+ onOpenChange: D,
13
+ placement: q,
14
+ defaultPlacement: S = "dock-right",
15
+ onPlacementChange: B,
16
+ frame: U,
17
+ defaultFrame: _,
18
+ onFrameChange: V,
19
19
  closeAnimationTarget: p,
20
- onCloseAnimationComplete: _
21
- } = D, C = n.useRef(null), a = n.useRef(null), d = n.useRef(null), y = n.useRef(!1), [o, P] = n.useState(!1), [v, x] = n.useState(!1), [G, l] = T({
20
+ onCloseAnimationComplete: w
21
+ } = N, C = n.useRef(null), r = n.useRef(null), d = n.useRef(null), F = n.useRef(!1), [a, P] = n.useState(!1), [v, L] = n.useState(!1), [X, l] = T({
22
22
  prop: W,
23
23
  defaultProp: E,
24
- onChange: q
25
- }), [j, u] = T({
26
- prop: B,
27
- defaultProp: w,
28
- onChange: U
29
- }), [L, M] = T({
30
- prop: V,
31
- defaultProp: S ?? I(),
32
- onChange: X
33
- }), h = n.useRef(
34
- L ?? S ?? I()
35
- ), s = G ?? E, g = j ?? w, r = L ?? I(), m = te(g);
36
- function J(e) {
37
- M(e);
24
+ onChange: D
25
+ }), [G, u] = T({
26
+ prop: q,
27
+ defaultProp: S,
28
+ onChange: B
29
+ }), [M, b] = T({
30
+ prop: U,
31
+ defaultProp: _ ?? g(),
32
+ onChange: V
33
+ }), A = n.useRef(
34
+ M ?? _ ?? g()
35
+ ), o = X ?? E, h = G ?? S, s = M ?? g(), m = te(h);
36
+ function j(e) {
37
+ b(e);
38
38
  }
39
39
  function i(e) {
40
- M(e);
40
+ b(e);
41
41
  }
42
- function K() {
43
- i(I());
44
- }
45
- function b() {
46
- h.current = r, i(se({ x: r.x, y: r.y })), u("minimized");
42
+ function J() {
43
+ i(g());
47
44
  }
48
45
  function H() {
49
- i(h.current), u("float");
46
+ A.current = s, i(se(s)), u("minimized");
47
+ }
48
+ function K() {
49
+ i(A.current), u("float");
50
50
  }
51
51
  function Q(e) {
52
- h.current = r, i(ce(e, z())), u("float");
52
+ A.current = s, i(ce(e, x())), u("float");
53
53
  }
54
54
  function Y() {
55
- const e = z();
56
- if (g === "minimized") {
57
- H();
58
- return;
59
- }
60
- if (ie(r, e)) {
61
- b();
55
+ const e = x();
56
+ if (ie(s, h)) {
57
+ const c = ne(e);
58
+ i(
59
+ re(
60
+ s,
61
+ Math.min(oe, c.width),
62
+ Math.min(ae, c.height),
63
+ e
64
+ )
65
+ ), u("float");
62
66
  return;
63
67
  }
64
- const t = ne(e), c = re(
65
- {
66
- x: r.x,
67
- y: r.y,
68
- width: Math.min(oe, t.width),
69
- height: Math.min(ae, t.height)
70
- },
71
- e
72
- );
73
- h.current = c, i(c), u("float");
68
+ H();
74
69
  }
75
70
  n.useEffect(() => () => {
76
- a.current !== null && window.clearTimeout(a.current), d.current?.();
71
+ r.current !== null && window.clearTimeout(r.current), d.current?.();
77
72
  }, []);
78
- const A = n.useCallback(() => {
79
- a.current !== null && (window.clearTimeout(a.current), a.current = null);
73
+ const R = n.useCallback(() => {
74
+ r.current !== null && (window.clearTimeout(r.current), r.current = null);
80
75
  const e = C.current;
81
- e && (e.style.transform = "", e.style.opacity = "", e.style.transition = "", e.style.pointerEvents = ""), P(!1), l(!1), _?.();
82
- }, [_, l]), F = n.useCallback(
76
+ e && (e.style.transform = "", e.style.opacity = "", e.style.transition = "", e.style.pointerEvents = ""), P(!1), l(!1), w?.();
77
+ }, [w, l]), I = n.useCallback(
83
78
  (e) => {
84
79
  requestAnimationFrame(() => {
85
80
  const c = p?.() ?? null;
86
- N({ target: c, panel: e, isWindowPlacement: m }) && (d.current?.(), x(!0), d.current = fe({
81
+ z({ target: c, panel: e, isWindowPlacement: m }) && (d.current?.(), L(!0), d.current = fe({
87
82
  panel: e,
88
83
  target: c,
89
84
  onComplete: () => {
90
- d.current = null, x(!1);
85
+ d.current = null, L(!1);
91
86
  }
92
87
  }));
93
88
  });
@@ -95,26 +90,26 @@ function Ie(D) {
95
90
  [p, m]
96
91
  ), f = n.useRef(!1);
97
92
  n.useLayoutEffect(() => {
98
- if (!s) {
99
- y.current = !1, f.current = !1;
93
+ if (!o) {
94
+ F.current = !1, f.current = !1;
100
95
  return;
101
96
  }
102
- if (y.current || o)
97
+ if (F.current || a)
103
98
  return;
104
- y.current = !0, f.current = !0;
99
+ F.current = !0, f.current = !0;
105
100
  const e = C.current;
106
- e && (f.current = !1, F(e));
107
- }, [o, s, F]);
101
+ e && (f.current = !1, I(e));
102
+ }, [a, o, I]);
108
103
  const Z = n.useCallback(
109
104
  (e) => {
110
- C.current = e, e && f.current && (f.current = !1, F(e));
105
+ C.current = e, e && f.current && (f.current = !1, I(e));
111
106
  },
112
- [F]
107
+ [I]
113
108
  ), $ = n.useCallback(() => {
114
- if (!s || o)
109
+ if (!o || a)
115
110
  return;
116
111
  const e = p?.() ?? null, t = C.current;
117
- if (!N({
112
+ if (!z({
118
113
  target: e,
119
114
  panel: t,
120
115
  isWindowPlacement: m
@@ -125,37 +120,37 @@ function Ie(D) {
125
120
  const ee = le(
126
121
  t.getBoundingClientRect(),
127
122
  e.getBoundingClientRect()
128
- ), R = me(ee);
129
- P(!0), t.style.pointerEvents = "none", t.style.transformOrigin = "center center", t.style.transition = R.transition, t.style.opacity = R.opacity, requestAnimationFrame(() => {
130
- t.style.transform = R.transform;
123
+ ), y = me(ee);
124
+ P(!0), t.style.pointerEvents = "none", t.style.transformOrigin = "center center", t.style.transition = y.transition, t.style.opacity = y.opacity, requestAnimationFrame(() => {
125
+ t.style.transform = y.transform;
131
126
  });
132
127
  const O = (k) => {
133
- k.target !== t || k.propertyName !== "transform" || (t.removeEventListener("transitionend", O), A());
128
+ k.target !== t || k.propertyName !== "transform" || (t.removeEventListener("transitionend", O), R());
134
129
  };
135
- t.addEventListener("transitionend", O), a.current = window.setTimeout(() => {
136
- t.removeEventListener("transitionend", O), A();
130
+ t.addEventListener("transitionend", O), r.current = window.setTimeout(() => {
131
+ t.removeEventListener("transitionend", O), R();
137
132
  }, ue + 80);
138
- }, [p, A, o, m, s, l]);
133
+ }, [p, R, a, m, o, l]);
139
134
  return {
140
- resolvedOpen: s,
141
- resolvedPlacement: g,
142
- isClosing: o,
135
+ resolvedOpen: o,
136
+ resolvedPlacement: h,
137
+ isClosing: a,
143
138
  isOpening: v,
144
139
  providerValue: {
145
- open: s,
140
+ open: o,
146
141
  setOpen: l,
147
142
  requestClose: $,
148
- isClosing: o,
143
+ isClosing: a,
149
144
  isOpening: v,
150
145
  registerPanelNode: Z,
151
- placement: g,
146
+ placement: h,
152
147
  setPlacement: u,
153
- frame: r,
154
- setFrame: J,
148
+ frame: s,
149
+ setFrame: j,
155
150
  commitFrame: i,
156
- resetFrame: K,
157
- applyCompactFrame: b,
158
- expandFromCompactFrame: H,
151
+ resetFrame: J,
152
+ applyCompactFrame: H,
153
+ expandFromCompactFrame: K,
159
154
  applySnapPreset: Q,
160
155
  toggleWindowSize: Y,
161
156
  isWindowPlacement: m
@@ -163,5 +158,5 @@ function Ie(D) {
163
158
  };
164
159
  }
165
160
  export {
166
- Ie as useIrisChatRoot
161
+ Fe as useIrisChatRoot
167
162
  };
@@ -337,6 +337,11 @@ export interface IrisChatMessages {
337
337
  snapTopHalf: string;
338
338
  snapBottomHalf: string;
339
339
  snapFill: string;
340
+ snapDock: string;
341
+ snapBottomRight: string;
342
+ snapBottomLeft: string;
343
+ snapTopRight: string;
344
+ snapTopLeft: string;
340
345
  resize: string;
341
346
  back: string;
342
347
  filter: string;
@@ -346,6 +346,11 @@ const e = {
346
346
  snapTopHalf: "Snap to top half",
347
347
  snapBottomHalf: "Snap to bottom half",
348
348
  snapFill: "Fill available space",
349
+ snapDock: "Dock as chat window",
350
+ snapBottomRight: "Dock bottom right",
351
+ snapBottomLeft: "Dock bottom left",
352
+ snapTopRight: "Dock top right",
353
+ snapTopLeft: "Dock top left",
349
354
  resize: "Resize",
350
355
  back: "Back",
351
356
  filter: "Filter",
@@ -432,7 +437,7 @@ const e = {
432
437
  columnOptions: "Column Options",
433
438
  chooseColumns: "Choose Columns",
434
439
  resetColumns: "Reset Columns"
435
- }, T = {
440
+ }, k = {
436
441
  calendar: e,
437
442
  datePicker: t,
438
443
  filter: a,
@@ -458,5 +463,5 @@ const e = {
458
463
  stereoScatter: w
459
464
  };
460
465
  export {
461
- T as defaultMessages
466
+ k as defaultMessages
462
467
  };
@@ -372,6 +372,11 @@ const e = {
372
372
  snapTopHalf: "Obere Hälfte",
373
373
  snapBottomHalf: "Untere Hälfte",
374
374
  snapFill: "Verfügbaren Platz füllen",
375
+ snapDock: "Als Chatfenster andocken",
376
+ snapBottomRight: "Unten rechts",
377
+ snapBottomLeft: "Unten links",
378
+ snapTopRight: "Oben rechts",
379
+ snapTopLeft: "Oben links",
375
380
  resize: "Größe ändern",
376
381
  back: "Zurück",
377
382
  filter: "Filter",
@@ -372,6 +372,11 @@ const e = {
372
372
  snapTopHalf: "Mitad superior",
373
373
  snapBottomHalf: "Mitad inferior",
374
374
  snapFill: "Rellenar espacio",
375
+ snapDock: "Acoplar como chat",
376
+ snapBottomRight: "Abajo a la derecha",
377
+ snapBottomLeft: "Abajo a la izquierda",
378
+ snapTopRight: "Arriba a la derecha",
379
+ snapTopLeft: "Arriba a la izquierda",
375
380
  resize: "Redimensionar",
376
381
  back: "Atrás",
377
382
  filter: "Filtrar",
@@ -372,6 +372,11 @@ const e = {
372
372
  snapTopHalf: "ऊपरी आधा",
373
373
  snapBottomHalf: "निचला आधा",
374
374
  snapFill: "उपलब्ध स्थान भरें",
375
+ snapDock: "चैट विंडो के रूप में डॉक करें",
376
+ snapBottomRight: "नीचे दाएँ",
377
+ snapBottomLeft: "नीचे बाएँ",
378
+ snapTopRight: "ऊपर दाएँ",
379
+ snapTopLeft: "ऊपर बाएँ",
375
380
  resize: "आकार बदलें",
376
381
  back: "वापस",
377
382
  filter: "फ़िल्टर",
@@ -372,6 +372,11 @@ const e = {
372
372
  snapTopHalf: "Snap to top half",
373
373
  snapBottomHalf: "Snap to bottom half",
374
374
  snapFill: "Fill available space",
375
+ snapDock: "Dock as chat window",
376
+ snapBottomRight: "Dock bottom right",
377
+ snapBottomLeft: "Dock bottom left",
378
+ snapTopRight: "Dock top right",
379
+ snapTopLeft: "Dock top left",
375
380
  resize: "Resize",
376
381
  back: "Back",
377
382
  filter: "Filter",