@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.
- package/dist/components/notes/NotesBoardNote.js +65 -64
- package/dist/components/notes/NotesContextMenu.js +17 -17
- package/dist/components/notes/NotesEditorFlyout.js +4 -4
- package/dist/components/notes/NotesOverlay.js +91 -75
- package/dist/components/notes/NotesTrashFlyout.js +4 -4
- package/dist/components/notes/useNotesOverlayModel.d.ts +1 -0
- package/dist/components/notes/useNotesOverlayModel.js +327 -299
- package/dist/context/CommandContext.d.ts +2 -0
- package/dist/context/CommandContext.js +47 -49
- package/dist/context/ComponentRegistry.d.ts +1 -0
- package/dist/context/ComponentRegistry.js +40 -39
- package/dist/hooks/useOverlayMask.d.ts +4 -0
- package/dist/hooks/useOverlayMask.js +37 -32
- 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,43 +1,43 @@
|
|
|
1
|
-
import { use as
|
|
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__ */
|
|
5
|
-
const
|
|
6
|
-
function
|
|
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
|
|
10
|
-
return M + Math.max(1, t) * X + Math.max(0, n) *
|
|
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
|
|
17
|
-
return typeof
|
|
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 (!
|
|
22
|
+
if (!P(e))
|
|
23
23
|
return h();
|
|
24
24
|
const a = e.icon;
|
|
25
25
|
return (() => {
|
|
26
|
-
var o = I(),
|
|
27
|
-
return
|
|
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
|
-
}),
|
|
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 &&
|
|
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
|
-
})),
|
|
38
|
+
})), d((e) => {
|
|
39
39
|
var a = `${t.x}px`, o = `${t.y}px`;
|
|
40
|
-
return a !== e.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
|
-
|
|
49
|
+
A as NOTES_CONTEXT_MENU_WIDTH_PX,
|
|
50
50
|
R as NotesContextMenu,
|
|
51
|
-
|
|
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,
|
|
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,
|
|
59
|
-
return i.$$pointerdown = (n) => n.stopPropagation(),
|
|
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
|
|
2
|
-
import { Show as s } from "solid-js";
|
|
3
|
-
import { Motion as
|
|
4
|
-
import { easing as
|
|
5
|
-
import { useOverlayMask as
|
|
6
|
-
import { X as
|
|
7
|
-
import { NotesBoard as
|
|
8
|
-
import { NotesContextMenu as
|
|
9
|
-
import { NotesEditorFlyout as
|
|
10
|
-
import { NotesOverviewPanel as
|
|
11
|
-
import { NotesTopicRail as
|
|
12
|
-
import { NotesTrashFlyout as
|
|
13
|
-
import { NotesTrashCanIcon as
|
|
14
|
-
import { useNotesOverlayModel as
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
|
40
|
-
const e =
|
|
41
|
-
let
|
|
42
|
-
const
|
|
43
|
-
return
|
|
44
|
-
open
|
|
45
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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:
|
|
52
|
-
blockTouchMove:
|
|
53
|
-
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
|
|
72
|
+
return r.open;
|
|
58
73
|
},
|
|
59
74
|
get children() {
|
|
60
|
-
return o(
|
|
75
|
+
return o(C.section, {
|
|
61
76
|
ref(t) {
|
|
62
|
-
var n =
|
|
63
|
-
typeof n == "function" ? n(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
|
|
83
|
+
return l().ariaModal;
|
|
69
84
|
},
|
|
70
85
|
"aria-label": "Notes overlay",
|
|
71
86
|
get "data-notes-interaction-mode"() {
|
|
72
|
-
return
|
|
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(
|
|
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:
|
|
118
|
+
easing: E.easeOut
|
|
103
119
|
};
|
|
104
120
|
},
|
|
105
121
|
get children() {
|
|
106
122
|
return [(() => {
|
|
107
|
-
var t =
|
|
108
|
-
return
|
|
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 =
|
|
113
|
-
return
|
|
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: (
|
|
154
|
-
e.rail.deleteTopic(
|
|
169
|
+
onDeleteTopic: (a) => {
|
|
170
|
+
e.rail.deleteTopic(a);
|
|
155
171
|
}
|
|
156
|
-
}), n),
|
|
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: (
|
|
221
|
-
e.board.copyNote(
|
|
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: (
|
|
230
|
-
e.board.moveToTrash(
|
|
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),
|
|
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(
|
|
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),
|
|
287
|
+
}), n), i(n, o(s, {
|
|
272
288
|
get when() {
|
|
273
289
|
return !e.trash.open();
|
|
274
290
|
},
|
|
275
291
|
get children() {
|
|
276
|
-
var
|
|
277
|
-
return
|
|
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
|
-
})),
|
|
295
|
+
})), y(() => k(a, "aria-label", `Open trash dock${e.trash.count() > 0 ? `, ${e.trash.count()} items` : ""}`)), a;
|
|
280
296
|
}
|
|
281
|
-
})),
|
|
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
|
|
302
|
+
return x(() => !!e.board.isMobile())() && e.board.overviewOpen();
|
|
287
303
|
},
|
|
288
304
|
get children() {
|
|
289
|
-
return o(
|
|
305
|
+
return o(c, {
|
|
290
306
|
get children() {
|
|
291
307
|
return [(() => {
|
|
292
|
-
var t =
|
|
293
|
-
return
|
|
308
|
+
var t = X();
|
|
309
|
+
return v(t, "click", e.overview.close, !0), t;
|
|
294
310
|
})(), (() => {
|
|
295
|
-
var t =
|
|
296
|
-
return
|
|
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(
|
|
343
|
+
}), o(c, {
|
|
328
344
|
get children() {
|
|
329
|
-
return o(
|
|
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(
|
|
380
|
+
return o(c, {
|
|
365
381
|
get children() {
|
|
366
382
|
return [(() => {
|
|
367
|
-
var t =
|
|
368
|
-
return
|
|
369
|
-
})(), o(
|
|
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(
|
|
404
|
+
return o(c, {
|
|
389
405
|
get children() {
|
|
390
|
-
return o(
|
|
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(
|
|
432
|
+
}), o(c, {
|
|
417
433
|
get children() {
|
|
418
|
-
return o(
|
|
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
|
-
|
|
458
|
+
$(["click", "contextmenu"]);
|
|
443
459
|
export {
|
|
444
|
-
|
|
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(),
|
|
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,
|
|
59
|
-
return t(
|
|
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
|
},
|