@floegence/floe-webapp-core 0.36.15 → 0.36.16
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/ui/InfiniteCanvas.d.ts +1 -0
- package/dist/components/ui/InfiniteCanvas.js +47 -45
- package/dist/components/workbench/WorkbenchCanvas.d.ts +3 -0
- package/dist/components/workbench/WorkbenchCanvas.js +51 -28
- package/dist/components/workbench/WorkbenchCanvasField.d.ts +2 -0
- package/dist/components/workbench/WorkbenchCanvasField.js +18 -6
- package/dist/components/workbench/WorkbenchHud.d.ts +9 -0
- package/dist/components/workbench/WorkbenchHud.js +24 -10
- package/dist/components/workbench/WorkbenchSurface.js +68 -49
- package/dist/components/workbench/WorkbenchThemeSelector.d.ts +6 -0
- package/dist/components/workbench/WorkbenchThemeSelector.js +77 -0
- package/dist/components/workbench/WorkbenchWidget.d.ts +2 -0
- package/dist/components/workbench/WorkbenchWidget.js +205 -164
- package/dist/components/workbench/index.d.ts +2 -0
- package/dist/components/workbench/types.d.ts +2 -0
- package/dist/components/workbench/useWorkbenchModel.d.ts +5 -0
- package/dist/components/workbench/useWorkbenchModel.js +83 -77
- package/dist/components/workbench/workbenchHelpers.js +53 -50
- package/dist/components/workbench/workbenchThemes.d.ts +32 -0
- package/dist/components/workbench/workbenchThemes.js +82 -0
- package/dist/styles.css +1 -1
- package/dist/workbench-themes.css +1106 -0
- package/dist/workbench.css +492 -96
- package/dist/workbench.js +35 -27
- package/package.json +1 -1
|
@@ -1,204 +1,257 @@
|
|
|
1
|
-
import { spread as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { startHotInteraction as
|
|
4
|
-
import {
|
|
5
|
-
import { WORKBENCH_WIDGET_SHELL_ATTR as
|
|
6
|
-
import { createWorkbenchWidgetSurfaceMetrics as
|
|
7
|
-
var
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
const [
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { spread as O, mergeProps as tt, insert as c, createComponent as w, memo as et, template as G, use as it, delegateEvents as nt } from "solid-js/web";
|
|
2
|
+
import { createSignal as F, onCleanup as ot, untrack as M, createMemo as m } from "solid-js";
|
|
3
|
+
import { startHotInteraction as N } from "../../utils/hotInteraction.js";
|
|
4
|
+
import { X as j, Minus as B, Maximize as V, GripVertical as at } from "../icons/index.js";
|
|
5
|
+
import { CANVAS_WHEEL_INTERACTIVE_ATTR as rt, WORKBENCH_WIDGET_SHELL_ATTR as dt, resolveWorkbenchWidgetEventOwnership as lt } from "../ui/localInteractionSurface.js";
|
|
6
|
+
import { createWorkbenchWidgetSurfaceMetrics as ct } from "./workbenchHelpers.js";
|
|
7
|
+
var st = /* @__PURE__ */ G('<article class=workbench-widget data-floe-dialog-surface-host=true><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>'), wt = /* @__PURE__ */ G('<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">');
|
|
8
|
+
const gt = 220, ht = 160, ut = '[data-floe-canvas-interactive="true"]', bt = '[data-floe-canvas-pan-surface="true"]';
|
|
9
|
+
function kt(t) {
|
|
10
|
+
const [v, y] = F(null), [$, C] = F(null);
|
|
11
|
+
let u, b, _;
|
|
12
|
+
ot(() => {
|
|
13
|
+
u?.abort(), u = void 0, b?.abort(), b = void 0, M(v)?.stopInteraction(), M($)?.stopInteraction();
|
|
14
14
|
});
|
|
15
|
-
const
|
|
16
|
-
target:
|
|
17
|
-
widgetRoot:
|
|
18
|
-
interactiveSelector:
|
|
19
|
-
panSurfaceSelector:
|
|
20
|
-
}),
|
|
21
|
-
|
|
15
|
+
const E = () => v() !== null, R = () => $() !== null, z = (e) => lt({
|
|
16
|
+
target: e,
|
|
17
|
+
widgetRoot: _ ?? null,
|
|
18
|
+
interactiveSelector: ut,
|
|
19
|
+
panSurfaceSelector: bt
|
|
20
|
+
}), Z = (e) => {
|
|
21
|
+
e.button === 0 && (t.onSelect(t.widgetId), t.onCommitFront(t.widgetId), z(e.target) === "widget_shell" && _?.focus({
|
|
22
22
|
preventScroll: !0
|
|
23
23
|
}));
|
|
24
|
-
},
|
|
25
|
-
const
|
|
26
|
-
return
|
|
27
|
-
x:
|
|
28
|
-
y:
|
|
24
|
+
}, I = m(() => {
|
|
25
|
+
const e = v();
|
|
26
|
+
return e ? {
|
|
27
|
+
x: e.worldX,
|
|
28
|
+
y: e.worldY
|
|
29
29
|
} : {
|
|
30
30
|
x: t.x,
|
|
31
31
|
y: t.y
|
|
32
32
|
};
|
|
33
|
-
}),
|
|
34
|
-
const
|
|
35
|
-
return
|
|
36
|
-
width:
|
|
37
|
-
height:
|
|
33
|
+
}), k = m(() => {
|
|
34
|
+
const e = $();
|
|
35
|
+
return e ? {
|
|
36
|
+
width: e.width,
|
|
37
|
+
height: e.height
|
|
38
38
|
} : {
|
|
39
39
|
width: t.width,
|
|
40
40
|
height: t.height
|
|
41
41
|
};
|
|
42
|
-
}),
|
|
42
|
+
}), p = m(() => {
|
|
43
43
|
if (!(t.layoutMode !== "projected_surface" || !t.projectedViewport))
|
|
44
|
-
return
|
|
44
|
+
return ct({
|
|
45
45
|
widgetId: t.widgetId,
|
|
46
|
-
worldX:
|
|
47
|
-
worldY:
|
|
48
|
-
worldWidth:
|
|
49
|
-
worldHeight:
|
|
46
|
+
worldX: I().x,
|
|
47
|
+
worldY: I().y,
|
|
48
|
+
worldWidth: k().width,
|
|
49
|
+
worldHeight: k().height,
|
|
50
50
|
viewport: t.projectedViewport,
|
|
51
51
|
ready: t.surfaceReady ?? !0
|
|
52
52
|
});
|
|
53
|
-
}),
|
|
54
|
-
const i =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
}), q = m(() => {
|
|
54
|
+
const e = t.itemSnapshot().z_index, i = Number.isFinite(e) ? Math.max(1, Math.min(99, Math.round(e))) : 1;
|
|
55
|
+
return String(i).padStart(2, "0");
|
|
56
|
+
}), D = (e) => {
|
|
57
|
+
e.preventDefault(), e.stopPropagation(), t.onRequestOverview(t.itemSnapshot());
|
|
58
|
+
}, T = (e) => {
|
|
59
|
+
e.preventDefault(), e.stopPropagation(), t.onRequestFit(t.itemSnapshot());
|
|
60
|
+
}, X = (e) => {
|
|
61
|
+
e.preventDefault(), e.stopPropagation(), t.onRequestDelete(t.widgetId);
|
|
62
|
+
}, K = m(() => {
|
|
63
|
+
const e = {
|
|
64
|
+
width: `${k().width}px`,
|
|
65
|
+
height: `${k().height}px`,
|
|
66
|
+
"z-index": E() || R() || t.optimisticFront ? `${t.topRenderLayer + 1}` : `${t.renderLayer}`
|
|
58
67
|
};
|
|
59
68
|
if (t.layoutMode === "projected_surface") {
|
|
60
|
-
const
|
|
69
|
+
const i = p()?.rect;
|
|
61
70
|
return {
|
|
62
|
-
...
|
|
63
|
-
left: `${
|
|
64
|
-
top: `${
|
|
65
|
-
"--floe-workbench-projected-scale": `${
|
|
71
|
+
...e,
|
|
72
|
+
left: `${i?.screenX ?? 0}px`,
|
|
73
|
+
top: `${i?.screenY ?? 0}px`,
|
|
74
|
+
"--floe-workbench-projected-scale": `${i?.viewportScale ?? Math.max(t.viewportScale, 1e-3)}`
|
|
66
75
|
};
|
|
67
76
|
}
|
|
68
77
|
return {
|
|
69
|
-
...
|
|
70
|
-
transform: `translate(${
|
|
78
|
+
...e,
|
|
79
|
+
transform: `translate(${I().x}px, ${I().y}px)`
|
|
71
80
|
};
|
|
72
|
-
}),
|
|
73
|
-
const
|
|
74
|
-
if (!
|
|
75
|
-
const
|
|
76
|
-
x:
|
|
77
|
-
y:
|
|
81
|
+
}), L = (e) => {
|
|
82
|
+
const i = M(v);
|
|
83
|
+
if (!i) return;
|
|
84
|
+
const d = {
|
|
85
|
+
x: i.worldX,
|
|
86
|
+
y: i.worldY
|
|
78
87
|
}, r = {
|
|
79
|
-
x:
|
|
80
|
-
y:
|
|
81
|
-
}, s =
|
|
82
|
-
t.onCommitFront(t.widgetId), s && t.onCommitMove(t.widgetId,
|
|
83
|
-
},
|
|
84
|
-
if (
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
x: i.startWorldX,
|
|
89
|
+
y: i.startWorldY
|
|
90
|
+
}, s = e && (Math.abs(d.x - r.x) > 1 || Math.abs(d.y - r.y) > 1);
|
|
91
|
+
t.onCommitFront(t.widgetId), s && t.onCommitMove(t.widgetId, d), i.stopInteraction(), y(null), u?.abort(), u = void 0;
|
|
92
|
+
}, Y = (e) => {
|
|
93
|
+
if (e.button !== 0 || t.locked) return;
|
|
94
|
+
e.preventDefault(), e.stopPropagation(), u?.abort(), t.onSelect(t.widgetId), _?.focus({
|
|
95
|
+
preventScroll: !0
|
|
96
|
+
}), t.onStartOptimisticFront(t.widgetId);
|
|
97
|
+
const i = N({
|
|
87
98
|
kind: "drag",
|
|
88
99
|
cursor: "grabbing"
|
|
89
|
-
}),
|
|
90
|
-
|
|
91
|
-
pointerId:
|
|
92
|
-
startClientX:
|
|
93
|
-
startClientY:
|
|
100
|
+
}), d = Math.max(t.viewportScale, 1e-3);
|
|
101
|
+
y({
|
|
102
|
+
pointerId: e.pointerId,
|
|
103
|
+
startClientX: e.clientX,
|
|
104
|
+
startClientY: e.clientY,
|
|
94
105
|
startWorldX: t.x,
|
|
95
106
|
startWorldY: t.y,
|
|
96
107
|
worldX: t.x,
|
|
97
108
|
worldY: t.y,
|
|
98
109
|
moved: !1,
|
|
99
|
-
scale:
|
|
100
|
-
stopInteraction:
|
|
110
|
+
scale: d,
|
|
111
|
+
stopInteraction: i
|
|
101
112
|
});
|
|
102
|
-
const r = (
|
|
103
|
-
|
|
104
|
-
if (!
|
|
105
|
-
const
|
|
113
|
+
const r = (a) => {
|
|
114
|
+
y((n) => {
|
|
115
|
+
if (!n || n.pointerId !== a.pointerId) return n;
|
|
116
|
+
const f = n.startWorldX + (a.clientX - n.startClientX) / n.scale, h = n.startWorldY + (a.clientY - n.startClientY) / n.scale;
|
|
106
117
|
return {
|
|
107
|
-
...
|
|
108
|
-
worldX:
|
|
109
|
-
worldY:
|
|
110
|
-
moved:
|
|
118
|
+
...n,
|
|
119
|
+
worldX: f,
|
|
120
|
+
worldY: h,
|
|
121
|
+
moved: n.moved || Math.abs(f - n.startWorldX) > 2 || Math.abs(h - n.startWorldY) > 2
|
|
111
122
|
};
|
|
112
123
|
});
|
|
113
|
-
}, s = (
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
signal:
|
|
124
|
+
}, s = (a) => {
|
|
125
|
+
a.pointerId === e.pointerId && L(!0);
|
|
126
|
+
}, g = (a) => {
|
|
127
|
+
a.pointerId === e.pointerId && L(!1);
|
|
128
|
+
}, l = new AbortController();
|
|
129
|
+
u = l, window.addEventListener("pointermove", r, {
|
|
130
|
+
signal: l.signal
|
|
120
131
|
}), window.addEventListener("pointerup", s, {
|
|
121
132
|
once: !0,
|
|
122
|
-
signal:
|
|
123
|
-
}), window.addEventListener("pointercancel",
|
|
133
|
+
signal: l.signal
|
|
134
|
+
}), window.addEventListener("pointercancel", g, {
|
|
124
135
|
once: !0,
|
|
125
|
-
signal:
|
|
136
|
+
signal: l.signal
|
|
126
137
|
});
|
|
127
|
-
},
|
|
128
|
-
const
|
|
129
|
-
if (!
|
|
130
|
-
const
|
|
131
|
-
width:
|
|
132
|
-
height:
|
|
133
|
-
}, r = Math.abs(
|
|
134
|
-
|
|
135
|
-
},
|
|
136
|
-
if (
|
|
137
|
-
|
|
138
|
-
const
|
|
138
|
+
}, P = (e) => {
|
|
139
|
+
const i = M($);
|
|
140
|
+
if (!i) return;
|
|
141
|
+
const d = {
|
|
142
|
+
width: i.width,
|
|
143
|
+
height: i.height
|
|
144
|
+
}, r = Math.abs(i.width - i.startWidth) > 1 || Math.abs(i.height - i.startHeight) > 1;
|
|
145
|
+
e && r && t.onCommitResize(t.widgetId, d), i.stopInteraction(), C(null), b?.abort(), b = void 0;
|
|
146
|
+
}, U = (e) => {
|
|
147
|
+
if (e.button !== 0 || t.locked) return;
|
|
148
|
+
e.preventDefault(), e.stopPropagation(), b?.abort(), t.onStartOptimisticFront(t.widgetId);
|
|
149
|
+
const i = N({
|
|
139
150
|
kind: "drag",
|
|
140
151
|
cursor: "nwse-resize"
|
|
141
|
-
}),
|
|
142
|
-
|
|
143
|
-
pointerId:
|
|
144
|
-
startClientX:
|
|
145
|
-
startClientY:
|
|
152
|
+
}), d = Math.max(t.viewportScale, 1e-3);
|
|
153
|
+
C({
|
|
154
|
+
pointerId: e.pointerId,
|
|
155
|
+
startClientX: e.clientX,
|
|
156
|
+
startClientY: e.clientY,
|
|
146
157
|
startWidth: t.width,
|
|
147
158
|
startHeight: t.height,
|
|
148
159
|
width: t.width,
|
|
149
160
|
height: t.height,
|
|
150
|
-
scale:
|
|
151
|
-
stopInteraction:
|
|
161
|
+
scale: d,
|
|
162
|
+
stopInteraction: i
|
|
152
163
|
});
|
|
153
|
-
const r = (
|
|
154
|
-
|
|
155
|
-
if (!
|
|
156
|
-
const
|
|
164
|
+
const r = (a) => {
|
|
165
|
+
C((n) => {
|
|
166
|
+
if (!n || n.pointerId !== a.pointerId) return n;
|
|
167
|
+
const f = Math.max(gt, n.startWidth + (a.clientX - n.startClientX) / n.scale), h = Math.max(ht, n.startHeight + (a.clientY - n.startClientY) / n.scale);
|
|
157
168
|
return {
|
|
158
|
-
...
|
|
159
|
-
width:
|
|
160
|
-
height:
|
|
169
|
+
...n,
|
|
170
|
+
width: f,
|
|
171
|
+
height: h
|
|
161
172
|
};
|
|
162
173
|
});
|
|
163
|
-
}, s = (
|
|
164
|
-
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
},
|
|
168
|
-
|
|
169
|
-
signal:
|
|
174
|
+
}, s = (a) => {
|
|
175
|
+
a.pointerId === e.pointerId && P(!0);
|
|
176
|
+
}, g = (a) => {
|
|
177
|
+
a.pointerId === e.pointerId && P(!1);
|
|
178
|
+
}, l = new AbortController();
|
|
179
|
+
b = l, window.addEventListener("pointermove", r, {
|
|
180
|
+
signal: l.signal
|
|
170
181
|
}), window.addEventListener("pointerup", s, {
|
|
171
182
|
once: !0,
|
|
172
|
-
signal:
|
|
173
|
-
}), window.addEventListener("pointercancel",
|
|
183
|
+
signal: l.signal
|
|
184
|
+
}), window.addEventListener("pointercancel", g, {
|
|
174
185
|
once: !0,
|
|
175
|
-
signal:
|
|
186
|
+
signal: l.signal
|
|
176
187
|
});
|
|
177
188
|
};
|
|
178
189
|
return (() => {
|
|
179
|
-
var
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
190
|
+
var e = st(), i = e.firstChild, d = i.firstChild, r = d.firstChild, s = r.nextSibling, g = s.nextSibling, l = d.nextSibling, a = l.nextSibling, n = a.nextSibling, f = n.firstChild, h = f.nextSibling, J = n.nextSibling, S = J.firstChild, x = S.nextSibling, W = x.nextSibling, Q = i.nextSibling, H = _;
|
|
191
|
+
return typeof H == "function" ? it(H, e) : _ = e, O(e, tt({
|
|
192
|
+
get classList() {
|
|
193
|
+
return {
|
|
194
|
+
"is-selected": t.selected,
|
|
195
|
+
"is-dragging": E(),
|
|
196
|
+
"is-resizing": R(),
|
|
197
|
+
"is-filtered-out": t.filtered,
|
|
198
|
+
"is-projected-surface": t.layoutMode === "projected_surface",
|
|
199
|
+
"is-locked": t.locked
|
|
200
|
+
};
|
|
201
|
+
},
|
|
202
|
+
get "data-floe-workbench-widget-id"() {
|
|
203
|
+
return t.widgetId;
|
|
204
|
+
},
|
|
205
|
+
get "data-workbench-widget-type"() {
|
|
206
|
+
return t.widgetType;
|
|
207
|
+
},
|
|
208
|
+
get "data-floe-workbench-render-mode"() {
|
|
209
|
+
return t.layoutMode ?? "canvas_scaled";
|
|
210
|
+
}
|
|
211
|
+
}, () => ({
|
|
212
|
+
[rt]: t.selected ? "true" : void 0
|
|
213
|
+
}), {
|
|
214
|
+
tabIndex: 0,
|
|
215
|
+
onPointerDown: Z,
|
|
216
|
+
onFocus: () => {
|
|
217
|
+
t.onSelect(t.widgetId);
|
|
218
|
+
},
|
|
219
|
+
onContextMenu: (o) => {
|
|
220
|
+
z(o.target) === "widget_shell" && (o.preventDefault(), o.stopPropagation(), t.onContextMenu(o, t.itemSnapshot()));
|
|
221
|
+
},
|
|
222
|
+
get style() {
|
|
223
|
+
return K();
|
|
224
|
+
}
|
|
225
|
+
}), !1, !0), i.$$pointerdown = Y, O(i, {
|
|
226
|
+
[dt]: "true"
|
|
227
|
+
}, !1, !0), r.$$click = X, r.$$pointerdown = (o) => o.stopPropagation(), c(r, w(j, {
|
|
228
|
+
class: "workbench-widget__traffic-icon",
|
|
229
|
+
"aria-hidden": "true"
|
|
230
|
+
})), s.$$click = D, s.$$pointerdown = (o) => o.stopPropagation(), c(s, w(B, {
|
|
231
|
+
class: "workbench-widget__traffic-icon",
|
|
232
|
+
"aria-hidden": "true"
|
|
233
|
+
})), g.$$click = T, g.$$pointerdown = (o) => o.stopPropagation(), c(g, w(V, {
|
|
234
|
+
class: "workbench-widget__traffic-icon",
|
|
235
|
+
"aria-hidden": "true"
|
|
236
|
+
})), c(l, q), a.$$pointerdown = Y, c(a, w(at, {
|
|
189
237
|
class: "w-3.5 h-3.5"
|
|
190
|
-
})),
|
|
191
|
-
const
|
|
192
|
-
return
|
|
238
|
+
})), c(n, () => {
|
|
239
|
+
const o = t.definition.icon;
|
|
240
|
+
return w(o, {
|
|
193
241
|
class: "w-3.5 h-3.5"
|
|
194
242
|
});
|
|
195
|
-
},
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
243
|
+
}, h), c(h, () => t.widgetTitle), S.$$click = D, S.$$pointerdown = (o) => o.stopPropagation(), c(S, w(B, {
|
|
244
|
+
class: "workbench-widget__window-control-icon",
|
|
245
|
+
"aria-hidden": "true"
|
|
246
|
+
})), x.$$click = T, x.$$pointerdown = (o) => o.stopPropagation(), c(x, w(V, {
|
|
247
|
+
class: "workbench-widget__window-control-icon",
|
|
248
|
+
"aria-hidden": "true"
|
|
249
|
+
})), W.$$click = X, W.$$pointerdown = (o) => o.stopPropagation(), c(W, w(j, {
|
|
250
|
+
class: "workbench-widget__window-control-icon",
|
|
251
|
+
"aria-hidden": "true"
|
|
252
|
+
})), c(Q, () => {
|
|
253
|
+
const o = t.definition.body;
|
|
254
|
+
return w(o, {
|
|
202
255
|
get widgetId() {
|
|
203
256
|
return t.widgetId;
|
|
204
257
|
},
|
|
@@ -209,31 +262,19 @@ function ft(t) {
|
|
|
209
262
|
return t.widgetType;
|
|
210
263
|
},
|
|
211
264
|
get surfaceMetrics() {
|
|
212
|
-
return
|
|
265
|
+
return p();
|
|
213
266
|
}
|
|
214
267
|
});
|
|
215
|
-
}),
|
|
216
|
-
var
|
|
217
|
-
return () =>
|
|
218
|
-
var
|
|
219
|
-
return
|
|
268
|
+
}), c(e, (() => {
|
|
269
|
+
var o = et(() => !!t.locked);
|
|
270
|
+
return () => o() ? null : (() => {
|
|
271
|
+
var A = wt();
|
|
272
|
+
return A.$$pointerdown = U, A;
|
|
220
273
|
})();
|
|
221
|
-
})(), null),
|
|
222
|
-
var l = !!t.selected, g = !!S(), R = !!W(), X = !!t.filtered, Y = t.layoutMode === "projected_surface", z = t.widgetId, D = t.layoutMode ?? "canvas_scaled", B = j();
|
|
223
|
-
return l !== e.e && i.classList.toggle("is-selected", e.e = l), g !== e.t && i.classList.toggle("is-dragging", e.t = g), R !== e.a && i.classList.toggle("is-resizing", e.a = R), X !== e.o && i.classList.toggle("is-filtered-out", e.o = X), Y !== e.i && i.classList.toggle("is-projected-surface", e.i = Y), z !== e.n && T(i, "data-floe-workbench-widget-id", e.n = z), D !== e.s && T(i, "data-floe-workbench-render-mode", e.s = D), e.h = q(i, B, e.h), e;
|
|
224
|
-
}, {
|
|
225
|
-
e: void 0,
|
|
226
|
-
t: void 0,
|
|
227
|
-
a: void 0,
|
|
228
|
-
o: void 0,
|
|
229
|
-
i: void 0,
|
|
230
|
-
n: void 0,
|
|
231
|
-
s: void 0,
|
|
232
|
-
h: void 0
|
|
233
|
-
}), i;
|
|
274
|
+
})(), null), e;
|
|
234
275
|
})();
|
|
235
276
|
}
|
|
236
|
-
|
|
277
|
+
nt(["pointerdown", "click"]);
|
|
237
278
|
export {
|
|
238
|
-
|
|
279
|
+
kt as WorkbenchWidget
|
|
239
280
|
};
|
|
@@ -5,3 +5,5 @@ export { useWorkbenchModel, type UseWorkbenchModelOptions } from './useWorkbench
|
|
|
5
5
|
export { WIDGET_REGISTRY, createWorkbenchFilterState, getWidgetEntry, isValidWorkbenchWidgetType, resolveWorkbenchWidgetDefinitions, type WidgetRegistryEntry, } from './widgets/widgetRegistry';
|
|
6
6
|
export * from './types';
|
|
7
7
|
export { sanitizeWorkbenchState, createDefaultWorkbenchState, createWorkbenchId, createWorkbenchProjectedRect, createWorkbenchRenderLayerMap, createWorkbenchViewportCenteredOnWidget, createWorkbenchViewportFitForWidget, createWorkbenchWidgetSurfaceMetrics, resolveWorkbenchWidgetRenderMode, type WorkbenchRenderLayerMap, } from './workbenchHelpers';
|
|
8
|
+
export { DEFAULT_WORKBENCH_THEME, WORKBENCH_THEME_IDS, WORKBENCH_THEMES, isWorkbenchThemeId, workbenchThemeMeta, type WorkbenchThemeId, type WorkbenchThemeMeta, type WorkbenchThemePreview, } from './workbenchThemes';
|
|
9
|
+
export { WorkbenchThemeSelector, type WorkbenchThemeSelectorProps, } from './WorkbenchThemeSelector';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Component } from 'solid-js';
|
|
2
|
+
import type { WorkbenchThemeId } from './workbenchThemes';
|
|
2
3
|
export type BuiltinWorkbenchWidgetType = 'terminal' | 'file-browser' | 'system-monitor' | 'log-viewer' | 'code-editor';
|
|
3
4
|
export type WorkbenchWidgetType = BuiltinWorkbenchWidgetType | (string & {});
|
|
4
5
|
export declare const WORKBENCH_WIDGET_TYPES: readonly WorkbenchWidgetType[];
|
|
@@ -64,6 +65,7 @@ export interface WorkbenchState<TWidgetType extends string = WorkbenchWidgetType
|
|
|
64
65
|
locked: boolean;
|
|
65
66
|
filters: Record<TWidgetType, boolean>;
|
|
66
67
|
selectedWidgetId: string | null;
|
|
68
|
+
theme: WorkbenchThemeId;
|
|
67
69
|
}
|
|
68
70
|
export interface WorkbenchContextMenuState {
|
|
69
71
|
clientX: number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { InfiniteCanvasContextMenuEvent } from '../../ui';
|
|
2
2
|
import { type WorkbenchWidgetDefinition, type WorkbenchContextMenuState, type WorkbenchState, type WorkbenchViewport, type WorkbenchWidgetItem, type WorkbenchWidgetType } from './types';
|
|
3
|
+
import type { WorkbenchThemeId } from './workbenchThemes';
|
|
3
4
|
import type { WorkbenchContextMenuItem } from './WorkbenchContextMenu';
|
|
4
5
|
export interface UseWorkbenchModelOptions {
|
|
5
6
|
state: () => WorkbenchState;
|
|
@@ -17,6 +18,7 @@ export declare function useWorkbenchModel(options: UseWorkbenchModelOptions): {
|
|
|
17
18
|
locked: import("solid-js").Accessor<boolean>;
|
|
18
19
|
filters: import("solid-js").Accessor<Record<WorkbenchWidgetType, boolean>>;
|
|
19
20
|
selectedWidgetId: import("solid-js").Accessor<string | null>;
|
|
21
|
+
theme: import("solid-js").Accessor<"terminal" | "default" | "aurora" | "vibrancy" | "mica" | "midnight">;
|
|
20
22
|
topZIndex: import("solid-js").Accessor<number>;
|
|
21
23
|
scaleLabel: import("solid-js").Accessor<string>;
|
|
22
24
|
optimisticFrontWidgetId: import("solid-js").Accessor<string | null>;
|
|
@@ -90,5 +92,8 @@ export declare function useWorkbenchModel(options: UseWorkbenchModelOptions): {
|
|
|
90
92
|
findWidgetByType: (type: WorkbenchWidgetType) => WorkbenchWidgetItem<WorkbenchWidgetType> | null;
|
|
91
93
|
findWidgetById: (widgetId: string) => WorkbenchWidgetItem<WorkbenchWidgetType> | null;
|
|
92
94
|
};
|
|
95
|
+
appearance: {
|
|
96
|
+
setTheme: (next: WorkbenchThemeId) => void;
|
|
97
|
+
};
|
|
93
98
|
handleCloseRequest: () => void;
|
|
94
99
|
};
|