@floegence/floe-webapp-core 0.36.42 → 0.36.43

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.
Files changed (31) hide show
  1. package/dist/components/icons/index.d.ts +2 -0
  2. package/dist/components/icons/index.js +419 -397
  3. package/dist/components/workbench/WorkbenchCanvas.d.ts +45 -2
  4. package/dist/components/workbench/WorkbenchCanvas.js +265 -66
  5. package/dist/components/workbench/WorkbenchCanvasField.d.ts +47 -2
  6. package/dist/components/workbench/WorkbenchCanvasField.js +258 -78
  7. package/dist/components/workbench/WorkbenchFilterBar.d.ts +9 -7
  8. package/dist/components/workbench/WorkbenchFilterBar.js +233 -145
  9. package/dist/components/workbench/WorkbenchLayerObjects.d.ts +136 -0
  10. package/dist/components/workbench/WorkbenchLayerObjects.js +986 -0
  11. package/dist/components/workbench/WorkbenchOverlay.d.ts +4 -1
  12. package/dist/components/workbench/WorkbenchOverlay.js +59 -29
  13. package/dist/components/workbench/WorkbenchSurface.d.ts +23 -11
  14. package/dist/components/workbench/WorkbenchSurface.js +315 -195
  15. package/dist/components/workbench/WorkbenchWidget.js +37 -37
  16. package/dist/components/workbench/index.d.ts +2 -1
  17. package/dist/components/workbench/types.d.ts +96 -1
  18. package/dist/components/workbench/types.js +12 -4
  19. package/dist/components/workbench/useWorkbenchModel.d.ts +62 -4
  20. package/dist/components/workbench/useWorkbenchModel.js +790 -253
  21. package/dist/components/workbench/widgets/widgetRegistry.d.ts +1 -1
  22. package/dist/components/workbench/workbenchHelpers.d.ts +5 -5
  23. package/dist/components/workbench/workbenchHelpers.js +345 -154
  24. package/dist/components/workbench/workbenchOptions.d.ts +43 -0
  25. package/dist/components/workbench/workbenchOptions.js +112 -0
  26. package/dist/full.js +620 -618
  27. package/dist/icons.js +71 -69
  28. package/dist/styles.css +1 -1
  29. package/dist/workbench.css +1117 -26
  30. package/dist/workbench.js +52 -36
  31. package/package.json +1 -1
@@ -1,45 +1,67 @@
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);
1
+ import { insert as h, createComponent as d, effect as x, setAttribute as A, memo as le, template as I, Portal as se, setStyleProperty as de, use as ue, delegateEvents as ge } from "solid-js/web";
2
+ import { createSignal as F, onCleanup as z, createEffect as ve, createMemo as W, Show as N, For as j } from "solid-js";
3
+ import { Motion as X } 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 H, duration as Y } from "../../utils/animations.js";
5
+ import { LayoutDashboard as fe, Layers as Z, Region as me, TextTool as he, MessageSquare as ke, Plus as be } from "../icons/index.js";
6
+ import { startHotInteraction as _e } from "../../utils/hotInteraction.js";
7
+ import { startPointerSession as we } from "../ui/pointerSession.js";
8
+ import { WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as ee, createWorkbenchEdgeAutoPanController as Ee, frameFromElement as Ce } from "./workbenchEdgeAutoPan.js";
9
+ var Se = /* @__PURE__ */ I("<button type=button class=workbench-dock__item>"), Oe = /* @__PURE__ */ I('<div class=workbench-dock__mode-popover role=menu aria-label="Canvas mode">'), Le = /* @__PURE__ */ I('<div class=workbench-dock data-floe-canvas-interactive=true><div class=workbench-dock__mode-switcher><button type=button class="workbench-dock__item workbench-dock__mode-trigger"aria-label="Switch canvas mode"aria-haspopup=menu></button></div><span class=workbench-dock__divider aria-hidden=true>'), De = /* @__PURE__ */ I("<button type=button class=workbench-dock__mode-option role=menuitemradio><span class=workbench-dock__mode-option-icon></span><span class=workbench-dock__mode-option-copy><span class=workbench-dock__mode-option-label></span><span class=workbench-dock__mode-option-description>"), Me = /* @__PURE__ */ I("<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 J = 5, pe = ".workbench-dock", K = [{
11
+ mode: "work",
12
+ label: "Work Mode",
13
+ description: "Operate windows and sticky notes",
14
+ icon: fe
15
+ }, {
16
+ mode: "background",
17
+ label: "Background Mode",
18
+ description: "Edit regions and canvas text",
19
+ icon: Z
20
+ }], ye = [{
21
+ tool: "sticky-note",
22
+ label: "Sticky",
23
+ icon: ke
24
+ }], Ie = [{
25
+ tool: "background-region",
26
+ label: "Region",
27
+ icon: me
28
+ }, {
29
+ tool: "text",
30
+ label: "Text",
31
+ icon: he
32
+ }];
33
+ function te() {
34
+ const t = document.querySelector(ee);
13
35
  return t instanceof HTMLElement ? t.getBoundingClientRect() : null;
14
36
  }
