@floegence/floe-webapp-core 0.35.56 → 0.35.57
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/NotesBoard.d.ts +2 -0
- package/dist/components/notes/NotesBoard.js +30 -24
- package/dist/components/notes/NotesBoardNote.d.ts +2 -0
- package/dist/components/notes/NotesBoardNote.js +83 -76
- package/dist/components/notes/NotesOverlay.js +148 -102
- package/dist/components/notes/notesNumbering.d.ts +18 -0
- package/dist/components/notes/notesNumbering.js +28 -0
- package/dist/components/notes/useNotesOverlayModel.d.ts +7 -0
- package/dist/components/notes/useNotesOverlayModel.js +467 -402
- package/dist/notes-legacy.css +82 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,29 +1,41 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { createMemo as
|
|
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 c, addEventListener as h, effect as M, setAttribute as F, Portal as v, memo as R, template as m, delegateEvents as K } from "solid-js/web";
|
|
2
|
+
import { createSignal as Z, createMemo as z, createEffect as C, onCleanup as O, Show as g } from "solid-js";
|
|
3
|
+
import { Motion as E } 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 H, duration as I } from "../../utils/animations.js";
|
|
5
|
+
import { useOverlayMask as W } from "../../hooks/useOverlayMask.js";
|
|
6
|
+
import { X as A } from "../icons/index.js";
|
|
7
|
+
import { useResolvedFloeConfig as q } from "../../context/FloeConfigContext.js";
|
|
8
|
+
import { NotesBoard as G } from "./NotesBoard.js";
|
|
9
|
+
import { NotesContextMenu as j } from "./NotesContextMenu.js";
|
|
10
|
+
import { NotesEditorFlyout as V, NotesManualPasteFlyout as Y } from "./NotesEditorFlyout.js";
|
|
11
|
+
import { NotesOverviewPanel as x } from "./NotesOverviewPanel.js";
|
|
12
|
+
import { NotesTopicRail as U } from "./NotesTopicRail.js";
|
|
13
|
+
import { NotesTrashFlyout as X } from "./NotesTrashFlyout.js";
|
|
14
|
+
import { NotesTrashCanIcon as J } from "./notesAppearance.js";
|
|
15
|
+
import { useNotesOverlayModel as Q } from "./useNotesOverlayModel.js";
|
|
16
|
+
var ee = /* @__PURE__ */ m('<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>'), te = /* @__PURE__ */ m("<button type=button class=notes-trash__toggle><div class=notes-trash__toggle-mark>"), oe = /* @__PURE__ */ m("<div class=notes-overlay__body><div class=notes-trash data-floe-canvas-interactive=true>"), re = /* @__PURE__ */ m("<div class=notes-overview-backdrop data-floe-notes-boundary=true>"), ne = /* @__PURE__ */ m("<div class=notes-overview-flyout data-floe-notes-boundary=true>"), ae = /* @__PURE__ */ m("<div class=notes-menu-backdrop data-floe-notes-boundary=true>");
|
|
17
|
+
const ie = '[data-floe-notes-boundary="true"]', le = '[data-floe-notes-digit-browse="true"]', se = 'input, textarea, select, [contenteditable=""], [contenteditable="true"], [contenteditable="plaintext-only"], [role="textbox"]';
|
|
18
|
+
function _(o) {
|
|
19
|
+
return typeof Element < "u" && o instanceof Element ? o : typeof Node < "u" && o instanceof Node ? o.parentElement : null;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
return !!
|
|
21
|
+
function y(o) {
|
|
22
|
+
return !!_(o)?.closest(ie);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
26
|
-
|
|
24
|
+
function w(o) {
|
|
25
|
+
return !!_(o)?.closest(le);
|
|
26
|
+
}
|
|
27
|
+
function B(o) {
|
|
28
|
+
return !!_(o)?.closest(se);
|
|
29
|
+
}
|
|
30
|
+
function ce(o) {
|
|
31
|
+
return o.key === "Shift" || o.key === "Meta" || o.key === "Alt" || o.key === "Control";
|
|
32
|
+
}
|
|
33
|
+
function ue(o) {
|
|
34
|
+
return /^\d$/.test(o.key) ? o.key : null;
|
|
35
|
+
}
|
|
36
|
+
function de(o) {
|
|
37
|
+
return o === "floating" ? {
|
|
38
|
+
mode: o,
|
|
27
39
|
ariaModal: void 0,
|
|
28
40
|
lockBodyScroll: !1,
|
|
29
41
|
trapFocus: !1,
|
|
@@ -44,62 +56,90 @@ function oe(n) {
|
|
|
44
56
|
}
|
|
45
57
|
};
|
|
46
58
|
}
|
|
47
|
-
function
|
|
48
|
-
const
|
|
49
|
-
let
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
59
|
+
function De(o) {
|
|
60
|
+
const S = q(), e = Q(o);
|
|
61
|
+
let p;
|
|
62
|
+
const [$, f] = Z(!1), s = () => de(o.interactionMode), k = () => o.onClose(), P = z(() => {
|
|
63
|
+
if (s().mode !== "floating")
|
|
52
64
|
return [];
|
|
53
65
|
const t = /* @__PURE__ */ new Set();
|
|
54
|
-
if (
|
|
55
|
-
const
|
|
56
|
-
r && t.add(r);
|
|
57
|
-
}
|
|
58
|
-
for (const r of n.allowGlobalHotkeys ?? []) {
|
|
59
|
-
const a = r.trim();
|
|
66
|
+
if (S.config.commands.palette.enabled) {
|
|
67
|
+
const a = S.config.commands.palette.keybind.trim();
|
|
60
68
|
a && t.add(a);
|
|
61
69
|
}
|
|
70
|
+
for (const a of o.allowGlobalHotkeys ?? []) {
|
|
71
|
+
const i = a.trim();
|
|
72
|
+
i && t.add(i);
|
|
73
|
+
}
|
|
62
74
|
return Array.from(t);
|
|
63
75
|
});
|
|
64
|
-
return
|
|
65
|
-
if (!
|
|
66
|
-
const t = (
|
|
67
|
-
|
|
76
|
+
return C(() => {
|
|
77
|
+
if (!o.open || s().mode !== "floating" || typeof document > "u") return;
|
|
78
|
+
const t = (a) => {
|
|
79
|
+
y(a.target) || queueMicrotask(k);
|
|
68
80
|
};
|
|
69
|
-
document.addEventListener("click", t, !0),
|
|
70
|
-
}),
|
|
71
|
-
open: () =>
|
|
72
|
-
root: () =>
|
|
81
|
+
document.addEventListener("click", t, !0), O(() => document.removeEventListener("click", t, !0));
|
|
82
|
+
}), W({
|
|
83
|
+
open: () => o.open,
|
|
84
|
+
root: () => p,
|
|
73
85
|
onClose: () => e.handleCloseRequest(),
|
|
74
|
-
onEscapeOutside:
|
|
75
|
-
containsTarget:
|
|
76
|
-
lockBodyScroll:
|
|
77
|
-
trapFocus:
|
|
78
|
-
closeOnEscape:
|
|
86
|
+
onEscapeOutside: s().mode === "floating" ? k : void 0,
|
|
87
|
+
containsTarget: y,
|
|
88
|
+
lockBodyScroll: s().lockBodyScroll,
|
|
89
|
+
trapFocus: s().trapFocus,
|
|
90
|
+
closeOnEscape: s().closeOnEscape,
|
|
79
91
|
blockHotkeys: !0,
|
|
80
|
-
allowHotkeys:
|
|
81
|
-
blockWheel:
|
|
82
|
-
blockTouchMove:
|
|
83
|
-
autoFocus:
|
|
92
|
+
allowHotkeys: P,
|
|
93
|
+
blockWheel: s().blockWheel,
|
|
94
|
+
blockTouchMove: s().blockTouchMove,
|
|
95
|
+
autoFocus: s().autoFocus,
|
|
84
96
|
restoreFocus: !0
|
|
85
|
-
}),
|
|
97
|
+
}), C(() => {
|
|
98
|
+
o.open || (f(!1), e.shortcuts.clearPendingDigitState());
|
|
99
|
+
}), C(() => {
|
|
100
|
+
if (!o.open || typeof document > "u") return;
|
|
101
|
+
const t = () => {
|
|
102
|
+
f(!1), e.shortcuts.clearPendingDigitState();
|
|
103
|
+
}, a = (r) => {
|
|
104
|
+
const u = w(r.target), l = y(r.target);
|
|
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();
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const l = document.activeElement, T = w(l), b = $() && (!l || l === document.body || l === document.documentElement || l === p);
|
|
116
|
+
if (!(!r.defaultPrevented && !r.repeat && !r.isComposing && !r.altKey && !r.ctrlKey && !r.metaKey && !e.shortcuts.blocked() && !B(r.target) && !B(l) && (T || b))) {
|
|
117
|
+
t();
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
r.preventDefault(), typeof r.stopImmediatePropagation == "function" ? r.stopImmediatePropagation() : r.stopPropagation(), e.shortcuts.handleDigitShortcut(u);
|
|
121
|
+
};
|
|
122
|
+
document.addEventListener("pointerdown", a, !0), document.addEventListener("focusin", i, !0), document.addEventListener("keydown", d, !0), O(() => {
|
|
123
|
+
document.removeEventListener("pointerdown", a, !0), document.removeEventListener("focusin", i, !0), document.removeEventListener("keydown", d, !0);
|
|
124
|
+
});
|
|
125
|
+
}), n(g, {
|
|
86
126
|
get when() {
|
|
87
|
-
return
|
|
127
|
+
return o.open;
|
|
88
128
|
},
|
|
89
129
|
get children() {
|
|
90
|
-
return
|
|
130
|
+
return n(E.section, {
|
|
91
131
|
ref(t) {
|
|
92
|
-
var
|
|
93
|
-
typeof
|
|
132
|
+
var a = p;
|
|
133
|
+
typeof a == "function" ? a(t) : p = t;
|
|
94
134
|
},
|
|
95
135
|
class: "notes-overlay",
|
|
96
136
|
role: "dialog",
|
|
97
137
|
get "aria-modal"() {
|
|
98
|
-
return
|
|
138
|
+
return s().ariaModal;
|
|
99
139
|
},
|
|
100
140
|
"aria-label": "Notes overlay",
|
|
101
141
|
get "data-notes-interaction-mode"() {
|
|
102
|
-
return
|
|
142
|
+
return s().mode;
|
|
103
143
|
},
|
|
104
144
|
tabIndex: -1,
|
|
105
145
|
initial: {
|
|
@@ -110,11 +150,11 @@ function he(n) {
|
|
|
110
150
|
},
|
|
111
151
|
get transition() {
|
|
112
152
|
return {
|
|
113
|
-
duration:
|
|
153
|
+
duration: I.fast
|
|
114
154
|
};
|
|
115
155
|
},
|
|
116
156
|
get children() {
|
|
117
|
-
return [
|
|
157
|
+
return [n(E.div, {
|
|
118
158
|
class: "notes-overlay__frame",
|
|
119
159
|
"data-floe-notes-boundary": "true",
|
|
120
160
|
initial: {
|
|
@@ -129,19 +169,19 @@ function he(n) {
|
|
|
129
169
|
},
|
|
130
170
|
get transition() {
|
|
131
171
|
return {
|
|
132
|
-
duration:
|
|
133
|
-
easing:
|
|
172
|
+
duration: I.normal,
|
|
173
|
+
easing: H.easeOut
|
|
134
174
|
};
|
|
135
175
|
},
|
|
136
176
|
get children() {
|
|
137
177
|
return [(() => {
|
|
138
|
-
var t =
|
|
139
|
-
return
|
|
178
|
+
var t = ee(), a = t.firstChild, i = a.firstChild, d = i.nextSibling, r = d.nextSibling, u = r.firstChild, l = r.nextSibling, T = l.firstChild, b = l.nextSibling, N = b.firstChild, L = a.nextSibling, D = L.firstChild;
|
|
179
|
+
return c(r, () => e.header.topicCount(), u), c(l, () => e.header.totalLiveNotes(), T), c(l, () => e.header.totalLiveNotes() === 1 ? "" : "s", null), c(b, () => e.header.trashCount(), N), D.$$click = () => e.handleCloseRequest(), c(D, n(A, {
|
|
140
180
|
class: "w-4 h-4"
|
|
141
181
|
})), t;
|
|
142
182
|
})(), (() => {
|
|
143
|
-
var t =
|
|
144
|
-
return
|
|
183
|
+
var t = oe(), a = t.firstChild;
|
|
184
|
+
return c(t, n(U, {
|
|
145
185
|
get topics() {
|
|
146
186
|
return e.rail.topics();
|
|
147
187
|
},
|
|
@@ -181,10 +221,10 @@ function he(n) {
|
|
|
181
221
|
get onCancelRename() {
|
|
182
222
|
return e.rail.cancelTopicRename;
|
|
183
223
|
},
|
|
184
|
-
onDeleteTopic: (
|
|
185
|
-
e.rail.deleteTopic(
|
|
224
|
+
onDeleteTopic: (i) => {
|
|
225
|
+
e.rail.deleteTopic(i);
|
|
186
226
|
}
|
|
187
|
-
}),
|
|
227
|
+
}), a), c(t, n(G, {
|
|
188
228
|
get activeTopic() {
|
|
189
229
|
return e.board.activeTopic();
|
|
190
230
|
},
|
|
@@ -221,6 +261,12 @@ function he(n) {
|
|
|
221
261
|
get copiedNoteID() {
|
|
222
262
|
return e.board.copiedNoteID();
|
|
223
263
|
},
|
|
264
|
+
get noteNumberByID() {
|
|
265
|
+
return e.board.noteNumberByID();
|
|
266
|
+
},
|
|
267
|
+
get pendingShortcutNoteID() {
|
|
268
|
+
return e.board.pendingShortcutNoteID();
|
|
269
|
+
},
|
|
224
270
|
get setCanvasFrameRef() {
|
|
225
271
|
return e.board.setCanvasFrameRef;
|
|
226
272
|
},
|
|
@@ -251,8 +297,8 @@ function he(n) {
|
|
|
251
297
|
get onSeedMoveProjection() {
|
|
252
298
|
return e.board.seedMoveProjection;
|
|
253
299
|
},
|
|
254
|
-
onCopyNote: (
|
|
255
|
-
e.board.copyNote(
|
|
300
|
+
onCopyNote: (i) => {
|
|
301
|
+
e.board.copyNote(i);
|
|
256
302
|
},
|
|
257
303
|
get onOpenNoteContextMenu() {
|
|
258
304
|
return e.board.openNoteContextMenu;
|
|
@@ -260,8 +306,8 @@ function he(n) {
|
|
|
260
306
|
get onOpenEditor() {
|
|
261
307
|
return e.board.openEditor;
|
|
262
308
|
},
|
|
263
|
-
onMoveToTrash: (
|
|
264
|
-
e.board.moveToTrash(
|
|
309
|
+
onMoveToTrash: (i) => {
|
|
310
|
+
e.board.moveToTrash(i);
|
|
265
311
|
},
|
|
266
312
|
get onStartOptimisticFront() {
|
|
267
313
|
return e.board.startOptimisticFront;
|
|
@@ -272,12 +318,12 @@ function he(n) {
|
|
|
272
318
|
get onCommitMove() {
|
|
273
319
|
return e.board.commitMove;
|
|
274
320
|
}
|
|
275
|
-
}),
|
|
321
|
+
}), a), c(t, n(g, {
|
|
276
322
|
get when() {
|
|
277
323
|
return !e.board.isMobile();
|
|
278
324
|
},
|
|
279
325
|
get children() {
|
|
280
|
-
return
|
|
326
|
+
return n(x, {
|
|
281
327
|
mode: "desktop",
|
|
282
328
|
get items() {
|
|
283
329
|
return e.overview.items();
|
|
@@ -302,32 +348,32 @@ function he(n) {
|
|
|
302
348
|
}
|
|
303
349
|
});
|
|
304
350
|
}
|
|
305
|
-
}),
|
|
351
|
+
}), a), c(a, n(g, {
|
|
306
352
|
get when() {
|
|
307
353
|
return !e.trash.open();
|
|
308
354
|
},
|
|
309
355
|
get children() {
|
|
310
|
-
var
|
|
311
|
-
return
|
|
356
|
+
var i = te(), d = i.firstChild;
|
|
357
|
+
return h(i, "click", e.trash.openDock, !0), c(d, n(J, {
|
|
312
358
|
class: "notes-trash__toggle-icon"
|
|
313
|
-
})),
|
|
359
|
+
})), M(() => F(i, "aria-label", `Open trash dock${e.trash.count() > 0 ? `, ${e.trash.count()} items` : ""}`)), i;
|
|
314
360
|
}
|
|
315
|
-
})),
|
|
361
|
+
})), M(() => a.classList.toggle("is-open", !!e.trash.open())), t;
|
|
316
362
|
})()];
|
|
317
363
|
}
|
|
318
|
-
}),
|
|
364
|
+
}), n(g, {
|
|
319
365
|
get when() {
|
|
320
|
-
return
|
|
366
|
+
return R(() => !!e.board.isMobile())() && e.board.overviewOpen();
|
|
321
367
|
},
|
|
322
368
|
get children() {
|
|
323
|
-
return
|
|
369
|
+
return n(v, {
|
|
324
370
|
get children() {
|
|
325
371
|
return [(() => {
|
|
326
|
-
var t =
|
|
327
|
-
return
|
|
372
|
+
var t = re();
|
|
373
|
+
return h(t, "click", e.overview.close, !0), t;
|
|
328
374
|
})(), (() => {
|
|
329
|
-
var t =
|
|
330
|
-
return
|
|
375
|
+
var t = ne();
|
|
376
|
+
return c(t, n(x, {
|
|
331
377
|
mode: "mobile",
|
|
332
378
|
get items() {
|
|
333
379
|
return e.overview.items();
|
|
@@ -358,9 +404,9 @@ function he(n) {
|
|
|
358
404
|
}
|
|
359
405
|
});
|
|
360
406
|
}
|
|
361
|
-
}),
|
|
407
|
+
}), n(v, {
|
|
362
408
|
get children() {
|
|
363
|
-
return
|
|
409
|
+
return n(X, {
|
|
364
410
|
get open() {
|
|
365
411
|
return e.trash.open();
|
|
366
412
|
},
|
|
@@ -390,17 +436,17 @@ function he(n) {
|
|
|
390
436
|
}
|
|
391
437
|
});
|
|
392
438
|
}
|
|
393
|
-
}),
|
|
439
|
+
}), n(g, {
|
|
394
440
|
get when() {
|
|
395
441
|
return e.contextMenu.state();
|
|
396
442
|
},
|
|
397
443
|
get children() {
|
|
398
|
-
return
|
|
444
|
+
return n(v, {
|
|
399
445
|
get children() {
|
|
400
446
|
return [(() => {
|
|
401
|
-
var t =
|
|
402
|
-
return
|
|
403
|
-
})(),
|
|
447
|
+
var t = ae();
|
|
448
|
+
return h(t, "contextmenu", e.contextMenu.retarget, !0), h(t, "click", e.contextMenu.close, !0), t;
|
|
449
|
+
})(), n(j, {
|
|
404
450
|
get x() {
|
|
405
451
|
return e.contextMenu.position()?.left ?? 0;
|
|
406
452
|
},
|
|
@@ -414,14 +460,14 @@ function he(n) {
|
|
|
414
460
|
}
|
|
415
461
|
});
|
|
416
462
|
}
|
|
417
|
-
}),
|
|
463
|
+
}), n(g, {
|
|
418
464
|
get when() {
|
|
419
465
|
return !!e.editor.note();
|
|
420
466
|
},
|
|
421
467
|
get children() {
|
|
422
|
-
return
|
|
468
|
+
return n(v, {
|
|
423
469
|
get children() {
|
|
424
|
-
return
|
|
470
|
+
return n(V, {
|
|
425
471
|
get note() {
|
|
426
472
|
return e.editor.note();
|
|
427
473
|
},
|
|
@@ -453,9 +499,9 @@ function he(n) {
|
|
|
453
499
|
}
|
|
454
500
|
});
|
|
455
501
|
}
|
|
456
|
-
}),
|
|
502
|
+
}), n(v, {
|
|
457
503
|
get children() {
|
|
458
|
-
return
|
|
504
|
+
return n(Y, {
|
|
459
505
|
get open() {
|
|
460
506
|
return e.manualPaste.open();
|
|
461
507
|
},
|
|
@@ -479,7 +525,7 @@ function he(n) {
|
|
|
479
525
|
}
|
|
480
526
|
});
|
|
481
527
|
}
|
|
482
|
-
|
|
528
|
+
K(["click", "contextmenu"]);
|
|
483
529
|
export {
|
|
484
|
-
|
|
530
|
+
De as NotesOverlay
|
|
485
531
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { NotesItem } from './types';
|
|
2
|
+
export interface NotesNumberedItem {
|
|
3
|
+
readonly item: NotesItem;
|
|
4
|
+
readonly index: number;
|
|
5
|
+
readonly label: string;
|
|
6
|
+
}
|
|
7
|
+
export type NotesDigitSequenceResolution = Readonly<{
|
|
8
|
+
kind: 'invalid';
|
|
9
|
+
}> | Readonly<{
|
|
10
|
+
kind: 'pending';
|
|
11
|
+
exactMatch: NotesNumberedItem | null;
|
|
12
|
+
}> | Readonly<{
|
|
13
|
+
kind: 'ready';
|
|
14
|
+
match: NotesNumberedItem;
|
|
15
|
+
}>;
|
|
16
|
+
export declare function sortNotesForNumbering(items: readonly NotesItem[]): NotesItem[];
|
|
17
|
+
export declare function numberNotesInTopic(items: readonly NotesItem[], topicID: string): NotesNumberedItem[];
|
|
18
|
+
export declare function resolveNotesDigitSequence(sequence: string, numberedItems: readonly NotesNumberedItem[]): NotesDigitSequenceResolution;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function o(i) {
|
|
2
|
+
return [...i].sort(
|
|
3
|
+
(e, n) => e.created_at_unix_ms !== n.created_at_unix_ms ? e.created_at_unix_ms - n.created_at_unix_ms : e.note_id.localeCompare(n.note_id)
|
|
4
|
+
);
|
|
5
|
+
}
|
|
6
|
+
function c(i, e) {
|
|
7
|
+
return o(i.filter((n) => n.topic_id === e)).map(
|
|
8
|
+
(n, t) => ({
|
|
9
|
+
item: n,
|
|
10
|
+
index: t + 1,
|
|
11
|
+
label: String(t + 1)
|
|
12
|
+
})
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
function d(i, e) {
|
|
16
|
+
const n = String(i ?? "").trim();
|
|
17
|
+
if (!/^[1-9]\d*$/.test(n))
|
|
18
|
+
return { kind: "invalid" };
|
|
19
|
+
const t = e.find((r) => r.label === n) ?? null, a = e.some(
|
|
20
|
+
(r) => r.label.startsWith(n) && r.label !== n
|
|
21
|
+
);
|
|
22
|
+
return t && !a ? { kind: "ready", match: t } : t || a ? { kind: "pending", exactMatch: t } : { kind: "invalid" };
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
c as numberNotesInTopic,
|
|
26
|
+
d as resolveNotesDigitSequence,
|
|
27
|
+
o as sortNotesForNumbering
|
|
28
|
+
};
|
|
@@ -89,6 +89,8 @@ export declare function useNotesOverlayModel(options: UseNotesOverlayModelOption
|
|
|
89
89
|
overviewOpen: import("solid-js").Accessor<boolean>;
|
|
90
90
|
optimisticFrontNoteID: import("solid-js").Accessor<string | null>;
|
|
91
91
|
copiedNoteID: import("solid-js").Accessor<string | null>;
|
|
92
|
+
noteNumberByID: import("solid-js").Accessor<Map<string, string>>;
|
|
93
|
+
pendingShortcutNoteID: import("solid-js").Accessor<string | null>;
|
|
92
94
|
setCanvasFrameRef: import("solid-js").Setter<HTMLDivElement | undefined>;
|
|
93
95
|
commitViewport: (viewport: NotesViewport) => void;
|
|
94
96
|
openCanvasContextMenu: (event: {
|
|
@@ -203,5 +205,10 @@ export declare function useNotesOverlayModel(options: UseNotesOverlayModelOption
|
|
|
203
205
|
close: () => void;
|
|
204
206
|
confirm: () => Promise<void>;
|
|
205
207
|
};
|
|
208
|
+
shortcuts: {
|
|
209
|
+
blocked: import("solid-js").Accessor<boolean>;
|
|
210
|
+
handleDigitShortcut: (digit: string) => void;
|
|
211
|
+
clearPendingDigitState: () => void;
|
|
212
|
+
};
|
|
206
213
|
handleCloseRequest: () => void;
|
|
207
214
|
};
|