@floegence/floe-webapp-core 0.36.16 → 0.36.17

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,27 +1,28 @@
1
- import { insert as v, createComponent as d, effect as D, setAttribute as S, template as I, Portal as F, setStyleProperty as H, delegateEvents as P } from "solid-js/web";
2
- import { createSignal as O, onCleanup as R, createMemo as B, For as T, Show as X } from "solid-js";
3
- import { Motion as C } 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 y, duration as L } from "../../utils/animations.js";
5
- import { Layers as G, Plus as q } from "../icons/index.js";
6
- import { startHotInteraction as z } from "../../utils/hotInteraction.js";
7
- var N = /* @__PURE__ */ I("<button type=button class=workbench-dock__item>"), U = /* @__PURE__ */ I('<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>'), V = /* @__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>");
8
- const x = 5, W = '[data-floe-workbench-canvas-frame="true"]';
9
- function j(e, l) {
10
- const a = document.querySelector(W);
1
+ import { insert as g, createComponent as d, effect as D, setAttribute as S, template as L, Portal as Y, setStyleProperty as M, delegateEvents as A } from "solid-js/web";
2
+ import { createSignal as I, onCleanup as F, createMemo as H, For as P, Show as x } from "solid-js";
3
+ import { Motion as w } 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 y, duration as C } from "../../utils/animations.js";
5
+ import { Layers as R, Plus as T } from "../icons/index.js";
6
+ import { startHotInteraction as B } from "../../utils/hotInteraction.js";
7
+ import { startPointerSession as G } from "../ui/pointerSession.js";
8
+ var q = /* @__PURE__ */ L("<button type=button class=workbench-dock__item>"), z = /* @__PURE__ */ L('<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>'), N = /* @__PURE__ */ L("<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>");
9
+ const O = 5, V = '[data-floe-workbench-canvas-frame="true"]';
10
+ function W(t, l) {
11
+ const a = document.querySelector(V);
11
12
  if (!(a instanceof HTMLElement)) return !1;
12
- const s = a.getBoundingClientRect();
13
- return e >= s.left && e <= s.right && l >= s.top && l <= s.bottom;
13
+ const c = a.getBoundingClientRect();
14
+ return t >= c.left && t <= c.right && l >= c.top && l <= c.bottom;
14
15
  }
