@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.
- package/dist/components/notes/NotesBoardNote.js +65 -64
- package/dist/components/notes/NotesOverlay.js +19 -19
- package/dist/components/notes/useNotesOverlayModel.d.ts +1 -0
- package/dist/components/notes/useNotesOverlayModel.js +327 -299
- package/dist/notes-legacy.css +10 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,101 +1,101 @@
|
|
|
1
|
-
import { insert as m, createComponent as _, memo as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { startHotInteraction as
|
|
4
|
-
import { GripVertical as
|
|
5
|
-
import { notePreviewMetrics as
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
const [
|
|
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
|
-
|
|
11
|
-
c?.abort(), c = void 0,
|
|
10
|
+
G(() => {
|
|
11
|
+
c?.abort(), c = void 0, W(u)?.stopInteraction();
|
|
12
12
|
});
|
|
13
|
-
const $ = h(() =>
|
|
14
|
-
const
|
|
15
|
-
return
|
|
16
|
-
x:
|
|
17
|
-
y:
|
|
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 = (
|
|
23
|
-
const
|
|
24
|
-
if (!
|
|
25
|
-
const
|
|
26
|
-
x:
|
|
27
|
-
y:
|
|
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:
|
|
30
|
-
y:
|
|
29
|
+
x: n.startWorldX,
|
|
30
|
+
y: n.startWorldY
|
|
31
31
|
};
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
if (
|
|
35
|
-
|
|
36
|
-
const
|
|
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
|
-
}),
|
|
39
|
+
}), l = Math.max(t.viewportScale, 1e-3);
|
|
40
40
|
w({
|
|
41
|
-
pointerId:
|
|
42
|
-
startClientX:
|
|
43
|
-
startClientY:
|
|
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:
|
|
50
|
-
stopInteraction:
|
|
49
|
+
scale: l,
|
|
50
|
+
stopInteraction: n
|
|
51
51
|
});
|
|
52
52
|
const s = (a) => {
|
|
53
|
-
w((
|
|
54
|
-
if (!
|
|
55
|
-
const
|
|
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
|
-
...
|
|
58
|
-
worldX:
|
|
59
|
-
worldY:
|
|
60
|
-
moved:
|
|
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 ===
|
|
65
|
-
},
|
|
66
|
-
a.pointerId ===
|
|
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",
|
|
73
|
+
}), window.addEventListener("pointercancel", v, {
|
|
74
74
|
once: !0,
|
|
75
75
|
signal: d.signal
|
|
76
76
|
});
|
|
77
77
|
};
|
|
78
78
|
return (() => {
|
|
79
|
-
var
|
|
80
|
-
return
|
|
81
|
-
|
|
82
|
-
}, s.$$pointerdown =
|
|
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
|
-
})),
|
|
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, _(
|
|
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(
|
|
89
|
-
var
|
|
90
|
-
return () =>
|
|
91
|
-
var
|
|
92
|
-
return m(f, _(
|
|
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
|
-
})),
|
|
94
|
+
})), r;
|
|
95
95
|
})() : null;
|
|
96
|
-
})(), null),
|
|
97
|
-
var
|
|
98
|
-
return
|
|
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
|
-
|
|
107
|
+
h: void 0,
|
|
108
|
+
r: void 0
|
|
109
|
+
}), o;
|
|
109
110
|
})();
|
|
110
111
|
}
|
|
111
|
-
|
|
112
|
+
O(["contextmenu", "click", "pointerdown"]);
|
|
112
113
|
export {
|
|
113
|
-
|
|
114
|
+
at as NotesBoardNote
|
|
114
115
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createComponent as o, insert as i, addEventListener as
|
|
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__ */
|
|
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
|
|
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: () =>
|
|
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 =
|
|
78
|
-
typeof n == "function" ? n(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,
|
|
124
|
-
return i(
|
|
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(),
|
|
293
|
-
return
|
|
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
|
|
302
|
+
return x(() => !!e.board.isMobile())() && e.board.overviewOpen();
|
|
303
303
|
},
|
|
304
304
|
get children() {
|
|
305
|
-
return o(
|
|
305
|
+
return o(c, {
|
|
306
306
|
get children() {
|
|
307
307
|
return [(() => {
|
|
308
308
|
var t = X();
|
|
309
|
-
return
|
|
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(
|
|
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(
|
|
380
|
+
return o(c, {
|
|
381
381
|
get children() {
|
|
382
382
|
return [(() => {
|
|
383
383
|
var t = j();
|
|
384
|
-
return
|
|
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(
|
|
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(
|
|
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
|
-
|
|
458
|
+
$(["click", "contextmenu"]);
|
|
459
459
|
export {
|
|
460
460
|
ge as NotesOverlay
|
|
461
461
|
};
|