@floegence/floe-webapp-core 0.35.45 → 0.35.46

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,101 +1,101 @@
1
- import { insert as m, createComponent as _, memo as T, effect as z, className as F, setStyleProperty as b, template as W, delegateEvents as N } from "solid-js/web";
2
- import { createSignal as O, onCleanup as A, untrack as P, createMemo as h } from "solid-js";
3
- import { startHotInteraction as B } from "../../utils/hotInteraction.js";
4
- import { GripVertical as G, Pencil as H, Trash as V, Check as Z } from "../icons/index.js";
5
- import { notePreviewMetrics as j, getNotePreviewText as q, noteColorClass as J, samePoint as K } from "./notesOverlayHelpers.js";
6
- var Q = /* @__PURE__ */ W('<article data-floe-geometry-surface=notes-note><div class=notes-note__surface><header class=notes-note__header><button type=button class=notes-note__drag aria-label="Drag note"data-floe-canvas-interactive=true></button><div class=notes-note__actions><button type=button class=notes-note__icon-button data-floe-canvas-interactive=true aria-label="Edit note"></button><button type=button class="notes-note__icon-button is-danger"data-floe-canvas-interactive=true aria-label="Move note to trash"></button></div></header><button type=button class=notes-note__body data-floe-canvas-interactive=true data-floe-canvas-pan-surface=true><span>'), R = /* @__PURE__ */ W("<div class=notes-note__copied-state aria-hidden=true><div class=notes-note__copied-pill><span class=notes-note__copied-icon></span><span class=notes-note__copied-copy>Copied");
7
- function nt(t) {
8
- const [v, w] = O(null);
1
+ import { insert as m, createComponent as _, memo as z, effect as F, className as N, setAttribute as A, setStyleProperty as b, template as D, delegateEvents as O } from "solid-js/web";
2
+ import { createSignal as B, onCleanup as G, untrack as W, createMemo as h } from "solid-js";
3
+ import { startHotInteraction as H } from "../../utils/hotInteraction.js";
4
+ import { GripVertical as V, Pencil as Z, Trash as j, Check as q } from "../icons/index.js";
5
+ import { notePreviewMetrics as J, getNotePreviewText as K, noteColorClass as Q, samePoint as R } from "./notesOverlayHelpers.js";
6
+ var U = /* @__PURE__ */ D('<article data-floe-geometry-surface=notes-note><div class=notes-note__surface><header class=notes-note__header><button type=button class=notes-note__drag aria-label="Drag note"data-floe-canvas-interactive=true></button><div class=notes-note__actions><button type=button class=notes-note__icon-button data-floe-canvas-interactive=true aria-label="Edit note"></button><button type=button class="notes-note__icon-button is-danger"data-floe-canvas-interactive=true aria-label="Move note to trash"></button></div></header><button type=button class=notes-note__body data-floe-canvas-interactive=true data-floe-canvas-pan-surface=true><span>'), p = /* @__PURE__ */ D("<div class=notes-note__copied-state aria-hidden=true><div class=notes-note__copied-pill><span class=notes-note__copied-icon></span><span class=notes-note__copied-copy>Copied");
7
+ function at(t) {
8
+ const [u, w] = B(null);
9
9
  let c;
10
- A(() => {
11
- c?.abort(), c = void 0, P(v)?.stopInteraction();
10
+ G(() => {
11
+ c?.abort(), c = void 0, W(u)?.stopInteraction();
12
12
  });
13
- const $ = h(() => j(t.item)), D = h(() => q(t.item.body, $().preview_limit)), L = h(() => !t.item.body.trim()), C = () => v() !== null, y = h(() => {
14
- const e = v();
15
- return e ? {
16
- x: e.worldX,
17
- y: e.worldY
13
+ const $ = h(() => J(t.item)), L = h(() => K(t.item.body, $().preview_limit)), E = h(() => !t.item.body.trim()), C = () => u() !== null, y = h(() => {
14
+ const o = u();
15
+ return o ? {
16
+ x: o.worldX,
17
+ y: o.worldY
18
18
  } : {
19
19
  x: t.item.x,
20
20
  y: t.item.y
21
21
  };
22
- }), I = (e) => {
23
- const i = P(v);
24
- if (!i || (i.stopInteraction(), w(null), c?.abort(), c = void 0, t.onCommitFront(t.item.note_id), !e)) return;
25
- const r = {
26
- x: i.worldX,
27
- y: i.worldY
22
+ }), I = (o) => {
23
+ const n = W(u);
24
+ if (!n || (n.stopInteraction(), w(null), c?.abort(), c = void 0, t.onCommitFront(t.item.note_id), !o)) return;
25
+ const l = {
26
+ x: n.worldX,
27
+ y: n.worldY
28
28
  }, s = {
29
- x: i.startWorldX,
30
- y: i.startWorldY
29
+ x: n.startWorldX,
30
+ y: n.startWorldY
31
31
  };
32
- K(r, s) || t.onCommitMove(t.item.note_id, r);
33
- }, E = (e) => {
34
- if (e.button !== 0) return;
35
- e.preventDefault(), e.stopPropagation(), c?.abort(), t.onStartOptimisticFront(t.item.note_id);
36
- const i = B({
32
+ R(l, s) || t.onCommitMove(t.item.note_id, l);
33
+ }, T = (o) => {
34
+ if (o.button !== 0) return;
35
+ o.preventDefault(), o.stopPropagation(), c?.abort(), t.onStartOptimisticFront(t.item.note_id);
36
+ const n = H({
37
37
  kind: "drag",
38
38
  cursor: "grabbing"
39
- }), r = Math.max(t.viewportScale, 1e-3);
39
+ }), l = Math.max(t.viewportScale, 1e-3);
40
40
  w({
41
- pointerId: e.pointerId,
42
- startClientX: e.clientX,
43
- startClientY: e.clientY,
41
+ pointerId: o.pointerId,
42
+ startClientX: o.clientX,
43
+ startClientY: o.clientY,
44
44
  startWorldX: t.item.x,
45
45
  startWorldY: t.item.y,
46
46
  worldX: t.item.x,
47
47
  worldY: t.item.y,
48
48
  moved: !1,
49
- scale: r,
50
- stopInteraction: i
49
+ scale: l,
50
+ stopInteraction: n
51
51
  });
52
52
  const s = (a) => {
53
- w((n) => {
54
- if (!n || n.pointerId !== a.pointerId) return n;
55
- const o = n.startWorldX + (a.clientX - n.startClientX) / n.scale, l = n.startWorldY + (a.clientY - n.startClientY) / n.scale;
53
+ w((i) => {
54
+ if (!i || i.pointerId !== a.pointerId) return i;
55
+ const e = i.startWorldX + (a.clientX - i.startClientX) / i.scale, r = i.startWorldY + (a.clientY - i.startClientY) / i.scale;
56
56
  return {
57
- ...n,
58
- worldX: o,
59
- worldY: l,
60
- moved: n.moved || Math.abs(o - n.startWorldX) > 2 || Math.abs(l - n.startWorldY) > 2
57
+ ...i,
58
+ worldX: e,
59
+ worldY: r,
60
+ moved: i.moved || Math.abs(e - i.startWorldX) > 2 || Math.abs(r - i.startWorldY) > 2
61
61
  };
62
62
  });
63
63
  }, x = (a) => {
64
- a.pointerId === e.pointerId && I(!0);
65
- }, u = (a) => {
66
- a.pointerId === e.pointerId && I(!1);
64
+ a.pointerId === o.pointerId && I(!0);
65
+ }, v = (a) => {
66
+ a.pointerId === o.pointerId && I(!1);
67
67
  }, d = new AbortController();
68
68
  c = d, window.addEventListener("pointermove", s, {
69
69
  signal: d.signal
70
70
  }), window.addEventListener("pointerup", x, {
71
71
  once: !0,
72
72
  signal: d.signal
73
- }), window.addEventListener("pointercancel", u, {
73
+ }), window.addEventListener("pointercancel", v, {
74
74
  once: !0,
75
75
  signal: d.signal
76
76
  });
77
77
  };
78
78
  return (() => {
79
- var e = Q(), i = e.firstChild, r = i.firstChild, s = r.firstChild, x = s.nextSibling, u = x.firstChild, d = u.nextSibling, a = r.nextSibling, n = a.firstChild;
80
- return e.$$click = () => t.onCommitFront(t.item.note_id), e.$$contextmenu = (o) => {
81
- o.preventDefault(), o.stopPropagation(), t.onOpenContextMenu(o, t.item);
82
- }, s.$$pointerdown = E, m(s, _(G, {
79
+ var o = U(), n = o.firstChild, l = n.firstChild, s = l.firstChild, x = s.nextSibling, v = x.firstChild, d = v.nextSibling, a = l.nextSibling, i = a.firstChild;
80
+ return o.$$click = () => t.onCommitFront(t.item.note_id), o.$$contextmenu = (e) => {
81
+ e.preventDefault(), e.stopPropagation(), t.onOpenContextMenu(e, t.item);
82
+ }, s.$$pointerdown = T, m(s, _(V, {
83
83
  class: "w-3.5 h-3.5"
84
- })), u.$$click = () => t.onOpenEditor(t.item.note_id), m(u, _(H, {
84
+ })), v.$$click = () => t.onOpenEditor(t.item.note_id), m(v, _(Z, {
85
85
  class: "w-3.5 h-3.5"
86
- })), d.$$click = () => t.onMoveToTrash(t.item.note_id), m(d, _(V, {
86
+ })), d.$$click = () => t.onMoveToTrash(t.item.note_id), m(d, _(j, {
87
87
  class: "w-3.5 h-3.5"
88
- })), a.$$click = () => t.onCopy(t.item), m(n, D), m(i, (() => {
89
- var o = T(() => !!t.copied);
90
- return () => o() ? (() => {
91
- var l = R(), g = l.firstChild, f = g.firstChild;
92
- return m(f, _(Z, {
88
+ })), a.$$click = () => t.onCopy(t.item), m(i, L), m(n, (() => {
89
+ var e = z(() => !!t.copied);
90
+ return () => e() ? (() => {
91
+ var r = p(), g = r.firstChild, f = g.firstChild;
92
+ return m(f, _(q, {
93
93
  class: "w-3.5 h-3.5"
94
- })), l;
94
+ })), r;
95
95
  })() : null;
96
- })(), null), z((o) => {
97
- var l = `${J(t.item.color_token)} notes-note notes-note--size-${t.item.size_bucket - 1}`, g = !!t.copied, f = !!C(), X = `translate(${y().x}px, ${y().y}px)`, Y = `${$().width}px`, k = `${$().height}px`, M = C() || t.optimisticFront ? `${t.topZIndex + 1}` : `${t.item.z_index}`, S = !!L();
98
- return l !== o.e && F(e, o.e = l), g !== o.t && e.classList.toggle("is-copied", o.t = g), f !== o.a && e.classList.toggle("is-dragging", o.a = f), X !== o.o && b(e, "transform", o.o = X), Y !== o.i && b(e, "--note-width", o.i = Y), k !== o.n && b(e, "--note-height", o.n = k), M !== o.s && b(e, "z-index", o.s = M), S !== o.h && a.classList.toggle("is-empty", o.h = S), o;
96
+ })(), null), F((e) => {
97
+ var r = `${Q(t.item.color_token)} notes-note notes-note--size-${t.item.size_bucket - 1}`, g = !!t.copied, f = !!C(), X = t.item.note_id, Y = `translate(${y().x}px, ${y().y}px)`, k = `${$().width}px`, M = `${$().height}px`, S = C() || t.optimisticFront ? `${t.topZIndex + 1}` : `${t.item.z_index}`, P = !!E();
98
+ return r !== e.e && N(o, e.e = r), g !== e.t && o.classList.toggle("is-copied", e.t = g), f !== e.a && o.classList.toggle("is-dragging", e.a = f), X !== e.o && A(o, "data-floe-notes-note-id", e.o = X), Y !== e.i && b(o, "transform", e.i = Y), k !== e.n && b(o, "--note-width", e.n = k), M !== e.s && b(o, "--note-height", e.s = M), S !== e.h && b(o, "z-index", e.h = S), P !== e.r && a.classList.toggle("is-empty", e.r = P), e;
99
99
  }, {
100
100
  e: void 0,
101
101
  t: void 0,
@@ -104,11 +104,12 @@ function nt(t) {
104
104
  i: void 0,
105
105
  n: void 0,
106
106
  s: void 0,
107
- h: void 0
108
- }), e;
107
+ h: void 0,
108
+ r: void 0
109
+ }), o;
109
110
  })();
110
111
  }
111
- N(["contextmenu", "click", "pointerdown"]);
112
+ O(["contextmenu", "click", "pointerdown"]);
112
113
  export {
113
- nt as NotesBoardNote
114
+ at as NotesBoardNote
114
115
  };
@@ -1,4 +1,4 @@
1
- import { createComponent as o, insert as i, addEventListener as p, effect as y, setAttribute as k, Portal as u, memo as $, template as c, delegateEvents as x } from "solid-js/web";
1
+ import { createComponent as o, insert as i, addEventListener as v, effect as y, setAttribute as k, Portal as c, memo as x, template as u, delegateEvents as $ } from "solid-js/web";
2
2
  import { createEffect as D, onCleanup as I, Show as s } from "solid-js";
3
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
4
  import { easing as E, duration as T } from "../../utils/animations.js";
@@ -12,7 +12,7 @@ import { NotesTopicRail as z } from "./NotesTopicRail.js";
12
12
  import { NotesTrashFlyout as W } from "./NotesTrashFlyout.js";
13
13
  import { NotesTrashCanIcon as q } from "./notesAppearance.js";
14
14
  import { useNotesOverlayModel as A } from "./useNotesOverlayModel.js";
15
- var V = /* @__PURE__ */ c('<header class=notes-overlay__header data-floe-canvas-interactive=true><div class=notes-overlay__header-brand><div class=notes-overlay__header-title>Notes</div><div class=notes-overlay__header-separator></div><div class=notes-overlay__header-stat> topics</div><div class=notes-overlay__header-stat> live note</div><div class=notes-overlay__header-stat> trash</div></div><div class=notes-overlay__header-actions><button type=button class=notes-overlay__close aria-label="Close notes overlay"data-floe-overlay-close=true>'), H = /* @__PURE__ */ c("<button type=button class=notes-trash__toggle><div class=notes-trash__toggle-mark>"), U = /* @__PURE__ */ c("<div class=notes-overlay__body><div class=notes-trash data-floe-canvas-interactive=true>"), X = /* @__PURE__ */ c("<div class=notes-overview-backdrop data-floe-notes-boundary=true>"), Y = /* @__PURE__ */ c("<div class=notes-overview-flyout data-floe-notes-boundary=true>"), j = /* @__PURE__ */ c("<div class=notes-menu-backdrop data-floe-notes-boundary=true>");
15
+ var V = /* @__PURE__ */ u('<header class=notes-overlay__header data-floe-canvas-interactive=true><div class=notes-overlay__header-brand><div class=notes-overlay__header-title>Notes</div><div class=notes-overlay__header-separator></div><div class=notes-overlay__header-stat> topics</div><div class=notes-overlay__header-stat> live note</div><div class=notes-overlay__header-stat> trash</div></div><div class=notes-overlay__header-actions><button type=button class=notes-overlay__close aria-label="Close notes overlay"data-floe-overlay-close=true>'), H = /* @__PURE__ */ u("<button type=button class=notes-trash__toggle><div class=notes-trash__toggle-mark>"), U = /* @__PURE__ */ u("<div class=notes-overlay__body><div class=notes-trash data-floe-canvas-interactive=true>"), X = /* @__PURE__ */ u("<div class=notes-overview-backdrop data-floe-notes-boundary=true>"), Y = /* @__PURE__ */ u("<div class=notes-overview-flyout data-floe-notes-boundary=true>"), j = /* @__PURE__ */ u("<div class=notes-menu-backdrop data-floe-notes-boundary=true>");
16
16
  const G = '[data-floe-notes-boundary="true"]';
17
17
  function J(r) {
18
18
  return typeof Element < "u" && r instanceof Element ? r : typeof Node < "u" && r instanceof Node ? r.parentElement : null;
@@ -45,7 +45,7 @@ function K(r) {
45
45
  }
46
46
  function ge(r) {
47
47
  const e = A(r);
48
- let v;
48
+ let g;
49
49
  const l = () => K(r.interactionMode), b = () => r.onClose();
50
50
  return D(() => {
51
51
  if (!r.open || l().mode !== "floating" || typeof document > "u") return;
@@ -55,7 +55,7 @@ function ge(r) {
55
55
  document.addEventListener("click", t, !0), I(() => document.removeEventListener("click", t, !0));
56
56
  }), F({
57
57
  open: () => r.open,
58
- root: () => v,
58
+ root: () => g,
59
59
  onClose: () => e.handleCloseRequest(),
60
60
  onEscapeOutside: l().mode === "floating" ? b : void 0,
61
61
  containsTarget: w,
@@ -74,8 +74,8 @@ function ge(r) {
74
74
  get children() {
75
75
  return o(C.section, {
76
76
  ref(t) {
77
- var n = v;
78
- typeof n == "function" ? n(t) : v = t;
77
+ var n = g;
78
+ typeof n == "function" ? n(t) : g = t;
79
79
  },
80
80
  class: "notes-overlay",
81
81
  role: "dialog",
@@ -120,8 +120,8 @@ function ge(r) {
120
120
  },
121
121
  get children() {
122
122
  return [(() => {
123
- var t = V(), n = t.firstChild, a = n.firstChild, g = a.nextSibling, m = g.nextSibling, N = m.firstChild, d = m.nextSibling, M = d.firstChild, f = d.nextSibling, O = f.firstChild, S = n.nextSibling, h = S.firstChild;
124
- return i(m, () => e.header.topicCount(), N), i(d, () => e.header.totalLiveNotes(), M), i(d, () => e.header.totalLiveNotes() === 1 ? "" : "s", null), i(f, () => e.header.trashCount(), O), h.$$click = () => e.handleCloseRequest(), i(h, o(L, {
123
+ var t = V(), n = t.firstChild, a = n.firstChild, m = a.nextSibling, p = m.nextSibling, N = p.firstChild, d = p.nextSibling, M = d.firstChild, f = d.nextSibling, O = f.firstChild, S = n.nextSibling, h = S.firstChild;
124
+ return i(p, () => e.header.topicCount(), N), i(d, () => e.header.totalLiveNotes(), M), i(d, () => e.header.totalLiveNotes() === 1 ? "" : "s", null), i(f, () => e.header.trashCount(), O), h.$$click = () => e.handleCloseRequest(), i(h, o(L, {
125
125
  class: "w-4 h-4"
126
126
  })), t;
127
127
  })(), (() => {
@@ -289,8 +289,8 @@ function ge(r) {
289
289
  return !e.trash.open();
290
290
  },
291
291
  get children() {
292
- var a = H(), g = a.firstChild;
293
- return p(a, "click", e.trash.openDock, !0), i(g, o(q, {
292
+ var a = H(), m = a.firstChild;
293
+ return v(a, "click", e.trash.openDock, !0), i(m, o(q, {
294
294
  class: "notes-trash__toggle-icon"
295
295
  })), y(() => k(a, "aria-label", `Open trash dock${e.trash.count() > 0 ? `, ${e.trash.count()} items` : ""}`)), a;
296
296
  }
@@ -299,14 +299,14 @@ function ge(r) {
299
299
  }
300
300
  }), o(s, {
301
301
  get when() {
302
- return $(() => !!e.board.isMobile())() && e.board.overviewOpen();
302
+ return x(() => !!e.board.isMobile())() && e.board.overviewOpen();
303
303
  },
304
304
  get children() {
305
- return o(u, {
305
+ return o(c, {
306
306
  get children() {
307
307
  return [(() => {
308
308
  var t = X();
309
- return p(t, "click", e.overview.close, !0), t;
309
+ return v(t, "click", e.overview.close, !0), t;
310
310
  })(), (() => {
311
311
  var t = Y();
312
312
  return i(t, o(_, {
@@ -340,7 +340,7 @@ function ge(r) {
340
340
  }
341
341
  });
342
342
  }
343
- }), o(u, {
343
+ }), o(c, {
344
344
  get children() {
345
345
  return o(W, {
346
346
  get open() {
@@ -377,11 +377,11 @@ function ge(r) {
377
377
  return e.contextMenu.state();
378
378
  },
379
379
  get children() {
380
- return o(u, {
380
+ return o(c, {
381
381
  get children() {
382
382
  return [(() => {
383
383
  var t = j();
384
- return p(t, "click", e.contextMenu.close, !0), t;
384
+ return v(t, "contextmenu", e.contextMenu.retarget, !0), v(t, "click", e.contextMenu.close, !0), t;
385
385
  })(), o(B, {
386
386
  get x() {
387
387
  return e.contextMenu.position()?.left ?? 0;
@@ -401,7 +401,7 @@ function ge(r) {
401
401
  return !!e.editor.note();
402
402
  },
403
403
  get children() {
404
- return o(u, {
404
+ return o(c, {
405
405
  get children() {
406
406
  return o(P, {
407
407
  get note() {
@@ -429,7 +429,7 @@ function ge(r) {
429
429
  }
430
430
  });
431
431
  }
432
- }), o(u, {
432
+ }), o(c, {
433
433
  get children() {
434
434
  return o(Z, {
435
435
  get open() {
@@ -455,7 +455,7 @@ function ge(r) {
455
455
  }
456
456
  });
457
457
  }
458
- x(["click"]);
458
+ $(["click", "contextmenu"]);
459
459
  export {
460
460
  ge as NotesOverlay
461
461
  };
@@ -161,6 +161,7 @@ export declare function useNotesOverlayModel(options: UseNotesOverlayModelOption
161
161
  top: number;
162
162
  } | undefined>;
163
163
  close: () => null;
164
+ retarget: (event: MouseEvent) => void;
164
165
  };
165
166
  editor: {
166
167
  note: import("solid-js").Accessor<Readonly<{