@floegence/floe-webapp-core 0.35.57 → 0.35.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,41 +1,38 @@
|
|
|
1
|
-
import { createComponent as n, insert as
|
|
2
|
-
import {
|
|
3
|
-
import { Motion as
|
|
4
|
-
import { easing as
|
|
5
|
-
import { useOverlayMask as
|
|
6
|
-
import { X as
|
|
7
|
-
import { useResolvedFloeConfig as
|
|
8
|
-
import { NotesBoard as
|
|
9
|
-
import { NotesContextMenu as
|
|
10
|
-
import { NotesEditorFlyout as
|
|
11
|
-
import { NotesOverviewPanel as
|
|
12
|
-
import { NotesTopicRail as
|
|
13
|
-
import { NotesTrashFlyout as
|
|
14
|
-
import { NotesTrashCanIcon as
|
|
15
|
-
import { useNotesOverlayModel as
|
|
16
|
-
var
|
|
17
|
-
const
|
|
18
|
-
function
|
|
19
|
-
return typeof Element < "u" &&
|
|
1
|
+
import { createComponent as n, insert as l, addEventListener as v, effect as C, setAttribute as F, Portal as d, memo as P, template as c, delegateEvents as L } from "solid-js/web";
|
|
2
|
+
import { createMemo as R, createEffect as f, onCleanup as _, Show as s } from "solid-js";
|
|
3
|
+
import { Motion as w } 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 B, duration as k } from "../../utils/animations.js";
|
|
5
|
+
import { useOverlayMask as K } from "../../hooks/useOverlayMask.js";
|
|
6
|
+
import { X as Z } from "../icons/index.js";
|
|
7
|
+
import { useResolvedFloeConfig as z } from "../../context/FloeConfigContext.js";
|
|
8
|
+
import { NotesBoard as H } from "./NotesBoard.js";
|
|
9
|
+
import { NotesContextMenu as A } from "./NotesContextMenu.js";
|
|
10
|
+
import { NotesEditorFlyout as W, NotesManualPasteFlyout as q } from "./NotesEditorFlyout.js";
|
|
11
|
+
import { NotesOverviewPanel as N } from "./NotesOverviewPanel.js";
|
|
12
|
+
import { NotesTopicRail as G } from "./NotesTopicRail.js";
|
|
13
|
+
import { NotesTrashFlyout as j } from "./NotesTrashFlyout.js";
|
|
14
|
+
import { NotesTrashCanIcon as V } from "./notesAppearance.js";
|
|
15
|
+
import { useNotesOverlayModel as Y } from "./useNotesOverlayModel.js";
|
|
16
|
+
var U = /* @__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>'), X = /* @__PURE__ */ c("<button type=button class=notes-trash__toggle><div class=notes-trash__toggle-mark>"), J = /* @__PURE__ */ c("<div class=notes-overlay__body><div class=notes-trash data-floe-canvas-interactive=true>"), Q = /* @__PURE__ */ c("<div class=notes-overview-backdrop data-floe-notes-boundary=true>"), ee = /* @__PURE__ */ c("<div class=notes-overview-flyout data-floe-notes-boundary=true>"), te = /* @__PURE__ */ c("<div class=notes-menu-backdrop data-floe-notes-boundary=true>");
|
|
17
|
+
const oe = '[data-floe-notes-boundary="true"]', re = 'input, textarea, select, [contenteditable=""], [contenteditable="true"], [contenteditable="plaintext-only"], [role="textbox"]';
|
|
18
|
+
function D(r) {
|
|
19
|
+
return typeof Element < "u" && r instanceof Element ? r : typeof Node < "u" && r instanceof Node ? r.parentElement : null;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
return !!
|
|
21
|
+
function S(r) {
|
|
22
|
+
return !!D(r)?.closest(oe);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return !!
|
|
24
|
+
function M(r) {
|
|
25
|
+
return !!D(r)?.closest(re);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
return
|
|
27
|
+
function ne(r) {
|
|
28
|
+
return r.key === "Shift" || r.key === "Meta" || r.key === "Alt" || r.key === "Control";
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
return
|
|
30
|
+
function ae(r) {
|
|
31
|
+
return /^\d$/.test(r.key) ? r.key : null;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
return
|
|
35
|
-
|
|
36
|
-
function de(o) {
|
|
37
|
-
return o === "floating" ? {
|
|
38
|
-
mode: o,
|
|
33
|
+
function ie(r) {
|
|
34
|
+
return r === "floating" ? {
|
|
35
|
+
mode: r,
|
|
39
36
|
ariaModal: void 0,
|
|
40
37
|
lockBodyScroll: !1,
|
|
41
38
|
trapFocus: !1,
|
|
@@ -56,90 +53,82 @@ function de(o) {
|
|
|
56
53
|
}
|
|
57
54
|
};
|
|
58
55
|
}
|
|
59
|
-
function
|
|
60
|
-
const
|
|
56
|
+
function _e(r) {
|
|
57
|
+
const b = z(), e = Y(r);
|
|
61
58
|
let p;
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
59
|
+
const i = () => ie(r.interactionMode), h = () => r.onClose(), O = R(() => {
|
|
60
|
+
if (i().mode !== "floating")
|
|
64
61
|
return [];
|
|
65
62
|
const t = /* @__PURE__ */ new Set();
|
|
66
|
-
if (
|
|
67
|
-
const
|
|
68
|
-
|
|
63
|
+
if (b.config.commands.palette.enabled) {
|
|
64
|
+
const o = b.config.commands.palette.keybind.trim();
|
|
65
|
+
o && t.add(o);
|
|
69
66
|
}
|
|
70
|
-
for (const
|
|
71
|
-
const
|
|
72
|
-
|
|
67
|
+
for (const o of r.allowGlobalHotkeys ?? []) {
|
|
68
|
+
const a = o.trim();
|
|
69
|
+
a && t.add(a);
|
|
73
70
|
}
|
|
74
71
|
return Array.from(t);
|
|
75
72
|
});
|
|
76
|
-
return
|
|
77
|
-
if (!
|
|
78
|
-
const t = (
|
|
79
|
-
|
|
73
|
+
return f(() => {
|
|
74
|
+
if (!r.open || i().mode !== "floating" || typeof document > "u") return;
|
|
75
|
+
const t = (o) => {
|
|
76
|
+
S(o.target) || queueMicrotask(h);
|
|
80
77
|
};
|
|
81
|
-
document.addEventListener("click", t, !0),
|
|
82
|
-
}),
|
|
83
|
-
open: () =>
|
|
78
|
+
document.addEventListener("click", t, !0), _(() => document.removeEventListener("click", t, !0));
|
|
79
|
+
}), K({
|
|
80
|
+
open: () => r.open,
|
|
84
81
|
root: () => p,
|
|
85
82
|
onClose: () => e.handleCloseRequest(),
|
|
86
|
-
onEscapeOutside:
|
|
87
|
-
containsTarget:
|
|
88
|
-
lockBodyScroll:
|
|
89
|
-
trapFocus:
|
|
90
|
-
closeOnEscape:
|
|
83
|
+
onEscapeOutside: i().mode === "floating" ? h : void 0,
|
|
84
|
+
containsTarget: S,
|
|
85
|
+
lockBodyScroll: i().lockBodyScroll,
|
|
86
|
+
trapFocus: i().trapFocus,
|
|
87
|
+
closeOnEscape: i().closeOnEscape,
|
|
91
88
|
blockHotkeys: !0,
|
|
92
|
-
allowHotkeys:
|
|
93
|
-
blockWheel:
|
|
94
|
-
blockTouchMove:
|
|
95
|
-
autoFocus:
|
|
89
|
+
allowHotkeys: O,
|
|
90
|
+
blockWheel: i().blockWheel,
|
|
91
|
+
blockTouchMove: i().blockTouchMove,
|
|
92
|
+
autoFocus: i().autoFocus,
|
|
96
93
|
restoreFocus: !0
|
|
97
|
-
}),
|
|
98
|
-
|
|
99
|
-
}),
|
|
100
|
-
if (!
|
|
101
|
-
const t = () => {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
f(u), (!l || !u) && e.shortcuts.clearPendingDigitState();
|
|
106
|
-
}, i = (r) => {
|
|
107
|
-
const u = w(r.target), l = y(r.target);
|
|
108
|
-
f(u), (!l || !u) && e.shortcuts.clearPendingDigitState();
|
|
109
|
-
}, d = (r) => {
|
|
110
|
-
const u = ue(r);
|
|
111
|
-
if (!u) {
|
|
112
|
-
ce(r) || e.shortcuts.clearPendingDigitState();
|
|
94
|
+
}), f(() => {
|
|
95
|
+
r.open || e.shortcuts.clearPendingDigitState();
|
|
96
|
+
}), f(() => {
|
|
97
|
+
if (!r.open || typeof document > "u") return;
|
|
98
|
+
const t = (o) => {
|
|
99
|
+
const a = ae(o);
|
|
100
|
+
if (!a) {
|
|
101
|
+
ne(o) || e.shortcuts.clearPendingDigitState();
|
|
113
102
|
return;
|
|
114
103
|
}
|
|
115
|
-
const
|
|
116
|
-
if (!(!
|
|
117
|
-
|
|
104
|
+
const u = document.activeElement;
|
|
105
|
+
if (!(!o.defaultPrevented && !o.repeat && !o.isComposing && !o.altKey && !o.ctrlKey && !o.metaKey && !e.shortcuts.blocked() && !M(o.target) && !M(u))) {
|
|
106
|
+
e.shortcuts.clearPendingDigitState();
|
|
118
107
|
return;
|
|
119
108
|
}
|
|
120
|
-
|
|
109
|
+
o.preventDefault(), typeof o.stopImmediatePropagation == "function" ? o.stopImmediatePropagation() : o.stopPropagation(), e.shortcuts.handleDigitShortcut(a);
|
|
121
110
|
};
|
|
122
|
-
document.addEventListener("
|
|
123
|
-
document.removeEventListener("
|
|
111
|
+
document.addEventListener("keydown", t, !0), _(() => {
|
|
112
|
+
document.removeEventListener("keydown", t, !0);
|
|
124
113
|
});
|
|
125
|
-
}), n(
|
|
114
|
+
}), n(s, {
|
|
126
115
|
get when() {
|
|
127
|
-
return
|
|
116
|
+
return r.open;
|
|
128
117
|
},
|
|
129
118
|
get children() {
|
|
130
|
-
return n(
|
|
119
|
+
return n(w.section, {
|
|
131
120
|
ref(t) {
|
|
132
|
-
var
|
|
133
|
-
typeof
|
|
121
|
+
var o = p;
|
|
122
|
+
typeof o == "function" ? o(t) : p = t;
|
|
134
123
|
},
|
|
135
124
|
class: "notes-overlay",
|
|
136
125
|
role: "dialog",
|
|
137
126
|
get "aria-modal"() {
|
|
138
|
-
return
|
|
127
|
+
return i().ariaModal;
|
|
139
128
|
},
|
|
140
129
|
"aria-label": "Notes overlay",
|
|
141
130
|
get "data-notes-interaction-mode"() {
|
|
142
|
-
return
|
|
131
|
+
return i().mode;
|
|
143
132
|
},
|
|
144
133
|
tabIndex: -1,
|
|
145
134
|
initial: {
|
|
@@ -150,11 +139,11 @@ function De(o) {
|
|
|
150
139
|
},
|
|
151
140
|
get transition() {
|
|
152
141
|
return {
|
|
153
|
-
duration:
|
|
142
|
+
duration: k.fast
|
|
154
143
|
};
|
|
155
144
|
},
|
|
156
145
|
get children() {
|
|
157
|
-
return [n(
|
|
146
|
+
return [n(w.div, {
|
|
158
147
|
class: "notes-overlay__frame",
|
|
159
148
|
"data-floe-notes-boundary": "true",
|
|
160
149
|
initial: {
|
|
@@ -169,19 +158,19 @@ function De(o) {
|
|
|
169
158
|
},
|
|
170
159
|
get transition() {
|
|
171
160
|
return {
|
|
172
|
-
duration:
|
|
173
|
-
easing:
|
|
161
|
+
duration: k.normal,
|
|
162
|
+
easing: B.easeOut
|
|
174
163
|
};
|
|
175
164
|
},
|
|
176
165
|
get children() {
|
|
177
166
|
return [(() => {
|
|
178
|
-
var t =
|
|
179
|
-
return
|
|
167
|
+
var t = U(), o = t.firstChild, a = o.firstChild, u = a.nextSibling, g = u.nextSibling, x = g.firstChild, m = g.nextSibling, I = m.firstChild, y = m.nextSibling, $ = y.firstChild, E = o.nextSibling, T = E.firstChild;
|
|
168
|
+
return l(g, () => e.header.topicCount(), x), l(m, () => e.header.totalLiveNotes(), I), l(m, () => e.header.totalLiveNotes() === 1 ? "" : "s", null), l(y, () => e.header.trashCount(), $), T.$$click = () => e.handleCloseRequest(), l(T, n(Z, {
|
|
180
169
|
class: "w-4 h-4"
|
|
181
170
|
})), t;
|
|
182
171
|
})(), (() => {
|
|
183
|
-
var t =
|
|
184
|
-
return
|
|
172
|
+
var t = J(), o = t.firstChild;
|
|
173
|
+
return l(t, n(G, {
|
|
185
174
|
get topics() {
|
|
186
175
|
return e.rail.topics();
|
|
187
176
|
},
|
|
@@ -221,10 +210,10 @@ function De(o) {
|
|
|
221
210
|
get onCancelRename() {
|
|
222
211
|
return e.rail.cancelTopicRename;
|
|
223
212
|
},
|
|
224
|
-
onDeleteTopic: (
|
|
225
|
-
e.rail.deleteTopic(
|
|
213
|
+
onDeleteTopic: (a) => {
|
|
214
|
+
e.rail.deleteTopic(a);
|
|
226
215
|
}
|
|
227
|
-
}),
|
|
216
|
+
}), o), l(t, n(H, {
|
|
228
217
|
get activeTopic() {
|
|
229
218
|
return e.board.activeTopic();
|
|
230
219
|
},
|
|
@@ -297,8 +286,8 @@ function De(o) {
|
|
|
297
286
|
get onSeedMoveProjection() {
|
|
298
287
|
return e.board.seedMoveProjection;
|
|
299
288
|
},
|
|
300
|
-
onCopyNote: (
|
|
301
|
-
e.board.copyNote(
|
|
289
|
+
onCopyNote: (a) => {
|
|
290
|
+
e.board.copyNote(a);
|
|
302
291
|
},
|
|
303
292
|
get onOpenNoteContextMenu() {
|
|
304
293
|
return e.board.openNoteContextMenu;
|
|
@@ -306,8 +295,8 @@ function De(o) {
|
|
|
306
295
|
get onOpenEditor() {
|
|
307
296
|
return e.board.openEditor;
|
|
308
297
|
},
|
|
309
|
-
onMoveToTrash: (
|
|
310
|
-
e.board.moveToTrash(
|
|
298
|
+
onMoveToTrash: (a) => {
|
|
299
|
+
e.board.moveToTrash(a);
|
|
311
300
|
},
|
|
312
301
|
get onStartOptimisticFront() {
|
|
313
302
|
return e.board.startOptimisticFront;
|
|
@@ -318,12 +307,12 @@ function De(o) {
|
|
|
318
307
|
get onCommitMove() {
|
|
319
308
|
return e.board.commitMove;
|
|
320
309
|
}
|
|
321
|
-
}),
|
|
310
|
+
}), o), l(t, n(s, {
|
|
322
311
|
get when() {
|
|
323
312
|
return !e.board.isMobile();
|
|
324
313
|
},
|
|
325
314
|
get children() {
|
|
326
|
-
return n(
|
|
315
|
+
return n(N, {
|
|
327
316
|
mode: "desktop",
|
|
328
317
|
get items() {
|
|
329
318
|
return e.overview.items();
|
|
@@ -348,32 +337,32 @@ function De(o) {
|
|
|
348
337
|
}
|
|
349
338
|
});
|
|
350
339
|
}
|
|
351
|
-
}),
|
|
340
|
+
}), o), l(o, n(s, {
|
|
352
341
|
get when() {
|
|
353
342
|
return !e.trash.open();
|
|
354
343
|
},
|
|
355
344
|
get children() {
|
|
356
|
-
var
|
|
357
|
-
return
|
|
345
|
+
var a = X(), u = a.firstChild;
|
|
346
|
+
return v(a, "click", e.trash.openDock, !0), l(u, n(V, {
|
|
358
347
|
class: "notes-trash__toggle-icon"
|
|
359
|
-
})),
|
|
348
|
+
})), C(() => F(a, "aria-label", `Open trash dock${e.trash.count() > 0 ? `, ${e.trash.count()} items` : ""}`)), a;
|
|
360
349
|
}
|
|
361
|
-
})),
|
|
350
|
+
})), C(() => o.classList.toggle("is-open", !!e.trash.open())), t;
|
|
362
351
|
})()];
|
|
363
352
|
}
|
|
364
|
-
}), n(
|
|
353
|
+
}), n(s, {
|
|
365
354
|
get when() {
|
|
366
|
-
return
|
|
355
|
+
return P(() => !!e.board.isMobile())() && e.board.overviewOpen();
|
|
367
356
|
},
|
|
368
357
|
get children() {
|
|
369
|
-
return n(
|
|
358
|
+
return n(d, {
|
|
370
359
|
get children() {
|
|
371
360
|
return [(() => {
|
|
372
|
-
var t =
|
|
373
|
-
return
|
|
361
|
+
var t = Q();
|
|
362
|
+
return v(t, "click", e.overview.close, !0), t;
|
|
374
363
|
})(), (() => {
|
|
375
|
-
var t =
|
|
376
|
-
return
|
|
364
|
+
var t = ee();
|
|
365
|
+
return l(t, n(N, {
|
|
377
366
|
mode: "mobile",
|
|
378
367
|
get items() {
|
|
379
368
|
return e.overview.items();
|
|
@@ -404,9 +393,9 @@ function De(o) {
|
|
|
404
393
|
}
|
|
405
394
|
});
|
|
406
395
|
}
|
|
407
|
-
}), n(
|
|
396
|
+
}), n(d, {
|
|
408
397
|
get children() {
|
|
409
|
-
return n(
|
|
398
|
+
return n(j, {
|
|
410
399
|
get open() {
|
|
411
400
|
return e.trash.open();
|
|
412
401
|
},
|
|
@@ -436,17 +425,17 @@ function De(o) {
|
|
|
436
425
|
}
|
|
437
426
|
});
|
|
438
427
|
}
|
|
439
|
-
}), n(
|
|
428
|
+
}), n(s, {
|
|
440
429
|
get when() {
|
|
441
430
|
return e.contextMenu.state();
|
|
442
431
|
},
|
|
443
432
|
get children() {
|
|
444
|
-
return n(
|
|
433
|
+
return n(d, {
|
|
445
434
|
get children() {
|
|
446
435
|
return [(() => {
|
|
447
|
-
var t =
|
|
448
|
-
return
|
|
449
|
-
})(), n(
|
|
436
|
+
var t = te();
|
|
437
|
+
return v(t, "contextmenu", e.contextMenu.retarget, !0), v(t, "click", e.contextMenu.close, !0), t;
|
|
438
|
+
})(), n(A, {
|
|
450
439
|
get x() {
|
|
451
440
|
return e.contextMenu.position()?.left ?? 0;
|
|
452
441
|
},
|
|
@@ -460,14 +449,14 @@ function De(o) {
|
|
|
460
449
|
}
|
|
461
450
|
});
|
|
462
451
|
}
|
|
463
|
-
}), n(
|
|
452
|
+
}), n(s, {
|
|
464
453
|
get when() {
|
|
465
454
|
return !!e.editor.note();
|
|
466
455
|
},
|
|
467
456
|
get children() {
|
|
468
|
-
return n(
|
|
457
|
+
return n(d, {
|
|
469
458
|
get children() {
|
|
470
|
-
return n(
|
|
459
|
+
return n(W, {
|
|
471
460
|
get note() {
|
|
472
461
|
return e.editor.note();
|
|
473
462
|
},
|
|
@@ -499,9 +488,9 @@ function De(o) {
|
|
|
499
488
|
}
|
|
500
489
|
});
|
|
501
490
|
}
|
|
502
|
-
}), n(
|
|
491
|
+
}), n(d, {
|
|
503
492
|
get children() {
|
|
504
|
-
return n(
|
|
493
|
+
return n(q, {
|
|
505
494
|
get open() {
|
|
506
495
|
return e.manualPaste.open();
|
|
507
496
|
},
|
|
@@ -525,7 +514,7 @@ function De(o) {
|
|
|
525
514
|
}
|
|
526
515
|
});
|
|
527
516
|
}
|
|
528
|
-
|
|
517
|
+
L(["click", "contextmenu"]);
|
|
529
518
|
export {
|
|
530
|
-
|
|
519
|
+
_e as NotesOverlay
|
|
531
520
|
};
|