@floegence/floe-webapp-core 0.35.45 → 0.35.47

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.
@@ -22,6 +22,10 @@ export interface NotesBoardProps {
22
22
  onSelectTopic: (topicID: string) => void;
23
23
  onMobileCreateNote: () => void;
24
24
  onMobilePaste: () => void;
25
+ onSeedMoveProjection: (noteID: string, position: {
26
+ x: number;
27
+ y: number;
28
+ }) => void;
25
29
  onCopyNote: (item: NotesItem) => void;
26
30
  onOpenNoteContextMenu: (event: MouseEvent, item: NotesItem) => void;
27
31
  onOpenEditor: (noteID: string) => void;
@@ -1,34 +1,34 @@
1
- import { insert as t, createComponent as o, className as x, effect as M, use as O, memo as S, template as r, delegateEvents as p } from "solid-js/web";
1
+ import { insert as t, createComponent as o, className as k, effect as S, use as x, memo as O, template as r, delegateEvents as I } from "solid-js/web";
2
2
  import { Show as u, For as y } from "solid-js";
3
- import { Minus as I, Plus as w, Layers as k, Paste as N } from "../icons/index.js";
3
+ import { Minus as N, Plus as w, Layers as M, Paste as p } from "../icons/index.js";
4
4
  import { NotesAnimalIcon as F } from "./notesAppearance.js";
5
5
  import { NotesBoardNote as T } from "./NotesBoardNote.js";
6
- import { topicAccentClass as Z } from "./notesOverlayHelpers.js";
7
- import { InfiniteCanvas as L } from "../ui/InfiniteCanvas.js";
8
- var P = /* @__PURE__ */ r('<button type=button class=notes-overlay__hud-button aria-label="Open overview map">'), A = /* @__PURE__ */ r("<div class=notes-page__mobile-toolbar><div class=notes-page__mobile-topics>"), D = /* @__PURE__ */ r("<div class=notes-canvas__field>"), E = /* @__PURE__ */ r('<div class=notes-mobile-dock data-floe-canvas-interactive=true><button type=button class=notes-mobile-dock__action aria-label="Create note at canvas center"><span>New</span></button><button type=button class=notes-mobile-dock__action aria-label="Paste note at canvas center"><span>Paste</span></button><button type=button class="notes-mobile-dock__action is-emphasis"aria-label="Open overview map"><span>Map'), B = /* @__PURE__ */ r('<section class="notes-page notes-overlay__board"><div class=notes-overlay__board-head data-floe-canvas-interactive=true><div class=notes-overlay__board-topic></div><div class=notes-overlay__board-actions><button type=button class=notes-overlay__hud-button aria-label="Zoom out"></button><div class=notes-overlay__hud-scale></div><button type=button class=notes-overlay__hud-button aria-label="Zoom in"></button></div></div><div class=notes-page__canvas>'), R = /* @__PURE__ */ r("<div>"), V = /* @__PURE__ */ r("<div class=notes-overlay__board-topic-copy><div class=notes-page__eyebrow>Active Topic</div><div class=notes-overlay__board-title></div><div class=notes-overlay__board-meta> live note"), K = /* @__PURE__ */ r("<button type=button class=notes-page__mobile-topic>");
6
+ import { topicAccentClass as P } from "./notesOverlayHelpers.js";
7
+ import { InfiniteCanvas as Z } from "../ui/InfiniteCanvas.js";
8
+ var L = /* @__PURE__ */ r('<button type=button class=notes-overlay__hud-button aria-label="Open overview map">'), A = /* @__PURE__ */ r("<div class=notes-page__mobile-toolbar><div class=notes-page__mobile-topics>"), D = /* @__PURE__ */ r("<div class=notes-canvas__field>"), E = /* @__PURE__ */ r('<div class=notes-mobile-dock data-floe-canvas-interactive=true><button type=button class=notes-mobile-dock__action aria-label="Create note at canvas center"><span>New</span></button><button type=button class=notes-mobile-dock__action aria-label="Paste note at canvas center"><span>Paste</span></button><button type=button class="notes-mobile-dock__action is-emphasis"aria-label="Open overview map"><span>Map'), j = /* @__PURE__ */ r('<section class="notes-page notes-overlay__board"><div class=notes-overlay__board-head data-floe-canvas-interactive=true><div class=notes-overlay__board-topic></div><div class=notes-overlay__board-actions><button type=button class=notes-overlay__hud-button aria-label="Zoom out"></button><div class=notes-overlay__hud-scale></div><button type=button class=notes-overlay__hud-button aria-label="Zoom in"></button></div></div><div class=notes-page__canvas>'), B = /* @__PURE__ */ r("<div>"), R = /* @__PURE__ */ r("<div class=notes-overlay__board-topic-copy><div class=notes-page__eyebrow>Active Topic</div><div class=notes-overlay__board-title></div><div class=notes-overlay__board-meta> live note"), V = /* @__PURE__ */ r("<button type=button class=notes-page__mobile-topic>");
9
9
  function U(e) {
10
10
  return (() => {
11
- var c = B(), b = c.firstChild, $ = b.firstChild, g = $.nextSibling, d = g.firstChild, h = d.nextSibling, C = h.nextSibling, v = b.nextSibling;
11
+ var s = j(), b = s.firstChild, $ = b.firstChild, g = $.nextSibling, d = g.firstChild, h = d.nextSibling, C = h.nextSibling, v = b.nextSibling;
12
12
  t($, o(u, {
13
13
  get when() {
14
14
  return e.activeTopic;
15
15
  },
16
16
  children: (n) => {
17
- const a = Z(n().icon_accent);
17
+ const i = P(n().icon_accent);
18
18
  return [(() => {
19
- var i = R();
20
- return x(i, `notes-topic-mark notes-topic-mark--board ${a}`), t(i, o(F, {
19
+ var a = B();
20
+ return k(a, `notes-topic-mark notes-topic-mark--board ${i}`), t(a, o(F, {
21
21
  get iconKey() {
22
22
  return n().icon_key;
23
23
  },
24
24
  class: "notes-topic-mark__icon"
25
- })), i;
25
+ })), a;
26
26
  })(), (() => {
27
- var i = V(), l = i.firstChild, _ = l.nextSibling, s = _.nextSibling, m = s.firstChild;
28
- return t(_, () => n().name), t(s, () => e.activeItems.length, m), t(s, () => e.activeItems.length === 1 ? "" : "s", null), i;
27
+ var a = R(), l = a.firstChild, _ = l.nextSibling, c = _.nextSibling, m = c.firstChild;
28
+ return t(_, () => n().name), t(c, () => e.activeItems.length, m), t(c, () => e.activeItems.length === 1 ? "" : "s", null), a;
29
29
  })()];
30
30
  }
31
- })), d.$$click = () => e.onZoomOut(), t(d, o(I, {
31
+ })), d.$$click = () => e.onZoomOut(), t(d, o(N, {
32
32
  class: "w-3.5 h-3.5"
33
33
  })), t(h, () => e.boardScaleLabel), C.$$click = () => e.onZoomIn(), t(C, o(w, {
34
34
  class: "w-3.5 h-3.5"
@@ -37,30 +37,30 @@ function U(e) {
37
37
  return e.isMobile;
38
38
  },
39
39
  get children() {
40
- var n = P();
41
- return n.$$click = () => e.onOpenOverview(), t(n, o(k, {
40
+ var n = L();
41
+ return n.$$click = () => e.onOpenOverview(), t(n, o(M, {
42
42
  class: "w-3.5 h-3.5"
43
43
  })), n;
44
44
  }
45
- }), null), t(c, o(u, {
45
+ }), null), t(s, o(u, {
46
46
  get when() {
47
47
  return e.isMobile;
48
48
  },
49
49
  get children() {
50
- var n = A(), a = n.firstChild;
51
- return t(a, o(y, {
50
+ var n = A(), i = n.firstChild;
51
+ return t(i, o(y, {
52
52
  get each() {
53
53
  return e.topics;
54
54
  },
55
- children: (i) => (() => {
56
- var l = K();
57
- return l.$$click = () => e.onSelectTopic(i.topic_id), t(l, () => i.name), M(() => l.classList.toggle("is-active", i.topic_id === e.activeTopicID)), l;
55
+ children: (a) => (() => {
56
+ var l = V();
57
+ return l.$$click = () => e.onSelectTopic(a.topic_id), t(l, () => a.name), S(() => l.classList.toggle("is-active", a.topic_id === e.activeTopicID)), l;
58
58
  })()
59
59
  })), n;
60
60
  }
61
61
  }), v);
62
62
  var f = e.setCanvasFrameRef;
63
- return typeof f == "function" ? O(f, v) : e.setCanvasFrameRef = v, t(v, o(L, {
63
+ return typeof f == "function" ? x(f, v) : e.setCanvasFrameRef = v, t(v, o(Z, {
64
64
  get ariaLabel() {
65
65
  return `Canvas for ${e.activeTopicLabel}`;
66
66
  },
@@ -80,13 +80,13 @@ function U(e) {
80
80
  get each() {
81
81
  return e.activeItems;
82
82
  },
83
- children: (a) => o(T, {
84
- item: a,
83
+ children: (i) => o(T, {
84
+ item: i,
85
85
  get copied() {
86
- return e.copiedNoteID === a.note_id;
86
+ return e.copiedNoteID === i.note_id;
87
87
  },
88
88
  get optimisticFront() {
89
- return e.optimisticFrontNoteID === a.note_id;
89
+ return e.optimisticFrontNoteID === i.note_id;
90
90
  },
91
91
  get topZIndex() {
92
92
  return e.topZIndex;
@@ -94,6 +94,9 @@ function U(e) {
94
94
  get viewportScale() {
95
95
  return e.viewport.scale;
96
96
  },
97
+ get onSeedMoveProjection() {
98
+ return e.onSeedMoveProjection;
99
+ },
97
100
  get onCopy() {
98
101
  return e.onCopyNote;
99
102
  },
@@ -118,24 +121,24 @@ function U(e) {
118
121
  })
119
122
  })), n;
120
123
  }
121
- })), t(c, o(u, {
124
+ })), t(s, o(u, {
122
125
  get when() {
123
- return S(() => !!e.isMobile)() && !e.overviewOpen;
126
+ return O(() => !!e.isMobile)() && !e.overviewOpen;
124
127
  },
125
128
  get children() {
126
- var n = E(), a = n.firstChild, i = a.firstChild, l = a.nextSibling, _ = l.firstChild, s = l.nextSibling, m = s.firstChild;
127
- return a.$$click = () => e.onMobileCreateNote(), t(a, o(w, {
129
+ var n = E(), i = n.firstChild, a = i.firstChild, l = i.nextSibling, _ = l.firstChild, c = l.nextSibling, m = c.firstChild;
130
+ return i.$$click = () => e.onMobileCreateNote(), t(i, o(w, {
128
131
  class: "w-4 h-4"
129
- }), i), l.$$click = () => e.onMobilePaste(), t(l, o(N, {
132
+ }), a), l.$$click = () => e.onMobilePaste(), t(l, o(p, {
130
133
  class: "w-4 h-4"
131
- }), _), s.$$click = () => e.onOpenOverview(), t(s, o(k, {
134
+ }), _), c.$$click = () => e.onOpenOverview(), t(c, o(M, {
132
135
  class: "w-4 h-4"
133
136
  }), m), n;
134
137
  }
135
- }), null), c;
138
+ }), null), s;
136
139
  })();
137
140
  }
138
- p(["click"]);
141
+ I(["click"]);
139
142
  export {
140
143
  U as NotesBoard
141
144
  };
@@ -6,6 +6,7 @@ export interface NotesBoardNoteProps {
6
6
  optimisticFront: boolean;
7
7
  topZIndex: number;
8
8
  viewportScale: number;
9
+ onSeedMoveProjection: (noteID: string, position: NotesPoint) => void;
9
10
  onCopy: (item: NotesItem) => void;
10
11
  onOpenContextMenu: (event: MouseEvent, item: NotesItem) => void;
11
12
  onOpenEditor: (noteID: string) => void;
@@ -1,73 +1,73 @@
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 v, createComponent as b, memo as z, effect as F, className as N, setAttribute as A, setStyleProperty as h, template as D, delegateEvents as O } from "solid-js/web";
2
+ import { createSignal as j, onCleanup as B, untrack as W, createMemo as w } from "solid-js";
3
+ import { startHotInteraction as G } from "../../utils/hotInteraction.js";
4
+ import { GripVertical as H, Pencil as V, Trash as Z, 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 [g, $] = j(null);
9
9
  let c;
10
- A(() => {
11
- c?.abort(), c = void 0, P(v)?.stopInteraction();
10
+ B(() => {
11
+ c?.abort(), c = void 0, W(g)?.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 C = w(() => J(t.item)), L = w(() => K(t.item.body, C().preview_limit)), E = w(() => !t.item.body.trim()), x = () => g() !== null, y = w(() => {
14
+ const o = g();
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(g);
24
+ if (!n) return;
25
+ const l = {
26
+ x: n.worldX,
27
+ y: n.worldY
28
28
  }, s = {
29
- x: i.startWorldX,
30
- y: i.startWorldY
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({
29
+ x: n.startWorldX,
30
+ y: n.startWorldY
31
+ }, m = o && !R(l, s);
32
+ m && t.onSeedMoveProjection(t.item.note_id, l), n.stopInteraction(), $(null), c?.abort(), c = void 0, t.onCommitFront(t.item.note_id), m && 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 = G({
37
37
  kind: "drag",
38
38
  cursor: "grabbing"
39
- }), r = Math.max(t.viewportScale, 1e-3);
40
- w({
41
- pointerId: e.pointerId,
42
- startClientX: e.clientX,
43
- startClientY: e.clientY,
39
+ }), l = Math.max(t.viewportScale, 1e-3);
40
+ $({
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
+ $((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
- }, x = (a) => {
64
- a.pointerId === e.pointerId && I(!0);
63
+ }, m = (a) => {
64
+ a.pointerId === o.pointerId && I(!0);
65
65
  }, u = (a) => {
66
- a.pointerId === e.pointerId && I(!1);
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
- }), window.addEventListener("pointerup", x, {
70
+ }), window.addEventListener("pointerup", m, {
71
71
  once: !0,
72
72
  signal: d.signal
73
73
  }), window.addEventListener("pointercancel", u, {
@@ -76,26 +76,26 @@ function nt(t) {
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, m = s.nextSibling, u = m.firstChild, d = u.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, v(s, b(H, {
83
83
  class: "w-3.5 h-3.5"
84
- })), u.$$click = () => t.onOpenEditor(t.item.note_id), m(u, _(H, {
84
+ })), u.$$click = () => t.onOpenEditor(t.item.note_id), v(u, b(V, {
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), v(d, b(Z, {
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), v(i, L), v(n, (() => {
89
+ var e = z(() => !!t.copied);
90
+ return () => e() ? (() => {
91
+ var r = p(), f = r.firstChild, _ = f.firstChild;
92
+ return v(_, b(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}`, f = !!t.copied, _ = !!x(), M = t.item.note_id, X = `translate(${y().x}px, ${y().y}px)`, Y = `${C().width}px`, k = `${C().height}px`, S = x() || t.optimisticFront ? `${t.topZIndex + 1}` : `${t.item.z_index}`, P = !!E();
98
+ return r !== e.e && N(o, e.e = r), f !== e.t && o.classList.toggle("is-copied", e.t = f), _ !== e.a && o.classList.toggle("is-dragging", e.a = _), M !== e.o && A(o, "data-floe-notes-note-id", e.o = M), X !== e.i && h(o, "transform", e.i = X), Y !== e.n && h(o, "--note-width", e.n = Y), k !== e.s && h(o, "--note-height", e.s = k), S !== e.h && h(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 u, memo as x, template as c, 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";
@@ -11,8 +11,8 @@ import { NotesOverviewPanel as _ } from "./NotesOverviewPanel.js";
11
11
  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
- 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>");
14
+ import { useNotesOverlayModel as j } from "./useNotesOverlayModel.js";
15
+ var A = /* @__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>'), V = /* @__PURE__ */ c("<button type=button class=notes-trash__toggle><div class=notes-trash__toggle-mark>"), H = /* @__PURE__ */ c("<div class=notes-overlay__body><div class=notes-trash data-floe-canvas-interactive=true>"), U = /* @__PURE__ */ c("<div class=notes-overview-backdrop data-floe-notes-boundary=true>"), X = /* @__PURE__ */ c("<div class=notes-overview-flyout data-floe-notes-boundary=true>"), Y = /* @__PURE__ */ c("<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;
@@ -44,8 +44,8 @@ function K(r) {
44
44
  };
45
45
  }
46
46
  function ge(r) {
47
- const e = A(r);
48
- let v;
47
+ const e = j(r);
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,12 +120,12 @@ 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 = A(), n = t.firstChild, a = n.firstChild, m = a.nextSibling, p = m.nextSibling, N = p.firstChild, d = p.nextSibling, M = d.firstChild, f = d.nextSibling, S = f.firstChild, O = n.nextSibling, h = O.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(), S), h.$$click = () => e.handleCloseRequest(), i(h, o(L, {
125
125
  class: "w-4 h-4"
126
126
  })), t;
127
127
  })(), (() => {
128
- var t = U(), n = t.firstChild;
128
+ var t = H(), n = t.firstChild;
129
129
  return i(t, o(z, {
130
130
  get topics() {
131
131
  return e.rail.topics();
@@ -233,6 +233,9 @@ function ge(r) {
233
233
  onMobilePaste: () => {
234
234
  e.board.mobilePaste();
235
235
  },
236
+ get onSeedMoveProjection() {
237
+ return e.board.seedMoveProjection;
238
+ },
236
239
  onCopyNote: (a) => {
237
240
  e.board.copyNote(a);
238
241
  },
@@ -289,8 +292,8 @@ function ge(r) {
289
292
  return !e.trash.open();
290
293
  },
291
294
  get children() {
292
- var a = H(), g = a.firstChild;
293
- return p(a, "click", e.trash.openDock, !0), i(g, o(q, {
295
+ var a = V(), m = a.firstChild;
296
+ return v(a, "click", e.trash.openDock, !0), i(m, o(q, {
294
297
  class: "notes-trash__toggle-icon"
295
298
  })), y(() => k(a, "aria-label", `Open trash dock${e.trash.count() > 0 ? `, ${e.trash.count()} items` : ""}`)), a;
296
299
  }
@@ -299,16 +302,16 @@ function ge(r) {
299
302
  }
300
303
  }), o(s, {
301
304
  get when() {
302
- return $(() => !!e.board.isMobile())() && e.board.overviewOpen();
305
+ return x(() => !!e.board.isMobile())() && e.board.overviewOpen();
303
306
  },
304
307
  get children() {
305
308
  return o(u, {
306
309
  get children() {
307
310
  return [(() => {
308
- var t = X();
309
- return p(t, "click", e.overview.close, !0), t;
311
+ var t = U();
312
+ return v(t, "click", e.overview.close, !0), t;
310
313
  })(), (() => {
311
- var t = Y();
314
+ var t = X();
312
315
  return i(t, o(_, {
313
316
  mode: "mobile",
314
317
  get items() {
@@ -380,8 +383,8 @@ function ge(r) {
380
383
  return o(u, {
381
384
  get children() {
382
385
  return [(() => {
383
- var t = j();
384
- return p(t, "click", e.contextMenu.close, !0), t;
386
+ var t = Y();
387
+ return v(t, "contextmenu", e.contextMenu.retarget, !0), v(t, "click", e.contextMenu.close, !0), t;
385
388
  })(), o(B, {
386
389
  get x() {
387
390
  return e.contextMenu.position()?.left ?? 0;
@@ -455,7 +458,7 @@ function ge(r) {
455
458
  }
456
459
  });
457
460
  }
458
- x(["click"]);
461
+ $(["click", "contextmenu"]);
459
462
  export {
460
463
  ge as NotesOverlay
461
464
  };
@@ -101,6 +101,10 @@ export declare function useNotesOverlayModel(options: UseNotesOverlayModelOption
101
101
  selectTopic: (topicID: string) => void;
102
102
  mobileCreateNote: () => Promise<void>;
103
103
  mobilePaste: () => Promise<void>;
104
+ seedMoveProjection: (noteID: string, position: {
105
+ x: number;
106
+ y: number;
107
+ }) => void;
104
108
  copyNote: (item: NotesItem) => Promise<void>;
105
109
  openNoteContextMenu: (event: MouseEvent, item: NotesItem) => void;
106
110
  openEditor: (noteID: string) => void;
@@ -161,6 +165,7 @@ export declare function useNotesOverlayModel(options: UseNotesOverlayModelOption
161
165
  top: number;
162
166
  } | undefined>;
163
167
  close: () => null;
168
+ retarget: (event: MouseEvent) => void;
164
169
  };
165
170
  editor: {
166
171
  note: import("solid-js").Accessor<Readonly<{