@floegence/floe-webapp-core 0.36.39 → 0.36.41
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/file-browser/useFileBrowserMarqueeSelection.d.ts +2 -0
- package/dist/components/file-browser/useFileBrowserMarqueeSelection.js +74 -68
- package/dist/components/workbench/WorkbenchFilterBar.js +152 -131
- package/dist/components/workbench/workbenchEdgeAutoPan.d.ts +8 -0
- package/dist/components/workbench/workbenchEdgeAutoPan.js +69 -76
- package/package.json +1 -1
|
@@ -1,93 +1,99 @@
|
|
|
1
|
-
import { createSignal as
|
|
2
|
-
import { isPrimaryModKeyPressed as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const
|
|
1
|
+
import { createSignal as v, createMemo as w, onCleanup as M } from "solid-js";
|
|
2
|
+
import { isPrimaryModKeyPressed as T } from "../../utils/keybind.js";
|
|
3
|
+
const x = 4, _ = "pointer-events-none absolute z-40 rounded-md floe-file-browser-marquee-overlay";
|
|
4
|
+
function y(e, t, l, r) {
|
|
5
|
+
const i = Math.min(e, l), s = Math.min(t, r);
|
|
6
6
|
return {
|
|
7
|
-
left:
|
|
8
|
-
top:
|
|
9
|
-
width: Math.abs(
|
|
10
|
-
height: Math.abs(
|
|
7
|
+
left: i,
|
|
8
|
+
top: s,
|
|
9
|
+
width: Math.abs(l - e),
|
|
10
|
+
height: Math.abs(r - t)
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return !(e.left + e.width <
|
|
13
|
+
function H(e, t) {
|
|
14
|
+
return !(e.left + e.width < t.left || t.right < e.left || e.top + e.height < t.top || t.bottom < e.top);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function O(e) {
|
|
17
17
|
return !(!(e instanceof Element) || e.closest("[data-file-browser-item-id]") || e.closest('button, input, textarea, select, a, [role="button"], [role="menuitem"]'));
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
const
|
|
19
|
+
function P(e) {
|
|
20
|
+
const t = e.getBoundingClientRect(), l = e.offsetWidth, r = e.offsetHeight;
|
|
21
21
|
return {
|
|
22
|
-
left:
|
|
23
|
-
top:
|
|
22
|
+
left: t.left,
|
|
23
|
+
top: t.top,
|
|
24
24
|
scrollLeft: e.scrollLeft,
|
|
25
25
|
scrollTop: e.scrollTop,
|
|
26
26
|
clientLeft: e.clientLeft,
|
|
27
|
-
clientTop: e.clientTop
|
|
27
|
+
clientTop: e.clientTop,
|
|
28
|
+
scaleX: l > 0 && t.width > 0 ? t.width / l : 1,
|
|
29
|
+
scaleY: r > 0 && t.height > 0 ? t.height / r : 1
|
|
28
30
|
};
|
|
29
31
|
}
|
|
30
|
-
function
|
|
32
|
+
function I(e) {
|
|
33
|
+
return Number.isFinite(e) && e !== void 0 && e > 0 ? e : 1;
|
|
34
|
+
}
|
|
35
|
+
function B(e, t) {
|
|
36
|
+
const l = I(t.scaleX), r = I(t.scaleY);
|
|
31
37
|
return {
|
|
32
|
-
left: e.left -
|
|
33
|
-
top: e.top -
|
|
34
|
-
width: e.width,
|
|
35
|
-
height: e.height
|
|
38
|
+
left: (e.left - t.left) / l + t.scrollLeft - t.clientLeft,
|
|
39
|
+
top: (e.top - t.top) / r + t.scrollTop - t.clientTop,
|
|
40
|
+
width: e.width / l,
|
|
41
|
+
height: e.height / r
|
|
36
42
|
};
|
|
37
43
|
}
|
|
38
|
-
function
|
|
39
|
-
const [
|
|
40
|
-
let
|
|
41
|
-
const
|
|
42
|
-
typeof document > "u" || (document.removeEventListener("pointermove", p, !0), document.removeEventListener("pointerup",
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
const
|
|
47
|
-
const g = e.getElementForId(
|
|
48
|
-
return g ?
|
|
49
|
-
}),
|
|
50
|
-
e.replaceSelection(
|
|
51
|
-
anchorId:
|
|
52
|
-
lastInteractedId:
|
|
53
|
-
preserveAnchor:
|
|
44
|
+
function A(e) {
|
|
45
|
+
const [t, l] = v(null);
|
|
46
|
+
let r = null, i = !1, s = [], a = 0, d = 0, u = !1;
|
|
47
|
+
const L = () => {
|
|
48
|
+
typeof document > "u" || (document.removeEventListener("pointermove", p, !0), document.removeEventListener("pointerup", h, !0), document.removeEventListener("pointercancel", m, !0));
|
|
49
|
+
}, f = () => {
|
|
50
|
+
L(), r = null, i = !1, s = [], a = 0, d = 0, u = !1, l(null);
|
|
51
|
+
}, E = (n) => {
|
|
52
|
+
const c = e.getVisibleItemIdsInOrder().filter((S) => {
|
|
53
|
+
const g = e.getElementForId(S);
|
|
54
|
+
return g ? H(n, g.getBoundingClientRect()) : !1;
|
|
55
|
+
}), o = i ? [...s, ...c] : c;
|
|
56
|
+
e.replaceSelection(o, {
|
|
57
|
+
anchorId: i ? void 0 : o[0] ?? null,
|
|
58
|
+
lastInteractedId: o[o.length - 1] ?? null,
|
|
59
|
+
preserveAnchor: i
|
|
54
60
|
});
|
|
55
|
-
}, p = (
|
|
56
|
-
if (
|
|
57
|
-
const
|
|
58
|
-
if (!
|
|
61
|
+
}, p = (n) => {
|
|
62
|
+
if (r !== n.pointerId) return;
|
|
63
|
+
const c = Math.hypot(n.clientX - a, n.clientY - d);
|
|
64
|
+
if (!u && c < x)
|
|
59
65
|
return;
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
},
|
|
70
|
-
const
|
|
71
|
-
if (!
|
|
72
|
-
const
|
|
73
|
-
if (!
|
|
74
|
-
const
|
|
66
|
+
n.preventDefault(), u = !0;
|
|
67
|
+
const o = y(a, d, n.clientX, n.clientY);
|
|
68
|
+
l(o), E(o);
|
|
69
|
+
}, h = (n) => {
|
|
70
|
+
r === n.pointerId && (!u && !i && e.clearSelection(), f());
|
|
71
|
+
}, m = (n) => {
|
|
72
|
+
r === n.pointerId && f();
|
|
73
|
+
}, b = (n) => {
|
|
74
|
+
n.pointerType !== "mouse" || n.button !== 0 || O(n.target) && e.getContainer() && (r = n.pointerId, i = T(n), s = i ? e.getSelectedIds() : [], a = n.clientX, d = n.clientY, u = !1, typeof document < "u" && (document.addEventListener("pointermove", p, !0), document.addEventListener("pointerup", h, !0), document.addEventListener("pointercancel", m, !0)), n.preventDefault());
|
|
75
|
+
}, R = w(() => {
|
|
76
|
+
const n = t();
|
|
77
|
+
if (!n) return null;
|
|
78
|
+
const c = e.getOverlayHost?.() ?? e.getContainer();
|
|
79
|
+
if (!c) return null;
|
|
80
|
+
const o = B(n, P(c));
|
|
75
81
|
return {
|
|
76
|
-
left: `${
|
|
77
|
-
top: `${
|
|
78
|
-
width: `${
|
|
79
|
-
height: `${
|
|
82
|
+
left: `${o.left}px`,
|
|
83
|
+
top: `${o.top}px`,
|
|
84
|
+
width: `${o.width}px`,
|
|
85
|
+
height: `${o.height}px`
|
|
80
86
|
};
|
|
81
87
|
});
|
|
82
|
-
return
|
|
83
|
-
|
|
88
|
+
return M(() => {
|
|
89
|
+
f();
|
|
84
90
|
}), {
|
|
85
|
-
overlayStyle:
|
|
86
|
-
onPointerDown:
|
|
91
|
+
overlayStyle: R,
|
|
92
|
+
onPointerDown: b
|
|
87
93
|
};
|
|
88
94
|
}
|
|
89
95
|
export {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
96
|
+
_ as FILE_BROWSER_MARQUEE_OVERLAY_CLASS,
|
|
97
|
+
A as createFileBrowserMarqueeSelection,
|
|
98
|
+
B as projectViewportRectToOverlayHost
|
|
93
99
|
};
|
|
@@ -1,26 +1,45 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { Motion as
|
|
4
|
-
import { easing as
|
|
5
|
-
import { Layers as
|
|
6
|
-
import { startHotInteraction as
|
|
7
|
-
import { startPointerSession as
|
|
8
|
-
import { WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as
|
|
9
|
-
var
|
|
10
|
-
const
|
|
11
|
-
function
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const c = l.getBoundingClientRect();
|
|
15
|
-
return t >= c.left && t <= c.right && s >= c.top && s <= c.bottom;
|
|
1
|
+
import { insert as _, createComponent as d, effect as M, setAttribute as I, template as X, Portal as K, setStyleProperty as N, delegateEvents as U } from "solid-js/web";
|
|
2
|
+
import { createSignal as R, onCleanup as q, createMemo as z, For as j, Show as x } from "solid-js";
|
|
3
|
+
import { Motion as D } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.11/node_modules/solid-motionone/dist/index.js";
|
|
4
|
+
import { easing as L, duration as P } from "../../utils/animations.js";
|
|
5
|
+
import { Layers as J, Plus as Q } from "../icons/index.js";
|
|
6
|
+
import { startHotInteraction as Z } from "../../utils/hotInteraction.js";
|
|
7
|
+
import { startPointerSession as tt } from "../ui/pointerSession.js";
|
|
8
|
+
import { WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as B, createWorkbenchEdgeAutoPanController as et, frameFromElement as nt } from "./workbenchEdgeAutoPan.js";
|
|
9
|
+
var ot = /* @__PURE__ */ X("<button type=button class=workbench-dock__item>"), rt = /* @__PURE__ */ X('<div class=workbench-dock data-floe-canvas-interactive=true><button type=button class=workbench-dock__item aria-label="Show all widgets"></button><span class=workbench-dock__divider aria-hidden=true>'), it = /* @__PURE__ */ X("<div class=workbench-dock-ghost aria-hidden=true><div class=workbench-dock-ghost__halo></div><div class=workbench-dock-ghost__card><div class=workbench-dock-ghost__icon></div><div class=workbench-dock-ghost__copy><div class=workbench-dock-ghost__title></div><div class=workbench-dock-ghost__hint><span>");
|
|
10
|
+
const H = 5, at = ".workbench-dock";
|
|
11
|
+
function V() {
|
|
12
|
+
const t = document.querySelector(B);
|
|
13
|
+
return t instanceof HTMLElement ? t.getBoundingClientRect() : null;
|
|
16
14
|
}
|
|
17
|
-
function
|
|
15
|
+
function A(t, a, r) {
|
|
16
|
+
return t >= r.left && t <= r.right && a >= r.top && a <= r.bottom;
|
|
17
|
+
}
|
|
18
|
+
function lt(t, a) {
|
|
19
|
+
const r = V();
|
|
20
|
+
return r ? A(t, a, r) : !1;
|
|
21
|
+
}
|
|
22
|
+
function st(t, a, r, u) {
|
|
23
|
+
const o = V();
|
|
24
|
+
if (!o) return !1;
|
|
25
|
+
if (A(t, a, o) || A(r, u, o))
|
|
26
|
+
return !0;
|
|
27
|
+
const n = r - t, c = u - a;
|
|
28
|
+
let v = 0, g = 1;
|
|
29
|
+
const f = (h, E) => {
|
|
30
|
+
if (h === 0) return E >= 0;
|
|
31
|
+
const m = E / h;
|
|
32
|
+
return h < 0 ? m > g ? !1 : (m > v && (v = m), !0) : m < v ? !1 : (m < g && (g = m), !0);
|
|
33
|
+
};
|
|
34
|
+
return f(-n, t - o.left) && f(n, o.right - t) && f(-c, a - o.top) && f(c, o.bottom - a);
|
|
35
|
+
}
|
|
36
|
+
function T(t, a) {
|
|
18
37
|
if (typeof document.elementFromPoint != "function") return !1;
|
|
19
|
-
const
|
|
20
|
-
return
|
|
38
|
+
const r = document.elementFromPoint(t, a);
|
|
39
|
+
return r instanceof Element && r.closest(at) !== null;
|
|
21
40
|
}
|
|
22
|
-
function
|
|
23
|
-
const
|
|
41
|
+
function ct(t) {
|
|
42
|
+
const a = () => t.hoverOffset === -1 ? {
|
|
24
43
|
scale: 1.26,
|
|
25
44
|
y: -6,
|
|
26
45
|
x: 0
|
|
@@ -36,20 +55,20 @@ function ot(t) {
|
|
|
36
55
|
scale: 1,
|
|
37
56
|
y: 0,
|
|
38
57
|
x: 0
|
|
39
|
-
},
|
|
40
|
-
|
|
58
|
+
}, r = () => t.hoverOffset === -1, u = (o) => {
|
|
59
|
+
o.button === 0 && t.onDragBegin(o, t.type, t.label, t.icon);
|
|
41
60
|
};
|
|
42
61
|
return (() => {
|
|
43
|
-
var
|
|
44
|
-
return
|
|
62
|
+
var o = ot();
|
|
63
|
+
return o.$$pointerdown = u, o.addEventListener("pointerleave", () => t.onLeave()), o.addEventListener("pointerenter", () => t.onEnter()), _(o, d(D.span, {
|
|
45
64
|
class: "workbench-dock__tile",
|
|
46
65
|
get animate() {
|
|
47
|
-
return
|
|
66
|
+
return a();
|
|
48
67
|
},
|
|
49
68
|
get transition() {
|
|
50
69
|
return {
|
|
51
|
-
duration:
|
|
52
|
-
easing:
|
|
70
|
+
duration: P.fast,
|
|
71
|
+
easing: L.easeOut
|
|
53
72
|
};
|
|
54
73
|
},
|
|
55
74
|
get children() {
|
|
@@ -60,54 +79,54 @@ function ot(t) {
|
|
|
60
79
|
});
|
|
61
80
|
})();
|
|
62
81
|
}
|
|
63
|
-
}), null),
|
|
82
|
+
}), null), _(o, d(D.span, {
|
|
64
83
|
class: "workbench-dock__tooltip",
|
|
65
84
|
get animate() {
|
|
66
85
|
return {
|
|
67
|
-
opacity:
|
|
68
|
-
y:
|
|
86
|
+
opacity: r() ? 1 : 0,
|
|
87
|
+
y: r() ? -6 : 0
|
|
69
88
|
};
|
|
70
89
|
},
|
|
71
90
|
get transition() {
|
|
72
91
|
return {
|
|
73
|
-
duration:
|
|
74
|
-
easing:
|
|
92
|
+
duration: P.fast,
|
|
93
|
+
easing: L.easeOut
|
|
75
94
|
};
|
|
76
95
|
},
|
|
77
96
|
get children() {
|
|
78
97
|
return t.label;
|
|
79
98
|
}
|
|
80
|
-
}), null),
|
|
81
|
-
var
|
|
82
|
-
return
|
|
99
|
+
}), null), M((n) => {
|
|
100
|
+
var c = !!t.active, v = !!r(), g = !!t.isDragging, f = `${t.label} — click to solo, drag to canvas to create`, h = t.active;
|
|
101
|
+
return c !== n.e && o.classList.toggle("is-active", n.e = c), v !== n.t && o.classList.toggle("is-hovered", n.t = v), g !== n.a && o.classList.toggle("is-source-dragging", n.a = g), f !== n.o && I(o, "aria-label", n.o = f), h !== n.i && I(o, "aria-pressed", n.i = h), n;
|
|
83
102
|
}, {
|
|
84
103
|
e: void 0,
|
|
85
104
|
t: void 0,
|
|
86
105
|
a: void 0,
|
|
87
106
|
o: void 0,
|
|
88
107
|
i: void 0
|
|
89
|
-
}),
|
|
108
|
+
}), o;
|
|
90
109
|
})();
|
|
91
110
|
}
|
|
92
|
-
function
|
|
93
|
-
const [
|
|
94
|
-
let n,
|
|
95
|
-
|
|
96
|
-
|
|
111
|
+
function _t(t) {
|
|
112
|
+
const [a, r] = R(null), [u, o] = R(null);
|
|
113
|
+
let n, c, v = null;
|
|
114
|
+
q(() => {
|
|
115
|
+
c?.stop(), n?.stop({
|
|
97
116
|
reason: "manual_stop",
|
|
98
117
|
commit: !1
|
|
99
|
-
}), n = void 0,
|
|
118
|
+
}), n = void 0, u()?.stopInteraction();
|
|
100
119
|
});
|
|
101
|
-
const
|
|
102
|
-
const
|
|
103
|
-
return
|
|
104
|
-
},
|
|
105
|
-
|
|
120
|
+
const g = z(() => t.widgetDefinitions.every((e) => t.filters[e.type])), f = (e) => {
|
|
121
|
+
const i = a();
|
|
122
|
+
return i === null ? 0 : i === e ? -1 : i === e + 1 ? -2 : i === e - 1 ? 1 : 0;
|
|
123
|
+
}, h = () => {
|
|
124
|
+
c?.stop(), c = void 0, v = null;
|
|
106
125
|
}, E = () => {
|
|
107
|
-
!t.viewport || !t.onViewportCommit || (v = t.viewport,
|
|
126
|
+
!t.viewport || !t.onViewportCommit || (v = t.viewport, c?.stop(), c = et({
|
|
108
127
|
readFrame: () => {
|
|
109
|
-
const e = document.querySelector(
|
|
110
|
-
return e instanceof HTMLElement ?
|
|
128
|
+
const e = document.querySelector(B);
|
|
129
|
+
return e instanceof HTMLElement ? nt(e) : null;
|
|
111
130
|
},
|
|
112
131
|
readViewport: () => v ?? t.viewport ?? null,
|
|
113
132
|
commitViewport: (e) => {
|
|
@@ -115,26 +134,26 @@ function gt(t) {
|
|
|
115
134
|
},
|
|
116
135
|
onPanStart: () => t.onViewportInteractionStart?.("pan"),
|
|
117
136
|
shouldPan: () => {
|
|
118
|
-
const e =
|
|
119
|
-
return !!(e?.moved && e.
|
|
137
|
+
const e = u();
|
|
138
|
+
return !!(e?.moved && e.hasEnteredCanvas && !T(e.clientX, e.clientY));
|
|
120
139
|
}
|
|
121
140
|
}));
|
|
122
|
-
},
|
|
123
|
-
const
|
|
124
|
-
if (!
|
|
125
|
-
const
|
|
126
|
-
if (
|
|
127
|
-
t.onSoloFilter(
|
|
141
|
+
}, m = (e) => {
|
|
142
|
+
const i = u();
|
|
143
|
+
if (!i) return;
|
|
144
|
+
const l = !i.moved;
|
|
145
|
+
if (i.stopInteraction(), h(), o(null), n = void 0, l) {
|
|
146
|
+
t.onSoloFilter(i.type);
|
|
128
147
|
return;
|
|
129
148
|
}
|
|
130
|
-
e &&
|
|
131
|
-
},
|
|
149
|
+
e && i.overCanvas && t.onCreateAt?.(i.type, i.clientX, i.clientY);
|
|
150
|
+
}, k = (e, i, l, C) => {
|
|
132
151
|
e.preventDefault(), n?.stop({
|
|
133
152
|
reason: "manual_stop",
|
|
134
153
|
commit: !1
|
|
135
|
-
}), E(),
|
|
136
|
-
type:
|
|
137
|
-
label:
|
|
154
|
+
}), E(), o({
|
|
155
|
+
type: i,
|
|
156
|
+
label: l,
|
|
138
157
|
icon: C,
|
|
139
158
|
pointerId: e.pointerId,
|
|
140
159
|
startClientX: e.clientX,
|
|
@@ -143,144 +162,146 @@ function gt(t) {
|
|
|
143
162
|
clientY: e.clientY,
|
|
144
163
|
moved: !1,
|
|
145
164
|
overCanvas: !1,
|
|
146
|
-
|
|
165
|
+
hasEnteredCanvas: !1,
|
|
166
|
+
stopInteraction: Z({
|
|
147
167
|
kind: "drag",
|
|
148
168
|
cursor: "grabbing"
|
|
149
169
|
})
|
|
150
170
|
});
|
|
151
|
-
const
|
|
152
|
-
let
|
|
153
|
-
|
|
154
|
-
if (!
|
|
155
|
-
const
|
|
156
|
-
return
|
|
157
|
-
...
|
|
158
|
-
clientX:
|
|
159
|
-
clientY:
|
|
160
|
-
moved:
|
|
161
|
-
overCanvas: Y
|
|
171
|
+
const w = (s) => {
|
|
172
|
+
let F = !1;
|
|
173
|
+
o((b) => {
|
|
174
|
+
if (!b || b.pointerId !== s.pointerId) return b;
|
|
175
|
+
const G = s.clientX - b.startClientX, p = s.clientY - b.startClientY, S = b.moved || Math.abs(G) > H || Math.abs(p) > H, O = T(s.clientX, s.clientY), Y = S && lt(s.clientX, s.clientY) && !O, W = S && !O && st(b.clientX, b.clientY, s.clientX, s.clientY), $ = b.hasEnteredCanvas || Y || W;
|
|
176
|
+
return F = S && $ && !O, {
|
|
177
|
+
...b,
|
|
178
|
+
clientX: s.clientX,
|
|
179
|
+
clientY: s.clientY,
|
|
180
|
+
moved: S,
|
|
181
|
+
overCanvas: Y,
|
|
182
|
+
hasEnteredCanvas: $
|
|
162
183
|
};
|
|
163
|
-
}),
|
|
184
|
+
}), F && c?.updatePointer(s.clientX, s.clientY);
|
|
164
185
|
};
|
|
165
|
-
n =
|
|
186
|
+
n = tt({
|
|
166
187
|
pointerEvent: e,
|
|
167
188
|
captureEl: e.currentTarget,
|
|
168
|
-
onMove:
|
|
189
|
+
onMove: w,
|
|
169
190
|
onEnd: ({
|
|
170
|
-
commit:
|
|
171
|
-
}) =>
|
|
191
|
+
commit: s
|
|
192
|
+
}) => m(s)
|
|
172
193
|
});
|
|
173
|
-
},
|
|
194
|
+
}, y = () => u()?.type ?? null;
|
|
174
195
|
return [(() => {
|
|
175
|
-
var e =
|
|
176
|
-
return
|
|
196
|
+
var e = rt(), i = e.firstChild;
|
|
197
|
+
return i.nextSibling, e.addEventListener("pointerleave", () => r(null)), i.$$click = () => t.onShowAll(), i.addEventListener("pointerleave", () => r((l) => l === 0 ? null : l)), i.addEventListener("pointerenter", () => r(0)), _(i, d(D.span, {
|
|
177
198
|
class: "workbench-dock__tile",
|
|
178
199
|
get animate() {
|
|
179
200
|
return {
|
|
180
|
-
scale:
|
|
181
|
-
y:
|
|
182
|
-
x:
|
|
201
|
+
scale: a() === 0 ? 1.26 : 1,
|
|
202
|
+
y: a() === 0 ? -6 : 0,
|
|
203
|
+
x: a() === 1 ? -5 : 0
|
|
183
204
|
};
|
|
184
205
|
},
|
|
185
206
|
get transition() {
|
|
186
207
|
return {
|
|
187
|
-
duration:
|
|
188
|
-
easing:
|
|
208
|
+
duration: P.fast,
|
|
209
|
+
easing: L.easeOut
|
|
189
210
|
};
|
|
190
211
|
},
|
|
191
212
|
get children() {
|
|
192
|
-
return d(
|
|
213
|
+
return d(J, {
|
|
193
214
|
class: "workbench-dock__icon"
|
|
194
215
|
});
|
|
195
216
|
}
|
|
196
|
-
}), null),
|
|
217
|
+
}), null), _(i, d(D.span, {
|
|
197
218
|
class: "workbench-dock__tooltip",
|
|
198
219
|
get animate() {
|
|
199
220
|
return {
|
|
200
|
-
opacity:
|
|
201
|
-
y:
|
|
221
|
+
opacity: a() === 0 ? 1 : 0,
|
|
222
|
+
y: a() === 0 ? -6 : 0
|
|
202
223
|
};
|
|
203
224
|
},
|
|
204
225
|
get transition() {
|
|
205
226
|
return {
|
|
206
|
-
duration:
|
|
207
|
-
easing:
|
|
227
|
+
duration: P.fast,
|
|
228
|
+
easing: L.easeOut
|
|
208
229
|
};
|
|
209
230
|
},
|
|
210
231
|
children: "Show all widgets"
|
|
211
|
-
}), null),
|
|
232
|
+
}), null), _(e, d(j, {
|
|
212
233
|
get each() {
|
|
213
234
|
return t.widgetDefinitions;
|
|
214
235
|
},
|
|
215
|
-
children: (
|
|
216
|
-
const
|
|
217
|
-
return d(
|
|
236
|
+
children: (l, C) => {
|
|
237
|
+
const w = () => C() + 1;
|
|
238
|
+
return d(ct, {
|
|
218
239
|
get type() {
|
|
219
|
-
return
|
|
240
|
+
return l.type;
|
|
220
241
|
},
|
|
221
242
|
get label() {
|
|
222
|
-
return
|
|
243
|
+
return l.label;
|
|
223
244
|
},
|
|
224
245
|
get icon() {
|
|
225
|
-
return
|
|
246
|
+
return l.icon;
|
|
226
247
|
},
|
|
227
248
|
get active() {
|
|
228
|
-
return t.filters[
|
|
249
|
+
return t.filters[l.type];
|
|
229
250
|
},
|
|
230
251
|
get hoverOffset() {
|
|
231
|
-
return
|
|
252
|
+
return f(w());
|
|
232
253
|
},
|
|
233
254
|
get isDragging() {
|
|
234
|
-
return
|
|
255
|
+
return y() === l.type;
|
|
235
256
|
},
|
|
236
|
-
onEnter: () =>
|
|
237
|
-
onLeave: () =>
|
|
238
|
-
onSolo: () => t.onSoloFilter(
|
|
239
|
-
onDragBegin:
|
|
257
|
+
onEnter: () => r(w()),
|
|
258
|
+
onLeave: () => r((s) => s === w() ? null : s),
|
|
259
|
+
onSolo: () => t.onSoloFilter(l.type),
|
|
260
|
+
onDragBegin: k
|
|
240
261
|
});
|
|
241
262
|
}
|
|
242
|
-
}), null),
|
|
243
|
-
var C = !!
|
|
244
|
-
return C !==
|
|
263
|
+
}), null), M((l) => {
|
|
264
|
+
var C = !!g(), w = a() === 0, s = g();
|
|
265
|
+
return C !== l.e && i.classList.toggle("is-active", l.e = C), w !== l.t && i.classList.toggle("is-hovered", l.t = w), s !== l.a && I(i, "aria-pressed", l.a = s), l;
|
|
245
266
|
}, {
|
|
246
267
|
e: void 0,
|
|
247
268
|
t: void 0,
|
|
248
269
|
a: void 0
|
|
249
270
|
}), e;
|
|
250
|
-
})(), d(
|
|
271
|
+
})(), d(x, {
|
|
251
272
|
get when() {
|
|
252
|
-
return
|
|
273
|
+
return u()?.moved ?? !1;
|
|
253
274
|
},
|
|
254
275
|
get children() {
|
|
255
|
-
return d(
|
|
256
|
-
state:
|
|
276
|
+
return d(dt, {
|
|
277
|
+
state: u
|
|
257
278
|
});
|
|
258
279
|
}
|
|
259
280
|
})];
|
|
260
281
|
}
|
|
261
|
-
function
|
|
262
|
-
const
|
|
282
|
+
function dt(t) {
|
|
283
|
+
const a = () => {
|
|
263
284
|
const n = t.state();
|
|
264
285
|
return n ? `translate3d(${n.clientX + 14}px, ${n.clientY - 56}px, 0)` : "translate3d(0px, 0px, 0)";
|
|
265
|
-
},
|
|
266
|
-
return d(
|
|
286
|
+
}, r = () => t.state()?.overCanvas ?? !1, u = () => t.state()?.label ?? "", o = () => t.state()?.icon;
|
|
287
|
+
return d(K, {
|
|
267
288
|
get children() {
|
|
268
|
-
var n =
|
|
269
|
-
return
|
|
289
|
+
var n = it(), c = n.firstChild, v = c.nextSibling, g = v.firstChild, f = g.nextSibling, h = f.firstChild, E = h.nextSibling, m = E.firstChild;
|
|
290
|
+
return _(g, d(x, {
|
|
270
291
|
get when() {
|
|
271
|
-
return
|
|
292
|
+
return o();
|
|
272
293
|
},
|
|
273
|
-
children: (
|
|
274
|
-
const
|
|
275
|
-
return d(
|
|
294
|
+
children: (k) => {
|
|
295
|
+
const y = k();
|
|
296
|
+
return d(y, {
|
|
276
297
|
class: "w-4 h-4"
|
|
277
298
|
});
|
|
278
299
|
}
|
|
279
|
-
})),
|
|
300
|
+
})), _(h, u), _(E, d(Q, {
|
|
280
301
|
class: "w-3 h-3"
|
|
281
|
-
}),
|
|
282
|
-
var
|
|
283
|
-
return
|
|
302
|
+
}), m), _(m, () => r() ? "Drop to create" : "Drag onto canvas"), M((k) => {
|
|
303
|
+
var y = !!r(), e = a();
|
|
304
|
+
return y !== k.e && n.classList.toggle("is-over-canvas", k.e = y), e !== k.t && N(n, "transform", k.t = e), k;
|
|
284
305
|
}, {
|
|
285
306
|
e: void 0,
|
|
286
307
|
t: void 0
|
|
@@ -288,7 +309,7 @@ function rt(t) {
|
|
|
288
309
|
}
|
|
289
310
|
});
|
|
290
311
|
}
|
|
291
|
-
|
|
312
|
+
U(["pointerdown", "click"]);
|
|
292
313
|
export {
|
|
293
|
-
|
|
314
|
+
_t as WorkbenchFilterBar
|
|
294
315
|
};
|
|
@@ -13,6 +13,10 @@ export interface WorkbenchEdgeAutoPanVelocityOptions {
|
|
|
13
13
|
clientX: number;
|
|
14
14
|
clientY: number;
|
|
15
15
|
thresholdPx?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Deprecated: edge auto-pan intentionally keeps moving after the pointer leaves
|
|
18
|
+
* the frame during an active drag.
|
|
19
|
+
*/
|
|
16
20
|
outsideTolerancePx?: number;
|
|
17
21
|
maxSpeedPxPerSecond?: number;
|
|
18
22
|
}
|
|
@@ -35,6 +39,10 @@ export interface WorkbenchEdgeAutoPanControllerOptions {
|
|
|
35
39
|
onPanStart?: () => void;
|
|
36
40
|
shouldPan?: () => boolean;
|
|
37
41
|
thresholdPx?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Deprecated: edge auto-pan intentionally keeps moving after the pointer leaves
|
|
44
|
+
* the frame during an active drag.
|
|
45
|
+
*/
|
|
38
46
|
outsideTolerancePx?: number;
|
|
39
47
|
activationDelayMs?: number;
|
|
40
48
|
maxSpeedPxPerSecond?: number;
|
|
@@ -1,34 +1,31 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
1
|
+
const x = '[data-floe-workbench-canvas-frame="true"]';
|
|
2
|
+
function u(e, t) {
|
|
3
3
|
return Number.isFinite(e) && Number(e) > 0 ? Number(e) : t;
|
|
4
4
|
}
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
return
|
|
5
|
+
function w(e) {
|
|
6
|
+
const t = Math.max(0, Math.min(1, e));
|
|
7
|
+
return t * t * (3 - 2 * t);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
function h(e, t) {
|
|
10
|
+
if (e >= t) return 0;
|
|
11
|
+
if (e >= 0) {
|
|
12
|
+
const i = (t - e) / t * 0.78;
|
|
13
|
+
return w(i);
|
|
14
|
+
}
|
|
15
|
+
const r = Math.max(96, t), n = Math.min(1, Math.abs(e) / r);
|
|
16
|
+
return w(0.78 + n * 0.22);
|
|
12
17
|
}
|
|
13
|
-
function
|
|
14
|
-
const t =
|
|
15
|
-
e.outsideTolerancePx,
|
|
16
|
-
10
|
|
17
|
-
)), r = c(
|
|
18
|
+
function p(e) {
|
|
19
|
+
const t = u(e.thresholdPx, 72), r = u(
|
|
18
20
|
e.maxSpeedPxPerSecond,
|
|
19
|
-
|
|
21
|
+
680
|
|
20
22
|
), n = e.frame;
|
|
21
|
-
if (!Number.isFinite(n.width) || n.width <= 0 || !Number.isFinite(n.height) || n.height <= 0
|
|
22
|
-
frame: n,
|
|
23
|
-
clientX: e.clientX,
|
|
24
|
-
clientY: e.clientY,
|
|
25
|
-
outsideTolerancePx: i
|
|
26
|
-
}))
|
|
23
|
+
if (!Number.isFinite(n.width) || n.width <= 0 || !Number.isFinite(n.height) || n.height <= 0)
|
|
27
24
|
return { viewportVelocityX: 0, viewportVelocityY: 0 };
|
|
28
|
-
const
|
|
25
|
+
const i = r / 1e3, l = h(e.clientX - n.left, t), s = h(n.right - e.clientX, t), A = h(e.clientY - n.top, t), D = h(n.bottom - e.clientY, t);
|
|
29
26
|
return {
|
|
30
|
-
viewportVelocityX: (
|
|
31
|
-
viewportVelocityY: (A - D) *
|
|
27
|
+
viewportVelocityX: (l - s) * i,
|
|
28
|
+
viewportVelocityY: (A - D) * i
|
|
32
29
|
};
|
|
33
30
|
}
|
|
34
31
|
function y(e) {
|
|
@@ -42,93 +39,89 @@ function y(e) {
|
|
|
42
39
|
height: t.height
|
|
43
40
|
} : null;
|
|
44
41
|
}
|
|
45
|
-
function
|
|
42
|
+
function X(e) {
|
|
46
43
|
return typeof window > "u" || typeof window.requestAnimationFrame != "function" ? null : window.requestAnimationFrame(e);
|
|
47
44
|
}
|
|
48
|
-
function
|
|
45
|
+
function L(e) {
|
|
49
46
|
e === null || typeof window > "u" || typeof window.cancelAnimationFrame != "function" || window.cancelAnimationFrame(e);
|
|
50
47
|
}
|
|
51
48
|
function b(e) {
|
|
52
|
-
let t = null,
|
|
53
|
-
const
|
|
54
|
-
e.outsideTolerancePx,
|
|
55
|
-
10
|
|
56
|
-
)), D = () => Math.max(0, c(
|
|
49
|
+
let t = null, r = null, n = null, i = null, l = !1, s = !1;
|
|
50
|
+
const A = () => u(e.thresholdPx, 72), D = () => Math.max(0, u(
|
|
57
51
|
e.activationDelayMs,
|
|
58
|
-
|
|
59
|
-
)),
|
|
52
|
+
45
|
|
53
|
+
)), F = () => u(
|
|
60
54
|
e.maxSpeedPxPerSecond,
|
|
61
|
-
|
|
62
|
-
),
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
l ||
|
|
66
|
-
},
|
|
67
|
-
if (
|
|
55
|
+
680
|
|
56
|
+
), E = () => {
|
|
57
|
+
i = null, n = null;
|
|
58
|
+
}, c = () => {
|
|
59
|
+
l || r !== null || !t || (r = X(T));
|
|
60
|
+
}, T = (o) => {
|
|
61
|
+
if (r = null, l || !t) return;
|
|
68
62
|
if (e.shouldPan && !e.shouldPan()) {
|
|
69
|
-
|
|
63
|
+
E();
|
|
70
64
|
return;
|
|
71
65
|
}
|
|
72
|
-
const
|
|
73
|
-
if (!
|
|
74
|
-
|
|
66
|
+
const _ = e.readFrame(), a = e.readViewport();
|
|
67
|
+
if (!_ || !a) {
|
|
68
|
+
E();
|
|
75
69
|
return;
|
|
76
70
|
}
|
|
77
|
-
const
|
|
78
|
-
frame:
|
|
71
|
+
const m = p({
|
|
72
|
+
frame: _,
|
|
79
73
|
clientX: t.clientX,
|
|
80
74
|
clientY: t.clientY,
|
|
81
|
-
thresholdPx:
|
|
82
|
-
|
|
83
|
-
maxSpeedPxPerSecond: M()
|
|
75
|
+
thresholdPx: A(),
|
|
76
|
+
maxSpeedPxPerSecond: F()
|
|
84
77
|
});
|
|
85
|
-
if (
|
|
86
|
-
|
|
78
|
+
if (m.viewportVelocityX === 0 && m.viewportVelocityY === 0) {
|
|
79
|
+
E();
|
|
87
80
|
return;
|
|
88
81
|
}
|
|
89
|
-
if (
|
|
90
|
-
|
|
82
|
+
if (i === null) {
|
|
83
|
+
i = o, n = o, c();
|
|
91
84
|
return;
|
|
92
85
|
}
|
|
93
|
-
if (o -
|
|
94
|
-
|
|
86
|
+
if (o - i < D()) {
|
|
87
|
+
n = o, c();
|
|
95
88
|
return;
|
|
96
89
|
}
|
|
97
|
-
const
|
|
98
|
-
if (
|
|
99
|
-
|
|
90
|
+
const P = Math.max(0, Math.min(48, o - (n ?? o)));
|
|
91
|
+
if (n = o, P <= 0) {
|
|
92
|
+
c();
|
|
100
93
|
return;
|
|
101
94
|
}
|
|
102
|
-
const
|
|
103
|
-
if (Math.abs(
|
|
104
|
-
|
|
95
|
+
const d = m.viewportVelocityX * P, f = m.viewportVelocityY * P;
|
|
96
|
+
if (Math.abs(d) < 0.01 && Math.abs(f) < 0.01) {
|
|
97
|
+
c();
|
|
105
98
|
return;
|
|
106
99
|
}
|
|
107
|
-
const
|
|
108
|
-
...
|
|
109
|
-
x:
|
|
110
|
-
y:
|
|
100
|
+
const S = Math.max(Math.abs(Number(a.scale)), 1e-3), M = {
|
|
101
|
+
...a,
|
|
102
|
+
x: a.x + d,
|
|
103
|
+
y: a.y + f
|
|
111
104
|
};
|
|
112
|
-
|
|
113
|
-
viewportDeltaX:
|
|
114
|
-
viewportDeltaY:
|
|
115
|
-
worldDeltaX: -
|
|
116
|
-
worldDeltaY: -
|
|
117
|
-
viewport:
|
|
118
|
-
}),
|
|
105
|
+
s || (s = !0, e.onPanStart?.()), e.commitViewport(M), e.onPan?.({
|
|
106
|
+
viewportDeltaX: d,
|
|
107
|
+
viewportDeltaY: f,
|
|
108
|
+
worldDeltaX: -d / S,
|
|
109
|
+
worldDeltaY: -f / S,
|
|
110
|
+
viewport: M
|
|
111
|
+
}), c();
|
|
119
112
|
};
|
|
120
113
|
return {
|
|
121
|
-
updatePointer: (o,
|
|
122
|
-
t = { clientX: o, clientY:
|
|
114
|
+
updatePointer: (o, _) => {
|
|
115
|
+
t = { clientX: o, clientY: _ }, c();
|
|
123
116
|
},
|
|
124
117
|
stop: () => {
|
|
125
|
-
l = !0,
|
|
118
|
+
l = !0, L(r), r = null, t = null, E();
|
|
126
119
|
}
|
|
127
120
|
};
|
|
128
121
|
}
|
|
129
122
|
export {
|
|
130
|
-
|
|
123
|
+
x as WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR,
|
|
131
124
|
b as createWorkbenchEdgeAutoPanController,
|
|
132
125
|
y as frameFromElement,
|
|
133
|
-
|
|
126
|
+
p as resolveWorkbenchEdgeAutoPanVelocity
|
|
134
127
|
};
|