@floegence/floe-webapp-core 0.96.0 → 0.97.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.
@@ -1,23 +1,23 @@
1
1
  import { createComponent as l, use as ut, spread as lt, mergeProps as gt, insert as C, Portal as ft, addEventListener as wt, template as P, delegateEvents as mt } from "solid-js/web";
2
- import { useContextMenuActions as kt } from "../ui/ContextMenuActions.js";
3
- import { WorkbenchCompositionActionsContext as vt, WorkbenchCompositionMessagesContext as yt } from "./workbenchCompositionMessages.js";
4
- import { createMemo as g, createSignal as I, untrack as b, createEffect as h, onCleanup as W, Show as At } from "solid-js";
2
+ import { useContextMenuActions as kt, ContextMenuActionIcon as vt } from "../ui/ContextMenuActions.js";
3
+ import { WorkbenchCompositionActionsContext as yt, WorkbenchCompositionMessagesContext as At } from "./workbenchCompositionMessages.js";
4
+ import { createMemo as g, createSignal as I, untrack as b, createEffect as h, onCleanup as W, Show as Ct } from "solid-js";
5
5
  import { clientToCanvasWorld as E } from "../ui/canvasGeometry.js";
6
- import { createUIFirstSelection as Ct } from "../../utils/uiFirstSelection.js";
7
- import { WorkbenchCanvas as bt } from "./WorkbenchCanvas.js";
8
- import { WorkbenchContextMenu as ht } from "./WorkbenchContextMenu.js";
9
- import { WorkbenchDock as Wt } from "./WorkbenchFilterBar.js";
10
- import { WorkbenchHud as pt } from "./WorkbenchHud.js";
11
- import { WorkbenchLockButton as St } from "./WorkbenchLockButton.js";
12
- import { installWorkbenchContextMenuDismissListeners as xt } from "./workbenchContextMenuDismiss.js";
13
- import { createContextMenuPosition as It, WORKBENCH_CONTEXT_MENU_WIDTH_PX as Mt, estimateContextMenuHeight as Dt } from "./workbenchHelpers.js";
14
- import { resolveWorkbenchWidgetPlacementPreview as Lt, resolveWorkbenchToolPlacementPreview as Ft } from "./workbenchPlacement.js";
15
- import { useWorkbenchModel as Tt } from "./useWorkbenchModel.js";
16
- import { sortWorkbenchDockFocusCandidates as Bt, workbenchDockFocusCandidateKey as R, resolveWorkbenchDockFocusCycle as _t } from "./workbenchDockFocusCycle.js";
17
- import { resolveWorkbenchInteractionAdapter as Ot } from "./workbenchInteractionAdapter.js";
18
- import { SURFACE_PORTAL_LAYER_ATTR as Et, DIALOG_SURFACE_HOST_ATTR as Rt } from "../ui/dialogSurfaceScope.js";
19
- var Nt = /* @__PURE__ */ P("<div class=workbench-menu-backdrop data-floe-workbench-boundary=true>"), Pt = /* @__PURE__ */ P("<div><div class=workbench-surface__body data-floe-workbench-canvas-frame=true>");
20
- const Xt = "F1";
6
+ import { createUIFirstSelection as bt } from "../../utils/uiFirstSelection.js";
7
+ import { WorkbenchCanvas as ht } from "./WorkbenchCanvas.js";
8
+ import { WorkbenchContextMenu as Wt } from "./WorkbenchContextMenu.js";
9
+ import { WorkbenchDock as pt } from "./WorkbenchFilterBar.js";
10
+ import { WorkbenchHud as St } from "./WorkbenchHud.js";
11
+ import { WorkbenchLockButton as xt } from "./WorkbenchLockButton.js";
12
+ import { installWorkbenchContextMenuDismissListeners as It } from "./workbenchContextMenuDismiss.js";
13
+ import { createContextMenuPosition as Mt, WORKBENCH_CONTEXT_MENU_WIDTH_PX as Dt, estimateContextMenuHeight as Lt } from "./workbenchHelpers.js";
14
+ import { resolveWorkbenchWidgetPlacementPreview as Ft, resolveWorkbenchToolPlacementPreview as Tt } from "./workbenchPlacement.js";
15
+ import { useWorkbenchModel as Bt } from "./useWorkbenchModel.js";
16
+ import { sortWorkbenchDockFocusCandidates as _t, workbenchDockFocusCandidateKey as R, resolveWorkbenchDockFocusCycle as Ot } from "./workbenchDockFocusCycle.js";
17
+ import { resolveWorkbenchInteractionAdapter as Et } from "./workbenchInteractionAdapter.js";
18
+ import { SURFACE_PORTAL_LAYER_ATTR as Rt, DIALOG_SURFACE_HOST_ATTR as Nt } from "../ui/dialogSurfaceScope.js";
19
+ var Pt = /* @__PURE__ */ P("<div class=workbench-menu-backdrop data-floe-workbench-boundary=true>"), Xt = /* @__PURE__ */ P("<div><div class=workbench-surface__body data-floe-workbench-canvas-frame=true>");
20
+ const qt = "F1";
21
21
  function N(c) {
22
22
  if (c)
23
23
  try {
@@ -28,8 +28,8 @@ function N(c) {
28
28
  c.focus();
29
29
  }
30
30
  }
31
- function ce(c) {
32
- const X = g(() => c.compositionMessages), e = Tt({
31
+ function ae(c) {
32
+ const X = g(() => c.compositionMessages), e = Bt({
33
33
  state: () => c.state(),
34
34
  setState: (t) => c.setState(t),
35
35
  widgetDefinitions: () => c.widgetDefinitions,
@@ -37,7 +37,7 @@ function ce(c) {
37
37
  backgroundLayerDefaults: () => c.backgroundLayerDefaults,
38
38
  onClose: () => {
39
39
  }
40
- }), u = Ct({
40
+ }), u = bt({
41
41
  committed: e.selectedWidgetId,
42
42
  commitEqualRequests: !0,
43
43
  commit: (t, n) => {
@@ -74,7 +74,7 @@ function ce(c) {
74
74
  return;
75
75
  }
76
76
  e.canvas.selectWidget(t), e.canvas.commitFront(t);
77
- }, [f, z] = I(null), [V, H] = I(null), d = g(() => Ot(c.interactionAdapter)), [D, m] = I(b(() => d().createInitialInputOwner())), L = g(() => {
77
+ }, [f, z] = I(null), [V, H] = I(null), d = g(() => Et(c.interactionAdapter)), [D, m] = I(b(() => d().createInitialInputOwner())), L = g(() => {
78
78
  const t = c.launcherWidgetTypes;
79
79
  return !t || t.length <= 0 ? null : new Set(t);
80
80
  }), U = g(() => {
@@ -84,7 +84,10 @@ function ce(c) {
84
84
  id: t.id,
85
85
  kind: "action",
86
86
  label: t.label,
87
- icon: () => t.icon?.(),
87
+ icon: (n) => vt({
88
+ icon: t.icon,
89
+ class: n.class
90
+ }),
88
91
  disabled: t.disabled,
89
92
  onSelect: () => {
90
93
  e.contextMenu.close(), t.onSelect();
@@ -110,11 +113,11 @@ function ce(c) {
110
113
  const t = e.contextMenu.state();
111
114
  if (!t) return;
112
115
  const n = F(), o = n.filter((i) => i.kind === "action").length, r = n.filter((i) => i.kind === "separator").length;
113
- return It({
116
+ return Mt({
114
117
  clientX: t.clientX,
115
118
  clientY: t.clientY,
116
- menuWidth: Mt,
117
- menuHeight: Dt(o, r)
119
+ menuWidth: Dt,
120
+ menuHeight: Lt(o, r)
118
121
  });
119
122
  }), B = (t, n, o) => {
120
123
  const r = d(), i = r.findWidgetRoot(t), a = r.readWidgetId(i);
@@ -220,7 +223,7 @@ function ce(c) {
220
223
  id: i.id
221
224
  };
222
225
  }
223
- const r = _t({
226
+ const r = Ot({
224
227
  dockItemKey: G(t),
225
228
  candidates: n,
226
229
  selectedObject: o,
@@ -228,7 +231,7 @@ function ce(c) {
228
231
  });
229
232
  y = r.session, r.target && Q(r.target);
230
233
  }, nt = (t) => {
231
- const n = Bt(S(t)), o = p(), r = o ? R(o) : null, i = r ? n.findIndex((a) => R(a) === r) : -1;
234
+ const n = _t(S(t)), o = p(), r = o ? R(o) : null, i = r ? n.findIndex((a) => R(a) === r) : -1;
232
235
  return {
233
236
  count: n.length,
234
237
  currentIndex: i >= 0 ? i : null,
@@ -300,10 +303,10 @@ function ce(c) {
300
303
  c.onApiReady?.(null);
301
304
  });
302
305
  });
303
- const O = () => c.lockShortcut === void 0 ? Xt : c.lockShortcut;
306
+ const O = () => c.lockShortcut === void 0 ? qt : c.lockShortcut;
304
307
  h(() => {
305
308
  if (typeof window > "u" || !e.contextMenu.state()) return;
306
- const t = xt({
309
+ const t = It({
307
310
  ownerWindow: window,
308
311
  onDismiss: e.contextMenu.close
309
312
  });
@@ -396,13 +399,13 @@ function ce(c) {
396
399
  const t = V();
397
400
  if (!t) return null;
398
401
  const n = x(t.clientX, t.clientY, t);
399
- return n ? t.kind === "widget" ? Lt({
402
+ return n ? t.kind === "widget" ? Ft({
400
403
  type: t.id,
401
404
  widgetDefinitions: e.widgetDefinitions(),
402
405
  worldX: n.worldX,
403
406
  worldY: n.worldY,
404
407
  dropAllowed: t.dropAllowed
405
- }) : Ft({
408
+ }) : Tt({
406
409
  tool: t.id,
407
410
  label: t.label,
408
411
  worldX: n.worldX,
@@ -412,7 +415,7 @@ function ce(c) {
412
415
  backgroundDefaults: c.backgroundLayerDefaults
413
416
  }) : null;
414
417
  });
415
- return l(vt.Provider, {
418
+ return l(yt.Provider, {
416
419
  value: {
417
420
  duplicate: (t) => {
418
421
  if (t.kind === "sticky_note") {
@@ -430,10 +433,10 @@ function ce(c) {
430
433
  }
431
434
  },
432
435
  get children() {
433
- return l(yt.Provider, {
436
+ return l(At.Provider, {
434
437
  value: X,
435
438
  get children() {
436
- var t = Pt(), n = t.firstChild;
439
+ var t = Xt(), n = t.firstChild;
437
440
  return ut(z, t), lt(t, gt({
438
441
  get class() {
439
442
  return `workbench-surface${c.class ? ` ${c.class}` : ""}`;
@@ -441,8 +444,8 @@ function ce(c) {
441
444
  }, () => ({
442
445
  [d().surfaceRootAttr]: "true",
443
446
  [d().dialogSurfaceHostAttr]: "true",
444
- [Rt]: "true",
445
- [Et]: "true"
447
+ [Nt]: "true",
448
+ [Rt]: "true"
446
449
  }), {
447
450
  get "data-workbench-theme"() {
448
451
  return e.theme();
@@ -451,7 +454,7 @@ function ce(c) {
451
454
  return e.mode();
452
455
  },
453
456
  tabIndex: -1
454
- }), !1, !0), C(n, l(bt, {
457
+ }), !1, !0), C(n, l(ht, {
455
458
  get widgetDefinitions() {
456
459
  return e.widgetDefinitions();
457
460
  },
@@ -598,7 +601,7 @@ function ce(c) {
598
601
  get onLayoutInteractionEnd() {
599
602
  return c.onLayoutInteractionEnd;
600
603
  }
601
- })), C(t, l(St, {
604
+ })), C(t, l(xt, {
602
605
  get locked() {
603
606
  return e.locked();
604
607
  },
@@ -608,7 +611,7 @@ function ce(c) {
608
611
  get shortcutLabel() {
609
612
  return O() ?? void 0;
610
613
  }
611
- }), null), C(t, l(Wt, {
614
+ }), null), C(t, l(pt, {
612
615
  get widgetDefinitions() {
613
616
  return U();
614
617
  },
@@ -661,7 +664,7 @@ function ce(c) {
661
664
  return c.registerExternalDockDragController;
662
665
  },
663
666
  onDragPreviewChange: H
664
- }), null), C(t, l(pt, {
667
+ }), null), C(t, l(St, {
665
668
  get scaleLabel() {
666
669
  return e.scaleLabel();
667
670
  },
@@ -675,7 +678,7 @@ function ce(c) {
675
678
  return e.theme();
676
679
  },
677
680
  onSelectTheme: (o) => e.appearance.setTheme(o)
678
- }), null), C(t, l(At, {
681
+ }), null), C(t, l(Ct, {
679
682
  get when() {
680
683
  return e.contextMenu.state();
681
684
  },
@@ -683,9 +686,9 @@ function ce(c) {
683
686
  return l(ft, {
684
687
  get children() {
685
688
  return [(() => {
686
- var o = Nt();
689
+ var o = Pt();
687
690
  return wt(o, "contextmenu", e.contextMenu.retarget, !0), o;
688
- })(), l(ht, {
691
+ })(), l(Wt, {
689
692
  get x() {
690
693
  return T()?.left ?? 0;
691
694
  },
@@ -707,5 +710,5 @@ function ce(c) {
707
710
  }
708
711
  mt(["contextmenu"]);
709
712
  export {
710
- ce as WorkbenchSurface
713
+ ae as WorkbenchSurface
711
714
  };