@floegence/floe-webapp-core 0.50.6 → 0.52.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.
- package/dist/components/chat/input/ChatInput.js +8 -8
- package/dist/components/ui/Button.js +16 -13
- package/dist/components/ui/Card.js +125 -119
- package/dist/components/ui/Checkbox.js +178 -132
- package/dist/components/ui/CommandPalette.js +10 -10
- package/dist/components/ui/Dialog.d.ts +7 -0
- package/dist/components/ui/Dialog.js +160 -114
- package/dist/components/ui/DirectoryInput.js +5 -5
- package/dist/components/ui/Dropdown.d.ts +2 -0
- package/dist/components/ui/Dropdown.js +183 -160
- package/dist/components/ui/FloatingWindow.js +211 -199
- package/dist/components/ui/HighlightBlock.js +8 -8
- package/dist/components/ui/Input.js +40 -40
- package/dist/components/ui/Pagination.js +90 -88
- package/dist/components/ui/ProcessingIndicator.js +1 -1
- package/dist/components/ui/Progress.js +99 -88
- package/dist/components/ui/QuoteBlock.js +9 -9
- package/dist/components/ui/Radio.js +151 -127
- package/dist/components/ui/SegmentedControl.js +26 -25
- package/dist/components/ui/Stepper.js +114 -112
- package/dist/components/ui/Switch.js +34 -33
- package/dist/components/ui/Tabs.js +153 -150
- package/dist/components/ui/Tag.js +24 -21
- package/dist/components/ui/Tooltip.js +10 -10
- package/dist/components/ui/floatingPresence.js +40 -30
- package/dist/components/workbench/WorkbenchHud.js +9 -9
- package/dist/components/workbench/WorkbenchLockButton.js +4 -4
- package/dist/components/workbench/WorkbenchWidget.js +46 -43
- package/dist/context/FloeConfigContext.d.ts +5 -1
- package/dist/context/FloeConfigContext.js +10 -9
- package/dist/context/ThemeContext.d.ts +3 -1
- package/dist/context/ThemeContext.js +78 -71
- package/dist/floe.css +32 -0
- package/dist/full.js +839 -836
- package/dist/hooks/useOverlayMask.js +95 -83
- package/dist/index.js +150 -147
- package/dist/input-focus.css +0 -1
- package/dist/styles/themes/index.d.ts +3 -0
- package/dist/styles/themes/index.js +40 -31
- package/dist/styles/tokens.d.ts +36 -0
- package/dist/styles/tokens.js +12 -5
- package/dist/styles.css +1 -1
- package/dist/surface.css +467 -0
- package/dist/themes.d.ts +1 -1
- package/dist/ui.css +9 -0
- package/package.json +1 -1
|
@@ -1,52 +1,62 @@
|
|
|
1
|
-
import { createMemo as
|
|
2
|
-
function
|
|
1
|
+
import { createMemo as g, untrack as t, createSignal as p, createEffect as T, onCleanup as M } from "solid-js";
|
|
2
|
+
function h() {
|
|
3
3
|
return typeof window > "u" || typeof window.matchMedia != "function" ? !1 : window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function u(e) {
|
|
6
6
|
return typeof window < "u" && typeof window.requestAnimationFrame == "function" ? window.requestAnimationFrame(e) : globalThis.setTimeout(e, 16);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function F(e) {
|
|
9
9
|
if (typeof window < "u" && typeof window.cancelAnimationFrame == "function") {
|
|
10
10
|
window.cancelAnimationFrame(e);
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
13
|
globalThis.clearTimeout(e);
|
|
14
14
|
}
|
|
15
|
-
function F(e) {
|
|
16
|
-
return p() ? Math.max(0, e.reducedMotionExitDurationMs ?? 1) : Math.max(0, e.exitDurationMs ?? 120);
|
|
17
|
-
}
|
|
18
15
|
function y(e) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
return h() ? Math.max(0, e.reducedMotionExitDurationMs ?? 1) : Math.max(0, e.exitDurationMs ?? 120);
|
|
17
|
+
}
|
|
18
|
+
function A(e) {
|
|
19
|
+
const o = g(() => e.open()), s = t(o), [a, m] = p(s), [l, i] = p(s ? "entering" : "exiting");
|
|
20
|
+
let n = null, r = null;
|
|
21
|
+
const c = () => {
|
|
22
|
+
n !== null && (F(n), n = null);
|
|
23
|
+
}, d = () => {
|
|
24
|
+
r !== null && (globalThis.clearTimeout(r), r = null);
|
|
25
25
|
};
|
|
26
|
-
return
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
return T(() => {
|
|
27
|
+
if (o()) {
|
|
28
|
+
if (d(), c(), t(a) && t(l) === "exiting") {
|
|
29
|
+
i("open");
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
m(!0), i("entering"), n = u(() => {
|
|
33
|
+
n = null, t(o) && i("open");
|
|
30
34
|
});
|
|
31
35
|
return;
|
|
32
36
|
}
|
|
33
|
-
if (
|
|
34
|
-
|
|
37
|
+
if (c(), !t(a)) {
|
|
38
|
+
i("exiting");
|
|
35
39
|
return;
|
|
36
40
|
}
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
i("exiting");
|
|
42
|
+
const f = y(e), w = () => {
|
|
43
|
+
n = null, t(o) || m(!1);
|
|
44
|
+
}, x = () => {
|
|
45
|
+
n = null, r = globalThis.setTimeout(() => {
|
|
46
|
+
r = null, f <= 1 ? w() : n = u(w);
|
|
47
|
+
}, f);
|
|
48
|
+
};
|
|
49
|
+
f <= 1 ? x() : n = u(() => {
|
|
50
|
+
n = u(x);
|
|
51
|
+
});
|
|
52
|
+
}), M(() => {
|
|
53
|
+
c(), d();
|
|
44
54
|
}), {
|
|
45
|
-
mounted:
|
|
46
|
-
state:
|
|
47
|
-
exiting: () =>
|
|
55
|
+
mounted: a,
|
|
56
|
+
state: l,
|
|
57
|
+
exiting: () => l() === "exiting"
|
|
48
58
|
};
|
|
49
59
|
}
|
|
50
60
|
export {
|
|
51
|
-
|
|
61
|
+
A as createFloatingPresence
|
|
52
62
|
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { insert as n, createComponent as o, memo as
|
|
1
|
+
import { insert as n, createComponent as o, memo as u, template as r, delegateEvents as h } from "solid-js/web";
|
|
2
2
|
import { Show as m } from "solid-js";
|
|
3
3
|
import { Minus as b, Plus as d } from "../icons/index.js";
|
|
4
4
|
import { WorkbenchThemeSelector as s } from "./WorkbenchThemeSelector.js";
|
|
5
|
-
var _ = /* @__PURE__ */
|
|
6
|
-
function
|
|
5
|
+
var _ = /* @__PURE__ */ r("<div class=workbench-hud__divider aria-hidden=true>"), v = /* @__PURE__ */ r('<div class=workbench-hud data-floe-surface=floating data-floe-canvas-interactive=true><button type=button class=workbench-hud__button aria-label="Zoom out"></button><div class=workbench-hud__scale></div><button type=button class=workbench-hud__button aria-label="Zoom in">');
|
|
6
|
+
function g(e) {
|
|
7
7
|
return (() => {
|
|
8
|
-
var l = v(), t = l.firstChild,
|
|
8
|
+
var l = v(), t = l.firstChild, a = t.nextSibling, c = a.nextSibling;
|
|
9
9
|
return n(l, o(m, {
|
|
10
10
|
get when() {
|
|
11
|
-
return
|
|
11
|
+
return u(() => !!e.activeTheme)() && e.onSelectTheme;
|
|
12
12
|
},
|
|
13
13
|
get children() {
|
|
14
14
|
return [o(s, {
|
|
15
15
|
get activeTheme() {
|
|
16
16
|
return e.activeTheme;
|
|
17
17
|
},
|
|
18
|
-
onSelect: (
|
|
18
|
+
onSelect: (i) => e.onSelectTheme?.(i)
|
|
19
19
|
}), _()];
|
|
20
20
|
}
|
|
21
21
|
}), t), t.$$click = () => e.onZoomOut(), n(t, o(b, {
|
|
22
22
|
class: "w-3.5 h-3.5"
|
|
23
|
-
})), n(
|
|
23
|
+
})), n(a, () => e.scaleLabel), c.$$click = () => e.onZoomIn(), n(c, o(d, {
|
|
24
24
|
class: "w-3.5 h-3.5"
|
|
25
25
|
})), l;
|
|
26
26
|
})();
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
h(["click"]);
|
|
29
29
|
export {
|
|
30
|
-
|
|
30
|
+
g as WorkbenchHud
|
|
31
31
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { insert as n, createComponent as c, memo as s, effect as d, setAttribute as u, template as k, delegateEvents as v } from "solid-js/web";
|
|
2
2
|
import { Motion as m } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.11/node_modules/solid-motionone/dist/index.js";
|
|
3
|
-
import { easing as
|
|
3
|
+
import { easing as f, duration as h } from "../../utils/animations.js";
|
|
4
4
|
import { Lock as g, Unlock as _ } from "../icons/index.js";
|
|
5
|
-
var L = /* @__PURE__ */ k("<button type=button class=workbench-lock-button data-floe-canvas-interactive=true><span class=workbench-lock-button__icon>"), w = /* @__PURE__ */ k("<span class=workbench-lock-button__kbd>");
|
|
5
|
+
var L = /* @__PURE__ */ k("<button type=button class=workbench-lock-button data-floe-surface=floating data-floe-canvas-interactive=true><span class=workbench-lock-button__icon>"), w = /* @__PURE__ */ k("<span class=workbench-lock-button__kbd>");
|
|
6
6
|
function y(t) {
|
|
7
7
|
const l = () => t.locked ? "Unlock canvas" : "Lock canvas";
|
|
8
8
|
return (() => {
|
|
@@ -16,8 +16,8 @@ function y(t) {
|
|
|
16
16
|
},
|
|
17
17
|
get transition() {
|
|
18
18
|
return {
|
|
19
|
-
duration:
|
|
20
|
-
easing:
|
|
19
|
+
duration: h.fast,
|
|
20
|
+
easing: f.easeOut
|
|
21
21
|
};
|
|
22
22
|
},
|
|
23
23
|
get children() {
|
|
@@ -8,16 +8,16 @@ import { createWorkbenchWidgetSurfaceMetrics as Ee, resolveWorkbenchProjectedSur
|
|
|
8
8
|
import { createWorkbenchEdgeAutoPanController as Le, WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as Re, frameFromElement as ze } from "./workbenchEdgeAutoPan.js";
|
|
9
9
|
import { resolveWorkbenchInteractionAdapter as Xe } from "./workbenchInteractionAdapter.js";
|
|
10
10
|
import { createOwnerSafePropAccessor as a } from "./workbenchOwnerSafeAccessors.js";
|
|
11
|
-
var Ye = /* @__PURE__ */ Rt('<article class=workbench-widget><div class=workbench-widget__surface><header class=workbench-widget__header><span class=workbench-widget__traffic role=group aria-label="Window controls"><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--close"aria-label="Close widget"title="Close widget"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--min"aria-label="Minimize widget to overview"title="Minimize widget to overview"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--max"aria-label="Zoom widget to fit viewport"title="Zoom widget to fit viewport"data-floe-canvas-interactive=true></button></span><span class=workbench-widget__badge aria-hidden=true></span><button type=button class=workbench-widget__drag aria-label="Drag widget"data-floe-canvas-interactive=true></button><div class=workbench-widget__title-area><span class=workbench-widget__title-dot aria-hidden=true></span><span class=workbench-widget__title></span></div><span class=workbench-widget__window-controls role=group aria-label="Window controls"><button type=button class="workbench-widget__window-control workbench-widget__window-control--min"aria-label="Minimize widget to overview"title="Minimize widget to overview"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__window-control workbench-widget__window-control--max"aria-label="Zoom widget to fit viewport"title="Zoom widget to fit viewport"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__window-control workbench-widget__window-control--close"aria-label="Remove widget"title="Remove widget"data-floe-canvas-interactive=true></button></span></header><div class=workbench-widget__body data-floe-canvas-interactive=true>'), De = /* @__PURE__ */ Rt('<div class=workbench-widget__resize aria-label="Resize widget"data-floe-canvas-interactive=true><svg class=workbench-widget__resize-glyph viewBox="0 0 12 12"aria-hidden=true><path d="M12 0 L0 12"></path><path d="M12 4 L4 12"></path><path d="M12 8 L8 12">');
|
|
11
|
+
var Ye = /* @__PURE__ */ Rt('<article class=workbench-widget data-floe-surface=floating><div class=workbench-widget__surface><header class=workbench-widget__header><span class=workbench-widget__traffic role=group aria-label="Window controls"><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--close"aria-label="Close widget"title="Close widget"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--min"aria-label="Minimize widget to overview"title="Minimize widget to overview"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--max"aria-label="Zoom widget to fit viewport"title="Zoom widget to fit viewport"data-floe-canvas-interactive=true></button></span><span class=workbench-widget__badge aria-hidden=true></span><button type=button class=workbench-widget__drag aria-label="Drag widget"data-floe-canvas-interactive=true></button><div class=workbench-widget__title-area><span class=workbench-widget__title-dot aria-hidden=true></span><span class=workbench-widget__title></span></div><span class=workbench-widget__window-controls role=group aria-label="Window controls"><button type=button class="workbench-widget__window-control workbench-widget__window-control--min"aria-label="Minimize widget to overview"title="Minimize widget to overview"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__window-control workbench-widget__window-control--max"aria-label="Zoom widget to fit viewport"title="Zoom widget to fit viewport"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__window-control workbench-widget__window-control--close"aria-label="Remove widget"title="Remove widget"data-floe-canvas-interactive=true></button></span></header><div class=workbench-widget__body data-floe-canvas-interactive=true>'), De = /* @__PURE__ */ Rt('<div class=workbench-widget__resize aria-label="Resize widget"data-floe-canvas-interactive=true><svg class=workbench-widget__resize-glyph viewBox="0 0 12 12"aria-hidden=true><path d="M12 0 L0 12"></path><path d="M12 4 L4 12"></path><path d="M12 8 L8 12">');
|
|
12
12
|
const Fe = 220, je = 160, Oe = 160;
|
|
13
13
|
function Qe(i) {
|
|
14
|
-
const
|
|
14
|
+
const N = a(() => i.definition), u = a(() => i.widgetId), at = a(() => i.widgetTitle), ct = a(() => i.widgetType), L = a(() => i.itemSnapshot), lt = a(() => i.renderLayer), zt = a(() => i.visualFront), st = a(() => i.motion ?? null), dt = a(() => i.topRenderLayer), Xt = a(() => i.viewport), G = a(() => i.onSelect), Yt = a(() => i.onActivate), Dt = a(() => i.onContextMenu), Z = a(() => i.onClaimVisualFrontOwner), K = a(() => i.onCommitFront), Ft = a(() => i.onCommitMove), jt = a(() => i.onCommitResize), Ot = a(() => i.onViewportCommit), Ht = a(() => i.onViewportInteractionStart), Vt = a(() => i.onRequestOverview), qt = a(() => i.onRequestFit), Bt = a(() => i.onRequestDelete), Nt = a(() => i.onLayoutInteractionStart), Gt = a(() => i.onLayoutInteractionEnd), h = g(() => Xe(i.interactionAdapter)), P = a(() => i.selected), v = a(() => i.locked), U = a(() => i.filtered), b = a(() => i.layoutMode ?? "canvas_scaled"), Zt = a(() => i.projectedViewport), Kt = a(() => i.surfaceReady ?? !0), ut = a(() => ({
|
|
15
15
|
x: i.x,
|
|
16
16
|
y: i.y
|
|
17
17
|
})), wt = a(() => ({
|
|
18
18
|
width: i.width,
|
|
19
19
|
height: i.height
|
|
20
|
-
})),
|
|
20
|
+
})), J = a(() => Math.max(i.viewportScale, 1e-3)), [x, R] = $(null), [z, Q] = $(null), [Ut, Jt] = $(), [tt, W] = $(!1), [gt, ht] = $(!1), [ft, X] = $({
|
|
21
21
|
enabled: !1,
|
|
22
22
|
scale: 1
|
|
23
23
|
});
|
|
@@ -77,16 +77,16 @@ function Qe(i) {
|
|
|
77
77
|
W(!0), ht(!0), e(t);
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
|
-
W(!1),
|
|
80
|
+
W(!1), G()(t), K()(t);
|
|
81
81
|
}, oe = () => {
|
|
82
82
|
if (lt() >= dt()) {
|
|
83
|
-
|
|
83
|
+
Z()(u());
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
|
-
|
|
87
|
-
},
|
|
86
|
+
K()(u());
|
|
87
|
+
}, et = () => {
|
|
88
88
|
W(!1);
|
|
89
|
-
}, A = g(() => P() ||
|
|
89
|
+
}, A = g(() => P() || tt());
|
|
90
90
|
rt(() => {
|
|
91
91
|
!gt() || !P() || (ht(!1), W(!1));
|
|
92
92
|
});
|
|
@@ -107,10 +107,10 @@ function Qe(i) {
|
|
|
107
107
|
const t = w;
|
|
108
108
|
if (!t) return;
|
|
109
109
|
const e = (r) => {
|
|
110
|
-
r.button === 0 && ne(r.pointerId, A(),
|
|
110
|
+
r.button === 0 && ne(r.pointerId, A(), H(r.target));
|
|
111
111
|
}, n = (r) => {
|
|
112
|
-
if (r.button === 0 &&
|
|
113
|
-
if (
|
|
112
|
+
if (r.button === 0 && H(r.target) === "widget_local") {
|
|
113
|
+
if (tt()) {
|
|
114
114
|
F();
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
@@ -118,14 +118,14 @@ function Qe(i) {
|
|
|
118
118
|
}
|
|
119
119
|
}, o = () => {
|
|
120
120
|
setTimeout(() => {
|
|
121
|
-
P() ||
|
|
121
|
+
P() || et();
|
|
122
122
|
}, 0);
|
|
123
123
|
};
|
|
124
|
-
t.addEventListener("pointerdown", e, !0), t.addEventListener("click", n, !0), t.addEventListener("pointerup", o), t.addEventListener("pointercancel",
|
|
125
|
-
t.removeEventListener("pointerdown", e, !0), t.removeEventListener("click", n, !0), t.removeEventListener("pointerup", o), t.removeEventListener("pointercancel",
|
|
124
|
+
t.addEventListener("pointerdown", e, !0), t.addEventListener("click", n, !0), t.addEventListener("pointerup", o), t.addEventListener("pointercancel", et), Mt(() => {
|
|
125
|
+
t.removeEventListener("pointerdown", e, !0), t.removeEventListener("click", n, !0), t.removeEventListener("pointerup", o), t.removeEventListener("pointercancel", et);
|
|
126
126
|
});
|
|
127
127
|
});
|
|
128
|
-
const
|
|
128
|
+
const j = () => x() !== null, O = () => z() !== null, re = g(() => U() ? "cold" : A() ? "hot" : v() ? "cold" : "warm"), H = (t) => h().resolveWidgetEventOwnership({
|
|
129
129
|
target: t,
|
|
130
130
|
widgetRoot: w ?? null,
|
|
131
131
|
interactiveSelector: h().interactiveSelector,
|
|
@@ -169,7 +169,7 @@ function Qe(i) {
|
|
|
169
169
|
});
|
|
170
170
|
}, se = (t) => {
|
|
171
171
|
if (t.button !== 0 || v()) return;
|
|
172
|
-
const e = ie(t.pointerId), n = e?.wasSelected ?? P(), o = e?.ownership ??
|
|
172
|
+
const e = ie(t.pointerId), n = e?.wasSelected ?? P(), o = e?.ownership ?? H(t.target), r = o === "widget_local" ? Ie({
|
|
173
173
|
target: t.target,
|
|
174
174
|
widgetRoot: w ?? null,
|
|
175
175
|
interactiveSelector: h().interactiveSelector,
|
|
@@ -208,7 +208,7 @@ function Qe(i) {
|
|
|
208
208
|
F(), _t(t.pointerType || void 0);
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
|
-
},
|
|
211
|
+
}, V = g(() => {
|
|
212
212
|
const t = x();
|
|
213
213
|
return t ? {
|
|
214
214
|
x: t.worldX,
|
|
@@ -225,14 +225,14 @@ function Qe(i) {
|
|
|
225
225
|
if (!(b() !== "projected_surface" || !t))
|
|
226
226
|
return Ee({
|
|
227
227
|
widgetId: u(),
|
|
228
|
-
worldX:
|
|
229
|
-
worldY:
|
|
228
|
+
worldX: V().x,
|
|
229
|
+
worldY: V().y,
|
|
230
230
|
worldWidth: p().width,
|
|
231
231
|
worldHeight: p().height,
|
|
232
232
|
viewport: t(),
|
|
233
233
|
ready: Kt()
|
|
234
234
|
});
|
|
235
|
-
}), nt = g(() => ot()?.rect.viewportScale ??
|
|
235
|
+
}), nt = g(() => ot()?.rect.viewportScale ?? J()), bt = g(() => b() === "projected_surface" && Ae(N()) === "settle_sharp_zoom"), vt = g(() => b() === "projected_surface" && bt() && ft().enabled && ft().scale > 1.001), de = g(() => {
|
|
236
236
|
if (b() !== "projected_surface")
|
|
237
237
|
return;
|
|
238
238
|
const t = nt();
|
|
@@ -256,7 +256,7 @@ function Qe(i) {
|
|
|
256
256
|
t.preventDefault(), t.stopPropagation(), Bt()(u());
|
|
257
257
|
}, we = g(() => {
|
|
258
258
|
const t = {
|
|
259
|
-
"z-index":
|
|
259
|
+
"z-index": j() || O() || zt() ? `${dt() + 1}` : `${lt()}`
|
|
260
260
|
};
|
|
261
261
|
if (b() === "projected_surface") {
|
|
262
262
|
const e = ot()?.rect, n = nt(), o = vt(), r = o ? e?.screenWidth ?? p().width * n : p().width, s = o ? e?.screenHeight ?? p().height * n : p().height;
|
|
@@ -272,7 +272,7 @@ function Qe(i) {
|
|
|
272
272
|
...t,
|
|
273
273
|
width: `${p().width}px`,
|
|
274
274
|
height: `${p().height}px`,
|
|
275
|
-
transform: `translate(${
|
|
275
|
+
transform: `translate(${V().x}px, ${V().y}px)`
|
|
276
276
|
};
|
|
277
277
|
}), yt = g(() => st()?.phase === "enter");
|
|
278
278
|
rt(() => {
|
|
@@ -284,7 +284,7 @@ function Qe(i) {
|
|
|
284
284
|
return;
|
|
285
285
|
}
|
|
286
286
|
const t = nt();
|
|
287
|
-
if (t <= 1.001 ||
|
|
287
|
+
if (t <= 1.001 || j() || O()) {
|
|
288
288
|
D(), X({
|
|
289
289
|
enabled: !1,
|
|
290
290
|
scale: t
|
|
@@ -315,7 +315,7 @@ function Qe(i) {
|
|
|
315
315
|
x: e.startWorldX,
|
|
316
316
|
y: e.startWorldY
|
|
317
317
|
}, r = t && (Math.abs(n.x - o.x) > 1 || Math.abs(n.y - o.y) > 1), s = u();
|
|
318
|
-
|
|
318
|
+
K()(s), r && Ft()(s, n), e.stopInteraction(), mt(), R(null), C = void 0;
|
|
319
319
|
}, Pt = (t) => {
|
|
320
320
|
if (t.button !== 0 || v()) return;
|
|
321
321
|
t.preventDefault(), t.stopPropagation(), C?.stop({
|
|
@@ -323,10 +323,10 @@ function Qe(i) {
|
|
|
323
323
|
commit: !1
|
|
324
324
|
});
|
|
325
325
|
const e = u();
|
|
326
|
-
|
|
326
|
+
G()(e), w?.focus({
|
|
327
327
|
preventScroll: !0
|
|
328
|
-
}),
|
|
329
|
-
const n = pt("drag", "grabbing"), o =
|
|
328
|
+
}), Z()(e);
|
|
329
|
+
const n = pt("drag", "grabbing"), o = J(), r = ut();
|
|
330
330
|
R({
|
|
331
331
|
pointerId: t.pointerId,
|
|
332
332
|
startClientX: t.clientX,
|
|
@@ -368,15 +368,15 @@ function Qe(i) {
|
|
|
368
368
|
width: e.width,
|
|
369
369
|
height: e.height
|
|
370
370
|
}, o = Math.abs(e.width - e.startWidth) > 1 || Math.abs(e.height - e.startHeight) > 1;
|
|
371
|
-
t && o && jt()(u(), n), e.stopInteraction(),
|
|
371
|
+
t && o && jt()(u(), n), e.stopInteraction(), Q(null), I = void 0;
|
|
372
372
|
}, fe = (t) => {
|
|
373
373
|
if (t.button !== 0 || v()) return;
|
|
374
374
|
t.preventDefault(), t.stopPropagation(), I?.stop({
|
|
375
375
|
reason: "manual_stop",
|
|
376
376
|
commit: !1
|
|
377
|
-
}),
|
|
378
|
-
const e = pt("resize", "nwse-resize"), n =
|
|
379
|
-
|
|
377
|
+
}), Z()(u());
|
|
378
|
+
const e = pt("resize", "nwse-resize"), n = J(), o = wt();
|
|
379
|
+
Q({
|
|
380
380
|
pointerId: t.pointerId,
|
|
381
381
|
startClientX: t.clientX,
|
|
382
382
|
startClientY: t.clientY,
|
|
@@ -388,7 +388,7 @@ function Qe(i) {
|
|
|
388
388
|
stopInteraction: e
|
|
389
389
|
});
|
|
390
390
|
const r = (s) => {
|
|
391
|
-
|
|
391
|
+
Q((c) => {
|
|
392
392
|
if (!c || c.pointerId !== s.pointerId) return c;
|
|
393
393
|
const d = Math.max(Fe, c.startWidth + (s.clientX - c.startClientX) / c.scale), _ = Math.max(je, c.startHeight + (s.clientY - c.startClientY) / c.scale);
|
|
394
394
|
return {
|
|
@@ -408,14 +408,17 @@ function Qe(i) {
|
|
|
408
408
|
});
|
|
409
409
|
};
|
|
410
410
|
return (() => {
|
|
411
|
-
var t = Ye(), e = t.firstChild, n = e.firstChild, o = n.firstChild, r = o.firstChild, s = r.nextSibling, c = s.nextSibling, d = o.nextSibling, _ = d.nextSibling, k = _.nextSibling, pe = k.firstChild, xt = pe.nextSibling, me = k.nextSibling,
|
|
411
|
+
var t = Ye(), e = t.firstChild, n = e.firstChild, o = n.firstChild, r = o.firstChild, s = r.nextSibling, c = s.nextSibling, d = o.nextSibling, _ = d.nextSibling, k = _.nextSibling, pe = k.firstChild, xt = pe.nextSibling, me = k.nextSibling, q = me.firstChild, B = q.nextSibling, it = B.nextSibling, _e = n.nextSibling, Wt = w;
|
|
412
412
|
return typeof Wt == "function" ? $e(Wt, t) : w = t, It(t, be({
|
|
413
|
+
get "data-floe-surface-interacting"() {
|
|
414
|
+
return j() || O() ? "true" : void 0;
|
|
415
|
+
},
|
|
413
416
|
get classList() {
|
|
414
417
|
return {
|
|
415
418
|
"is-selected": A(),
|
|
416
|
-
"is-dragging":
|
|
417
|
-
"is-resizing":
|
|
418
|
-
"is-filtered-out":
|
|
419
|
+
"is-dragging": j(),
|
|
420
|
+
"is-resizing": O(),
|
|
421
|
+
"is-filtered-out": U(),
|
|
419
422
|
"is-projected-surface": b() === "projected_surface",
|
|
420
423
|
"is-locked": v(),
|
|
421
424
|
"is-entering": yt()
|
|
@@ -447,10 +450,10 @@ function Qe(i) {
|
|
|
447
450
|
tabIndex: 0,
|
|
448
451
|
onPointerDown: se,
|
|
449
452
|
onFocus: () => {
|
|
450
|
-
|
|
453
|
+
tt() || gt() || G()(u());
|
|
451
454
|
},
|
|
452
455
|
onContextMenu: (l) => {
|
|
453
|
-
|
|
456
|
+
H(l.target) === "widget_shell" && (l.preventDefault(), l.stopPropagation(), Dt()(l, L()()));
|
|
454
457
|
},
|
|
455
458
|
get style() {
|
|
456
459
|
return we();
|
|
@@ -469,21 +472,21 @@ function Qe(i) {
|
|
|
469
472
|
})), f(d, ue), _.$$pointerdown = Pt, f(_, m(xe, {
|
|
470
473
|
class: "w-3.5 h-3.5"
|
|
471
474
|
})), f(k, () => {
|
|
472
|
-
const l =
|
|
475
|
+
const l = N().icon;
|
|
473
476
|
return m(l, {
|
|
474
477
|
class: "w-3.5 h-3.5"
|
|
475
478
|
});
|
|
476
|
-
}, xt), f(xt, at),
|
|
479
|
+
}, xt), f(xt, at), q.$$click = St, q.$$pointerdown = (l) => l.stopPropagation(), f(q, m(Et, {
|
|
477
480
|
class: "workbench-widget__window-control-icon",
|
|
478
481
|
"aria-hidden": "true"
|
|
479
|
-
})),
|
|
482
|
+
})), B.$$click = kt, B.$$pointerdown = (l) => l.stopPropagation(), f(B, m(At, {
|
|
480
483
|
class: "workbench-widget__window-control-icon",
|
|
481
484
|
"aria-hidden": "true"
|
|
482
485
|
})), it.$$click = $t, it.$$pointerdown = (l) => l.stopPropagation(), f(it, m(Tt, {
|
|
483
486
|
class: "workbench-widget__window-control-icon",
|
|
484
487
|
"aria-hidden": "true"
|
|
485
488
|
})), f(_e, () => {
|
|
486
|
-
const l =
|
|
489
|
+
const l = N().body;
|
|
487
490
|
return m(l, {
|
|
488
491
|
get widgetId() {
|
|
489
492
|
return u();
|
|
@@ -508,7 +511,7 @@ function Qe(i) {
|
|
|
508
511
|
return A();
|
|
509
512
|
},
|
|
510
513
|
get filtered() {
|
|
511
|
-
return
|
|
514
|
+
return U();
|
|
512
515
|
},
|
|
513
516
|
requestActivate: ae
|
|
514
517
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type JSX } from 'solid-js';
|
|
2
|
-
import type { FloeThemePreset, FloeThemeTokenOverrides, ThemeType } from '../styles/themes';
|
|
2
|
+
import type { FloeSurfaceStyle, FloeThemePreset, FloeThemeTokenOverrides, ThemeType } from '../styles/themes';
|
|
3
3
|
export interface FloeStorageAdapter {
|
|
4
4
|
getItem: (key: string) => string | null;
|
|
5
5
|
setItem: (key: string, value: string) => void;
|
|
@@ -73,6 +73,10 @@ export interface FloeLayoutConfig {
|
|
|
73
73
|
export interface FloeThemeConfig {
|
|
74
74
|
storageKey: string;
|
|
75
75
|
defaultTheme: ThemeType;
|
|
76
|
+
/** Surface material, independent of color palettes. Defaults to standard. */
|
|
77
|
+
defaultSurfaceStyle?: FloeSurfaceStyle;
|
|
78
|
+
/** Defaults to `${storageKey}-surface-style`; uses the configured persistence service. */
|
|
79
|
+
surfaceStyleStorageKey?: string;
|
|
76
80
|
/** Optional storage key for the active named token preset. Defaults to `${storageKey}-preset`. */
|
|
77
81
|
presetStorageKey?: string;
|
|
78
82
|
/** Optional default named token preset. Falls back to the first preset when omitted. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createComponent as C } from "solid-js/web";
|
|
2
|
-
import { createContext as L, createMemo as u, createEffect as
|
|
2
|
+
import { createContext as L, createMemo as u, createEffect as S, onCleanup as F, useContext as v } from "solid-js";
|
|
3
3
|
const m = {
|
|
4
4
|
storage: {
|
|
5
5
|
namespace: "floe",
|
|
@@ -44,7 +44,8 @@ const m = {
|
|
|
44
44
|
},
|
|
45
45
|
theme: {
|
|
46
46
|
storageKey: "theme",
|
|
47
|
-
defaultTheme: "system"
|
|
47
|
+
defaultTheme: "system",
|
|
48
|
+
defaultSurfaceStyle: "standard"
|
|
48
49
|
},
|
|
49
50
|
accessibility: {
|
|
50
51
|
mainContentId: "floe-main-content",
|
|
@@ -79,7 +80,7 @@ const m = {
|
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
};
|
|
82
|
-
function
|
|
83
|
+
function I() {
|
|
83
84
|
if (!(typeof window > "u"))
|
|
84
85
|
return {
|
|
85
86
|
getItem: (e) => localStorage.getItem(e),
|
|
@@ -89,7 +90,7 @@ function k() {
|
|
|
89
90
|
};
|
|
90
91
|
}
|
|
91
92
|
function h(e) {
|
|
92
|
-
const t = e.adapter ??
|
|
93
|
+
const t = e.adapter ?? I(), c = e.namespace ? `${e.namespace}-` : "", r = (o) => `${c}${o}`, n = () => e.enabled && !!t, i = /* @__PURE__ */ new Map(), d = () => {
|
|
93
94
|
if (n()) {
|
|
94
95
|
for (const [o, a] of i.entries()) {
|
|
95
96
|
clearTimeout(a.timer);
|
|
@@ -166,7 +167,7 @@ function h(e) {
|
|
|
166
167
|
}
|
|
167
168
|
};
|
|
168
169
|
}
|
|
169
|
-
function
|
|
170
|
+
function k(e) {
|
|
170
171
|
if (typeof window > "u") return () => {
|
|
171
172
|
};
|
|
172
173
|
const t = () => {
|
|
@@ -209,10 +210,10 @@ function b(e, t) {
|
|
|
209
210
|
const y = L();
|
|
210
211
|
function N(e) {
|
|
211
212
|
const t = u(() => b(m, e.config)), c = u(() => h(t().storage));
|
|
212
|
-
|
|
213
|
-
const n = c(), d = t().storage.enabled ?
|
|
213
|
+
S(() => {
|
|
214
|
+
const n = c(), d = t().storage.enabled ? k(n) : () => {
|
|
214
215
|
};
|
|
215
|
-
|
|
216
|
+
F(() => {
|
|
216
217
|
d(), n.dispose?.();
|
|
217
218
|
});
|
|
218
219
|
});
|
|
@@ -245,7 +246,7 @@ function D() {
|
|
|
245
246
|
export {
|
|
246
247
|
m as DEFAULT_FLOE_CONFIG,
|
|
247
248
|
N as FloeConfigProvider,
|
|
248
|
-
|
|
249
|
+
k as installPersistFlushListeners,
|
|
249
250
|
O as useFloeConfig,
|
|
250
251
|
D as useResolvedFloeConfig
|
|
251
252
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type Accessor } from 'solid-js';
|
|
2
|
-
import { type FloeShellThemeMode, type FloeThemePreset, type ThemeType } from '../styles/themes';
|
|
2
|
+
import { type FloeShellThemeMode, type FloeThemePreset, type ThemeType, type FloeSurfaceStyle } from '../styles/themes';
|
|
3
3
|
export interface ThemeContextValue {
|
|
4
|
+
surfaceStyle: Accessor<FloeSurfaceStyle>;
|
|
5
|
+
setSurfaceStyle: (style: FloeSurfaceStyle) => void;
|
|
4
6
|
theme: Accessor<ThemeType>;
|
|
5
7
|
resolvedTheme: Accessor<'light' | 'dark'>;
|
|
6
8
|
setTheme: (theme: ThemeType) => void;
|