@floegence/floe-webapp-core 0.35.44 → 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,43 +1,43 @@
1
- import { use as E, insert as i, createComponent as m, addEventListener as T, effect as v, className as f, setStyleProperty as d, template as s, delegateEvents as N } from "solid-js/web";
1
+ import { use as f, insert as s, createComponent as m, addEventListener as E, effect as d, className as T, setStyleProperty as v, template as i, delegateEvents as N } from "solid-js/web";
2
2
  import { For as x } from "solid-js";
3
3
  import { cn as C } from "../../utils/cn.js";
4
- var O = /* @__PURE__ */ s('<div role=menu class="notes-context-menu notes-menu">'), h = /* @__PURE__ */ s("<div role=separator aria-orientation=horizontal class=notes-context-menu__separator>"), I = /* @__PURE__ */ s("<button type=button role=menuitem><span class=notes-context-menu__label>");
5
- const H = 188, M = 16, X = 32, P = 9;
6
- function S(t) {
4
+ var O = /* @__PURE__ */ i('<div role=menu class="notes-context-menu notes-menu"data-floe-notes-boundary=true>'), h = /* @__PURE__ */ i("<div role=separator aria-orientation=horizontal class=notes-context-menu__separator>"), I = /* @__PURE__ */ i("<button type=button role=menuitem><span class=notes-context-menu__label>");
5
+ const A = 188, M = 16, X = 32, b = 9;
6
+ function P(t) {
7
7
  return t.kind === "action";
8
8
  }
9
- function y(t, n = 0) {
10
- return M + Math.max(1, t) * X + Math.max(0, n) * P;
9
+ function H(t, n = 0) {
10
+ return M + Math.max(1, t) * X + Math.max(0, n) * b;
11
11
  }
12
12
  function R(t) {
13
13
  return (() => {
14
14
  var n = O();
15
15
  n.$$contextmenu = (e) => e.preventDefault();
16
- var c = t.menuRef;
17
- return typeof c == "function" ? E(c, n) : t.menuRef = n, i(n, m(x, {
16
+ var u = t.menuRef;
17
+ return typeof u == "function" ? f(u, n) : t.menuRef = n, s(n, m(x, {
18
18
  get each() {
19
19
  return t.items;
20
20
  },
21
21
  children: (e) => {
22
- if (!S(e))
22
+ if (!P(e))
23
23
  return h();
24
24
  const a = e.icon;
25
25
  return (() => {
26
- var o = I(), u = o.firstChild;
27
- return T(o, "click", e.onSelect, !0), i(o, m(a, {
26
+ var o = I(), c = o.firstChild;
27
+ return E(o, "click", e.onSelect, !0), s(o, m(a, {
28
28
  class: "h-3.5 w-3.5"
29
- }), u), i(u, () => e.label), v((r) => {
29
+ }), c), s(c, () => e.label), d((r) => {
30
30
  var l = C("notes-context-menu__item notes-menu__item", e.destructive && "is-destructive is-danger"), _ = e.disabled;
31
- return l !== r.e && f(o, r.e = l), _ !== r.t && (o.disabled = r.t = _), r;
31
+ return l !== r.e && T(o, r.e = l), _ !== r.t && (o.disabled = r.t = _), r;
32
32
  }, {
33
33
  e: void 0,
34
34
  t: void 0
35
35
  }), o;
36
36
  })();
37
37
  }
38
- })), v((e) => {
38
+ })), d((e) => {
39
39
  var a = `${t.x}px`, o = `${t.y}px`;
40
- return a !== e.e && d(n, "left", e.e = a), o !== e.t && d(n, "top", e.t = o), e;
40
+ return a !== e.e && v(n, "left", e.e = a), o !== e.t && v(n, "top", e.t = o), e;
41
41
  }, {
42
42
  e: void 0,
43
43
  t: void 0
@@ -46,7 +46,7 @@ function R(t) {
46
46
  }
47
47
  N(["contextmenu", "click"]);
48
48
  export {
49
- H as NOTES_CONTEXT_MENU_WIDTH_PX,
49
+ A as NOTES_CONTEXT_MENU_WIDTH_PX,
50
50
  R as NotesContextMenu,
51
- y as estimateNotesContextMenuHeight
51
+ H as estimateNotesContextMenuHeight
52
52
  };
@@ -6,10 +6,10 @@ import { noteColorClass as L } from "./notesOverlayHelpers.js";
6
6
  import { NOTE_COLOR_TOKENS as B } from "./types.js";
7
7
  import { Textarea as y } from "../ui/Input.js";
8
8
  import { Button as v } from "../ui/Button.js";
9
- var P = /* @__PURE__ */ f('<div class="notes-flyout notes-flyout--editor"><div class=notes-flyout__header><div><div class=notes-editor__label>Edit note</div><div class=notes-flyout__title></div></div><button type=button class=notes-flyout__close aria-label="Close editor"></button></div><div class=notes-editor><div class=notes-editor__palette><div class=notes-editor__label>Color</div><div class=notes-editor__swatches></div></div><div class=notes-editor__field><div class=notes-editor__label>Text</div></div></div><div class=notes-flyout__footer>'), F = /* @__PURE__ */ f("<button type=button><span>"), R = /* @__PURE__ */ f('<div class="notes-flyout notes-flyout--paste"><div class=notes-flyout__header><div><div class=notes-editor__label>Manual paste</div><div class=notes-flyout__title>Clipboard access was unavailable</div></div><button type=button class=notes-flyout__close aria-label="Close paste panel"></button></div><div class=notes-flyout__body></div><div class=notes-flyout__footer>');
9
+ var P = /* @__PURE__ */ f('<div class="notes-flyout notes-flyout--editor"data-floe-notes-boundary=true><div class=notes-flyout__header><div><div class=notes-editor__label>Edit note</div><div class=notes-flyout__title></div></div><button type=button class=notes-flyout__close aria-label="Close editor"></button></div><div class=notes-editor><div class=notes-editor__palette><div class=notes-editor__label>Color</div><div class=notes-editor__swatches></div></div><div class=notes-editor__field><div class=notes-editor__label>Text</div></div></div><div class=notes-flyout__footer>'), F = /* @__PURE__ */ f("<button type=button><span>"), R = /* @__PURE__ */ f('<div class="notes-flyout notes-flyout--paste"data-floe-notes-boundary=true><div class=notes-flyout__header><div><div class=notes-editor__label>Manual paste</div><div class=notes-flyout__title>Clipboard access was unavailable</div></div><button type=button class=notes-flyout__close aria-label="Close paste panel"></button></div><div class=notes-flyout__body></div><div class=notes-flyout__footer>');
10
10
  function z(t) {
11
11
  return (() => {
12
- var i = P(), r = i.firstChild, c = r.firstChild, u = c.firstChild, _ = u.nextSibling, a = c.nextSibling, n = r.nextSibling, C = n.firstChild, x = C.firstChild, S = x.nextSibling, h = C.nextSibling;
12
+ var i = P(), r = i.firstChild, u = r.firstChild, c = u.firstChild, _ = c.nextSibling, a = u.nextSibling, n = r.nextSibling, C = n.firstChild, x = C.firstChild, S = x.nextSibling, h = C.nextSibling;
13
13
  h.firstChild;
14
14
  var g = n.nextSibling;
15
15
  return i.$$pointerdown = (o) => o.stopPropagation(), e(_, () => t.note?.body.trim() ? "Refine note" : "Compose note"), a.$$click = () => t.onClose(), e(a, l(m, {
@@ -55,8 +55,8 @@ function G(t) {
55
55
  return t.open;
56
56
  },
57
57
  get children() {
58
- var i = R(), r = i.firstChild, c = r.firstChild, u = c.nextSibling, _ = r.nextSibling, a = _.nextSibling;
59
- return i.$$pointerdown = (n) => n.stopPropagation(), u.$$click = () => t.onClose(), e(u, l(m, {
58
+ var i = R(), r = i.firstChild, u = r.firstChild, c = u.nextSibling, _ = r.nextSibling, a = _.nextSibling;
59
+ return i.$$pointerdown = (n) => n.stopPropagation(), c.$$click = () => t.onClose(), e(c, l(m, {
60
60
  class: "w-4 h-4"
61
61
  })), e(_, l(y, {
62
62
  "data-floe-autofocus": !0,
@@ -1,21 +1,28 @@
1
- import { createComponent as o, insert as a, addEventListener as m, effect as f, setAttribute as S, Portal as u, memo as $, template as c, delegateEvents as k } from "solid-js/web";
2
- import { Show as s } from "solid-js";
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
- import { easing as O, duration as T } from "../../utils/animations.js";
5
- import { useOverlayMask as x } from "../../hooks/useOverlayMask.js";
6
- import { X as D } from "../icons/index.js";
7
- import { NotesBoard as I } from "./NotesBoard.js";
8
- import { NotesContextMenu as F } from "./NotesContextMenu.js";
9
- import { NotesEditorFlyout as R, NotesManualPasteFlyout as L } from "./NotesEditorFlyout.js";
10
- import { NotesOverviewPanel as C } from "./NotesOverviewPanel.js";
11
- import { NotesTopicRail as P } from "./NotesTopicRail.js";
12
- import { NotesTrashFlyout as B } from "./NotesTrashFlyout.js";
13
- import { NotesTrashCanIcon as E } from "./notesAppearance.js";
14
- import { useNotesOverlayModel as Z } from "./useNotesOverlayModel.js";
15
- var z = /* @__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>'), W = /* @__PURE__ */ c("<button type=button class=notes-trash__toggle><div class=notes-trash__toggle-mark>"), q = /* @__PURE__ */ c("<div class=notes-overlay__body><div class=notes-trash data-floe-canvas-interactive=true>"), V = /* @__PURE__ */ c("<div class=notes-overview-backdrop>"), A = /* @__PURE__ */ c("<div class=notes-overview-flyout>"), H = /* @__PURE__ */ c("<div class=notes-menu-backdrop>");
16
- function X(l) {
17
- return l === "floating" ? {
18
- mode: l,
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
+ import { createEffect as D, onCleanup as I, Show as s } 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 E, duration as T } from "../../utils/animations.js";
5
+ import { useOverlayMask as F } from "../../hooks/useOverlayMask.js";
6
+ import { X as L } from "../icons/index.js";
7
+ import { NotesBoard as R } from "./NotesBoard.js";
8
+ import { NotesContextMenu as B } from "./NotesContextMenu.js";
9
+ import { NotesEditorFlyout as P, NotesManualPasteFlyout as Z } from "./NotesEditorFlyout.js";
10
+ import { NotesOverviewPanel as _ } from "./NotesOverviewPanel.js";
11
+ import { NotesTopicRail as z } from "./NotesTopicRail.js";
12
+ import { NotesTrashFlyout as W } from "./NotesTrashFlyout.js";
13
+ import { NotesTrashCanIcon as q } from "./notesAppearance.js";
14
+ import { useNotesOverlayModel as A } from "./useNotesOverlayModel.js";
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
+ const G = '[data-floe-notes-boundary="true"]';
17
+ function J(r) {
18
+ return typeof Element < "u" && r instanceof Element ? r : typeof Node < "u" && r instanceof Node ? r.parentElement : null;
19
+ }
20
+ function w(r) {
21
+ return !!J(r)?.closest(G);
22
+ }
23
+ function K(r) {
24
+ return r === "floating" ? {
25
+ mode: r,
19
26
  ariaModal: void 0,
20
27
  lockBodyScroll: !1,
21
28
  trapFocus: !1,
@@ -36,40 +43,48 @@ function X(l) {
36
43
  }
37
44
  };
38
45
  }
39
- function le(l) {
40
- const e = Z(l);
41
- let v;
42
- const i = () => X(l.interactionMode);
43
- return x({
44
- open: () => l.open,
45
- root: () => v,
46
+ function ge(r) {
47
+ const e = A(r);
48
+ let g;
49
+ const l = () => K(r.interactionMode), b = () => r.onClose();
50
+ return D(() => {
51
+ if (!r.open || l().mode !== "floating" || typeof document > "u") return;
52
+ const t = (n) => {
53
+ w(n.target) || queueMicrotask(b);
54
+ };
55
+ document.addEventListener("click", t, !0), I(() => document.removeEventListener("click", t, !0));
56
+ }), F({
57
+ open: () => r.open,
58
+ root: () => g,
46
59
  onClose: () => e.handleCloseRequest(),
47
- lockBodyScroll: i().lockBodyScroll,
48
- trapFocus: i().trapFocus,
49
- closeOnEscape: i().closeOnEscape,
60
+ onEscapeOutside: l().mode === "floating" ? b : void 0,
61
+ containsTarget: w,
62
+ lockBodyScroll: l().lockBodyScroll,
63
+ trapFocus: l().trapFocus,
64
+ closeOnEscape: l().closeOnEscape,
50
65
  blockHotkeys: !0,
51
- blockWheel: i().blockWheel,
52
- blockTouchMove: i().blockTouchMove,
53
- autoFocus: i().autoFocus,
66
+ blockWheel: l().blockWheel,
67
+ blockTouchMove: l().blockTouchMove,
68
+ autoFocus: l().autoFocus,
54
69
  restoreFocus: !0
55
70
  }), o(s, {
56
71
  get when() {
57
- return l.open;
72
+ return r.open;
58
73
  },
59
74
  get children() {
60
- return o(_.section, {
75
+ return o(C.section, {
61
76
  ref(t) {
62
- var n = v;
63
- typeof n == "function" ? n(t) : v = t;
77
+ var n = g;
78
+ typeof n == "function" ? n(t) : g = t;
64
79
  },
65
80
  class: "notes-overlay",
66
81
  role: "dialog",
67
82
  get "aria-modal"() {
68
- return i().ariaModal;
83
+ return l().ariaModal;
69
84
  },
70
85
  "aria-label": "Notes overlay",
71
86
  get "data-notes-interaction-mode"() {
72
- return i().mode;
87
+ return l().mode;
73
88
  },
74
89
  tabIndex: -1,
75
90
  initial: {
@@ -84,8 +99,9 @@ function le(l) {
84
99
  };
85
100
  },
86
101
  get children() {
87
- return [o(_.div, {
102
+ return [o(C.div, {
88
103
  class: "notes-overlay__frame",
104
+ "data-floe-notes-boundary": "true",
89
105
  initial: {
90
106
  opacity: 0,
91
107
  y: 18,
@@ -99,18 +115,18 @@ function le(l) {
99
115
  get transition() {
100
116
  return {
101
117
  duration: T.normal,
102
- easing: O.easeOut
118
+ easing: E.easeOut
103
119
  };
104
120
  },
105
121
  get children() {
106
122
  return [(() => {
107
- var t = z(), n = t.firstChild, r = n.firstChild, g = r.nextSibling, p = g.nextSibling, y = p.firstChild, d = p.nextSibling, w = d.firstChild, b = d.nextSibling, M = b.firstChild, N = n.nextSibling, h = N.firstChild;
108
- return a(p, () => e.header.topicCount(), y), a(d, () => e.header.totalLiveNotes(), w), a(d, () => e.header.totalLiveNotes() === 1 ? "" : "s", null), a(b, () => e.header.trashCount(), M), h.$$click = () => e.handleCloseRequest(), a(h, o(D, {
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, {
109
125
  class: "w-4 h-4"
110
126
  })), t;
111
127
  })(), (() => {
112
- var t = q(), n = t.firstChild;
113
- return a(t, o(P, {
128
+ var t = U(), n = t.firstChild;
129
+ return i(t, o(z, {
114
130
  get topics() {
115
131
  return e.rail.topics();
116
132
  },
@@ -150,10 +166,10 @@ function le(l) {
150
166
  get onCancelRename() {
151
167
  return e.rail.cancelTopicRename;
152
168
  },
153
- onDeleteTopic: (r) => {
154
- e.rail.deleteTopic(r);
169
+ onDeleteTopic: (a) => {
170
+ e.rail.deleteTopic(a);
155
171
  }
156
- }), n), a(t, o(I, {
172
+ }), n), i(t, o(R, {
157
173
  get activeTopic() {
158
174
  return e.board.activeTopic();
159
175
  },
@@ -217,8 +233,8 @@ function le(l) {
217
233
  onMobilePaste: () => {
218
234
  e.board.mobilePaste();
219
235
  },
220
- onCopyNote: (r) => {
221
- e.board.copyNote(r);
236
+ onCopyNote: (a) => {
237
+ e.board.copyNote(a);
222
238
  },
223
239
  get onOpenNoteContextMenu() {
224
240
  return e.board.openNoteContextMenu;
@@ -226,8 +242,8 @@ function le(l) {
226
242
  get onOpenEditor() {
227
243
  return e.board.openEditor;
228
244
  },
229
- onMoveToTrash: (r) => {
230
- e.board.moveToTrash(r);
245
+ onMoveToTrash: (a) => {
246
+ e.board.moveToTrash(a);
231
247
  },
232
248
  get onStartOptimisticFront() {
233
249
  return e.board.startOptimisticFront;
@@ -238,12 +254,12 @@ function le(l) {
238
254
  get onCommitMove() {
239
255
  return e.board.commitMove;
240
256
  }
241
- }), n), a(t, o(s, {
257
+ }), n), i(t, o(s, {
242
258
  get when() {
243
259
  return !e.board.isMobile();
244
260
  },
245
261
  get children() {
246
- return o(C, {
262
+ return o(_, {
247
263
  mode: "desktop",
248
264
  get items() {
249
265
  return e.overview.items();
@@ -268,32 +284,32 @@ function le(l) {
268
284
  }
269
285
  });
270
286
  }
271
- }), n), a(n, o(s, {
287
+ }), n), i(n, o(s, {
272
288
  get when() {
273
289
  return !e.trash.open();
274
290
  },
275
291
  get children() {
276
- var r = W(), g = r.firstChild;
277
- return m(r, "click", e.trash.openDock, !0), a(g, o(E, {
292
+ var a = H(), m = a.firstChild;
293
+ return v(a, "click", e.trash.openDock, !0), i(m, o(q, {
278
294
  class: "notes-trash__toggle-icon"
279
- })), f(() => S(r, "aria-label", `Open trash dock${e.trash.count() > 0 ? `, ${e.trash.count()} items` : ""}`)), r;
295
+ })), y(() => k(a, "aria-label", `Open trash dock${e.trash.count() > 0 ? `, ${e.trash.count()} items` : ""}`)), a;
280
296
  }
281
- })), f(() => n.classList.toggle("is-open", !!e.trash.open())), t;
297
+ })), y(() => n.classList.toggle("is-open", !!e.trash.open())), t;
282
298
  })()];
283
299
  }
284
300
  }), o(s, {
285
301
  get when() {
286
- return $(() => !!e.board.isMobile())() && e.board.overviewOpen();
302
+ return x(() => !!e.board.isMobile())() && e.board.overviewOpen();
287
303
  },
288
304
  get children() {
289
- return o(u, {
305
+ return o(c, {
290
306
  get children() {
291
307
  return [(() => {
292
- var t = V();
293
- return m(t, "click", e.overview.close, !0), t;
308
+ var t = X();
309
+ return v(t, "click", e.overview.close, !0), t;
294
310
  })(), (() => {
295
- var t = A();
296
- return a(t, o(C, {
311
+ var t = Y();
312
+ return i(t, o(_, {
297
313
  mode: "mobile",
298
314
  get items() {
299
315
  return e.overview.items();
@@ -324,9 +340,9 @@ function le(l) {
324
340
  }
325
341
  });
326
342
  }
327
- }), o(u, {
343
+ }), o(c, {
328
344
  get children() {
329
- return o(B, {
345
+ return o(W, {
330
346
  get open() {
331
347
  return e.trash.open();
332
348
  },
@@ -361,12 +377,12 @@ function le(l) {
361
377
  return e.contextMenu.state();
362
378
  },
363
379
  get children() {
364
- return o(u, {
380
+ return o(c, {
365
381
  get children() {
366
382
  return [(() => {
367
- var t = H();
368
- return m(t, "click", e.contextMenu.close, !0), t;
369
- })(), o(F, {
383
+ var t = j();
384
+ return v(t, "contextmenu", e.contextMenu.retarget, !0), v(t, "click", e.contextMenu.close, !0), t;
385
+ })(), o(B, {
370
386
  get x() {
371
387
  return e.contextMenu.position()?.left ?? 0;
372
388
  },
@@ -385,9 +401,9 @@ function le(l) {
385
401
  return !!e.editor.note();
386
402
  },
387
403
  get children() {
388
- return o(u, {
404
+ return o(c, {
389
405
  get children() {
390
- return o(R, {
406
+ return o(P, {
391
407
  get note() {
392
408
  return e.editor.note();
393
409
  },
@@ -413,9 +429,9 @@ function le(l) {
413
429
  }
414
430
  });
415
431
  }
416
- }), o(u, {
432
+ }), o(c, {
417
433
  get children() {
418
- return o(L, {
434
+ return o(Z, {
419
435
  get open() {
420
436
  return e.manualPaste.open();
421
437
  },
@@ -439,7 +455,7 @@ function le(l) {
439
455
  }
440
456
  });
441
457
  }
442
- k(["click"]);
458
+ $(["click", "contextmenu"]);
443
459
  export {
444
- le as NotesOverlay
460
+ ge as NotesOverlay
445
461
  };
@@ -3,7 +3,7 @@ import { Show as u, For as P } from "solid-js";
3
3
  import { X as U } from "../icons/index.js";
4
4
  import { NotesAnimalIcon as V, NotesTrashCanIcon as W } from "./notesAppearance.js";
5
5
  import { topicAccentClass as Y, notePreviewMetrics as Z, getNotePreviewText as tt, formatDeletedTimestamp as et, formatRemainingTrashTime as st, noteColorClass as nt } from "./notesOverlayHelpers.js";
6
- var it = /* @__PURE__ */ a("<div class=notes-trash-backdrop>"), lt = /* @__PURE__ */ a("<div class=notes-trash__sections>"), ot = /* @__PURE__ */ a('<div class=notes-trash__flyout><div class=notes-trash__panel><div class=notes-trash__panel-header><div class=notes-trash__panel-title-group><div class=notes-trash__panel-title-row><div class=notes-trash__panel-title>Trash Dock</div><div class=notes-trash__panel-header-actions><div class=notes-trash__panel-count> items</div><button type=button class=notes-trash__panel-close aria-label="Close trash dock"></button></div></div><div class=notes-trash__panel-body>Grouped by topic, sorted by latest deletion, and recoverable for 72 hours.'), rt = /* @__PURE__ */ a("<div class=notes-trash__empty><div><strong>Trash is empty</strong><span>Deleted notes from any topic will appear here."), at = /* @__PURE__ */ a("<section class=notes-trash-section><div class=notes-trash-section__header><div class=notes-trash-section__title-group><div class=notes-trash-section__title-line><div></div><div class=notes-trash-section__title></div></div><div class=notes-trash-section__meta> deleted note</div></div><button type=button class=notes-trash-section__clear>Clear topic trash</button></div><div class=notes-trash-section__grid>"), ct = /* @__PURE__ */ a("<button type=button class=is-danger>Delete now"), _t = /* @__PURE__ */ a("<article><div class=notes-note__surface><div class=notes-trash-note__meta><span></span><strong></strong></div><div class=notes-trash-note__body><span></span></div><div class=notes-trash-note__actions><button type=button>Restore");
6
+ var it = /* @__PURE__ */ a("<div class=notes-trash-backdrop data-floe-notes-boundary=true>"), lt = /* @__PURE__ */ a("<div class=notes-trash__sections>"), ot = /* @__PURE__ */ a('<div class=notes-trash__flyout data-floe-notes-boundary=true><div class=notes-trash__panel><div class=notes-trash__panel-header><div class=notes-trash__panel-title-group><div class=notes-trash__panel-title-row><div class=notes-trash__panel-title>Trash Dock</div><div class=notes-trash__panel-header-actions><div class=notes-trash__panel-count> items</div><button type=button class=notes-trash__panel-close aria-label="Close trash dock"></button></div></div><div class=notes-trash__panel-body>Grouped by topic, sorted by latest deletion, and recoverable for 72 hours.'), rt = /* @__PURE__ */ a("<div class=notes-trash__empty><div><strong>Trash is empty</strong><span>Deleted notes from any topic will appear here."), at = /* @__PURE__ */ a("<section class=notes-trash-section><div class=notes-trash-section__header><div class=notes-trash-section__title-group><div class=notes-trash-section__title-line><div></div><div class=notes-trash-section__title></div></div><div class=notes-trash-section__meta> deleted note</div></div><button type=button class=notes-trash-section__clear>Clear topic trash</button></div><div class=notes-trash-section__grid>"), ct = /* @__PURE__ */ a("<button type=button class=is-danger>Delete now"), _t = /* @__PURE__ */ a("<article><div class=notes-note__surface><div class=notes-trash-note__meta><span></span><strong></strong></div><div class=notes-trash-note__body><span></span></div><div class=notes-trash-note__actions><button type=button>Restore");
7
7
  function mt(s) {
8
8
  return r(u, {
9
9
  get when() {
@@ -42,7 +42,7 @@ function mt(s) {
42
42
  children: (n) => {
43
43
  const B = Y(n.topic_icon_accent);
44
44
  return (() => {
45
- var p = at(), g = p.firstChild, f = g.firstChild, C = f.firstChild, h = C.firstChild, E = h.nextSibling, $ = C.nextSibling, G = $.firstChild, K = f.nextSibling, X = g.nextSibling;
45
+ var p = at(), f = p.firstChild, g = f.firstChild, b = g.firstChild, h = b.firstChild, E = h.nextSibling, $ = b.nextSibling, G = $.firstChild, K = g.nextSibling, X = f.nextSibling;
46
46
  return D(h, `notes-topic-mark notes-topic-mark--trash ${B}`), t(h, r(V, {
47
47
  get iconKey() {
48
48
  return n.topic_icon_key;
@@ -55,8 +55,8 @@ function mt(s) {
55
55
  children: (o) => {
56
56
  const v = Z(o), j = tt(o.body, v.preview_limit);
57
57
  return (() => {
58
- var _ = _t(), q = _.firstChild, b = q.firstChild, w = b.firstChild, H = w.nextSibling, x = b.nextSibling, J = x.firstChild, y = x.nextSibling, L = y.firstChild;
59
- return t(w, () => et(o.deleted_at_unix_ms)), t(H, () => st(o.deleted_at_unix_ms, s.now)), t(J, j), L.$$click = () => s.onRestore(o.note_id), t(y, r(u, {
58
+ var _ = _t(), q = _.firstChild, C = q.firstChild, y = C.firstChild, H = y.nextSibling, w = C.nextSibling, J = w.firstChild, x = w.nextSibling, L = x.firstChild;
59
+ return t(y, () => et(o.deleted_at_unix_ms)), t(H, () => st(o.deleted_at_unix_ms, s.now)), t(J, j), L.$$click = () => s.onRestore(o.note_id), t(x, r(u, {
60
60
  get when() {
61
61
  return s.canDeleteNow;
62
62
  },