15
- function p(e) {
16
- const l = () => e.hoverOffset === -1 ? {
16
+ function j(t) {
17
+ const l = () => t.hoverOffset === -1 ? {
17
18
  scale: 1.26,
18
19
  y: -6,
19
20
  x: 0
20
- } : e.hoverOffset === 1 ? {
21
+ } : t.hoverOffset === 1 ? {
21
22
  scale: 1.08,
22
23
  y: -2,
23
24
  x: 5
24
- } : e.hoverOffset === -2 ? {
25
+ } : t.hoverOffset === -2 ? {
25
26
  scale: 1.08,
26
27
  y: -2,
27
28
  x: -5
@@ -29,31 +30,31 @@ function p(e) {
29
30
  scale: 1,
30
31
  y: 0,
31
32
  x: 0
32
- }, a = () => e.hoverOffset === -1, s = (o) => {
33
- o.button === 0 && e.onDragBegin(o, e.type, e.label, e.icon);
33
+ }, a = () => t.hoverOffset === -1, c = (i) => {
34
+ i.button === 0 && t.onDragBegin(i, t.type, t.label, t.icon);
34
35
  };
35
36
  return (() => {
36
- var o = N();
37
- return o.$$pointerdown = s, o.addEventListener("pointerleave", () => e.onLeave()), o.addEventListener("pointerenter", () => e.onEnter()), v(o, d(C.span, {
37
+ var i = q();
38
+ return i.$$pointerdown = c, i.addEventListener("pointerleave", () => t.onLeave()), i.addEventListener("pointerenter", () => t.onEnter()), g(i, d(w.span, {
38
39
  class: "workbench-dock__tile",
39
40
  get animate() {
40
41
  return l();
41
42
  },
42
43
  get transition() {
43
44
  return {
44
- duration: L.fast,
45
+ duration: C.fast,
45
46
  easing: y.easeOut
46
47
  };
47
48
  },
48
49
  get children() {
49
50
  return (() => {
50
- const t = e.icon;
51
- return d(t, {
51
+ const n = t.icon;
52
+ return d(n, {
52
53
  class: "workbench-dock__icon"
53
54
  });
54
55
  })();
55
56
  }
56
- }), null), v(o, d(C.span, {
57
+ }), null), g(i, d(w.span, {
57
58
  class: "workbench-dock__tooltip",
58
59
  get animate() {
59
60
  return {
@@ -63,90 +64,91 @@ function p(e) {
63
64
  },
64
65
  get transition() {
65
66
  return {
66
- duration: L.fast,
67
+ duration: C.fast,
67
68
  easing: y.easeOut
68
69
  };
69
70
  },
70
71
  get children() {
71
- return e.label;
72
+ return t.label;
72
73
  }
73
- }), null), D((t) => {
74
- var h = !!e.active, m = !!a(), f = !!e.isDragging, _ = `${e.label} — click to solo, drag to canvas to create`, b = e.active;
75
- return h !== t.e && o.classList.toggle("is-active", t.e = h), m !== t.t && o.classList.toggle("is-hovered", t.t = m), f !== t.a && o.classList.toggle("is-source-dragging", t.a = f), _ !== t.o && S(o, "aria-label", t.o = _), b !== t.i && S(o, "aria-pressed", t.i = b), t;
74
+ }), null), D((n) => {
75
+ var f = !!t.active, k = !!a(), h = !!t.isDragging, _ = `${t.label} — click to solo, drag to canvas to create`, b = t.active;
76
+ return f !== n.e && i.classList.toggle("is-active", n.e = f), k !== n.t && i.classList.toggle("is-hovered", n.t = k), h !== n.a && i.classList.toggle("is-source-dragging", n.a = h), _ !== n.o && S(i, "aria-label", n.o = _), b !== n.i && S(i, "aria-pressed", n.i = b), n;
76
77
  }, {
77
78
  e: void 0,
78
79
  t: void 0,
79
80
  a: void 0,
80
81
  o: void 0,
81
82
  i: void 0
82
- }), o;
83
+ }), i;
83
84
  })();
84
85
  }
85
- function re(e) {
86
- const [l, a] = O(null), [s, o] = O(null);
87
- let t;
88
- R(() => {
89
- t?.abort(), t = void 0, s()?.stopInteraction();
86
+ function nt(t) {
87
+ const [l, a] = I(null), [c, i] = I(null);
88
+ let n;
89
+ F(() => {
90
+ n?.stop({
91
+ reason: "manual_stop",
92
+ commit: !1
93
+ }), n = void 0, c()?.stopInteraction();
90
94
  });
91
- const h = B(() => e.widgetDefinitions.every((i) => e.filters[i.type])), m = (i) => {
95
+ const f = H(() => t.widgetDefinitions.every((o) => t.filters[o.type])), k = (o) => {
92
96
  const r = l();
93
- return r === null ? 0 : r === i ? -1 : r === i + 1 ? -2 : r === i - 1 ? 1 : 0;
94
- }, f = (i) => {
95
- const r = s();
97
+ return r === null ? 0 : r === o ? -1 : r === o + 1 ? -2 : r === o - 1 ? 1 : 0;
98
+ }, h = (o) => {
99
+ const r = c();
96
100
  if (!r) return;
97
- const n = !r.moved;
98
- if (r.stopInteraction(), o(null), t?.abort(), t = void 0, n) {
99
- e.onSoloFilter(r.type);
101
+ const e = !r.moved;
102
+ if (r.stopInteraction(), i(null), n = void 0, e) {
103
+ t.onSoloFilter(r.type);
100
104
  return;
101
105
  }
102
- i && r.overCanvas && e.onCreateAt?.(r.type, r.clientX, r.clientY);
103
- }, _ = (i, r, n, u) => {
104
- i.preventDefault(), t?.abort(), o({
106
+ o && r.overCanvas && t.onCreateAt?.(r.type, r.clientX, r.clientY);
107
+ }, _ = (o, r, e, u) => {
108
+ o.preventDefault(), n?.stop({
109
+ reason: "manual_stop",
110
+ commit: !1
111
+ }), i({
105
112
  type: r,
106
- label: n,
113
+ label: e,
107
114
  icon: u,
108
- pointerId: i.pointerId,
109
- startClientX: i.clientX,
110
- startClientY: i.clientY,
111
- clientX: i.clientX,
112
- clientY: i.clientY,
115
+ pointerId: o.pointerId,
116
+ startClientX: o.clientX,
117
+ startClientY: o.clientY,
118
+ clientX: o.clientX,
119
+ clientY: o.clientY,
113
120
  moved: !1,
114
121
  overCanvas: !1,
115
- stopInteraction: z({
122
+ stopInteraction: B({
116
123
  kind: "drag",
117
124
  cursor: "grabbing"
118
125
  })
119
126
  });
120
- const c = new AbortController();
121
- t = c;
122
- const k = (g) => {
123
- o((w) => {
124
- if (!w || w.pointerId !== g.pointerId) return w;
125
- const Y = g.clientX - w.startClientX, M = g.clientY - w.startClientY, E = w.moved || Math.abs(Y) > x || Math.abs(M) > x;
127
+ const v = (s) => {
128
+ i((m) => {
129
+ if (!m || m.pointerId !== s.pointerId) return m;
130
+ const X = s.clientX - m.startClientX, $ = s.clientY - m.startClientY, E = m.moved || Math.abs(X) > O || Math.abs($) > O;
126
131
  return {
127
- ...w,
128
- clientX: g.clientX,
129
- clientY: g.clientY,
132
+ ...m,
133
+ clientX: s.clientX,
134
+ clientY: s.clientY,
130
135
  moved: E,
131
- overCanvas: E && j(g.clientX, g.clientY)
136
+ overCanvas: E && W(s.clientX, s.clientY)
132
137
  };
133
138
  });
134
- }, $ = (g) => {
135
- g.pointerId === i.pointerId && f(!0);
136
- }, A = (g) => {
137
- g.pointerId === i.pointerId && f(!1);
138
139
  };
139
- window.addEventListener("pointermove", k, {
140
- signal: c.signal
141
- }), window.addEventListener("pointerup", $, {
142
- signal: c.signal
143
- }), window.addEventListener("pointercancel", A, {
144
- signal: c.signal
140
+ n = G({
141
+ pointerEvent: o,
142
+ captureEl: o.currentTarget,
143
+ onMove: v,
144
+ onEnd: ({
145
+ commit: s
146
+ }) => h(s)
145
147
  });
146
- }, b = () => s()?.type ?? null;
148
+ }, b = () => c()?.type ?? null;
147
149
  return [(() => {
148
- var i = U(), r = i.firstChild;
149
- return r.nextSibling, i.addEventListener("pointerleave", () => a(null)), r.$$click = () => e.onShowAll(), r.addEventListener("pointerleave", () => a((n) => n === 0 ? null : n)), r.addEventListener("pointerenter", () => a(0)), v(r, d(C.span, {
150
+ var o = z(), r = o.firstChild;
151
+ return r.nextSibling, o.addEventListener("pointerleave", () => a(null)), r.$$click = () => t.onShowAll(), r.addEventListener("pointerleave", () => a((e) => e === 0 ? null : e)), r.addEventListener("pointerenter", () => a(0)), g(r, d(w.span, {
150
152
  class: "workbench-dock__tile",
151
153
  get animate() {
152
154
  return {
@@ -157,16 +159,16 @@ function re(e) {
157
159
  },
158
160
  get transition() {
159
161
  return {
160
- duration: L.fast,
162
+ duration: C.fast,
161
163
  easing: y.easeOut
162
164
  };
163
165
  },
164
166
  get children() {
165
- return d(G, {
167
+ return d(R, {
166
168
  class: "workbench-dock__icon"
167
169
  });
168
170
  }
169
- }), null), v(r, d(C.span, {
171
+ }), null), g(r, d(w.span, {
170
172
  class: "workbench-dock__tooltip",
171
173
  get animate() {
172
174
  return {
@@ -176,92 +178,92 @@ function re(e) {
176
178
  },
177
179
  get transition() {
178
180
  return {
179
- duration: L.fast,
181
+ duration: C.fast,
180
182
  easing: y.easeOut
181
183
  };
182
184
  },
183
185
  children: "Show all widgets"
184
- }), null), v(i, d(T, {
186
+ }), null), g(o, d(P, {
185
187
  get each() {
186
- return e.widgetDefinitions;
188
+ return t.widgetDefinitions;
187
189
  },
188
- children: (n, u) => {
189
- const c = () => u() + 1;
190
- return d(p, {
190
+ children: (e, u) => {
191
+ const v = () => u() + 1;
192
+ return d(j, {
191
193
  get type() {
192
- return n.type;
194
+ return e.type;
193
195
  },
194
196
  get label() {
195
- return n.label;
197
+ return e.label;
196
198
  },
197
199
  get icon() {
198
- return n.icon;
200
+ return e.icon;
199
201
  },
200
202
  get active() {
201
- return e.filters[n.type];
203
+ return t.filters[e.type];
202
204
  },
203
205
  get hoverOffset() {
204
- return m(c());
206
+ return k(v());
205
207
  },
206
208
  get isDragging() {
207
- return b() === n.type;
209
+ return b() === e.type;
208
210
  },
209
- onEnter: () => a(c()),
210
- onLeave: () => a((k) => k === c() ? null : k),
211
- onSolo: () => e.onSoloFilter(n.type),
211
+ onEnter: () => a(v()),
212
+ onLeave: () => a((s) => s === v() ? null : s),
213
+ onSolo: () => t.onSoloFilter(e.type),
212
214
  onDragBegin: _
213
215
  });
214
216
  }
215
- }), null), D((n) => {
216
- var u = !!h(), c = l() === 0, k = h();
217
- return u !== n.e && r.classList.toggle("is-active", n.e = u), c !== n.t && r.classList.toggle("is-hovered", n.t = c), k !== n.a && S(r, "aria-pressed", n.a = k), n;
217
+ }), null), D((e) => {
218
+ var u = !!f(), v = l() === 0, s = f();
219
+ return u !== e.e && r.classList.toggle("is-active", e.e = u), v !== e.t && r.classList.toggle("is-hovered", e.t = v), s !== e.a && S(r, "aria-pressed", e.a = s), e;
218
220
  }, {
219
221
  e: void 0,
220
222
  t: void 0,
221
223
  a: void 0
222
- }), i;
223
- })(), d(X, {
224
+ }), o;
225
+ })(), d(x, {
224
226
  get when() {
225
- return s()?.moved ?? !1;
227
+ return c()?.moved ?? !1;
226
228
  },
227
229
  get children() {
228
230
  return d(J, {
229
- state: s
231
+ state: c
230
232
  });
231
233
  }
232
234
  })];
233
235
  }
234
- function J(e) {
236
+ function J(t) {
235
237
  const l = () => {
236
- const t = e.state();
237
- return t ? `translate3d(${t.clientX + 14}px, ${t.clientY - 56}px, 0)` : "translate3d(0px, 0px, 0)";
238
- }, a = () => e.state()?.overCanvas ?? !1, s = () => e.state()?.label ?? "", o = () => e.state()?.icon;
239
- return d(F, {
238
+ const n = t.state();
239
+ return n ? `translate3d(${n.clientX + 14}px, ${n.clientY - 56}px, 0)` : "translate3d(0px, 0px, 0)";
240
+ }, a = () => t.state()?.overCanvas ?? !1, c = () => t.state()?.label ?? "", i = () => t.state()?.icon;
241
+ return d(Y, {
240
242
  get children() {
241
- var t = V(), h = t.firstChild, m = h.nextSibling, f = m.firstChild, _ = f.nextSibling, b = _.firstChild, i = b.nextSibling, r = i.firstChild;
242
- return v(f, d(X, {
243
+ var n = N(), f = n.firstChild, k = f.nextSibling, h = k.firstChild, _ = h.nextSibling, b = _.firstChild, o = b.nextSibling, r = o.firstChild;
244
+ return g(h, d(x, {
243
245
  get when() {
244
- return o();
246
+ return i();
245
247
  },
246
- children: (n) => {
247
- const u = n();
248
+ children: (e) => {
249
+ const u = e();
248
250
  return d(u, {
249
251
  class: "w-4 h-4"
250
252
  });
251
253
  }
252
- })), v(b, s), v(i, d(q, {
254
+ })), g(b, c), g(o, d(T, {
253
255
  class: "w-3 h-3"
254
- }), r), v(r, () => a() ? "Drop to create" : "Drag onto canvas"), D((n) => {
255
- var u = !!a(), c = l();
256
- return u !== n.e && t.classList.toggle("is-over-canvas", n.e = u), c !== n.t && H(t, "transform", n.t = c), n;
256
+ }), r), g(r, () => a() ? "Drop to create" : "Drag onto canvas"), D((e) => {
257
+ var u = !!a(), v = l();
258
+ return u !== e.e && n.classList.toggle("is-over-canvas", e.e = u), v !== e.t && M(n, "transform", e.t = v), e;
257
259
  }, {
258
260
  e: void 0,
259
261
  t: void 0
260
- }), t;
262
+ }), n;
261
263
  }
262
264
  });
263
265
  }
264
- P(["pointerdown", "click"]);
266
+ A(["pointerdown", "click"]);
265
267
  export {
266
- re as WorkbenchFilterBar
268
+ nt as WorkbenchFilterBar
267
269
  };