@floegence/floe-webapp-core 0.35.41 → 0.35.43

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.
Files changed (32) hide show
  1. package/dist/components/notes/NotesBoard.d.ts +36 -0
  2. package/dist/components/notes/NotesBoard.js +141 -0
  3. package/dist/components/notes/NotesBoardNote.d.ts +17 -0
  4. package/dist/components/notes/NotesBoardNote.js +114 -0
  5. package/dist/components/notes/NotesContextMenu.js +7 -7
  6. package/dist/components/notes/NotesEditorFlyout.d.ts +19 -0
  7. package/dist/components/notes/NotesEditorFlyout.js +92 -0
  8. package/dist/components/notes/NotesOverlay.d.ts +3 -1
  9. package/dist/components/notes/NotesOverlay.js +376 -852
  10. package/dist/components/notes/NotesOverlayLegacy.d.ts +1 -0
  11. package/dist/components/notes/NotesOverviewPanel.d.ts +22 -0
  12. package/dist/components/notes/NotesOverviewPanel.js +52 -0
  13. package/dist/components/notes/NotesTopicRail.d.ts +18 -0
  14. package/dist/components/notes/NotesTopicRail.js +94 -0
  15. package/dist/components/notes/NotesTrashFlyout.d.ts +13 -0
  16. package/dist/components/notes/NotesTrashFlyout.js +90 -0
  17. package/dist/components/notes/index.d.ts +1 -1
  18. package/dist/components/notes/notesOverlayHelpers.d.ts +93 -0
  19. package/dist/components/notes/notesOverlayHelpers.js +159 -0
  20. package/dist/components/notes/types.d.ts +3 -0
  21. package/dist/components/notes/types.js +61 -44
  22. package/dist/components/notes/useNotesOverlayModel.d.ts +196 -0
  23. package/dist/components/notes/useNotesOverlayModel.js +559 -0
  24. package/dist/floe.css +3 -1
  25. package/dist/full.js +254 -253
  26. package/dist/hooks/useOverlayMask.d.ts +3 -2
  27. package/dist/hooks/useOverlayMask.js +37 -27
  28. package/dist/notes-legacy.css +2584 -0
  29. package/dist/notes.css +1 -1014
  30. package/dist/notes.js +26 -25
  31. package/dist/styles.css +1 -1
  32. package/package.json +1 -1