15
- function A(t, a, r) {
16
- return t >= r.left && t <= r.right && a >= r.top && a <= r.bottom;
37
+ function V(t, s, a) {
38
+ return t >= a.left && t <= a.right && s >= a.top && s <= a.bottom;
17
39
  }
18
- function lt(t, a) {
19
- const r = V();
20
- return r ? A(t, a, r) : !1;
40
+ function Pe(t, s) {
41
+ const a = te();
42
+ return a ? V(t, s, a) : !1;
21
43
  }
22
- function st(t, a, r, u) {
23
- const o = V();
44
+ function Te(t, s, a, u) {
45
+ const o = te();
24
46
  if (!o) return !1;
25
- if (A(t, a, o) || A(r, u, o))
47
+ if (V(t, s, o) || V(a, u, o))
26
48
  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);
49
+ const n = a - t, w = u - s;
50
+ let k = 0, v = 1;
51
+ const g = (f, C) => {
52
+ if (f === 0) return C >= 0;
53
+ const E = C / f;
54
+ return f < 0 ? E > v ? !1 : (E > k && (k = E), !0) : E < k ? !1 : (E < v && (v = E), !0);
33
55
  };
34
- return f(-n, t - o.left) && f(n, o.right - t) && f(-c, a - o.top) && f(c, o.bottom - a);
56
+ return g(-n, t - o.left) && g(n, o.right - t) && g(-w, s - o.top) && g(w, o.bottom - s);
35
57
  }
36
- function T(t, a) {
58
+ function Q(t, s) {
37
59
  if (typeof document.elementFromPoint != "function") return !1;
38
- const r = document.elementFromPoint(t, a);
39
- return r instanceof Element && r.closest(at) !== null;
60
+ const a = document.elementFromPoint(t, s);
61
+ return a instanceof Element && a.closest(pe) !== null;
40
62
  }
41
- function ct(t) {
42
- const a = () => t.hoverOffset === -1 ? {
63
+ function $e(t) {
64
+ const s = () => t.hoverOffset === -1 ? {
43
65
  scale: 1.26,
44
66
  y: -6,
45
67
  x: 0
@@ -55,20 +77,20 @@ function ct(t) {
55
77
  scale: 1,
56
78
  y: 0,
57
79
  x: 0
58
- }, r = () => t.hoverOffset === -1, u = (o) => {
59
- o.button === 0 && t.onDragBegin(o, t.type, t.label, t.icon);
80
+ }, a = () => t.hoverOffset === -1, u = (o) => {
81
+ o.button === 0 && t.onDragBegin(o, t.kind, t.id, t.label, t.icon);
60
82
  };
61
83
  return (() => {
62
- var o = ot();
63
- return o.$$pointerdown = u, o.addEventListener("pointerleave", () => t.onLeave()), o.addEventListener("pointerenter", () => t.onEnter()), _(o, d(D.span, {
84
+ var o = Se();
85
+ return o.$$pointerdown = u, o.addEventListener("pointerleave", () => t.onLeave()), o.addEventListener("pointerenter", () => t.onEnter()), h(o, d(X.span, {
64
86
  class: "workbench-dock__tile",
65
87
  get animate() {
66
- return a();
88
+ return s();
67
89
  },
68
90
  get transition() {
69
91
  return {
70
- duration: P.fast,
71
- easing: L.easeOut
92
+ duration: Y.fast,
93
+ easing: H.easeOut
72
94
  };
73
95
  },
74
96
  get children() {
@@ -79,82 +101,94 @@ function ct(t) {
79
101
  });
80
102
  })();
81
103
  }
82
- }), null), _(o, d(D.span, {
104
+ }), null), h(o, d(X.span, {
83
105
  class: "workbench-dock__tooltip",
84
106
  get animate() {
85
107
  return {
86
- opacity: r() ? 1 : 0,
87
- y: r() ? -6 : 0
108
+ opacity: a() ? 1 : 0,
109
+ y: a() ? -6 : 0
88
110
  };
89
111
  },
90
112
  get transition() {
91
113
  return {
92
- duration: P.fast,
93
- easing: L.easeOut
114
+ duration: Y.fast,
115
+ easing: H.easeOut
94
116
  };
95
117
  },
96
118
  get children() {
97
119
  return t.label;
98
120
  }
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;
121
+ }), null), x((n) => {
122
+ var w = !!t.active, k = !t.visible, v = !!a(), g = !!t.isDragging, f = `${t.label} — click to solo, drag to canvas to create`, C = t.active;
123
+ return w !== n.e && o.classList.toggle("is-active", n.e = w), k !== n.t && o.classList.toggle("is-filter-muted", n.t = k), v !== n.a && o.classList.toggle("is-hovered", n.a = v), g !== n.o && o.classList.toggle("is-source-dragging", n.o = g), f !== n.i && A(o, "aria-label", n.i = f), C !== n.n && A(o, "aria-pressed", n.n = C), n;
102
124
  }, {
103
125
  e: void 0,
104
126
  t: void 0,
105
127
  a: void 0,
106
128
  o: void 0,
107
- i: void 0
129
+ i: void 0,
130
+ n: void 0
108
131
  }), o;
109
132
  })();
110
133
  }
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({
134
+ function Ke(t) {
135
+ const [s, a] = F(null), [u, o] = F(null), [n, w] = F(!1);
136
+ let k, v, g, f = null;
137
+ z(() => {
138
+ g?.stop(), v?.stop({
116
139
  reason: "manual_stop",
117
140
  commit: !1
118
- }), n = void 0, u()?.stopInteraction();
141
+ }), v = void 0, u()?.stopInteraction();
142
+ }), ve(() => {
143
+ if (!n() || typeof window > "u") return;
144
+ const e = (l) => {
145
+ k && l.target instanceof Node && k.contains(l.target) || w(!1);
146
+ }, i = (l) => {
147
+ l.key === "Escape" && w(!1);
148
+ };
149
+ window.addEventListener("pointerdown", e, !0), window.addEventListener("keydown", i, !0), z(() => {
150
+ window.removeEventListener("pointerdown", e, !0), window.removeEventListener("keydown", i, !0);
151
+ });
119
152
  });
120
- const g = z(() => t.widgetDefinitions.every((e) => t.filters[e.type])), f = (e) => {
121
- const i = a();
153
+ const C = (e) => {
154
+ const i = s();
122
155
  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;
125
156
  }, E = () => {
126
- !t.viewport || !t.onViewportCommit || (v = t.viewport, c?.stop(), c = et({
157
+ g?.stop(), g = void 0, f = null;
158
+ }, S = () => {
159
+ !t.viewport || !t.onViewportCommit || (f = t.viewport, g?.stop(), g = Ee({
127
160
  readFrame: () => {
128
- const e = document.querySelector(B);
129
- return e instanceof HTMLElement ? nt(e) : null;
161
+ const e = document.querySelector(ee);
162
+ return e instanceof HTMLElement ? Ce(e) : null;
130
163
  },
131
- readViewport: () => v ?? t.viewport ?? null,
164
+ readViewport: () => f ?? t.viewport ?? null,
132
165
  commitViewport: (e) => {
133
- v = e, t.onViewportCommit?.(e);
166
+ f = e, t.onViewportCommit?.(e);
134
167
  },
135
168
  onPanStart: () => t.onViewportInteractionStart?.("pan"),
136
169
  shouldPan: () => {
137
170
  const e = u();
138
- return !!(e?.moved && e.hasEnteredCanvas && !T(e.clientX, e.clientY));
171
+ return !!(e?.moved && e.hasEnteredCanvas && !Q(e.clientX, e.clientY));
139
172
  }
140
173
  }));
141
- }, m = (e) => {
174
+ }, L = (e) => {
142
175
  const i = u();
143
176
  if (!i) return;
144
177
  const l = !i.moved;
145
- if (i.stopInteraction(), h(), o(null), n = void 0, l) {
146
- t.onSoloFilter(i.type);
178
+ if (i.stopInteraction(), E(), o(null), v = void 0, l) {
179
+ t.onSoloFilter(String(i.id), U());
147
180
  return;
148
181
  }
149
- e && i.overCanvas && t.onCreateAt?.(i.type, i.clientX, i.clientY);
150
- }, k = (e, i, l, C) => {
151
- e.preventDefault(), n?.stop({
182
+ e && i.overCanvas && (i.kind === "widget" ? t.onCreateAt?.(i.id, i.clientX, i.clientY) : t.onCreateToolAt?.(i.id, i.clientX, i.clientY));
183
+ }, P = (e, i, l, T, r) => {
184
+ e.preventDefault(), v?.stop({
152
185
  reason: "manual_stop",
153
186
  commit: !1
154
- }), E(), o({
155
- type: i,
156
- label: l,
157
- icon: C,
187
+ }), S(), o({
188
+ kind: i,
189
+ id: l,
190
+ label: T,
191
+ icon: r,
158
192
  pointerId: e.pointerId,
159
193
  startClientX: e.clientX,
160
194
  startClientY: e.clientY,
@@ -163,145 +197,199 @@ function _t(t) {
163
197
  moved: !1,
164
198
  overCanvas: !1,
165
199
  hasEnteredCanvas: !1,
166
- stopInteraction: Z({
200
+ stopInteraction: _e({
167
201
  kind: "drag",
168
202
  cursor: "grabbing"
169
203
  })
170
204
  });
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: $
205
+ const b = (c) => {
206
+ let m = !1;
207
+ o((_) => {
208
+ if (!_ || _.pointerId !== c.pointerId) return _;
209
+ const B = c.clientX - _.startClientX, $ = c.clientY - _.startClientY, D = _.moved || Math.abs(B) > J || Math.abs($) > J, O = Q(c.clientX, c.clientY), y = D && Pe(c.clientX, c.clientY) && !O, R = D && !O && Te(_.clientX, _.clientY, c.clientX, c.clientY), q = _.hasEnteredCanvas || y || R;
210
+ return m = D && q && !O, {
211
+ ..._,
212
+ clientX: c.clientX,
213
+ clientY: c.clientY,
214
+ moved: D,
215
+ overCanvas: y,
216
+ hasEnteredCanvas: q
183
217
  };
184
- }), F && c?.updatePointer(s.clientX, s.clientY);
218
+ }), m && g?.updatePointer(c.clientX, c.clientY);
185
219
  };
186
- n = tt({
220
+ v = we({
187
221
  pointerEvent: e,
188
222
  captureEl: e.currentTarget,
189
- onMove: w,
223
+ onMove: b,
190
224
  onEnd: ({
191
- commit: s
192
- }) => m(s)
225
+ commit: c
226
+ }) => L(c)
193
227
  });
194
- }, y = () => u()?.type ?? null;
228
+ }, ne = () => u()?.kind === "widget" ? u().id : null, oe = () => u()?.kind === "tool" ? u().id : null, M = () => t.mode === "background" || t.mode === "annotation" ? "background" : "work", ie = W(() => K.find((e) => e.mode === M()) ?? K[0]), G = W(() => M() === "background" ? Ie.map((e) => ({
229
+ id: e.tool,
230
+ kind: "tool",
231
+ label: e.label,
232
+ icon: e.icon
233
+ })) : [...ye.map((e) => ({
234
+ id: e.tool,
235
+ kind: "tool",
236
+ label: e.label,
237
+ icon: e.icon
238
+ })), ...t.widgetDefinitions.map((e) => ({
239
+ id: e.type,
240
+ kind: "widget",
241
+ label: e.label,
242
+ icon: e.icon
243
+ }))]), U = W(() => G().map((e) => String(e.id))), re = (e) => t.filters[e] !== !1, ae = (e) => {
244
+ const i = U();
245
+ return i.length > 1 && i.every((l) => t.filters[l] !== !1 == (l === e));
246
+ }, p = () => s() === 0, ce = () => ({
247
+ scale: p() || n() ? 1.26 : 1,
248
+ y: p() || n() ? -6 : 0,
249
+ x: s() === 1 ? -5 : 0
250
+ });
195
251
  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, {
252
+ var e = Le(), i = e.firstChild, l = i.firstChild;
253
+ i.nextSibling, e.addEventListener("pointerleave", () => a(null));
254
+ var T = k;
255
+ return typeof T == "function" ? ue(T, e) : k = e, l.$$click = () => w((r) => !r), l.addEventListener("pointerleave", () => a((r) => r === 0 ? null : r)), l.addEventListener("pointerenter", () => a(0)), h(l, d(X.span, {
198
256
  class: "workbench-dock__tile",
199
257
  get animate() {
200
- return {
201
- scale: a() === 0 ? 1.26 : 1,
202
- y: a() === 0 ? -6 : 0,
203
- x: a() === 1 ? -5 : 0
204
- };
258
+ return ce();
205
259
  },
206
260
  get transition() {
207
261
  return {
208
- duration: P.fast,
209
- easing: L.easeOut
262
+ duration: Y.fast,
263
+ easing: H.easeOut
210
264
  };
211
265
  },
212
266
  get children() {
213
- return d(J, {
267
+ return d(Z, {
214
268
  class: "workbench-dock__icon"
215
269
  });
216
270
  }
217
- }), null), _(i, d(D.span, {
271
+ }), null), h(l, d(X.span, {
218
272
  class: "workbench-dock__tooltip",
219
273
  get animate() {
220
274
  return {
221
- opacity: a() === 0 ? 1 : 0,
222
- y: a() === 0 ? -6 : 0
275
+ opacity: p() && !n() ? 1 : 0,
276
+ y: p() && !n() ? -6 : 0
223
277
  };
224
278
  },
225
279
  get transition() {
226
280
  return {
227
- duration: P.fast,
228
- easing: L.easeOut
281
+ duration: Y.fast,
282
+ easing: H.easeOut
229
283
  };
230
284
  },
231
- children: "Show all widgets"
232
- }), null), _(e, d(j, {
285
+ get children() {
286
+ return ie().label;
287
+ }
288
+ }), null), h(i, d(N, {
289
+ get when() {
290
+ return n();
291
+ },
292
+ get children() {
293
+ var r = Oe();
294
+ return h(r, d(j, {
295
+ each: K,
296
+ children: (b) => {
297
+ const c = b.icon;
298
+ return (() => {
299
+ var m = De(), _ = m.firstChild, B = _.nextSibling, $ = B.firstChild, D = $.nextSibling;
300
+ return m.$$click = () => {
301
+ t.onSelectMode?.(b.mode), w(!1);
302
+ }, h(_, d(c, {
303
+ class: "workbench-dock__mode-icon"
304
+ })), h($, () => b.label), h(D, () => b.description), x((O) => {
305
+ var y = M() === b.mode, R = M() === b.mode;
306
+ return y !== O.e && m.classList.toggle("is-active", O.e = y), R !== O.t && A(m, "aria-checked", O.t = R), O;
307
+ }, {
308
+ e: void 0,
309
+ t: void 0
310
+ }), m;
311
+ })();
312
+ }
313
+ })), r;
314
+ }
315
+ }), null), h(e, d(j, {
233
316
  get each() {
234
- return t.widgetDefinitions;
317
+ return G();
235
318
  },
236
- children: (l, C) => {
237
- const w = () => C() + 1;
238
- return d(ct, {
239
- get type() {
240
- return l.type;
319
+ children: (r, b) => {
320
+ const c = () => b() + 1;
321
+ return d($e, {
322
+ get id() {
323
+ return String(r.id);
324
+ },
325
+ get kind() {
326
+ return r.kind;
241
327
  },
242
328
  get label() {
243
- return l.label;
329
+ return r.label;
244
330
  },
245
331
  get icon() {
246
- return l.icon;
332
+ return r.icon;
247
333
  },
248
334
  get active() {
249
- return t.filters[l.type];
335
+ return ae(String(r.id));
336
+ },
337
+ get visible() {
338
+ return re(String(r.id));
250
339
  },
251
340
  get hoverOffset() {
252
- return f(w());
341
+ return C(c());
253
342
  },
254
343
  get isDragging() {
255
- return y() === l.type;
344
+ return le(() => r.kind === "widget")() ? ne() === r.id : oe() === r.id;
256
345
  },
257
- onEnter: () => r(w()),
258
- onLeave: () => r((s) => s === w() ? null : s),
259
- onSolo: () => t.onSoloFilter(l.type),
260
- onDragBegin: k
346
+ onEnter: () => a(c()),
347
+ onLeave: () => a((m) => m === c() ? null : m),
348
+ onDragBegin: P
261
349
  });
262
350
  }
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;
351
+ }), null), x((r) => {
352
+ var b = M() === "background", c = !!(p() || n()), m = n();
353
+ return b !== r.e && l.classList.toggle("is-active", r.e = b), c !== r.t && l.classList.toggle("is-hovered", r.t = c), m !== r.a && A(l, "aria-expanded", r.a = m), r;
266
354
  }, {
267
355
  e: void 0,
268
356
  t: void 0,
269
357
  a: void 0
270
358
  }), e;
271
- })(), d(x, {
359
+ })(), d(N, {
272
360
  get when() {
273
361
  return u()?.moved ?? !1;
274
362
  },
275
363
  get children() {
276
- return d(dt, {
364
+ return d(Re, {
277
365
  state: u
278
366
  });
279
367
  }
280
368
  })];
281
369
  }
282
- function dt(t) {
283
- const a = () => {
370
+ function Re(t) {
371
+ const s = () => {
284
372
  const n = t.state();
285
373
  return n ? `translate3d(${n.clientX + 14}px, ${n.clientY - 56}px, 0)` : "translate3d(0px, 0px, 0)";
286
- }, r = () => t.state()?.overCanvas ?? !1, u = () => t.state()?.label ?? "", o = () => t.state()?.icon;
287
- return d(K, {
374
+ }, a = () => t.state()?.overCanvas ?? !1, u = () => t.state()?.label ?? "", o = () => t.state()?.icon;
375
+ return d(se, {
288
376
  get children() {
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, {
377
+ var n = Me(), w = n.firstChild, k = w.nextSibling, v = k.firstChild, g = v.nextSibling, f = g.firstChild, C = f.nextSibling, E = C.firstChild;
378
+ return h(v, d(N, {
291
379
  get when() {
292
380
  return o();
293
381
  },
294
- children: (k) => {
295
- const y = k();
296
- return d(y, {
382
+ children: (S) => {
383
+ const L = S();
384
+ return d(L, {
297
385
  class: "w-4 h-4"
298
386
  });
299
387
  }
300
- })), _(h, u), _(E, d(Q, {
388
+ })), h(f, u), h(C, d(be, {
301
389
  class: "w-3 h-3"
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;
390
+ }), E), h(E, () => a() ? "Drop to create" : "Drag onto canvas"), x((S) => {
391
+ var L = !!a(), P = s();
392
+ return L !== S.e && n.classList.toggle("is-over-canvas", S.e = L), P !== S.t && de(n, "transform", S.t = P), S;
305
393
  }, {
306
394
  e: void 0,
307
395
  t: void 0
@@ -309,7 +397,7 @@ function dt(t) {
309
397
  }
310
398
  });
311
399
  }
312
- U(["pointerdown", "click"]);
400
+ ge(["pointerdown", "click"]);
313
401
  export {
314
- _t as WorkbenchFilterBar
402
+ Ke as WorkbenchDock
315
403
  };