@floegence/floe-webapp-core 0.42.1 → 0.42.3

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.
@@ -1,4 +1,4 @@
1
- import { use as E, insert as w, createComponent as g, memo as k, effect as F, template as x } from "solid-js/web";
1
+ import { use as E, insert as w, createComponent as g, memo as y, effect as F, template as x } from "solid-js/web";
2
2
  import { createMemo as u, createSignal as _, Show as O, For as j } from "solid-js";
3
3
  import { resolveWorkbenchInteractionAdapter as z } from "./workbenchInteractionAdapter.js";
4
4
  import { WORKBENCH_BACKGROUND_REGION_FILTER_ID as P, WORKBENCH_TEXT_FILTER_ID as q, WORKBENCH_STICKY_FILTER_ID as T } from "./types.js";
@@ -137,7 +137,7 @@ function oe(e) {
137
137
  return a();
138
138
  },
139
139
  get selected() {
140
- return k(() => e.selectedObject?.kind === "sticky_note")() && e.selectedObject.id === e.noteId;
140
+ return y(() => e.selectedObject?.kind === "sticky_note")() && e.selectedObject.id === e.noteId;
141
141
  },
142
142
  get viewportScale() {
143
143
  return e.projectedViewport().scale;
@@ -190,13 +190,13 @@ function Ce(e) {
190
190
  for (const [o, d] of Object.entries(n))
191
191
  d !== void 0 && (l[o] = d);
192
192
  return l;
193
- }), C = u(() => new Map(e.widgets.map((n) => [n.id, n]))), B = u(() => (e.stickyNotes ?? []).map((n) => n.id)), N = u(() => new Map((e.stickyNotes ?? []).map((n) => [n.id, n]))), b = u(() => J([...e.widgets, ...e.stickyNotes ?? []])), I = Z(), [S, f] = _(null), s = u(() => Q(e.mode)), v = u(() => s().workLayerLocked), m = u(() => s().layerEditingEnabled), D = u(() => e.widgets.filter((n) => {
193
+ }), C = u(() => new Map(e.widgets.map((n) => [n.id, n]))), B = u(() => (e.stickyNotes ?? []).map((n) => n.id)), N = u(() => new Map((e.stickyNotes ?? []).map((n) => [n.id, n]))), b = u(() => J([...e.widgets, ...e.stickyNotes ?? []])), s = Z(), [S, f] = _(null), L = u(() => Q(e.mode)), v = u(() => L().workLayerLocked), m = u(() => L().layerEditingEnabled), D = u(() => e.widgets.filter((n) => {
194
194
  const l = R(n.type, e.widgetDefinitions);
195
195
  return A(l) === "canvas_scaled";
196
196
  })), h = u(() => e.widgets.filter((n) => {
197
197
  const l = R(n.type, e.widgetDefinitions);
198
198
  return A(l) === "projected_surface";
199
- }).map((n) => n.id)), M = u(() => h().length > 0), V = u(() => M() ? [] : e.stickyNotes ?? []), W = () => e.canvasFrameSize.width > 0 && e.canvasFrameSize.height > 0, L = M;
199
+ }).map((n) => n.id)), M = u(() => h().length > 0), V = u(() => M() ? [] : e.stickyNotes ?? []), W = () => e.canvasFrameSize.width > 0 && e.canvasFrameSize.height > 0, I = M;
200
200
  return (() => {
201
201
  var n = te();
202
202
  n.firstChild;
@@ -208,7 +208,7 @@ function Ce(e) {
208
208
  return e.viewport;
209
209
  },
210
210
  get minScale() {
211
- return s().minScale;
211
+ return L().minScale;
212
212
  },
213
213
  get onViewportChange() {
214
214
  return e.onViewportCommit;
@@ -238,10 +238,10 @@ function Ce(e) {
238
238
  },
239
239
  overlay: (o) => [g(O, {
240
240
  get when() {
241
- return L();
241
+ return I();
242
242
  },
243
243
  get children() {
244
- var d = ne(), y = d.firstChild;
244
+ var d = ne(), k = d.firstChild;
245
245
  return w(d, g($, {
246
246
  get items() {
247
247
  return e.backgroundLayers ?? [];
@@ -250,7 +250,7 @@ function Ce(e) {
250
250
  return e.selectedObject ?? null;
251
251
  },
252
252
  get editable() {
253
- return k(() => !!m())() && !e.locked;
253
+ return y(() => !!m())() && !e.locked;
254
254
  },
255
255
  get filtered() {
256
256
  return e.filters[P] === !1;
@@ -266,7 +266,7 @@ function Ce(e) {
266
266
  onSelect: (t) => e.onSelectBackgroundLayer?.(t),
267
267
  onContextMenu: (t, i) => e.onBackgroundLayerContextMenu?.(t, i),
268
268
  onCommitMove: (t, i) => e.onCommitBackgroundMove?.(t, i)
269
- }), y), w(d, g(K, {
269
+ }), k), w(d, g(K, {
270
270
  get items() {
271
271
  return e.annotations ?? [];
272
272
  },
@@ -274,7 +274,7 @@ function Ce(e) {
274
274
  return e.selectedObject ?? null;
275
275
  },
276
276
  get editable() {
277
- return k(() => !!m())() && !e.locked;
277
+ return y(() => !!m())() && !e.locked;
278
278
  },
279
279
  get filtered() {
280
280
  return e.filters[q] === !1;
@@ -284,7 +284,7 @@ function Ce(e) {
284
284
  return S();
285
285
  },
286
286
  onPreviewGeometry: f,
287
- textEditorRegistry: I,
287
+ textEditorRegistry: s,
288
288
  get viewport() {
289
289
  return o();
290
290
  },
@@ -292,7 +292,7 @@ function Ce(e) {
292
292
  onContextMenu: (t, i) => e.onAnnotationContextMenu?.(t, i),
293
293
  onCommitMove: (t, i) => e.onCommitAnnotationMove?.(t, i),
294
294
  onUpdate: (t, i) => e.onUpdateTextAnnotation?.(t, i)
295
- }), y), w(y, g(j, {
295
+ }), k), w(k, g(j, {
296
296
  get each() {
297
297
  return h();
298
298
  },
@@ -310,7 +310,7 @@ function Ce(e) {
310
310
  return c();
311
311
  },
312
312
  get selectedWidgetId() {
313
- return k(() => e.selectedObject?.kind === "widget")() ? e.selectedObject.id : e.selectedWidgetId;
313
+ return y(() => e.selectedObject?.kind === "widget")() ? e.selectedObject.id : e.selectedWidgetId;
314
314
  },
315
315
  get visualFrontOwnerId() {
316
316
  return e.visualFrontOwnerId;
@@ -374,7 +374,7 @@ function Ce(e) {
374
374
  return W();
375
375
  }
376
376
  })
377
- }), null), w(y, g(j, {
377
+ }), null), w(k, g(j, {
378
378
  get each() {
379
379
  return B();
380
380
  },
@@ -393,7 +393,7 @@ function Ce(e) {
393
393
  return e.locked || v();
394
394
  },
395
395
  get filtered() {
396
- return k(() => !v())() && e.filters[T] === !1;
396
+ return y(() => !v())() && e.filters[T] === !1;
397
397
  },
398
398
  get onSelectStickyNote() {
399
399
  return e.onSelectStickyNote;
@@ -440,7 +440,7 @@ function Ce(e) {
440
440
  return e.selectedObject ?? null;
441
441
  },
442
442
  get editable() {
443
- return k(() => !!m())() && !e.locked;
443
+ return y(() => !!m())() && !e.locked;
444
444
  },
445
445
  get showRegionOutlines() {
446
446
  return m();
@@ -453,7 +453,7 @@ function Ce(e) {
453
453
  return S();
454
454
  },
455
455
  onPreviewGeometry: f,
456
- textEditorRegistry: I,
456
+ textEditorRegistry: s,
457
457
  onCommitAnnotationMove: (t, i) => e.onCommitAnnotationMove?.(t, i),
458
458
  onCommitAnnotationResize: (t, i) => e.onCommitAnnotationResize?.(t, i),
459
459
  onUpdateTextAnnotation: (t, i) => e.onUpdateTextAnnotation?.(t, i),
@@ -465,7 +465,7 @@ function Ce(e) {
465
465
  }
466
466
  }), g(O, {
467
467
  get when() {
468
- return k(() => !!L())() ? e.placementPreview : null;
468
+ return y(() => !!I())() ? e.placementPreview : null;
469
469
  },
470
470
  children: (d) => g(G, {
471
471
  get preview() {
@@ -495,7 +495,7 @@ function Ce(e) {
495
495
  return e.backgroundLayers ?? [];
496
496
  },
497
497
  get placementPreview() {
498
- return e.placementPreview;
498
+ return y(() => !!I())() ? null : e.placementPreview;
499
499
  },
500
500
  get viewport() {
501
501
  return e.viewport;
@@ -522,7 +522,7 @@ function Ce(e) {
522
522
  return m();
523
523
  },
524
524
  get renderFreeformLayers() {
525
- return !L();
525
+ return !I();
526
526
  },
527
527
  get viewportScale() {
528
528
  return e.viewport.scale;
@@ -645,12 +645,12 @@ function Ce(e) {
645
645
  return S();
646
646
  },
647
647
  onLayerGeometryPreview: f,
648
- textEditorRegistry: I
648
+ textEditorRegistry: s
649
649
  });
650
650
  }
651
651
  }), null), F((o) => {
652
- var d = !!e.locked, y = !!m();
653
- return d !== o.e && n.classList.toggle("is-locked", o.e = d), y !== o.t && n.classList.toggle("is-composition-mode", o.t = y), o;
652
+ var d = !!e.locked, k = !!m();
653
+ return d !== o.e && n.classList.toggle("is-locked", o.e = d), k !== o.t && n.classList.toggle("is-composition-mode", o.t = k), o;
654
654
  }, {
655
655
  e: void 0,
656
656
  t: void 0
@@ -1,53 +1,53 @@
1
- import { insert as h, createComponent as c, effect as Y, setAttribute as y, memo as Z, className as Xe, template as X, addEventListener as ke, Portal as Ae, setStyleProperty as Ye, use as $e, delegateEvents as Fe } from "solid-js/web";
2
- import { createSignal as ee, onCleanup as U, createEffect as q, createMemo as H, Show as W, For as z } from "solid-js";
1
+ import { insert as h, createComponent as c, effect as Y, setAttribute as y, memo as Q, className as Xe, template as X, addEventListener as ke, Portal as Ae, setStyleProperty as Ye, use as $e, delegateEvents as Fe } from "solid-js/web";
2
+ import { createSignal as Z, onCleanup as U, createEffect as q, createMemo as H, Show as W, For as ee, Index as Re } from "solid-js";
3
3
  import { Motion as $ } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.11/node_modules/solid-motionone/dist/index.js";
4
4
  import { easing as F, duration as R } from "../../utils/animations.js";
5
- import { Plus as Re } from "../icons/index.js";
6
- import { startHotInteraction as pe } from "../../utils/hotInteraction.js";
7
- import { startPointerSession as Be } from "../ui/pointerSession.js";
8
- import { clientToCanvasWorld as He } from "../ui/canvasGeometry.js";
9
- import { createWorkbenchWidgetFrame as We } from "./workbenchHelpers.js";
10
- import { getWidgetEntry as Ne } from "./widgets/widgetRegistry.js";
11
- import { WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as be, frameFromElement as _e, createWorkbenchEdgeAutoPanController as Ke } from "./workbenchEdgeAutoPan.js";
12
- import { DockLayoutDashboard as Ve, DockLayers as Ge, DockRegion as Ue, DockText as qe, DockMessageSquare as ze } from "../icons/DockIcons.js";
13
- var je = /* @__PURE__ */ X("<button type=button class=workbench-dock__item>"), Je = /* @__PURE__ */ X('<button type=button class="workbench-dock__item workbench-dock__action">'), Qe = /* @__PURE__ */ X('<div class=workbench-dock__mode-popover role=menu aria-label="Canvas mode">'), Ze = /* @__PURE__ */ X("<span class=workbench-dock__external-placeholder aria-hidden=true>"), et = /* @__PURE__ */ X('<div 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>'), tt = /* @__PURE__ */ X("<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>"), nt = /* @__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>");
14
- const fe = 5, ot = 1e3, rt = ".workbench-dock", te = [{
5
+ import { Plus as pe } from "../icons/index.js";
6
+ import { startHotInteraction as Be } from "../../utils/hotInteraction.js";
7
+ import { startPointerSession as He } from "../ui/pointerSession.js";
8
+ import { clientToCanvasWorld as We } from "../ui/canvasGeometry.js";
9
+ import { createWorkbenchWidgetFrame as Ne } from "./workbenchHelpers.js";
10
+ import { getWidgetEntry as Ke } from "./widgets/widgetRegistry.js";
11
+ import { WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as be, frameFromElement as _e, createWorkbenchEdgeAutoPanController as Ve } from "./workbenchEdgeAutoPan.js";
12
+ import { DockLayoutDashboard as Ge, DockLayers as Ue, DockRegion as qe, DockText as ze, DockMessageSquare as je } from "../icons/DockIcons.js";
13
+ var Je = /* @__PURE__ */ X("<button type=button class=workbench-dock__item>"), Qe = /* @__PURE__ */ X('<button type=button class="workbench-dock__item workbench-dock__action">'), Ze = /* @__PURE__ */ X('<div class=workbench-dock__mode-popover role=menu aria-label="Canvas mode">'), et = /* @__PURE__ */ X("<span class=workbench-dock__external-placeholder aria-hidden=true>"), tt = /* @__PURE__ */ X('<div 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>'), nt = /* @__PURE__ */ X("<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>"), ot = /* @__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>");
14
+ const fe = 5, rt = 1e3, it = ".workbench-dock", te = [{
15
15
  mode: "work",
16
16
  label: "Work Mode",
17
17
  description: "Operate windows and sticky notes",
18
- icon: Ve
18
+ icon: Ge
19
19
  }, {
20
20
  mode: "background",
21
21
  label: "Composition Mode",
22
22
  description: "Arrange regions and canvas text",
23
- icon: Ge
24
- }], it = [{
23
+ icon: Ue
24
+ }], at = [{
25
25
  tool: "sticky-note",
26
26
  label: "Sticky",
27
- icon: ze
28
- }], at = [{
27
+ icon: je
28
+ }], lt = [{
29
29
  tool: "background-region",
30
30
  label: "Region",
31
- icon: Ue
31
+ icon: qe
32
32
  }, {
33
33
  tool: "text",
34
34
  label: "Text",
35
- icon: qe
35
+ icon: ze
36
36
  }];
37
- function lt(e) {
37
+ function ct(e) {
38
38
  const a = e?.closest(".workbench-surface")?.querySelector(be);
39
39
  return a instanceof HTMLElement ? _e(a) : null;
40
40
  }
41
41
  function ne(e, s, a) {
42
42
  return e >= a.left && e <= a.right && s >= a.top && s <= a.bottom;
43
43
  }
44
- function ct(e, s, a) {
44
+ function st(e, s, a) {
45
45
  return a ? ne(e, s, a) : !1;
46
46
  }
47
47
  function me(e, s, a) {
48
48
  return Math.min(a, Math.max(s, e));
49
49
  }
50
- function st(e, s, a, l, r) {
50
+ function dt(e, s, a, l, r) {
51
51
  if (!e) return !1;
52
52
  if (ne(s, a, e) || ne(l, r, e))
53
53
  return !0;
@@ -63,7 +63,7 @@ function st(e, s, a, l, r) {
63
63
  function we(e, s, a) {
64
64
  if (!a || typeof document.elementFromPoint != "function") return !1;
65
65
  const l = document.elementFromPoint(e, s);
66
- return l instanceof Element && l.closest(rt) === a;
66
+ return l instanceof Element && l.closest(it) === a;
67
67
  }
68
68
  function he(e) {
69
69
  const s = () => e.hoverOffset === -1 ? {
@@ -86,7 +86,7 @@ function he(e) {
86
86
  r.button === 0 && e.onDragBegin(r, e.kind, e.id, e.label, e.icon, r.currentTarget, e.canvasPlacement, null);
87
87
  };
88
88
  return (() => {
89
- var r = je();
89
+ var r = Je();
90
90
  return r.$$pointerdown = l, r.addEventListener("pointerleave", () => e.onLeave()), r.addEventListener("pointerenter", () => e.onEnter()), h(r, c($.span, {
91
91
  class: "workbench-dock__tile",
92
92
  get animate() {
@@ -137,14 +137,14 @@ function he(e) {
137
137
  }), r;
138
138
  })();
139
139
  }
140
- function dt(e) {
140
+ function ut(e) {
141
141
  const s = () => e.hoverOffset === -1, a = () => ({
142
142
  scale: 1,
143
143
  y: 0,
144
144
  x: 0
145
145
  }), l = e.action.icon;
146
146
  return (() => {
147
- var r = Je();
147
+ var r = Qe();
148
148
  return r.$$click = (i) => e.action.onActivate(i.currentTarget), r.addEventListener("dragstart", (i) => i.preventDefault()), ke(r, "pointerleave", e.onLeave), ke(r, "pointerenter", e.onEnter), y(r, "draggable", !1), h(r, c($.span, {
149
149
  class: "workbench-dock__tile",
150
150
  get animate() {
@@ -190,8 +190,8 @@ function dt(e) {
190
190
  }), r;
191
191
  })();
192
192
  }
193
- function Pt(e) {
194
- const [s, a] = ee(null), [l, r] = ee(null), [i, D] = ee(!1);
193
+ function Lt(e) {
194
+ const [s, a] = Z(null), [l, r] = Z(null), [i, D] = Z(!1);
195
195
  let v, E, g, b, C = null;
196
196
  U(() => {
197
197
  b?.stop(), E?.stop({
@@ -225,7 +225,7 @@ function Pt(e) {
225
225
  }, A = () => {
226
226
  b?.stop(), b = void 0, C = null;
227
227
  }, N = () => {
228
- !e.viewport || !e.onViewportCommit || (C = e.viewport, b?.stop(), b = Ke({
228
+ !e.viewport || !e.onViewportCommit || (C = e.viewport, b?.stop(), b = Ve({
229
229
  readFrame: () => {
230
230
  const n = v?.closest(".workbench-surface")?.querySelector(be);
231
231
  return n instanceof HTMLElement ? _e(n) : null;
@@ -264,7 +264,7 @@ function Pt(e) {
264
264
  return;
265
265
  }
266
266
  if (t && n.overCanvas && n.canvasPlacement) {
267
- const S = n.canvasFrame && P ? He(n.canvasFrame, P, {
267
+ const S = n.canvasFrame && P ? We(n.canvasFrame, P, {
268
268
  clientX: n.clientX,
269
269
  clientY: n.clientY
270
270
  }) : null, o = n.canvasFrame ? {
@@ -276,12 +276,12 @@ function Pt(e) {
276
276
  } : void 0;
277
277
  n.canvasPlacement.onDrop(n.clientX, n.clientY, o);
278
278
  }
279
- }, j = (t, n, f, P, S, o, _, w) => {
279
+ }, z = (t, n, f, P, S, o, _, w) => {
280
280
  t.preventDefault(), E?.stop({
281
281
  reason: "manual_stop",
282
282
  commit: !1
283
283
  }), N();
284
- const u = lt(v);
284
+ const u = ct(v);
285
285
  r({
286
286
  kind: n,
287
287
  id: f,
@@ -299,7 +299,7 @@ function Pt(e) {
299
299
  preview: null,
300
300
  canvasPlacement: _,
301
301
  dockDrop: w,
302
- stopInteraction: pe({
302
+ stopInteraction: Be({
303
303
  kind: "drag",
304
304
  cursor: "grabbing"
305
305
  }),
@@ -318,14 +318,14 @@ function Pt(e) {
318
318
  }, ue = (ve) => {
319
319
  ve.preventDefault(), ve.stopImmediatePropagation(), B();
320
320
  }, ge = () => B(), Me = () => {
321
- p !== void 0 && window.clearTimeout(p), p = window.setTimeout(B, ot);
321
+ p !== void 0 && window.clearTimeout(p), p = window.setTimeout(B, rt);
322
322
  };
323
323
  m.trigger.addEventListener("click", ue, !0), window.addEventListener("pointerdown", ge, !0), g = {
324
324
  clear: B,
325
325
  expire: Me
326
326
  };
327
327
  }
328
- const G = we(d.clientX, d.clientY, v), I = m.canvasFrame, ce = x && ct(d.clientX, d.clientY, I), se = ce && !G, Te = x && !G && st(I, m.clientX, m.clientY, d.clientX, d.clientY), de = m.hasEnteredCanvas || ce || Te;
328
+ const G = we(d.clientX, d.clientY, v), I = m.canvasFrame, ce = x && st(d.clientX, d.clientY, I), se = ce && !G, Te = x && !G && dt(I, m.clientX, m.clientY, d.clientX, d.clientY), de = m.hasEnteredCanvas || ce || Te;
329
329
  T = x && de && !G;
330
330
  const xe = I ? me(d.clientX, I.left, I.right) : d.clientX, ye = I ? me(d.clientY, I.top, I.bottom) : d.clientY;
331
331
  return {
@@ -348,7 +348,7 @@ function Pt(e) {
348
348
  };
349
349
  }), T && b?.updatePointer(d.clientX, d.clientY);
350
350
  };
351
- E = Be({
351
+ E = He({
352
352
  pointerEvent: t,
353
353
  captureEl: t.currentTarget,
354
354
  onMove: L,
@@ -370,11 +370,11 @@ function Pt(e) {
370
370
  },
371
371
  onDrop: (n, f, P) => {
372
372
  if (!P?.worldPoint) return;
373
- const S = Ne(t.widgetType, e.widgetDefinitions);
373
+ const S = Ke(t.widgetType, e.widgetDefinitions);
374
374
  t.onDrop({
375
375
  widgetType: t.widgetType,
376
376
  centerWorld: P.worldPoint,
377
- frame: We(S, {
377
+ frame: Ne(S, {
378
378
  anchor: "center",
379
379
  worldX: P.worldPoint.worldX,
380
380
  worldY: P.worldPoint.worldY
@@ -382,19 +382,19 @@ function Pt(e) {
382
382
  });
383
383
  }
384
384
  } : null, De = (t, n) => {
385
- t.button !== 0 || !(t.currentTarget instanceof HTMLElement) || (g?.clear(), g = void 0, j(t, "external", n.id, n.label, n.icon, t.currentTarget, oe(n.canvasPlacement), n.onDropToDock ?? null));
385
+ t.button !== 0 || !(t.currentTarget instanceof HTMLElement) || (g?.clear(), g = void 0, z(t, "external", n.id, n.label, n.icon, t.currentTarget, oe(n.canvasPlacement), n.onDropToDock ?? null));
386
386
  };
387
387
  q(() => {
388
388
  e.registerExternalDockDragController?.({
389
389
  begin: De
390
390
  }), U(() => e.registerExternalDockDragController?.(null));
391
391
  });
392
- const Ce = () => l()?.kind === "widget" ? l().id : null, Pe = () => l()?.kind === "tool" ? l().id : null, Le = () => l()?.kind === "external" ? l()?.icon : void 0, O = () => e.mode === "background" || e.mode === "annotation" ? "background" : "work", re = H(() => te.find((t) => t.mode === O()) ?? te[0]), ie = H(() => O() === "background" ? at.map((t) => ({
392
+ const Ce = () => l()?.kind === "widget" ? l().id : null, Pe = () => l()?.kind === "tool" ? l().id : null, Le = () => l()?.kind === "external" ? l()?.icon : void 0, O = () => e.mode === "background" || e.mode === "annotation" ? "background" : "work", re = H(() => te.find((t) => t.mode === O()) ?? te[0]), ie = H(() => O() === "background" ? lt.map((t) => ({
393
393
  id: t.tool,
394
394
  kind: "tool",
395
395
  label: t.label,
396
396
  icon: t.icon
397
- })) : [...it.map((t) => ({
397
+ })) : [...at.map((t) => ({
398
398
  id: t.tool,
399
399
  kind: "tool",
400
400
  label: t.label,
@@ -404,18 +404,18 @@ function Pt(e) {
404
404
  kind: "widget",
405
405
  label: t.label,
406
406
  icon: t.icon
407
- }))]), ae = H(() => O() === "background" ? [] : [...e.dockItems ?? []]), K = H(() => O() === "background" ? [] : [...e.dockActions ?? []]), le = H(() => ie().map((t) => String(t.id))), J = () => O() !== "background", Se = (t) => !J() || e.filters[t] !== !1, Ie = (t) => {
408
- if (!J())
407
+ }))]), ae = H(() => O() === "background" ? [] : [...e.dockItems ?? []]), K = H(() => O() === "background" ? [] : [...e.dockActions ?? []]), le = H(() => ie().map((t) => String(t.id))), j = () => O() !== "background", Se = (t) => !j() || e.filters[t] !== !1, Ie = (t) => {
408
+ if (!j())
409
409
  return !1;
410
410
  const n = le();
411
411
  return n.length > 1 && n.every((f) => e.filters[f] !== !1 == (f === t));
412
- }, Q = () => s() === 0, Oe = () => ({
412
+ }, J = () => s() === 0, Oe = () => ({
413
413
  scale: 1,
414
414
  y: 0,
415
415
  x: 0
416
416
  });
417
417
  return [(() => {
418
- var t = et(), n = t.firstChild, f = n.firstChild, P = n.nextSibling;
418
+ var t = tt(), n = t.firstChild, f = n.firstChild, P = n.nextSibling;
419
419
  t.addEventListener("pointerleave", () => a(null));
420
420
  var S = v;
421
421
  return typeof S == "function" ? $e(S, t) : v = t, f.$$click = () => D((o) => !o), f.addEventListener("pointerleave", () => a((o) => o === 0 ? null : o)), f.addEventListener("pointerenter", () => a(0)), h(f, c($.span, {
@@ -441,8 +441,8 @@ function Pt(e) {
441
441
  class: "workbench-dock__tooltip",
442
442
  get animate() {
443
443
  return {
444
- opacity: Q() && !i() ? 1 : 0,
445
- y: Q() && !i() ? -6 : 0
444
+ opacity: J() && !i() ? 1 : 0,
445
+ y: J() && !i() ? -6 : 0
446
446
  };
447
447
  },
448
448
  get transition() {
@@ -459,13 +459,13 @@ function Pt(e) {
459
459
  return i();
460
460
  },
461
461
  get children() {
462
- var o = Qe();
463
- return h(o, c(z, {
462
+ var o = Ze();
463
+ return h(o, c(ee, {
464
464
  each: te,
465
465
  children: (_) => {
466
466
  const w = _.icon;
467
467
  return (() => {
468
- var u = tt(), L = u.firstChild, d = L.nextSibling, T = d.firstChild, m = T.nextSibling;
468
+ var u = nt(), L = u.firstChild, d = L.nextSibling, T = d.firstChild, m = T.nextSibling;
469
469
  return u.$$click = () => {
470
470
  e.onSelectMode?.(_.mode), D(!1);
471
471
  }, h(L, c(w, {
@@ -481,14 +481,16 @@ function Pt(e) {
481
481
  }
482
482
  })), o;
483
483
  }
484
- }), null), h(t, c(z, {
484
+ }), null), h(t, c(Re, {
485
485
  get each() {
486
486
  return K();
487
487
  },
488
488
  children: (o, _) => {
489
- const w = () => _() + 1;
490
- return c(dt, {
491
- action: o,
489
+ const w = () => _ + 1;
490
+ return c(ut, {
491
+ get action() {
492
+ return o();
493
+ },
492
494
  get hoverOffset() {
493
495
  return k(w());
494
496
  },
@@ -501,7 +503,7 @@ function Pt(e) {
501
503
  return !!(l()?.kind === "external" && l()?.moved);
502
504
  },
503
505
  get children() {
504
- var o = Ze();
506
+ var o = et();
505
507
  return h(o, c(W, {
506
508
  get when() {
507
509
  return Le();
@@ -514,7 +516,7 @@ function Pt(e) {
514
516
  }
515
517
  })), Y(() => o.classList.toggle("is-drop-allowed", !!l()?.overDock)), o;
516
518
  }
517
- }), P), h(t, c(z, {
519
+ }), P), h(t, c(ee, {
518
520
  get each() {
519
521
  return ae();
520
522
  },
@@ -540,17 +542,17 @@ function Pt(e) {
540
542
  return k(w());
541
543
  },
542
544
  get isDragging() {
543
- return Z(() => l()?.kind === "host")() && l()?.id === o.id;
545
+ return Q(() => l()?.kind === "host")() && l()?.id === o.id;
544
546
  },
545
547
  get canvasPlacement() {
546
548
  return oe(o.canvasPlacement);
547
549
  },
548
550
  onEnter: () => a(w()),
549
551
  onLeave: () => a((u) => u === w() ? null : u),
550
- onDragBegin: j
552
+ onDragBegin: z
551
553
  });
552
554
  }
553
- }), P), h(t, c(z, {
555
+ }), P), h(t, c(ee, {
554
556
  get each() {
555
557
  return ie();
556
558
  },
@@ -576,16 +578,16 @@ function Pt(e) {
576
578
  return Se(String(o.id));
577
579
  },
578
580
  get filterable() {
579
- return J();
581
+ return j();
580
582
  },
581
583
  get hoverOffset() {
582
584
  return k(w());
583
585
  },
584
586
  get isDragging() {
585
- return Z(() => o.kind === "widget")() ? Ce() === o.id : Pe() === o.id;
587
+ return Q(() => o.kind === "widget")() ? Ce() === o.id : Pe() === o.id;
586
588
  },
587
589
  get canvasPlacement() {
588
- return Z(() => o.kind === "widget")() ? {
590
+ return Q(() => o.kind === "widget")() ? {
589
591
  preview: {
590
592
  kind: "widget",
591
593
  id: o.id
@@ -601,11 +603,11 @@ function Pt(e) {
601
603
  },
602
604
  onEnter: () => a(w()),
603
605
  onLeave: () => a((u) => u === w() ? null : u),
604
- onDragBegin: j
606
+ onDragBegin: z
605
607
  });
606
608
  }
607
609
  }), null), Y((o) => {
608
- var _ = `workbench-dock workbench-dock-material${l()?.kind === "external" && l()?.moved ? " is-external-drop-target" : ""}${l()?.kind === "external" && l()?.overDock ? " is-external-drop-allowed" : ""}`, w = O() === "background", u = !!(Q() || i()), L = i();
610
+ var _ = `workbench-dock workbench-dock-material${l()?.kind === "external" && l()?.moved ? " is-external-drop-target" : ""}${l()?.kind === "external" && l()?.overDock ? " is-external-drop-allowed" : ""}`, w = O() === "background", u = !!(J() || i()), L = i();
609
611
  return _ !== o.e && Xe(t, o.e = _), w !== o.t && f.classList.toggle("is-active", o.t = w), u !== o.a && f.classList.toggle("is-hovered", o.a = u), L !== o.o && y(f, "aria-expanded", o.o = L), o;
610
612
  }, {
611
613
  e: void 0,
@@ -618,20 +620,20 @@ function Pt(e) {
618
620
  return !!(l()?.moved && !l()?.preview);
619
621
  },
620
622
  get children() {
621
- return c(ut, {
623
+ return c(gt, {
622
624
  state: l
623
625
  });
624
626
  }
625
627
  })];
626
628
  }
627
- function ut(e) {
629
+ function gt(e) {
628
630
  const s = () => {
629
631
  const r = e.state();
630
632
  return r ? `translate3d(${r.clientX + 14}px, ${r.clientY - 56}px, 0)` : "translate3d(0px, 0px, 0)";
631
633
  }, a = () => e.state()?.label ?? "", l = () => e.state()?.icon;
632
634
  return c(Ae, {
633
635
  get children() {
634
- var r = nt(), i = r.firstChild, D = i.nextSibling, v = D.firstChild, E = v.nextSibling, g = E.firstChild, b = g.nextSibling, C = b.firstChild;
636
+ var r = ot(), i = r.firstChild, D = i.nextSibling, v = D.firstChild, E = v.nextSibling, g = E.firstChild, b = g.nextSibling, C = b.firstChild;
635
637
  return h(v, c(W, {
636
638
  get when() {
637
639
  return l();
@@ -642,7 +644,7 @@ function ut(e) {
642
644
  class: "w-4 h-4"
643
645
  });
644
646
  }
645
- })), h(g, a), h(b, c(Re, {
647
+ })), h(g, a), h(b, c(pe, {
646
648
  class: "w-3 h-3"
647
649
  }), C), h(C, () => e.state()?.kind === "external" ? "Pin to Dock" : "Drag onto canvas"), Y((k) => {
648
650
  var A = !!(e.state()?.kind === "external" && e.state()?.overDock), N = s();
@@ -656,5 +658,5 @@ function ut(e) {
656
658
  }
657
659
  Fe(["pointerdown", "click"]);
658
660
  export {
659
- Pt as WorkbenchDock
661
+ Lt as WorkbenchDock
660
662
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-core",
3
- "version": "0.42.1",
3
+ "version": "0.42.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",