@floegence/floe-webapp-core 0.35.57 → 0.35.58

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.
@@ -5,10 +5,10 @@ import { NotesAnimalIcon as T } from "./notesAppearance.js";
5
5
  import { NotesBoardNote as P } from "./NotesBoardNote.js";
6
6
  import { topicAccentClass as p } from "./notesOverlayHelpers.js";
7
7
  import { InfiniteCanvas as L } from "../ui/InfiniteCanvas.js";
8
- var Z = /* @__PURE__ */ r('<button type=button class=notes-overlay__hud-button aria-label="Open overview map">'), D = /* @__PURE__ */ r("<div class=notes-page__mobile-toolbar><div class=notes-page__mobile-topics>"), A = /* @__PURE__ */ r("<div class=notes-canvas__field>"), B = /* @__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'), E = /* @__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 data-floe-notes-digit-browse=true>'), j = /* @__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>");
8
+ var Z = /* @__PURE__ */ r('<button type=button class=notes-overlay__hud-button aria-label="Open overview map">'), D = /* @__PURE__ */ r("<div class=notes-page__mobile-toolbar><div class=notes-page__mobile-topics>"), A = /* @__PURE__ */ r("<div class=notes-canvas__field>"), B = /* @__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'), E = /* @__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>'), j = /* @__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 s = E(), m = s.firstChild, g = m.firstChild, $ = g.nextSibling, d = $.firstChild, h = d.nextSibling, C = h.nextSibling, v = m.nextSibling;
11
+ var s = E(), b = s.firstChild, g = b.firstChild, $ = g.nextSibling, d = $.firstChild, h = d.nextSibling, C = h.nextSibling, v = b.nextSibling;
12
12
  t(g, o(u, {
13
13
  get when() {
14
14
  return e.activeTopic;
@@ -24,8 +24,8 @@ function U(e) {
24
24
  class: "notes-topic-mark__icon"
25
25
  })), a;
26
26
  })(), (() => {
27
- var a = R(), l = a.firstChild, _ = l.nextSibling, c = _.nextSibling, b = c.firstChild;
28
- return t(_, () => n().name), t(c, () => e.activeItems.length, b), t(c, () => e.activeItems.length === 1 ? "" : "s", null), a;
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
31
  })), d.$$click = () => e.onZoomOut(), t(d, o(N, {
@@ -132,14 +132,14 @@ function U(e) {
132
132
  return O(() => !!e.isMobile)() && !e.overviewOpen;
133
133
  },
134
134
  get children() {
135
- var n = B(), i = n.firstChild, a = i.firstChild, l = i.nextSibling, _ = l.firstChild, c = l.nextSibling, b = c.firstChild;
135
+ var n = B(), i = n.firstChild, a = i.firstChild, l = i.nextSibling, _ = l.firstChild, c = l.nextSibling, m = c.firstChild;
136
136
  return i.$$click = () => e.onMobileCreateNote(), t(i, o(w, {
137
137
  class: "w-4 h-4"
138
138
  }), a), l.$$click = () => e.onMobilePaste(), t(l, o(F, {
139
139
  class: "w-4 h-4"
140
140
  }), _), c.$$click = () => e.onOpenOverview(), t(c, o(M, {
141
141
  class: "w-4 h-4"
142
- }), b), n;
142
+ }), m), n;
143
143
  }
144
144
  }), null), s;
145
145
  })();
@@ -1,18 +1,20 @@
1
- import { insert as l, createComponent as y, memo as b, effect as R, setAttribute as j, className as Z, setStyleProperty as C, template as g, delegateEvents as q } from "solid-js/web";
2
- import { createSignal as J, onCleanup as Q, untrack as G, createMemo as m } from "solid-js";
3
- import { startHotInteraction as U } from "../../utils/hotInteraction.js";
4
- import { GripVertical as p, Pencil as tt, Trash as et, Check as nt } from "../icons/index.js";
5
- import { notePreviewMetrics as ot, normalizeNoteTitle as it, normalizeNoteText as lt, getNotePreviewText as at, noteColorClass as st, samePoint as rt } from "./notesOverlayHelpers.js";
6
- var dt = /* @__PURE__ */ g('<article data-floe-geometry-surface=notes-note><div class=notes-note__surface><header class=notes-note__header><div class=notes-note__lead><button type=button class=notes-note__drag aria-label="Drag note"data-floe-canvas-interactive=true data-floe-notes-front-skip=true></button></div><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 data-floe-notes-front-skip=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>'), ct = /* @__PURE__ */ g("<div class=notes-note__number aria-hidden=true><span class=notes-note__number-key>"), mt = /* @__PURE__ */ g("<span class=notes-note__title-block><span class=notes-note__title>"), ut = /* @__PURE__ */ g("<span class=notes-note__body-copy>"), vt = /* @__PURE__ */ g("<span class=notes-note__body-copy>Empty note"), _t = /* @__PURE__ */ g("<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
- const gt = '[data-floe-notes-front-skip="true"]';
8
- function Ct(e) {
9
- const [h, w] = J(null);
1
+ import { insert as s, createComponent as L, memo as C, effect as j, setAttribute as T, style as q, className as J, setStyleProperty as k, template as b, delegateEvents as Q } from "solid-js/web";
2
+ import { createSignal as U, onCleanup as p, untrack as G, createMemo as c } from "solid-js";
3
+ import { startHotInteraction as tt } from "../../utils/hotInteraction.js";
4
+ import { GripVertical as et, Check as nt, Pencil as ot, Trash as it } from "../icons/index.js";
5
+ import { notePreviewMetrics as lt, normalizeNoteTitle as at, normalizeNoteText as st, getNotePreviewText as rt, noteColorClass as dt, samePoint as ct } from "./notesOverlayHelpers.js";
6
+ var mt = /* @__PURE__ */ b('<article data-floe-geometry-surface=notes-note><div class=notes-note__surface><header class=notes-note__header><div class=notes-note__lead><button type=button class=notes-note__drag aria-label="Drag note"data-floe-canvas-interactive=true data-floe-notes-front-skip=true></button></div></header><button type=button class=notes-note__body data-floe-canvas-interactive=true data-floe-canvas-pan-surface=true></button></div><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 data-floe-notes-front-skip=true aria-label="Move note to trash">'), ut = /* @__PURE__ */ b("<span class=notes-note__title-block><span class=notes-note__title>"), vt = /* @__PURE__ */ b("<span class=notes-note__body-copy>"), _t = /* @__PURE__ */ b("<span class=notes-note__body-copy>Empty note"), gt = /* @__PURE__ */ b("<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"), bt = /* @__PURE__ */ b("<div class=notes-note__number aria-hidden=true><span class=notes-note__number-key>");
7
+ const ft = '[data-floe-notes-front-skip="true"]';
8
+ function xt(e) {
9
+ const [w, I] = U(null);
10
10
  let _;
11
- Q(() => {
12
- _?.abort(), _ = void 0, G(h)?.stopInteraction();
11
+ p(() => {
12
+ _?.abort(), _ = void 0, G(w)?.stopInteraction();
13
13
  });
14
- const x = m(() => ot(e.item)), L = m(() => it(e.item.title)), T = m(() => lt(e.item.body)), H = m(() => T() ? at(e.item.body, x().preview_limit) : ""), f = m(() => L().length > 0), k = m(() => T().length > 0), M = m(() => !f() && !k()), S = () => h() !== null, X = m(() => {
15
- const n = h();
14
+ const M = c(() => lt(e.item)), X = c(() => at(e.item.title)), Y = c(() => st(e.item.body)), H = c(() => Y() ? rt(e.item.body, M().preview_limit) : ""), K = c(() => e.numberLabel ? {
15
+ "--notes-number-length": `${Math.max(e.numberLabel.length, 1)}`
16
+ } : void 0), f = c(() => X().length > 0), S = c(() => Y().length > 0), P = c(() => !f() && !S()), E = () => w() !== null, N = c(() => {
17
+ const n = w();
16
18
  return n ? {
17
19
  x: n.worldX,
18
20
  y: n.worldY
@@ -20,25 +22,25 @@ function Ct(e) {
20
22
  x: e.item.x,
21
23
  y: e.item.y
22
24
  };
23
- }), K = (n) => !(n instanceof Element && n.closest(gt)), Y = (n) => {
24
- const a = G(h);
25
- if (!a) return;
26
- const r = {
27
- x: a.worldX,
28
- y: a.worldY
29
- }, u = {
30
- x: a.startWorldX,
31
- y: a.startWorldY
32
- }, v = n && !rt(r, u);
33
- v && e.onSeedMoveProjection(e.item.note_id, r), a.stopInteraction(), w(null), _?.abort(), _ = void 0, e.onCommitFront(e.item.note_id), v && e.onCommitMove(e.item.note_id, r);
34
- }, V = (n) => {
25
+ }), V = (n) => !(n instanceof Element && n.closest(ft)), W = (n) => {
26
+ const l = G(w);
27
+ if (!l) return;
28
+ const m = {
29
+ x: l.worldX,
30
+ y: l.worldY
31
+ }, h = {
32
+ x: l.startWorldX,
33
+ y: l.startWorldY
34
+ }, v = n && !ct(m, h);
35
+ v && e.onSeedMoveProjection(e.item.note_id, m), l.stopInteraction(), I(null), _?.abort(), _ = void 0, e.onCommitFront(e.item.note_id), v && e.onCommitMove(e.item.note_id, m);
36
+ }, Z = (n) => {
35
37
  if (n.button !== 0) return;
36
38
  n.preventDefault(), n.stopPropagation(), _?.abort(), e.onStartOptimisticFront(e.item.note_id);
37
- const a = U({
39
+ const l = tt({
38
40
  kind: "drag",
39
41
  cursor: "grabbing"
40
- }), r = Math.max(e.viewportScale, 1e-3);
41
- w({
42
+ }), m = Math.max(e.viewportScale, 1e-3);
43
+ I({
42
44
  pointerId: n.pointerId,
43
45
  startClientX: n.clientX,
44
46
  startClientY: n.clientY,
@@ -47,79 +49,86 @@ function Ct(e) {
47
49
  worldX: e.item.x,
48
50
  worldY: e.item.y,
49
51
  moved: !1,
50
- scale: r,
51
- stopInteraction: a
52
+ scale: m,
53
+ stopInteraction: l
52
54
  });
53
- const u = (s) => {
54
- w((o) => {
55
- if (!o || o.pointerId !== s.pointerId) return o;
56
- const t = o.startWorldX + (s.clientX - o.startClientX) / o.scale, i = o.startWorldY + (s.clientY - o.startClientY) / o.scale;
55
+ const h = (r) => {
56
+ I((i) => {
57
+ if (!i || i.pointerId !== r.pointerId) return i;
58
+ const t = i.startWorldX + (r.clientX - i.startClientX) / i.scale, o = i.startWorldY + (r.clientY - i.startClientY) / i.scale;
57
59
  return {
58
- ...o,
60
+ ...i,
59
61
  worldX: t,
60
- worldY: i,
61
- moved: o.moved || Math.abs(t - o.startWorldX) > 2 || Math.abs(i - o.startWorldY) > 2
62
+ worldY: o,
63
+ moved: i.moved || Math.abs(t - i.startWorldX) > 2 || Math.abs(o - i.startWorldY) > 2
62
64
  };
63
65
  });
64
- }, v = (s) => {
65
- s.pointerId === n.pointerId && Y(!0);
66
- }, I = (s) => {
67
- s.pointerId === n.pointerId && Y(!1);
68
- }, d = new AbortController();
69
- _ = d, window.addEventListener("pointermove", u, {
70
- signal: d.signal
66
+ }, v = (r) => {
67
+ r.pointerId === n.pointerId && W(!0);
68
+ }, d = (r) => {
69
+ r.pointerId === n.pointerId && W(!1);
70
+ }, g = new AbortController();
71
+ _ = g, window.addEventListener("pointermove", h, {
72
+ signal: g.signal
71
73
  }), window.addEventListener("pointerup", v, {
72
74
  once: !0,
73
- signal: d.signal
74
- }), window.addEventListener("pointercancel", I, {
75
+ signal: g.signal
76
+ }), window.addEventListener("pointercancel", d, {
75
77
  once: !0,
76
- signal: d.signal
78
+ signal: g.signal
77
79
  });
78
80
  };
79
81
  return (() => {
80
- var n = dt(), a = n.firstChild, r = a.firstChild, u = r.firstChild, v = u.firstChild, I = u.nextSibling, d = I.firstChild, s = d.nextSibling, o = r.nextSibling;
82
+ var n = mt(), l = n.firstChild, m = l.firstChild, h = m.firstChild, v = h.firstChild, d = m.nextSibling, g = l.nextSibling, r = g.firstChild, i = r.nextSibling;
81
83
  return n.$$click = (t) => {
82
- K(t.target) && e.onCommitFront(e.item.note_id);
84
+ V(t.target) && e.onCommitFront(e.item.note_id);
83
85
  }, n.$$contextmenu = (t) => {
84
86
  t.preventDefault(), t.stopPropagation(), e.onOpenContextMenu(t, e.item);
85
- }, v.$$pointerdown = V, l(v, y(p, {
87
+ }, v.$$pointerdown = Z, s(v, L(et, {
86
88
  class: "w-3.5 h-3.5"
87
- })), l(u, (() => {
88
- var t = b(() => !!e.numberLabel);
89
+ })), d.$$click = () => e.onCopy(e.item), s(d, (() => {
90
+ var t = C(() => !!f());
89
91
  return () => t() ? (() => {
90
- var i = ct(), c = i.firstChild;
91
- return l(c, () => e.numberLabel), R(() => j(i, "data-floe-notes-note-number", e.numberLabel)), i;
92
+ var o = ut(), u = o.firstChild;
93
+ return s(u, X), o;
92
94
  })() : null;
93
- })(), null), d.$$click = () => e.onOpenEditor(e.item.note_id), l(d, y(tt, {
94
- class: "w-3.5 h-3.5"
95
- })), s.$$click = () => e.onMoveToTrash(e.item.note_id), l(s, y(et, {
96
- class: "w-3.5 h-3.5"
97
- })), o.$$click = () => e.onCopy(e.item), l(o, (() => {
98
- var t = b(() => !!f());
95
+ })(), null), s(d, (() => {
96
+ var t = C(() => !!S());
99
97
  return () => t() ? (() => {
100
- var i = mt(), c = i.firstChild;
101
- return l(c, L), i;
98
+ var o = vt();
99
+ return s(o, H), o;
102
100
  })() : null;
103
- })(), null), l(o, (() => {
104
- var t = b(() => !!k());
101
+ })(), null), s(d, (() => {
102
+ var t = C(() => !!P());
103
+ return () => t() ? _t() : null;
104
+ })(), null), s(l, (() => {
105
+ var t = C(() => !!e.copied);
105
106
  return () => t() ? (() => {
106
- var i = ut();
107
- return l(i, H), i;
107
+ var o = gt(), u = o.firstChild, a = u.firstChild;
108
+ return s(a, L(nt, {
109
+ class: "w-3.5 h-3.5"
110
+ })), o;
108
111
  })() : null;
109
- })(), null), l(o, (() => {
110
- var t = b(() => !!M());
111
- return () => t() ? vt() : null;
112
- })(), null), l(a, (() => {
113
- var t = b(() => !!e.copied);
112
+ })(), null), r.$$click = () => e.onOpenEditor(e.item.note_id), s(r, L(ot, {
113
+ class: "w-3.5 h-3.5"
114
+ })), i.$$click = () => e.onMoveToTrash(e.item.note_id), s(i, L(it, {
115
+ class: "w-3.5 h-3.5"
116
+ })), s(n, (() => {
117
+ var t = C(() => !!e.numberLabel);
114
118
  return () => t() ? (() => {
115
- var i = _t(), c = i.firstChild, $ = c.firstChild;
116
- return l($, y(nt, {
117
- class: "w-3.5 h-3.5"
118
- })), i;
119
+ var o = bt(), u = o.firstChild;
120
+ return s(u, () => e.numberLabel), j((a) => {
121
+ var y = e.numberLabel, $ = e.numberLabel.length, x = K();
122
+ return y !== a.e && T(o, "data-floe-notes-note-number", a.e = y), $ !== a.t && T(o, "data-floe-notes-note-number-length", a.t = $), a.a = q(o, x, a.a), a;
123
+ }, {
124
+ e: void 0,
125
+ t: void 0,
126
+ a: void 0
127
+ }), o;
119
128
  })() : null;
120
- })(), null), R((t) => {
121
- var i = `${st(e.item.color_token)} notes-note notes-note--size-${e.item.size_bucket - 1}`, c = !!e.copied, $ = !!S(), P = !!f(), E = !!e.shortcutPending, N = e.item.note_id, W = `translate(${X().x}px, ${X().y}px)`, D = `${x().width}px`, F = `${x().height}px`, z = S() || e.optimisticFront ? `${e.topZIndex + 1}` : `${e.item.z_index}`, O = !!M(), A = !!f(), B = !!(f() && !k());
122
- return i !== t.e && Z(n, t.e = i), c !== t.t && n.classList.toggle("is-copied", t.t = c), $ !== t.a && n.classList.toggle("is-dragging", t.a = $), P !== t.o && n.classList.toggle("has-title", t.o = P), E !== t.i && n.classList.toggle("is-shortcut-pending", t.i = E), N !== t.n && j(n, "data-floe-notes-note-id", t.n = N), W !== t.s && C(n, "transform", t.s = W), D !== t.h && C(n, "--note-width", t.h = D), F !== t.r && C(n, "--note-height", t.r = F), z !== t.d && C(n, "z-index", t.d = z), O !== t.l && o.classList.toggle("is-empty", t.l = O), A !== t.u && o.classList.toggle("has-title", t.u = A), B !== t.c && o.classList.toggle("is-title-only", t.c = B), t;
129
+ })(), null), j((t) => {
130
+ var o = `${dt(e.item.color_token)} notes-note notes-note--size-${e.item.size_bucket - 1}`, u = !!e.copied, a = !!E(), y = !!f(), $ = !!e.shortcutPending, x = e.item.note_id, D = `translate(${N().x}px, ${N().y}px)`, F = `${M().width}px`, z = `${M().height}px`, O = E() || e.optimisticFront ? `${e.topZIndex + 1}` : `${e.item.z_index}`, A = !!P(), B = !!f(), R = !!(f() && !S());
131
+ return o !== t.e && J(n, t.e = o), u !== t.t && n.classList.toggle("is-copied", t.t = u), a !== t.a && n.classList.toggle("is-dragging", t.a = a), y !== t.o && n.classList.toggle("has-title", t.o = y), $ !== t.i && n.classList.toggle("is-shortcut-pending", t.i = $), x !== t.n && T(n, "data-floe-notes-note-id", t.n = x), D !== t.s && k(n, "transform", t.s = D), F !== t.h && k(n, "--note-width", t.h = F), z !== t.r && k(n, "--note-height", t.r = z), O !== t.d && k(n, "z-index", t.d = O), A !== t.l && d.classList.toggle("is-empty", t.l = A), B !== t.u && d.classList.toggle("has-title", t.u = B), R !== t.c && d.classList.toggle("is-title-only", t.c = R), t;
123
132
  }, {
124
133
  e: void 0,
125
134
  t: void 0,
@@ -137,7 +146,7 @@ function Ct(e) {
137
146
  }), n;
138
147
  })();
139
148
  }
140
- q(["contextmenu", "click", "pointerdown"]);
149
+ Q(["contextmenu", "click", "pointerdown"]);
141
150
  export {
142
- Ct as NotesBoardNote
151
+ xt as NotesBoardNote
143
152
  };