@floegence/floe-webapp-core 0.72.0 → 0.74.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.
@@ -35,7 +35,10 @@ interface ResolveFloatingWindowRectOptions {
35
35
  resizeHandle: FloatingWindowResizeHandle;
36
36
  minSize: Size;
37
37
  maxSize: Size;
38
- viewport: Size;
38
+ viewport: Size & {
39
+ x?: number;
40
+ y?: number;
41
+ };
39
42
  viewportInsets?: FloatingWindowViewportInsets;
40
43
  mobile: boolean;
41
44
  mobilePadding: number;
@@ -44,13 +47,19 @@ interface NormalizeFloatingWindowRectOptions {
44
47
  rect: FloatingWindowRect;
45
48
  minSize: Size;
46
49
  maxSize: Size;
47
- viewport: Size;
50
+ viewport: Size & {
51
+ x?: number;
52
+ y?: number;
53
+ };
48
54
  viewportInsets?: FloatingWindowViewportInsets;
49
55
  mobile: boolean;
50
56
  mobilePadding: number;
51
57
  center?: boolean;
52
58
  }
53
- export declare function resolveFloatingWindowViewport(viewport: Size, insets?: FloatingWindowViewportInsets): FloatingWindowViewport;
59
+ export declare function resolveFloatingWindowViewport(viewport: Size & {
60
+ x?: number;
61
+ y?: number;
62
+ }, insets?: FloatingWindowViewportInsets): FloatingWindowViewport;
54
63
  export declare function resolveFloatingWindowRect(options: ResolveFloatingWindowRectOptions): FloatingWindowRect;
55
64
  export declare function normalizeFloatingWindowRect(options: NormalizeFloatingWindowRectOptions): FloatingWindowRect;
56
65
  export {};
@@ -1,37 +1,37 @@
1
- function x(e, i, m) {
2
- return Math.max(i, Math.min(m, e));
1
+ function x(n, i, m) {
2
+ return Math.max(i, Math.min(m, n));
3
3
  }
4
- function l(e, i, m) {
5
- const s = Math.max(0, m), o = Math.min(e, s), c = Math.max(o, Math.min(i, s));
4
+ function l(n, i, m) {
5
+ const s = Math.max(0, m), o = Math.min(n, s), c = Math.max(o, Math.min(i, s));
6
6
  return { min: o, max: c };
7
7
  }
8
- function z(e) {
9
- const i = Number(e);
8
+ function v(n) {
9
+ const i = Number(n);
10
10
  return Number.isFinite(i) && i > 0 ? i : 0;
11
11
  }
12
- function X(e, i = {}) {
13
- const m = Math.max(0, e.width), s = Math.max(0, e.height), o = Math.min(z(i.left), m), c = Math.min(z(i.top), s), n = Math.min(z(i.right), Math.max(0, m - o)), d = Math.min(z(i.bottom), Math.max(0, s - c));
12
+ function X(n, i = {}) {
13
+ const m = Math.max(0, n.width), s = Math.max(0, n.height), o = Math.min(v(i.left), m), c = Math.min(v(i.top), s), e = Math.min(v(i.right), Math.max(0, m - o)), d = Math.min(v(i.bottom), Math.max(0, s - c));
14
14
  return {
15
- x: o,
16
- y: c,
17
- width: Math.max(0, m - o - n),
15
+ x: (n.x ?? 0) + o,
16
+ y: (n.y ?? 0) + c,
17
+ width: Math.max(0, m - o - e),
18
18
  height: Math.max(0, s - c - d)
19
19
  };
20
20
  }
21
- function Y(e) {
22
- return e.x + e.width;
21
+ function Y(n) {
22
+ return n.x + n.width;
23
23
  }
24
- function H(e) {
25
- return e.y + e.height;
24
+ function H(n) {
25
+ return n.y + n.height;
26
26
  }
27
- function I(e) {
27
+ function I(n) {
28
28
  const {
29
29
  mode: i,
30
30
  pointer: m,
31
31
  dragStartPos: s,
32
32
  dragStartRect: o,
33
33
  resizeStartPos: c,
34
- resizeStartRect: n,
34
+ resizeStartRect: e,
35
35
  resizeHandle: d,
36
36
  minSize: r,
37
37
  maxSize: t,
@@ -39,55 +39,55 @@ function I(e) {
39
39
  viewportInsets: S,
40
40
  mobile: y,
41
41
  mobilePadding: f
42
- } = e, a = X(R, S), g = Y(a), w = H(a), u = m.x - (i === "drag" ? s.x : c.x), p = m.y - (i === "drag" ? s.y : c.y);
42
+ } = n, a = X(R, S), g = Y(a), M = H(a), u = m.x - (i === "drag" ? s.x : c.x), p = m.y - (i === "drag" ? s.y : c.y);
43
43
  if (i === "drag") {
44
- const h = Math.max(a.x, g - o.width), M = Math.max(a.y, w - o.height);
44
+ const h = Math.max(a.x, g - o.width), w = Math.max(a.y, M - o.height);
45
45
  return {
46
46
  ...o,
47
47
  x: x(y ? a.x + f : o.x + u, a.x, h),
48
- y: x(o.y + p, a.y, M)
48
+ y: x(o.y + p, a.y, w)
49
49
  };
50
50
  }
51
- let b = n.width, v = n.height, W = n.x, F = n.y;
51
+ let b = e.width, z = e.height, W = e.x, F = e.y;
52
52
  if (!y && d.includes("e")) {
53
- const h = l(r.width, t.width, g - n.x);
54
- b = x(n.width + u, h.min, h.max);
53
+ const h = l(r.width, t.width, g - e.x);
54
+ b = x(e.width + u, h.min, h.max);
55
55
  }
56
56
  if (!y && d.includes("w")) {
57
- const h = n.x + n.width, M = l(r.width, t.width, h - a.x), B = h - M.max, P = Math.max(B, h - M.min);
58
- W = x(n.x + u, B, P), b = Math.max(0, h - W);
57
+ const h = e.x + e.width, w = l(r.width, t.width, h - a.x), B = h - w.max, P = Math.max(B, h - w.min);
58
+ W = x(e.x + u, B, P), b = Math.max(0, h - W);
59
59
  }
60
60
  if (d.includes("s")) {
61
- const h = l(r.height, t.height, w - n.y);
62
- v = x(n.height + p, h.min, h.max);
61
+ const h = l(r.height, t.height, M - e.y);
62
+ z = x(e.height + p, h.min, h.max);
63
63
  }
64
64
  if (d.includes("n")) {
65
- const h = n.y + n.height, M = l(r.height, t.height, h - a.y), B = h - M.max, P = Math.max(B, h - M.min);
66
- F = x(n.y + p, B, P), v = Math.max(0, h - F);
65
+ const h = e.y + e.height, w = l(r.height, t.height, h - a.y), B = h - w.max, P = Math.max(B, h - w.min);
66
+ F = x(e.y + p, B, P), z = Math.max(0, h - F);
67
67
  }
68
68
  return {
69
69
  x: x(W, a.x, Math.max(a.x, g - b)),
70
- y: x(F, a.y, Math.max(a.y, w - v)),
70
+ y: x(F, a.y, Math.max(a.y, M - z)),
71
71
  width: b,
72
- height: v
72
+ height: z
73
73
  };
74
74
  }
75
- function V(e) {
75
+ function V(n) {
76
76
  const {
77
77
  rect: i,
78
78
  minSize: m,
79
79
  maxSize: s,
80
80
  viewport: o,
81
81
  viewportInsets: c,
82
- mobile: n,
82
+ mobile: e,
83
83
  mobilePadding: d,
84
84
  center: r = !1
85
- } = e, t = X(o, c), R = Y(t), S = H(t), y = n ? Math.max(0, t.width - d * 2) : t.width, f = l(m.width, s.width, y), a = l(m.height, s.height, t.height), g = n ? f.max : x(i.width, f.min, f.max), w = x(i.height, a.min, a.max), u = Math.max(t.x, R - g), p = Math.max(t.y, S - w);
85
+ } = n, t = X(o, c), R = Y(t), S = H(t), y = e ? Math.max(0, t.width - d * 2) : t.width, f = l(m.width, s.width, y), a = l(m.height, s.height, t.height), g = e ? f.max : x(i.width, f.min, f.max), M = x(i.height, a.min, a.max), u = Math.max(t.x, R - g), p = Math.max(t.y, S - M);
86
86
  return {
87
- x: n ? x(t.x + d, t.x, u) : r ? Math.max(t.x, Math.round(t.x + (t.width - g) / 2)) : x(i.x, t.x, u),
88
- y: r ? Math.max(t.y, Math.round(t.y + (t.height - w) / 2)) : x(i.y, t.y, p),
87
+ x: e ? x(t.x + d, t.x, u) : r ? Math.max(t.x, Math.round(t.x + (t.width - g) / 2)) : x(i.x, t.x, u),
88
+ y: r ? Math.max(t.y, Math.round(t.y + (t.height - M) / 2)) : x(i.y, t.y, p),
89
89
  width: g,
90
- height: w
90
+ height: M
91
91
  };
92
92
  }
93
93
  export {
package/dist/floe.css CHANGED
@@ -455,10 +455,29 @@
455
455
  --floe-floating-exit-scale: 1;
456
456
  }
457
457
 
458
+ .floe-side-drawer-overlay {
459
+ --floe-dialog-gap-y: 0px;
460
+ --floe-dialog-gap-x: 0px;
461
+ padding: 0;
462
+ }
463
+
464
+ .floe-side-drawer-panel {
465
+ height: 100%;
466
+ border-top-right-radius: 0;
467
+ border-bottom-right-radius: 0;
468
+ --floe-floating-enter-x: min(8rem, 18vw);
469
+ --floe-floating-exit-x: min(6rem, 14vw);
470
+ --floe-floating-enter-y: 0;
471
+ --floe-floating-exit-y: 0;
472
+ --floe-floating-enter-scale: 1;
473
+ --floe-floating-exit-scale: 1;
474
+ --floe-floating-origin: right center;
475
+ }
476
+
458
477
  .floe-bottom-drawer-overlay {
459
- padding: max(1.25rem, env(safe-area-inset-top, 0px))
460
- max(1.5rem, env(safe-area-inset-right, 0px)) max(1.25rem, env(safe-area-inset-bottom, 0px))
461
- max(1.5rem, env(safe-area-inset-left, 0px));
478
+ --floe-dialog-gap-y: 1.25rem;
479
+ --floe-dialog-gap-x: 1.5rem;
480
+ padding: var(--floe-dialog-gap-y) var(--floe-dialog-gap-x);
462
481
  }
463
482
 
464
483
  .floe-bottom-drawer-backdrop {
@@ -480,9 +499,8 @@
480
499
 
481
500
  @media (max-width: 639px) {
482
501
  .floe-bottom-drawer-overlay {
483
- padding: max(0.75rem, env(safe-area-inset-top, 0px))
484
- max(0.75rem, env(safe-area-inset-right, 0px)) max(0.75rem, env(safe-area-inset-bottom, 0px))
485
- max(0.75rem, env(safe-area-inset-left, 0px));
502
+ --floe-dialog-gap-y: 0.75rem;
503
+ --floe-dialog-gap-x: 0.75rem;
486
504
  }
487
505
  }
488
506