@floegence/floe-webapp-core 0.35.48 → 0.35.49

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.
@@ -12,4 +12,5 @@ export interface FileBrowserMarqueeSelectionResult {
12
12
  overlayStyle: Accessor<Record<string, string> | null>;
13
13
  onPointerDown: (event: PointerEvent) => void;
14
14
  }
15
+ export declare const FILE_BROWSER_MARQUEE_OVERLAY_CLASS = "pointer-events-none fixed z-40 rounded-md floe-file-browser-marquee-overlay";
15
16
  export declare function createFileBrowserMarqueeSelection(options: FileBrowserMarqueeSelectionOptions): FileBrowserMarqueeSelectionResult;
@@ -1,7 +1,7 @@
1
- import { createSignal as v, createMemo as y, onCleanup as w } from "solid-js";
1
+ import { createSignal as R, createMemo as b, onCleanup as y } from "solid-js";
2
2
  import { isPrimaryModKeyPressed as L } from "../../utils/keybind.js";
3
- const P = 4;
4
- function R(t, n, l, o) {
3
+ const w = 4, G = "pointer-events-none fixed z-40 rounded-md floe-file-browser-marquee-overlay";
4
+ function x(t, n, l, o) {
5
5
  const r = Math.min(t, l), c = Math.min(n, o);
6
6
  return {
7
7
  left: r,
@@ -10,44 +10,44 @@ function R(t, n, l, o) {
10
10
  height: Math.abs(o - n)
11
11
  };
12
12
  }
13
- function x(t, n) {
13
+ function P(t, n) {
14
14
  return !(t.left + t.width < n.left || n.right < t.left || t.top + t.height < n.top || n.bottom < t.top);
15
15
  }
16
- function D(t) {
16
+ function _(t) {
17
17
  return !(!(t instanceof Element) || t.closest("[data-file-browser-item-id]") || t.closest('button, input, textarea, select, a, [role="button"], [role="menuitem"]'));
18
18
  }
19
- function $(t) {
20
- const [n, l] = v(null);
19
+ function C(t) {
20
+ const [n, l] = R(null);
21
21
  let o = null, r = !1, c = [], s = 0, a = 0, u = !1;
22
- const I = () => {
23
- typeof document > "u" || (document.removeEventListener("pointermove", p, !0), document.removeEventListener("pointerup", m, !0), document.removeEventListener("pointercancel", h, !0));
22
+ const g = () => {
23
+ typeof document > "u" || (document.removeEventListener("pointermove", m, !0), document.removeEventListener("pointerup", p, !0), document.removeEventListener("pointercancel", h, !0));
24
24
  }, f = () => {
25
- I(), o = null, r = !1, c = [], s = 0, a = 0, u = !1, l(null);
25
+ g(), o = null, r = !1, c = [], s = 0, a = 0, u = !1, l(null);
26
26
  }, E = (e) => {
27
- const d = t.getVisibleItemIdsInOrder().filter((b) => {
28
- const g = t.getElementForId(b);
29
- return g ? x(e, g.getBoundingClientRect()) : !1;
27
+ const d = t.getVisibleItemIdsInOrder().filter((M) => {
28
+ const I = t.getElementForId(M);
29
+ return I ? P(e, I.getBoundingClientRect()) : !1;
30
30
  }), i = r ? [...c, ...d] : d;
31
31
  t.replaceSelection(i, {
32
32
  anchorId: r ? void 0 : i[0] ?? null,
33
33
  lastInteractedId: i[i.length - 1] ?? null,
34
34
  preserveAnchor: r
35
35
  });
36
- }, p = (e) => {
36
+ }, m = (e) => {
37
37
  if (o !== e.pointerId) return;
38
38
  const d = Math.hypot(e.clientX - s, e.clientY - a);
39
- if (!u && d < P)
39
+ if (!u && d < w)
40
40
  return;
41
41
  e.preventDefault(), u = !0;
42
- const i = R(s, a, e.clientX, e.clientY);
42
+ const i = x(s, a, e.clientX, e.clientY);
43
43
  l(i), E(i);
44
- }, m = (e) => {
44
+ }, p = (e) => {
45
45
  o === e.pointerId && (!u && !r && t.clearSelection(), f());
46
46
  }, h = (e) => {
47
47
  o === e.pointerId && f();
48
- }, M = (e) => {
49
- e.pointerType !== "mouse" || e.button !== 0 || D(e.target) && t.getContainer() && (o = e.pointerId, r = L(e), c = r ? t.getSelectedIds() : [], s = e.clientX, a = e.clientY, u = !1, typeof document < "u" && (document.addEventListener("pointermove", p, !0), document.addEventListener("pointerup", m, !0), document.addEventListener("pointercancel", h, !0)), e.preventDefault());
50
- }, S = y(() => {
48
+ }, S = (e) => {
49
+ e.pointerType !== "mouse" || e.button !== 0 || _(e.target) && t.getContainer() && (o = e.pointerId, r = L(e), c = r ? t.getSelectedIds() : [], s = e.clientX, a = e.clientY, u = !1, typeof document < "u" && (document.addEventListener("pointermove", m, !0), document.addEventListener("pointerup", p, !0), document.addEventListener("pointercancel", h, !0)), e.preventDefault());
50
+ }, v = b(() => {
51
51
  const e = n();
52
52
  return e ? {
53
53
  left: `${e.left}px`,
@@ -56,13 +56,14 @@ function $(t) {
56
56
  height: `${e.height}px`
57
57
  } : null;
58
58
  });
59
- return w(() => {
59
+ return y(() => {
60
60
  f();
61
61
  }), {
62
- overlayStyle: S,
63
- onPointerDown: M
62
+ overlayStyle: v,
63
+ onPointerDown: S
64
64
  };
65
65
  }
66
66
  export {
67
- $ as createFileBrowserMarqueeSelection
67
+ G as FILE_BROWSER_MARQUEE_OVERLAY_CLASS,
68
+ C as createFileBrowserMarqueeSelection
68
69
  };
package/dist/floe.css CHANGED
@@ -324,6 +324,14 @@
324
324
  -webkit-touch-callout: none;
325
325
  }
326
326
 
327
+ .floe-file-browser-marquee-overlay {
328
+ border: 2px solid color-mix(in srgb, var(--selection-bg) 96%, white 4%);
329
+ background-color: color-mix(in srgb, var(--selection-bg) 18%, transparent);
330
+ box-shadow:
331
+ 0 0 0 1px color-mix(in srgb, var(--selection-bg) 24%, white 12%),
332
+ 0 8px 24px color-mix(in srgb, var(--selection-bg) 18%, transparent);
333
+ }
334
+
327
335
  [data-floe-touch-surface='true'],
328
336
  [data-floe-touch-surface='true'] * {
329
337
  -webkit-user-select: none;