@@ -1,901 +1,425 @@
1
- import { createComponent as c, insert as a, use as Mt, effect as X, className as It, setAttribute as g, memo as he, setStyleProperty as q, template as p, delegateEvents as Fe } from "solid-js/web";
2
- import { createSignal as R, createMemo as x, createEffect as tt, onCleanup as yt, Show as M, For as ct, untrack as ve } from "solid-js";
3
- import { Motion as Vt } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.11/node_modules/solid-motionone/dist/index.js";
4
- import { FileText as We, Copy as pe, Trash as Ft, Plus as He, Pencil as fe, X as Wt, Check as Ke } from "../icons/index.js";
5
- import { cn as Pt } from "../../utils/cn.js";
6
- import { NotesContextMenu as Ge, NOTES_CONTEXT_MENU_WIDTH_PX as qe, estimateNotesContextMenuHeight as Ue } from "./NotesContextMenu.js";
7
- import { NotesOverlayIcon as Ze, NotesAnimalIcon as Ht, NotesTrashCanIcon as me, NOTE_COLOR_LABELS as je } from "./notesAppearance.js";
8
- import { groupTrashItems as Je, computeBoardBounds as Qe, visibleWorldRect as ge, mergeBoardBounds as tn, noteBucketMetrics as Dt, NOTE_COLOR_TOKENS as en, worldToScreen as nn, screenToWorld as on, zoomViewportAtPoint as ye, centerViewportOnWorldPoint as rn } from "./types.js";
9
- import { useNotification as an } from "../../context/NotificationContext.js";
10
- var sn = /* @__PURE__ */ p('<div class=notes-overlay__topic-create data-notes-interactive=true><input class=notes-overlay__topic-input placeholder="New topic"data-notes-interactive=true><div class=notes-overlay__topic-create-actions><button type=button class=notes-overlay__text-action data-notes-interactive=true>Add</button><button type=button class=notes-overlay__text-action data-notes-interactive=true>Cancel'), ln = /* @__PURE__ */ p("<div class=notes-overlay__empty-rail>Create your first topic to start pinning notes."), cn = /* @__PURE__ */ p("<div class=notes-overlay__loading>Loading notes…"), dn = /* @__PURE__ */ p("<div class=notes-overlay__empty-board>Right click anywhere to create the first note in this topic."), un = /* @__PURE__ */ p("<span class=notes-overlay__trash-count>"), _n = /* @__PURE__ */ p('<button type=button class=notes-overlay__trash-dock aria-label="Open trash"data-notes-interactive=true data-notes-trash-toggle=true>'), hn = /* @__PURE__ */ p('<div class=notes-trash__head><span class=notes-trash__title></span><button type=button class="notes-overlay__close notes-overlay__close--panel"aria-label="Close trash"data-notes-interactive=true>'), vn = /* @__PURE__ */ p("<div class=notes-trash__empty>Trash is empty."), pn = /* @__PURE__ */ p("<div class=notes-trash__content>"), fn = /* @__PURE__ */ p('<div class=notes-editor__head><span>Edit note</span><button type=button class="notes-overlay__close notes-overlay__close--panel"aria-label="Close note editor"data-notes-interactive=true>'), mn = /* @__PURE__ */ p("<div class=notes-editor__colors>"), gn = /* @__PURE__ */ p("<textarea class=notes-editor__textarea data-notes-interactive=true>"), yn = /* @__PURE__ */ p("<div class=notes-editor__actions><button type=button class=notes-overlay__text-action data-notes-interactive=true>Save</button><button type=button class=notes-overlay__text-action data-notes-interactive=true>Cancel"), wn = /* @__PURE__ */ p('<div class=notes-overlay><div class=notes-overlay__scrim></div><aside><div class=notes-overlay__rail-head><button type=button class=notes-overlay__brand aria-label="Notes topics"data-notes-interactive=true><span>Notes</span></button><button type=button class=notes-overlay__icon-button aria-label="Create topic"data-notes-interactive=true></button></div><div class=notes-overlay__topic-list></div></aside><div class=notes-overlay__viewport><div class=notes-overlay__hud><button type=button class=notes-overlay__hud-topic data-notes-interactive=true></button><button type=button class=notes-overlay__close aria-label="Close notes overlay"data-notes-interactive=true></button></div><div class=notes-overlay__board>'), $n = /* @__PURE__ */ p('<input class="notes-overlay__topic-input notes-overlay__topic-input--row"data-notes-interactive=true>'), bn = /* @__PURE__ */ p("<span>"), xn = /* @__PURE__ */ p('<div role=button tabindex=0 data-notes-interactive=true><span class=notes-overlay__topic-icon></span><span class=notes-overlay__topic-copy><span class=notes-overlay__topic-meta><span></span></span></span><span class=notes-overlay__topic-actions><button type=button class=notes-overlay__inline-icon data-notes-interactive=true></button><button type=button class="notes-overlay__inline-icon notes-overlay__inline-icon--danger"data-notes-interactive=true>'), Cn = /* @__PURE__ */ p("<span class=notes-overlay__topic-name>"), Tn = /* @__PURE__ */ p("<span>No topic"), Sn = /* @__PURE__ */ p('<span class="notes-overlay__topic-icon notes-overlay__topic-icon--hud">'), kn = /* @__PURE__ */ p("<span class=notes-overlay__hud-topic-copy><span class=notes-overlay__hud-topic-name></span><span class=notes-overlay__hud-topic-state>%"), En = /* @__PURE__ */ p("<span>Copied"), Mn = /* @__PURE__ */ p('<div><div class=notes-note__surface><div class=notes-note__toolbar><span class=notes-note__eyebrow></span><span class=notes-note__toolbar-actions><button type=button class=notes-overlay__inline-icon aria-label="Edit note"data-notes-interactive=true></button><button type=button class="notes-overlay__inline-icon notes-overlay__inline-icon--danger"aria-label="Delete note"data-notes-interactive=true></button></span></div><div class=notes-note__body>'), In = /* @__PURE__ */ p('<section class=notes-trash__group><div class=notes-trash__group-head><div class=notes-trash__group-title><span class="notes-overlay__topic-icon notes-overlay__topic-icon--hud"></span><span></span></div><button type=button class="notes-overlay__text-action notes-overlay__text-action--danger"data-notes-interactive=true>Clear</button></div><div class=notes-trash__grid>'), Pn = /* @__PURE__ */ p('<div class="notes-note notes-note--trash"><div class=notes-note__surface><div class="notes-note__toolbar notes-note__toolbar--trash"><span class=notes-note__eyebrow></span><button type=button class=notes-overlay__inline-icon aria-label="Restore note"data-notes-interactive=true></button></div><div class=notes-note__body>'), Dn = /* @__PURE__ */ p("<button type=button data-notes-interactive=true>"), Nn = /* @__PURE__ */ p('<div class=notes-minimap data-notes-interactive=true><svg viewBox="0 0 170 118"class=notes-minimap__svg aria-hidden=true><rect class=notes-minimap__viewport rx=4>'), Rn = /* @__PURE__ */ p("<svg><rect class=notes-minimap__note rx=2></svg>", !1, !0, !1);
11
- const Xn = 430, Ln = 6, Yn = 960;
12
- function On(o) {
13
- const h = Number(o);
14
- return !Number.isFinite(h) || h <= 0 ? "" : new Intl.DateTimeFormat("en-US", {
15
- month: "short",
16
- day: "numeric",
17
- hour: "numeric",
18
- minute: "2-digit"
19
- }).format(new Date(h));
20
- }
21
- function Kt(o) {
22
- const h = o instanceof HTMLElement ? o : null;
23
- if (!h) return !1;
24
- if (h.closest('[data-notes-interactive="true"]')) return !0;
25
- const w = h.tagName.toLowerCase();
26
- return w === "button" || w === "input" || w === "textarea" || w === "select" || w === "a";
27
- }
28
- function we(o) {
29
- if (o.length < 2) return 0;
30
- const h = o[0], w = o[1];
31
- return Math.hypot(w.clientX - h.clientX, w.clientY - h.clientY);
32
- }
33
- function $e(o) {
34
- if (o.length < 2) return {
35
- x: 0,
36
- y: 0
37
- };
38
- const h = o[0], w = o[1];
39
- return {
40
- x: (h.clientX + w.clientX) / 2,
41
- y: (h.clientY + w.clientY) / 2
42
- };
43
- }
44
- function Bn(o, h, w) {
45
- const U = Ue(w);
46
- return {
47
- x: Math.max(12, Math.min(o, window.innerWidth - qe - 16)),
48
- y: Math.max(12, Math.min(h, window.innerHeight - U - 16))
1
+ import { createComponent as o, insert as a, addEventListener as p, effect as h, setAttribute as N, memo as S, template as c, delegateEvents as $ } from "solid-js/web";
2
+ import { Show as s } from "solid-js";
3
+ import { Motion as f } 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 k, duration as _ } from "../../utils/animations.js";
5
+ import { useOverlayMask as O } from "../../hooks/useOverlayMask.js";
6
+ import { X as x } from "../icons/index.js";
7
+ import { NotesBoard as D } from "./NotesBoard.js";
8
+ import { NotesContextMenu as I } from "./NotesContextMenu.js";
9
+ import { NotesEditorFlyout as F, NotesManualPasteFlyout as R } from "./NotesEditorFlyout.js";
10
+ import { NotesOverviewPanel as T } from "./NotesOverviewPanel.js";
11
+ import { NotesTopicRail as L } from "./NotesTopicRail.js";
12
+ import { NotesTrashFlyout as B } from "./NotesTrashFlyout.js";
13
+ import { NotesTrashCanIcon as P } from "./notesAppearance.js";
14
+ import { useNotesOverlayModel as E } 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>'), z = /* @__PURE__ */ c("<button type=button class=notes-trash__toggle><div class=notes-trash__toggle-mark>"), W = /* @__PURE__ */ c("<div class=notes-overlay__body><div class=notes-trash data-floe-canvas-interactive=true>"), q = /* @__PURE__ */ c("<div class=notes-overview-backdrop>"), V = /* @__PURE__ */ c("<div class=notes-overview-flyout>"), A = /* @__PURE__ */ c("<div class=notes-menu-backdrop>");
16
+ function H(l) {
17
+ return l === "floating" ? {
18
+ mode: l,
19
+ ariaModal: void 0,
20
+ lockBodyScroll: !1,
21
+ trapFocus: !1,
22
+ closeOnEscape: "inside",
23
+ blockWheel: "none",
24
+ blockTouchMove: "none",
25
+ autoFocus: !1
26
+ } : {
27
+ mode: "modal",
28
+ ariaModal: !0,
29
+ lockBodyScroll: !0,
30
+ trapFocus: !0,
31
+ closeOnEscape: !0,
32
+ blockWheel: "outside",
33
+ blockTouchMove: "outside",
34
+ autoFocus: {
35
+ selector: '[data-floe-overlay-close="true"]'
36
+ }
49
37
  };
50
38
  }
51
- function be(o) {
52
- const h = String(o.preview_text ?? "").trim();
53
- return h || "Empty note";
54
- }
55
- function Zn(o) {
56
- const h = an(), [w, U] = R({
57
- width: 0,
58
- height: 0
59
- }), [k, wt] = R(!1), [$t, G] = R(!1), [et, B] = R(!1), [V, r] = R(null), [I, L] = R(null), [$, F] = R(null), [P, C] = R(""), [Z, dt] = R("sage"), [ut, nt] = R(!1), [_t, bt] = R(""), [Nt, ht] = R(null), [Gt, qt] = R("");
60
- let W, xt, Rt, Xt, Lt, Yt, vt = null, pt = null, m = null, ot = null;
61
- const Ot = x(() => o.controller.snapshot()), Ut = x(() => o.controller.loading?.() ?? !1), xe = x(() => o.controller.connectionState?.() ?? "idle"), Ce = x(() => o.controller.activeTopicID()), Y = x(() => o.controller.viewport()), lt = x(() => Ot().topics), ft = x(() => Ot().items), mt = x(() => Ot().trash_items), j = x(() => lt().find((t) => t.topic_id === Ce()) ?? lt()[0] ?? null), Ct = x(() => {
62
- const t = j();
63
- return t ? ft().filter((e) => e.topic_id === t.topic_id) : [];
64
- }), Zt = x(() => Je(mt())), Te = x(() => {
65
- const t = /* @__PURE__ */ new Map();
66
- for (const e of ft())
67
- t.set(e.topic_id, (t.get(e.topic_id) ?? 0) + 1);
68
- return t;
69
- }), Se = x(() => {
70
- const t = /* @__PURE__ */ new Map();
71
- for (const e of mt())
72
- t.set(e.topic_id, (t.get(e.topic_id) ?? 0) + 1);
73
- return t;
74
- }), ke = x(() => Qe(Ct())), Ee = x(() => {
75
- const t = ge(Y(), w().width || 1, w().height || 1);
76
- return tn(ke(), t);
77
- }), Bt = x(() => {
78
- const t = $();
79
- return t ? ft().find((e) => e.note_id === t) ?? null : null;
80
- });
81
- function Tt(t) {
82
- o.controller.setViewport(typeof t == "function" ? t(Y()) : t);
83
- }
84
- function jt() {
85
- vt != null && (window.clearTimeout(vt), vt = null), L(null);
86
- }
87
- function Me(t) {
88
- jt(), L(t), vt = window.setTimeout(() => {
89
- vt = null, L((e) => e === t ? null : e);
90
- }, 1500);
91
- }
92
- function Ie(t) {
93
- r(null);
94
- }
95
- function Jt() {
96
- const t = window.innerWidth < Yn;
97
- wt(t), G((e) => t ? e : !0);
98
- }
99
- function Qt(t) {
100
- F(t.note_id), C(t.body), dt(t.color_token), r(null), B(!1), queueMicrotask(() => Xt?.focus());
101
- }
102
- function it() {
103
- F(null);
104
- }
105
- async function te() {
106
- const t = Bt();
107
- if (t)
108
- try {
109
- await o.controller.updateNote(t.note_id, {
110
- body: P(),
111
- color_token: Z()
112
- }), it();
113
- } catch (e) {
114
- h.error("Save failed", e instanceof Error ? e.message : String(e));
115
- }
116
- }
117
- async function ee() {
118
- const t = _t().trim();
119
- if (t)
120
- try {
121
- const e = await o.controller.createTopic({
122
- name: t
123
- });
124
- o.controller.setActiveTopicID(e.topic_id), nt(!1), bt(""), k() && G(!1);
125
- } catch (e) {
126
- h.error("Topic failed", e instanceof Error ? e.message : String(e));
127
- }
128
- }
129
- async function ne(t) {
130
- const e = Gt().trim();
131
- if (ht(null), !(!e || e === t.name))
132
- try {
133
- await o.controller.updateTopic(t.topic_id, {
134
- name: e
135
- });
136
- } catch (l) {
137
- h.error("Rename failed", l instanceof Error ? l.message : String(l));
138
- }
139
- }
140
- async function Pe(t) {
141
- try {
142
- if (await o.controller.deleteTopic(t) === !1) return;
143
- it();
144
- } catch (e) {
145
- h.error("Delete failed", e instanceof Error ? e.message : String(e));
146
- }
147
- }
148
- async function oe(t, e, l, v) {
149
- const f = j();
150
- if (!f) {
151
- h.error("Topic required", "Create a topic first.");
152
- return;
153
- }
154
- try {
155
- const y = await o.controller.createNote({
156
- topic_id: f.topic_id,
157
- body: l,
158
- x: Math.round(t),
159
- y: Math.round(e)
160
- });
161
- v?.openEditor && Qt(y);
162
- } catch (y) {
163
- h.error("Note failed", y instanceof Error ? y.message : String(y));
164
- }
165
- }
166
- async function De(t, e) {
167
- let l = "";
168
- try {
169
- l = await navigator.clipboard.readText();
170
- } catch {
171
- h.error("Paste failed", "Clipboard permission denied.");
172
- return;
173
- }
174
- if (!String(l ?? "").trim()) {
175
- h.error("Clipboard empty", "Copy some text first.");
176
- return;
177
- }
178
- await oe(t, e, l, {
179
- openEditor: !1
180
- });
181
- }
182
- async function Ne(t) {
183
- Promise.resolve(o.controller.bringNoteToFront(t.note_id)).catch(() => {
184
- });
185
- try {
186
- await navigator.clipboard.writeText(t.body), Me(t.note_id);
187
- } catch {
188
- h.error("Copy failed", "Clipboard permission denied.");
189
- }
190
- }
191
- async function ie(t) {
192
- $() === t.note_id && it();
193
- try {
194
- await o.controller.deleteNote(t.note_id);
195
- } catch (e) {
196
- h.error("Delete failed", e instanceof Error ? e.message : String(e));
197
- }
198
- }
199
- async function Re(t) {
200
- try {
201
- const e = await o.controller.restoreNote(t.note_id);
202
- o.controller.setActiveTopicID(e.topic_id), k() && B(!1);
203
- } catch (e) {
204
- h.error("Restore failed", e instanceof Error ? e.message : String(e));
205
- }
206
- }
207
- async function Xe(t) {
208
- try {
209
- await o.controller.clearTrashTopic(t.topic_id);
210
- } catch (e) {
211
- h.error("Clear failed", e instanceof Error ? e.message : String(e));
212
- }
213
- }
214
- function Le(t, e) {
215
- const l = W?.getBoundingClientRect();
216
- return l ? on(Y(), {
217
- x: t - l.left,
218
- y: e - l.top
219
- }) : {
220
- x: 0,
221
- y: 0
222
- };
223
- }
224
- function zt(t, e, l) {
225
- const v = Le(t, e), f = j() ? 2 : 0, y = l ? f + 2 : Math.max(1, f), z = Bn(t, e, y);
226
- r({
227
- x: z.x,
228
- y: z.y,
229
- worldX: v.x,
230
- worldY: v.y,
231
- noteID: l
232
- }), B(!1);
233
- }
234
- function re(t, e) {
235
- if (t.button === 0 && !Kt(t.target) && (Ie(), m = {
236
- pointerId: t.pointerId,
237
- pointerType: t.pointerType || "mouse",
238
- noteID: e,
239
- startClientX: t.clientX,
240
- startClientY: t.clientY,
241
- startViewport: Y(),
242
- dragged: !1,
243
- contextOpened: !1,
244
- longPressTimer: null
245
- }, m.pointerType !== "mouse")) {
246
- const l = t.pointerId;
247
- m.longPressTimer = window.setTimeout(() => {
248
- !m || m.pointerId !== l || (m.contextOpened = !0, ve(() => zt(m.startClientX, m.startClientY, m.noteID)));
249
- }, Xn);
250
- }
251
- }
252
- function ae(t) {
253
- if (!m || m.pointerId !== t) return null;
254
- const e = m;
255
- return e.longPressTimer != null && window.clearTimeout(e.longPressTimer), m = null, e;
256
- }
257
- tt(() => {
258
- Jt();
259
- const t = () => Jt();
260
- window.addEventListener("resize", t), yt(() => window.removeEventListener("resize", t));
261
- }), tt(() => {
262
- W && (pt?.disconnect(), pt = new ResizeObserver((t) => {
263
- const e = t[0];
264
- e && U({
265
- width: Math.round(e.contentRect.width),
266
- height: Math.round(e.contentRect.height)
267
- });
268
- }), pt.observe(W), yt(() => {
269
- pt?.disconnect(), pt = null;
270
- }));
271
- }), tt(() => {
272
- o.open || (r(null), B(!1), it(), jt());
273
- }), tt(() => {
274
- const t = j();
275
- !t && lt().length > 0 && o.controller.setActiveTopicID(lt()[0].topic_id), t && Nt() && t.topic_id !== Nt() && ht(null);
276
- }), tt(() => {
277
- et() && mt().length === 0 && B(!1);
278
- }), tt(() => {
279
- if (!o.open) return;
280
- const t = (e) => {
281
- if (e.key === "Escape") {
282
- if (V()) {
283
- r(null);
284
- return;
285
- }
286
- if ($()) {
287
- it();
288
- return;
289
- }
290
- if (et()) {
291
- B(!1);
292
- return;
293
- }
294
- o.onClose();
295
- }
296
- };
297
- document.addEventListener("keydown", t), yt(() => document.removeEventListener("keydown", t));
298
- }), tt(() => {
299
- if (!o.open) return;
300
- const t = (v) => {
301
- if (!m || v.pointerId !== m.pointerId) return;
302
- const f = v.clientX - m.startClientX, y = v.clientY - m.startClientY;
303
- !m.dragged && Math.hypot(f, y) >= Ln && (m.dragged = !0, m.longPressTimer != null && (window.clearTimeout(m.longPressTimer), m.longPressTimer = null)), m.dragged && Tt({
304
- x: m.startViewport.x + f,
305
- y: m.startViewport.y + y,
306
- scale: m.startViewport.scale
307
- });
308
- }, e = (v) => {
309
- const f = ae(v.pointerId);
310
- if (!f || f.contextOpened || f.dragged || !f.noteID) return;
311
- const y = ft().find((z) => z.note_id === f.noteID);
312
- y && Ne(y);
313
- }, l = (v) => {
314
- ae(v.pointerId);
315
- };
316
- document.addEventListener("pointermove", t), document.addEventListener("pointerup", e), document.addEventListener("pointercancel", l), yt(() => {
317
- document.removeEventListener("pointermove", t), document.removeEventListener("pointerup", e), document.removeEventListener("pointercancel", l);
318
- });
319
- }), tt(() => {
320
- if (!o.open) return;
321
- const t = (e) => {
322
- const l = e.target instanceof HTMLElement ? e.target : null;
323
- V() && Rt && l && !Rt.contains(l) && r(null), et() && xt && l && !xt.contains(l) && (l.closest('[data-notes-trash-toggle="true"]') || B(!1));
324
- };
325
- document.addEventListener("pointerdown", t, !0), yt(() => document.removeEventListener("pointerdown", t, !0));
326
- });
327
- const Ye = x(() => {
328
- const t = V();
329
- if (!t) return [];
330
- const e = [], l = !!j();
331
- return e.push({
332
- id: "new",
333
- kind: "action",
334
- label: "New note",
335
- icon: We,
336
- disabled: !l,
337
- onSelect: () => {
338
- r(null), oe(t.worldX, t.worldY, "", {
339
- openEditor: !0
340
- });
341
- }
342
- }), e.push({
343
- id: "paste",
344
- kind: "action",
345
- label: "Paste here",
346
- icon: pe,
347
- disabled: !l,
348
- onSelect: () => {
349
- r(null), De(t.worldX, t.worldY);
350
- }
351
- }), t.noteID && (e.push({
352
- id: "sep-delete",
353
- kind: "separator"
354
- }), e.push({
355
- id: "delete",
356
- kind: "action",
357
- label: "Delete note",
358
- icon: Ft,
359
- destructive: !0,
360
- onSelect: () => {
361
- r(null);
362
- const v = ft().find((f) => f.note_id === t.noteID);
363
- v && ie(v);
364
- }
365
- })), e;
366
- });
367
- function Oe(t) {
368
- if (!W || t.target instanceof HTMLElement && Kt(t.target)) return;
369
- t.preventDefault();
370
- const e = W.getBoundingClientRect(), l = t.clientX - e.left, v = t.clientY - e.top, f = Math.exp(-t.deltaY * 15e-4);
371
- Tt((y) => ye(y, y.scale * f, l, v));
372
- }
373
- function Be(t) {
374
- if (t.touches.length < 2) {
375
- ot = null;
376
- return;
377
- }
378
- t.preventDefault();
379
- const e = $e(t.touches);
380
- ot = {
381
- startDistance: we(t.touches),
382
- startScale: Y().scale,
383
- midpointX: e.x,
384
- midpointY: e.y
385
- };
386
- }
387
- function ze(t) {
388
- if (!ot || t.touches.length < 2 || !W) return;
389
- t.preventDefault();
390
- const e = we(t.touches);
391
- if (!e || !ot.startDistance) return;
392
- const l = $e(t.touches), v = W.getBoundingClientRect(), f = l.x - v.left, y = l.y - v.top, z = ot.startScale * (e / ot.startDistance);
393
- Tt((H) => ye(H, z, f, y));
394
- }
395
- function se(t) {
396
- t.touches.length < 2 && (ot = null);
397
- }
398
- const At = x(() => {
399
- const t = Bt(), e = W?.getBoundingClientRect();
400
- if (!t || !e) return {
401
- left: 32,
402
- top: 32
403
- };
404
- const l = Dt(t.size_bucket), v = nn(Y(), {
405
- x: t.x,
406
- y: t.y
407
- }), f = l.width * Y().scale, y = e.left + v.x + f + 18, z = e.top + v.y, H = Math.min(320, Math.max(280, e.width * 0.32));
408
- let b = y;
409
- b + H > window.innerWidth - 16 && (b = e.left + v.x - H - 18), b = Math.max(16, Math.min(b, window.innerWidth - H - 16));
410
- const St = Math.max(16, Math.min(z, window.innerHeight - 320));
411
- return {
412
- left: b,
413
- top: St,
414
- width: H
415
- };
416
- }), Ae = x(() => ge(Y(), w().width || 1, w().height || 1));
417
- function Ve(t, e) {
418
- const l = ve(w);
419
- Tt((v) => rn(v, t, e, l.width || 1, l.height || 1));
420
- }
421
- return c(M, {
39
+ function ie(l) {
40
+ const e = E(l);
41
+ let d;
42
+ const i = () => H(l.interactionMode);
43
+ return O({
44
+ open: () => l.open,
45
+ root: () => d,
46
+ onClose: () => e.handleCloseRequest(),
47
+ lockBodyScroll: i().lockBodyScroll,
48
+ trapFocus: i().trapFocus,
49
+ closeOnEscape: i().closeOnEscape,
50
+ blockHotkeys: !0,
51
+ blockWheel: i().blockWheel,
52
+ blockTouchMove: i().blockTouchMove,
53
+ autoFocus: i().autoFocus,
54
+ restoreFocus: !0
55
+ }), o(s, {
422
56
  get when() {
423
- return o.open;
57
+ return l.open;
424
58
  },
425
59
  get children() {
426
- var t = wn(), e = t.firstChild, l = e.nextSibling, v = l.firstChild, f = v.firstChild, y = f.firstChild, z = f.nextSibling, H = v.nextSibling, b = l.nextSibling, St = b.firstChild, kt = St.firstChild, le = kt.nextSibling, Et = St.nextSibling;
427
- t.$$contextmenu = (n) => n.preventDefault(), f.$$click = () => {
428
- k() && G((n) => !n);
429
- }, a(f, c(Ze, {
430
- class: "h-4 w-4"
431
- }), y), z.$$click = () => {
432
- nt(!0), ht(null), queueMicrotask(() => Lt?.focus());
433
- }, a(z, c(He, {
434
- class: "h-3.5 w-3.5"
435
- })), a(l, c(M, {
436
- get when() {
437
- return ut();
60
+ return o(f.section, {
61
+ ref(t) {
62
+ var n = d;
63
+ typeof n == "function" ? n(t) : d = t;
438
64
  },
439
- get children() {
440
- var n = sn(), i = n.firstChild, u = i.nextSibling, _ = u.firstChild, D = _.nextSibling;
441
- i.$$keydown = (N) => {
442
- N.key === "Enter" && (N.preventDefault(), ee()), N.key === "Escape" && (nt(!1), bt(""));
443
- }, i.$$input = (N) => bt(N.currentTarget.value);
444
- var T = Lt;
445
- return typeof T == "function" ? Mt(T, i) : Lt = i, _.$$click = () => {
446
- ee();
447
- }, D.$$click = () => {
448
- nt(!1), bt("");
449
- }, X(() => i.value = _t()), n;
450
- }
451
- }), H), a(H, c(ct, {
452
- get each() {
453
- return lt();
65
+ class: "notes-overlay",
66
+ role: "dialog",
67
+ get "aria-modal"() {
68
+ return i().ariaModal;
454
69
  },
455
- children: (n) => {
456
- const i = Te().get(n.topic_id) ?? 0, u = Se().get(n.topic_id) ?? 0, _ = () => j()?.topic_id === n.topic_id, D = () => Nt() === n.topic_id;
457
- return (() => {
458
- var T = xn(), N = T.firstChild, rt = N.nextSibling, K = rt.firstChild, O = K.firstChild, at = rt.nextSibling, s = at.firstChild, J = s.nextSibling;
459
- return T.$$keydown = (d) => {
460
- (d.key === "Enter" || d.key === " ") && (d.preventDefault(), o.controller.setActiveTopicID(n.topic_id), k() && G(!1));
461
- }, T.$$click = () => {
462
- o.controller.setActiveTopicID(n.topic_id), k() && G(!1);
463
- }, a(N, c(Ht, {
464
- get iconKey() {
465
- return n.icon_key;
466
- },
467
- class: "h-4.5 w-4.5"
468
- })), a(rt, c(M, {
469
- get when() {
470
- return D();
471
- },
472
- get fallback() {
473
- return (() => {
474
- var d = Cn();
475
- return a(d, () => n.name), d;
476
- })();
477
- },
478
- get children() {
479
- var d = $n();
480
- d.$$keydown = (E) => {
481
- E.key === "Enter" && (E.preventDefault(), ne(n)), E.key === "Escape" && ht(null);
482
- }, d.addEventListener("blur", () => {
483
- ne(n);
484
- }), d.$$input = (E) => qt(E.currentTarget.value), d.$$click = (E) => E.stopPropagation();
485
- var A = Yt;
486
- return typeof A == "function" ? Mt(A, d) : Yt = d, X(() => d.value = Gt()), d;
487
- }
488
- }), K), a(O, i), a(K, c(M, {
489
- when: u > 0,
490
- get children() {
491
- var d = bn();
492
- return a(d, u), d;
493
- }
494
- }), null), s.$$click = (d) => {
495
- d.stopPropagation(), ht(n.topic_id), qt(n.name), queueMicrotask(() => Yt?.focus());
496
- }, a(s, c(fe, {
497
- class: "h-3.5 w-3.5"
498
- })), J.$$click = (d) => {
499
- d.stopPropagation(), Pe(n.topic_id);
500
- }, a(J, c(Ft, {
501
- class: "h-3.5 w-3.5"
502
- })), X((d) => {
503
- var A = Pt("notes-overlay__topic-row", _() && "is-active"), E = _() ? "true" : void 0, st = n.icon_accent, S = `Rename ${n.name}`, Q = `Delete ${n.name}`;
504
- return A !== d.e && It(T, d.e = A), E !== d.t && g(T, "aria-current", d.t = E), st !== d.a && g(N, "data-accent", d.a = st), S !== d.o && g(s, "aria-label", d.o = S), Q !== d.i && g(J, "aria-label", d.i = Q), d;
505
- }, {
506
- e: void 0,
507
- t: void 0,
508
- a: void 0,
509
- o: void 0,
510
- i: void 0
511
- }), T;
512
- })();
513
- }
514
- }), null), a(H, c(M, {
515
- get when() {
516
- return he(() => !lt().length)() && !ut();
517
- },
518
- get children() {
519
- return ln();
520
- }
521
- }), null), b.addEventListener("touchcancel", se), b.$$touchend = se, b.$$touchmove = ze, b.$$touchstart = Be, b.$$pointerdown = (n) => re(n, null), b.$$contextmenu = (n) => {
522
- n.preventDefault(), !Kt(n.target) && zt(n.clientX, n.clientY, null);
523
- }, b.addEventListener("wheel", Oe);
524
- var ce = W;
525
- return typeof ce == "function" ? Mt(ce, b) : W = b, kt.$$click = () => {
526
- k() && G((n) => !n);
527
- }, a(kt, c(M, {
528
- get when() {
529
- return j();
530
- },
531
- get fallback() {
532
- return Tn();
533
- },
534
- children: (n) => [(() => {
535
- var i = Sn();
536
- return a(i, c(Ht, {
537
- get iconKey() {
538
- return n().icon_key;
539
- },
540
- class: "h-4.5 w-4.5"
541
- })), X(() => g(i, "data-accent", n().icon_accent)), i;
542
- })(), (() => {
543
- var i = kn(), u = i.firstChild, _ = u.nextSibling, D = _.firstChild;
544
- return a(u, () => n().name), a(_, () => Math.round(Y().scale * 100), D), X(() => g(_, "data-state", xe())), i;
545
- })()]
546
- })), le.$$click = () => o.onClose(), a(le, c(Wt, {
547
- class: "h-4 w-4"
548
- })), a(b, c(M, {
549
- get when() {
550
- return Ut();
551
- },
552
- get children() {
553
- return cn();
554
- }
555
- }), Et), a(Et, c(ct, {
556
- get each() {
557
- return Ct();
70
+ "aria-label": "Notes overlay",
71
+ get "data-notes-interaction-mode"() {
72
+ return i().mode;
558
73
  },
559
- children: (n) => {
560
- const i = Dt(n.size_bucket), u = () => I() === n.note_id;
561
- return (() => {
562
- var _ = Mn(), D = _.firstChild, T = D.firstChild, N = T.firstChild, rt = N.nextSibling, K = rt.firstChild, O = K.nextSibling, at = T.nextSibling;
563
- return _.$$contextmenu = (s) => {
564
- s.preventDefault(), s.stopPropagation(), zt(s.clientX, s.clientY, n.note_id);
565
- }, _.$$pointerdown = (s) => {
566
- s.stopPropagation(), re(s, n.note_id);
567
- }, a(N, () => n.character_count || 0), K.$$click = (s) => {
568
- s.stopPropagation(), Qt(n);
569
- }, K.$$pointerdown = (s) => s.stopPropagation(), a(K, c(fe, {
570
- class: "h-3.5 w-3.5"
571
- })), O.$$click = (s) => {
572
- s.stopPropagation(), ie(n);
573
- }, O.$$pointerdown = (s) => s.stopPropagation(), a(O, c(Ft, {
574
- class: "h-3.5 w-3.5"
575
- })), a(at, () => be(n)), a(D, c(M, {
576
- get when() {
577
- return u();
578
- },
579
- get children() {
580
- return c(Vt.div, {
581
- class: "notes-note__copied",
582
- initial: {
583
- opacity: 0,
584
- scale: 0.88
585
- },
586
- animate: {
587
- opacity: 1,
588
- scale: 1
589
- },
590
- transition: {
591
- duration: 0.18,
592
- easing: "ease-out"
593
- },
594
- get children() {
595
- return [c(Ke, {
596
- class: "h-5 w-5"
597
- }), En()];
598
- }
599
- });
600
- }
601
- }), null), X((s) => {
602
- var J = Pt("notes-note", u() && "is-copied"), d = n.color_token, A = String(n.size_bucket), E = `${i.width}px`, st = `${i.height}px`, S = `translate3d(${n.x}px, ${n.y}px, 0)`, Q = String(n.z_index), gt = String(i.preview_lines);
603
- return J !== s.e && It(_, s.e = J), d !== s.t && g(_, "data-color", s.t = d), A !== s.a && g(_, "data-size", s.a = A), E !== s.o && q(_, "width", s.o = E), st !== s.i && q(_, "height", s.i = st), S !== s.n && q(_, "transform", s.n = S), Q !== s.s && q(_, "z-index", s.s = Q), gt !== s.h && q(_, "--notes-preview-lines", s.h = gt), s;
604
- }, {
605
- e: void 0,
606
- t: void 0,
607
- a: void 0,
608
- o: void 0,
609
- i: void 0,
610
- n: void 0,
611
- s: void 0,
612
- h: void 0
613
- }), _;
614
- })();
615
- }
616
- }), null), a(Et, c(M, {
617
- get when() {
618
- return he(() => !!(j() && !Ct().length))() && !Ut();
74
+ tabIndex: -1,
75
+ initial: {
76
+ opacity: 0
619
77
  },
620
- get children() {
621
- return dn();
622
- }
623
- }), null), a(b, c(zn, {
624
- bounds: Ee,
625
- items: Ct,
626
- viewportRect: Ae,
627
- onFocusPoint: Ve
628
- }), null), a(b, c(M, {
629
- get when() {
630
- return !et();
78
+ animate: {
79
+ opacity: 1
631
80
  },
632
- get children() {
633
- var n = _n();
634
- return n.$$click = () => {
635
- B(!0), r(null);
636
- }, a(n, c(me, {
637
- class: "h-8 w-8"
638
- }), null), a(n, c(M, {
639
- get when() {
640
- return mt().length > 0;
641
- },
642
- get children() {
643
- var i = un();
644
- return a(i, () => mt().length), i;
645
- }
646
- }), null), n;
647
- }
648
- }), null), a(b, c(M, {
649
- get when() {
650
- return et();
81
+ get transition() {
82
+ return {
83
+ duration: _.fast
84
+ };
651
85
  },
652
86
  get children() {
653
- return c(Vt.div, {
654
- ref(n) {
655
- var i = xt;
656
- typeof i == "function" ? i(n) : xt = n;
657
- },
658
- class: "notes-trash",
659
- "data-notes-interactive": "true",
87
+ return [o(f.div, {
88
+ class: "notes-overlay__frame",
660
89
  initial: {
661
90
  opacity: 0,
662
- y: 12,
663
- scale: 0.98
91
+ y: 18,
92
+ scale: 0.986
664
93
  },
665
94
  animate: {
666
95
  opacity: 1,
667
96
  y: 0,
668
97
  scale: 1
669
98
  },
670
- transition: {
671
- duration: 0.18,
672
- easing: "ease-out"
99
+ get transition() {
100
+ return {
101
+ duration: _.normal,
102
+ easing: k.easeOut
103
+ };
673
104
  },
674
105
  get children() {
675
106
  return [(() => {
676
- var n = hn(), i = n.firstChild, u = i.nextSibling;
677
- return a(i, c(me, {
678
- class: "h-5 w-5"
679
- })), u.$$click = () => B(!1), a(u, c(Wt, {
680
- class: "h-4 w-4"
681
- })), n;
107
+ var t = Z(), n = t.firstChild, r = n.firstChild, v = r.nextSibling, g = v.nextSibling, C = g.firstChild, u = g.nextSibling, y = u.firstChild, m = u.nextSibling, w = m.firstChild, M = n.nextSibling, b = M.firstChild;
108
+ return a(g, () => e.header.topicCount(), C), a(u, () => e.header.totalLiveNotes(), y), a(u, () => e.header.totalLiveNotes() === 1 ? "" : "s", null), a(m, () => e.header.trashCount(), w), b.$$click = () => e.handleCloseRequest(), a(b, o(x, {
109
+ class: "w-4 h-4"
110
+ })), t;
682
111
  })(), (() => {
683
- var n = pn();
684
- return a(n, c(ct, {
685
- get each() {
686
- return Zt();
687
- },
688
- children: (i) => (() => {
689
- var u = In(), _ = u.firstChild, D = _.firstChild, T = D.firstChild, N = T.nextSibling, rt = D.nextSibling, K = _.nextSibling;
690
- return a(T, c(Ht, {
691
- get iconKey() {
692
- return i.topic_icon_key;
112
+ var t = W(), n = t.firstChild;
113
+ return a(t, o(L, {
114
+ get topics() {
115
+ return e.rail.topics();
116
+ },
117
+ get activeTopicID() {
118
+ return e.rail.activeTopicID();
119
+ },
120
+ get draftTopicTitle() {
121
+ return e.rail.draftTopicTitle();
122
+ },
123
+ get renamingTopicID() {
124
+ return e.rail.renamingTopicID();
125
+ },
126
+ get renamingTopicTitle() {
127
+ return e.rail.renamingTopicTitle();
128
+ },
129
+ get getLiveNoteCount() {
130
+ return e.rail.getLiveNoteCount;
131
+ },
132
+ get onDraftTopicTitleChange() {
133
+ return e.rail.setDraftTopicTitle;
134
+ },
135
+ onSubmitTopic: () => {
136
+ e.rail.submitTopic();
137
+ },
138
+ get onSelectTopic() {
139
+ return e.rail.selectTopic;
140
+ },
141
+ get onStartRename() {
142
+ return e.rail.startTopicRename;
143
+ },
144
+ get onRenamingTopicTitleChange() {
145
+ return e.rail.setRenamingTopicTitle;
146
+ },
147
+ onSaveRename: () => {
148
+ e.rail.saveTopicRename();
149
+ },
150
+ get onCancelRename() {
151
+ return e.rail.cancelTopicRename;
152
+ },
153
+ onDeleteTopic: (r) => {
154
+ e.rail.deleteTopic(r);
155
+ }
156
+ }), n), a(t, o(D, {
157
+ get activeTopic() {
158
+ return e.board.activeTopic();
159
+ },
160
+ get activeTopicLabel() {
161
+ return e.board.activeTopicLabel();
162
+ },
163
+ get activeItems() {
164
+ return e.board.activeItems();
165
+ },
166
+ get activeTopicID() {
167
+ return e.board.activeTopicID();
168
+ },
169
+ get topics() {
170
+ return e.board.topics();
171
+ },
172
+ get topZIndex() {
173
+ return e.board.topZIndex();
174
+ },
175
+ get viewport() {
176
+ return e.board.viewport();
177
+ },
178
+ get boardScaleLabel() {
179
+ return e.board.boardScaleLabel();
180
+ },
181
+ get isMobile() {
182
+ return e.board.isMobile();
183
+ },
184
+ get overviewOpen() {
185
+ return e.board.overviewOpen();
186
+ },
187
+ get optimisticFrontNoteID() {
188
+ return e.board.optimisticFrontNoteID();
189
+ },
190
+ get copiedNoteID() {
191
+ return e.board.copiedNoteID();
192
+ },
193
+ get setCanvasFrameRef() {
194
+ return e.board.setCanvasFrameRef;
195
+ },
196
+ get onViewportCommit() {
197
+ return e.board.commitViewport;
198
+ },
199
+ get onCanvasContextMenu() {
200
+ return e.board.openCanvasContextMenu;
201
+ },
202
+ get onZoomOut() {
203
+ return e.board.zoomOut;
204
+ },
205
+ get onZoomIn() {
206
+ return e.board.zoomIn;
207
+ },
208
+ get onOpenOverview() {
209
+ return e.board.openOverview;
210
+ },
211
+ get onSelectTopic() {
212
+ return e.board.selectTopic;
213
+ },
214
+ onMobileCreateNote: () => {
215
+ e.board.mobileCreateNote();
216
+ },
217
+ onMobilePaste: () => {
218
+ e.board.mobilePaste();
219
+ },
220
+ onCopyNote: (r) => {
221
+ e.board.copyNote(r);
222
+ },
223
+ get onOpenNoteContextMenu() {
224
+ return e.board.openNoteContextMenu;
225
+ },
226
+ get onOpenEditor() {
227
+ return e.board.openEditor;
228
+ },
229
+ onMoveToTrash: (r) => {
230
+ e.board.moveToTrash(r);
231
+ },
232
+ get onStartOptimisticFront() {
233
+ return e.board.startOptimisticFront;
234
+ },
235
+ get onCommitFront() {
236
+ return e.board.commitFront;
237
+ },
238
+ get onCommitMove() {
239
+ return e.board.commitMove;
240
+ }
241
+ }), n), a(t, o(s, {
242
+ get when() {
243
+ return !e.board.isMobile();
244
+ },
245
+ get children() {
246
+ return o(T, {
247
+ mode: "desktop",
248
+ get items() {
249
+ return e.overview.items();
250
+ },
251
+ get boardScaleLabel() {
252
+ return e.board.boardScaleLabel();
253
+ },
254
+ get viewportStyle() {
255
+ return e.overview.viewportStyle();
256
+ },
257
+ get navigationState() {
258
+ return e.overview.navigationState();
693
259
  },
694
- class: "h-4.5 w-4.5"
695
- })), a(N, () => i.topic_name), rt.$$click = () => {
696
- Xe(i);
697
- }, a(K, c(ct, {
698
- get each() {
699
- return i.items;
260
+ get onPointerDown() {
261
+ return e.overview.beginNavigation;
700
262
  },
701
- children: (O) => {
702
- const at = Dt(O.size_bucket);
703
- return (() => {
704
- var s = Pn(), J = s.firstChild, d = J.firstChild, A = d.firstChild, E = A.nextSibling, st = d.nextSibling;
705
- return a(A, () => On(O.deleted_at_unix_ms)), E.$$click = () => {
706
- Re(O);
707
- }, a(E, c(pe, {
708
- class: "h-3.5 w-3.5"
709
- })), a(st, () => be(O)), X((S) => {
710
- var Q = O.color_token, gt = String(O.size_bucket), de = `${at.width}px`, ue = `${at.height}px`, _e = String(at.preview_lines);
711
- return Q !== S.e && g(s, "data-color", S.e = Q), gt !== S.t && g(s, "data-size", S.t = gt), de !== S.a && q(s, "width", S.a = de), ue !== S.o && q(s, "height", S.o = ue), _e !== S.i && q(s, "--notes-preview-lines", S.i = _e), S;
712
- }, {
713
- e: void 0,
714
- t: void 0,
715
- a: void 0,
716
- o: void 0,
717
- i: void 0
718
- }), s;
719
- })();
263
+ get onZoomOut() {
264
+ return e.board.zoomOut;
265
+ },
266
+ get onZoomIn() {
267
+ return e.board.zoomIn;
720
268
  }
721
- })), X(() => g(T, "data-accent", i.topic_icon_accent)), u;
722
- })()
723
- }), null), a(n, c(M, {
269
+ });
270
+ }
271
+ }), n), a(n, o(s, {
724
272
  get when() {
725
- return !Zt().length;
273
+ return !e.trash.open();
726
274
  },
727
275
  get children() {
728
- return vn();
276
+ var r = z(), v = r.firstChild;
277
+ return p(r, "click", e.trash.openDock, !0), a(v, o(P, {
278
+ class: "notes-trash__toggle-icon"
279
+ })), h(() => N(r, "aria-label", `Open trash dock${e.trash.count() > 0 ? `, ${e.trash.count()} items` : ""}`)), r;
729
280
  }
730
- }), null), n;
281
+ })), h(() => n.classList.toggle("is-open", !!e.trash.open())), t;
731
282
  })()];
732
283
  }
733
- });
734
- }
735
- }), null), a(t, c(M, {
736
- get when() {
737
- return V();
738
- },
739
- get children() {
740
- return c(Ge, {
741
- get x() {
742
- return V().x;
284
+ }), o(s, {
285
+ get when() {
286
+ return S(() => !!e.board.isMobile())() && e.board.overviewOpen();
743
287
  },
744
- get y() {
745
- return V().y;
288
+ get children() {
289
+ return [(() => {
290
+ var t = q();
291
+ return p(t, "click", e.overview.close, !0), t;
292
+ })(), (() => {
293
+ var t = V();
294
+ return a(t, o(T, {
295
+ mode: "mobile",
296
+ get items() {
297
+ return e.overview.items();
298
+ },
299
+ get boardScaleLabel() {
300
+ return e.board.boardScaleLabel();
301
+ },
302
+ get viewportStyle() {
303
+ return e.overview.viewportStyle();
304
+ },
305
+ get navigationState() {
306
+ return e.overview.navigationState();
307
+ },
308
+ get onPointerDown() {
309
+ return e.overview.beginNavigation;
310
+ },
311
+ get onZoomOut() {
312
+ return e.board.zoomOut;
313
+ },
314
+ get onZoomIn() {
315
+ return e.board.zoomIn;
316
+ },
317
+ get onClose() {
318
+ return e.overview.close;
319
+ }
320
+ })), t;
321
+ })()];
322
+ }
323
+ }), o(B, {
324
+ get open() {
325
+ return e.trash.open();
746
326
  },
747
- get items() {
748
- return Ye();
327
+ get groups() {
328
+ return e.trash.groups();
749
329
  },
750
- menuRef: (n) => {
751
- Rt = n;
752
- }
753
- });
754
- }
755
- }), null), a(t, c(M, {
756
- get when() {
757
- return Bt();
758
- },
759
- get children() {
760
- return c(Vt.div, {
761
- class: "notes-editor",
762
- "data-notes-interactive": "true",
763
- initial: {
764
- opacity: 0,
765
- y: 14,
766
- scale: 0.98
330
+ get now() {
331
+ return e.trash.now();
767
332
  },
768
- animate: {
769
- opacity: 1,
770
- y: 0,
771
- scale: 1
333
+ get canDeleteNow() {
334
+ return e.trash.canDeleteNow;
772
335
  },
773
- transition: {
774
- duration: 0.18,
775
- easing: "ease-out"
336
+ get onClose() {
337
+ return e.trash.close;
776
338
  },
777
- get style() {
778
- return {
779
- left: `${At().left}px`,
780
- top: `${At().top}px`,
781
- width: `${At().width}px`
782
- };
339
+ get onBackdropContextMenu() {
340
+ return e.trash.backdropContextMenu;
341
+ },
342
+ onRestore: (t) => {
343
+ e.trash.restore(t);
344
+ },
345
+ onDeleteNow: (t) => {
346
+ e.trash.deleteNow(t);
347
+ },
348
+ onClearTopicTrash: (t) => {
349
+ e.trash.clearTopic(t);
350
+ }
351
+ }), o(s, {
352
+ get when() {
353
+ return e.contextMenu.state();
783
354
  },
784
355
  get children() {
785
356
  return [(() => {
786
- var n = fn(), i = n.firstChild, u = i.nextSibling;
787
- return u.$$click = it, a(u, c(Wt, {
788
- class: "h-4 w-4"
789
- })), n;
790
- })(), (() => {
791
- var n = mn();
792
- return a(n, c(ct, {
793
- each: en,
794
- children: (i) => (() => {
795
- var u = Dn();
796
- return u.$$click = () => dt(i), g(u, "data-color", i), X((_) => {
797
- var D = Pt("notes-editor__color", Z() === i && "is-active"), T = `Use ${je[i]}`;
798
- return D !== _.e && It(u, _.e = D), T !== _.t && g(u, "aria-label", _.t = T), _;
799
- }, {
800
- e: void 0,
801
- t: void 0
802
- }), u;
803
- })()
804
- })), n;
805
- })(), (() => {
806
- var n = gn();
807
- n.$$keydown = (u) => {
808
- (u.metaKey || u.ctrlKey) && u.key === "Enter" && (u.preventDefault(), te());
809
- }, n.$$input = (u) => C(u.currentTarget.value);
810
- var i = Xt;
811
- return typeof i == "function" ? Mt(i, n) : Xt = n, g(n, "spellcheck", !1), X(() => n.value = P()), n;
812
- })(), (() => {
813
- var n = yn(), i = n.firstChild, u = i.nextSibling;
814
- return i.$$click = () => {
815
- te();
816
- }, u.$$click = it, n;
817
- })()];
357
+ var t = A();
358
+ return p(t, "click", e.contextMenu.close, !0), t;
359
+ })(), o(I, {
360
+ get x() {
361
+ return e.contextMenu.position()?.left ?? 0;
362
+ },
363
+ get y() {
364
+ return e.contextMenu.position()?.top ?? 0;
365
+ },
366
+ get items() {
367
+ return e.contextMenu.items();
368
+ }
369
+ })];
818
370
  }
819
- });
371
+ }), o(s, {
372
+ get when() {
373
+ return !!e.editor.note();
374
+ },
375
+ get children() {
376
+ return o(F, {
377
+ get note() {
378
+ return e.editor.note();
379
+ },
380
+ get draftBody() {
381
+ return e.editor.draftBody();
382
+ },
383
+ get draftColor() {
384
+ return e.editor.draftColor();
385
+ },
386
+ get onDraftBodyChange() {
387
+ return e.editor.setDraftBody;
388
+ },
389
+ get onDraftColorChange() {
390
+ return e.editor.setDraftColor;
391
+ },
392
+ get onClose() {
393
+ return e.editor.close;
394
+ },
395
+ onSave: () => {
396
+ e.editor.save();
397
+ }
398
+ });
399
+ }
400
+ }), o(R, {
401
+ get open() {
402
+ return e.manualPaste.open();
403
+ },
404
+ get text() {
405
+ return e.manualPaste.text();
406
+ },
407
+ get onTextChange() {
408
+ return e.manualPaste.setText;
409
+ },
410
+ get onClose() {
411
+ return e.manualPaste.close;
412
+ },
413
+ onConfirm: () => {
414
+ e.manualPaste.confirm();
415
+ }
416
+ })];
820
417
  }
821
- }), null), X((n) => {
822
- var i = Pt("notes-overlay__rail", $t() ? "is-open" : "is-closed"), u = k() ? "Open topics" : "Active topic", _ = `translate3d(${Y().x}px, ${Y().y}px, 0) scale(${Y().scale})`;
823
- return i !== n.e && It(l, n.e = i), u !== n.t && g(kt, "aria-label", n.t = u), _ !== n.a && q(Et, "transform", n.a = _), n;
824
- }, {
825
- e: void 0,
826
- t: void 0,
827
- a: void 0
828
- }), t;
418
+ });
829
419
  }
830
420
  });
831
421
  }
832
- function zn(o) {
833
- let U = null;
834
- const k = x(() => {
835
- const r = o.bounds();
836
- return Math.min(170 / Math.max(1, r.maxX - r.minX), 118 / Math.max(1, r.maxY - r.minY));
837
- });
838
- function wt(r) {
839
- return (r - o.bounds().minX) * k();
840
- }
841
- function $t(r) {
842
- return (r - o.bounds().minY) * k();
843
- }
844
- function G(r, I, L) {
845
- const $ = Math.max(0, Math.min(170, r - L.left)), F = Math.max(0, Math.min(118, I - L.top)), P = o.bounds().minX + $ / k(), C = o.bounds().minY + F / k();
846
- o.onFocusPoint(P, C);
847
- }
848
- function et(r) {
849
- if (r.button !== 0) return;
850
- r.preventDefault();
851
- const I = r.currentTarget;
852
- U = r.pointerId, I.setPointerCapture(r.pointerId), G(r.clientX, r.clientY, I.getBoundingClientRect());
853
- }
854
- function B(r) {
855
- if (U !== r.pointerId) return;
856
- r.preventDefault();
857
- const I = r.currentTarget;
858
- G(r.clientX, r.clientY, I.getBoundingClientRect());
859
- }
860
- function V(r) {
861
- if (U !== r.pointerId) return;
862
- const I = r.currentTarget;
863
- I.hasPointerCapture(r.pointerId) && I.releasePointerCapture(r.pointerId), U = null;
864
- }
865
- return (() => {
866
- var r = Nn(), I = r.firstChild, L = I.firstChild;
867
- return r.addEventListener("lostpointercapture", V), r.addEventListener("pointercancel", V), r.$$pointerup = V, r.$$pointermove = B, r.$$pointerdown = et, a(I, c(ct, {
868
- get each() {
869
- return o.items();
870
- },
871
- children: ($) => {
872
- const F = Dt($.size_bucket);
873
- return (() => {
874
- var P = Rn();
875
- return X((C) => {
876
- var Z = $.color_token, dt = wt($.x), ut = $t($.y), nt = Math.max(7, F.width * k()), _t = Math.max(5, F.height * k());
877
- return Z !== C.e && g(P, "data-color", C.e = Z), dt !== C.t && g(P, "x", C.t = dt), ut !== C.a && g(P, "y", C.a = ut), nt !== C.o && g(P, "width", C.o = nt), _t !== C.i && g(P, "height", C.i = _t), C;
878
- }, {
879
- e: void 0,
880
- t: void 0,
881
- a: void 0,
882
- o: void 0,
883
- i: void 0
884
- }), P;
885
- })();
886
- }
887
- }), L), X(($) => {
888
- var F = wt(o.viewportRect().minX), P = $t(o.viewportRect().minY), C = Math.max(22, (o.viewportRect().maxX - o.viewportRect().minX) * k()), Z = Math.max(18, (o.viewportRect().maxY - o.viewportRect().minY) * k());
889
- return F !== $.e && g(L, "x", $.e = F), P !== $.t && g(L, "y", $.t = P), C !== $.a && g(L, "width", $.a = C), Z !== $.o && g(L, "height", $.o = Z), $;
890
- }, {
891
- e: void 0,
892
- t: void 0,
893
- a: void 0,
894
- o: void 0
895
- }), r;
896
- })();
897
- }
898
- Fe(["contextmenu", "click", "input", "keydown", "pointerdown", "touchstart", "touchmove", "touchend", "pointermove", "pointerup"]);
422
+ $(["click"]);
899
423
  export {
900
- Zn as NotesOverlay
424
+ ie as NotesOverlay
901
425
  };