@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 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;
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 y(o) {
22
- return !!_(o)?.closest(ie);
21
+ function S(r) {
22
+ return !!D(r)?.closest(oe);
23
23
  }
24
- function w(o) {
25
- return !!_(o)?.closest(le);
24
+ function M(r) {
25
+ return !!D(r)?.closest(re);
26
26
  }
27
- function B(o) {
28
- return !!_(o)?.closest(se);
27
+ function ne(r) {
28
+ return r.key === "Shift" || r.key === "Meta" || r.key === "Alt" || r.key === "Control";
29
29
  }
30
- function ce(o) {
31
- return o.key === "Shift" || o.key === "Meta" || o.key === "Alt" || o.key === "Control";
30
+ function ae(r) {
31
+ return /^\d$/.test(r.key) ? r.key : null;
32
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,
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 De(o) {
60
- const S = q(), e = Q(o);
56
+ function _e(r) {
57
+ const b = z(), e = Y(r);
61
58
  let p;
62
- const [$, f] = Z(!1), s = () => de(o.interactionMode), k = () => o.onClose(), P = z(() => {
63
- if (s().mode !== "floating")
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 (S.config.commands.palette.enabled) {
67
- const a = S.config.commands.palette.keybind.trim();
68
- a && t.add(a);
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 a of o.allowGlobalHotkeys ?? []) {
71
- const i = a.trim();
72
- i && t.add(i);
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 C(() => {
77
- if (!o.open || s().mode !== "floating" || typeof document > "u") return;
78
- const t = (a) => {
79
- y(a.target) || queueMicrotask(k);
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), O(() => document.removeEventListener("click", t, !0));
82
- }), W({
83
- open: () => o.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: s().mode === "floating" ? k : void 0,
87
- containsTarget: y,
88
- lockBodyScroll: s().lockBodyScroll,
89
- trapFocus: s().trapFocus,
90
- closeOnEscape: s().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: P,
93
- blockWheel: s().blockWheel,
94
- blockTouchMove: s().blockTouchMove,
95
- autoFocus: s().autoFocus,
89
+ allowHotkeys: O,
90
+ blockWheel: i().blockWheel,
91
+ blockTouchMove: i().blockTouchMove,
92
+ autoFocus: i().autoFocus,
96
93
  restoreFocus: !0
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();
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 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();
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
- r.preventDefault(), typeof r.stopImmediatePropagation == "function" ? r.stopImmediatePropagation() : r.stopPropagation(), e.shortcuts.handleDigitShortcut(u);
109
+ o.preventDefault(), typeof o.stopImmediatePropagation == "function" ? o.stopImmediatePropagation() : o.stopPropagation(), e.shortcuts.handleDigitShortcut(a);
121
110
  };
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);
111
+ document.addEventListener("keydown", t, !0), _(() => {
112
+ document.removeEventListener("keydown", t, !0);
124
113
  });
125
- }), n(g, {
114
+ }), n(s, {
126
115
  get when() {
127
- return o.open;
116
+ return r.open;
128
117
  },
129
118
  get children() {
130
- return n(E.section, {
119
+ return n(w.section, {
131
120
  ref(t) {
132
- var a = p;
133
- typeof a == "function" ? a(t) : p = t;
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 s().ariaModal;
127
+ return i().ariaModal;
139
128
  },
140
129
  "aria-label": "Notes overlay",
141
130
  get "data-notes-interaction-mode"() {
142
- return s().mode;
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: I.fast
142
+ duration: k.fast
154
143
  };
155
144
  },
156
145
  get children() {
157
- return [n(E.div, {
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: I.normal,
173
- easing: H.easeOut
161
+ duration: k.normal,
162
+ easing: B.easeOut
174
163
  };
175
164
  },
176
165
  get children() {
177
166
  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, {
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 = oe(), a = t.firstChild;
184
- return c(t, n(U, {
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: (i) => {
225
- e.rail.deleteTopic(i);
213
+ onDeleteTopic: (a) => {
214
+ e.rail.deleteTopic(a);
226
215
  }
227
- }), a), c(t, n(G, {
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: (i) => {
301
- e.board.copyNote(i);
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: (i) => {
310
- e.board.moveToTrash(i);
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
- }), a), c(t, n(g, {
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(x, {
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
- }), a), c(a, n(g, {
340
+ }), o), l(o, n(s, {
352
341
  get when() {
353
342
  return !e.trash.open();
354
343
  },
355
344
  get children() {
356
- var i = te(), d = i.firstChild;
357
- return h(i, "click", e.trash.openDock, !0), c(d, n(J, {
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
- })), M(() => F(i, "aria-label", `Open trash dock${e.trash.count() > 0 ? `, ${e.trash.count()} items` : ""}`)), i;
348
+ })), C(() => F(a, "aria-label", `Open trash dock${e.trash.count() > 0 ? `, ${e.trash.count()} items` : ""}`)), a;
360
349
  }
361
- })), M(() => a.classList.toggle("is-open", !!e.trash.open())), t;
350
+ })), C(() => o.classList.toggle("is-open", !!e.trash.open())), t;
362
351
  })()];
363
352
  }
364
- }), n(g, {
353
+ }), n(s, {
365
354
  get when() {
366
- return R(() => !!e.board.isMobile())() && e.board.overviewOpen();
355
+ return P(() => !!e.board.isMobile())() && e.board.overviewOpen();
367
356
  },
368
357
  get children() {
369
- return n(v, {
358
+ return n(d, {
370
359
  get children() {
371
360
  return [(() => {
372
- var t = re();
373
- return h(t, "click", e.overview.close, !0), t;
361
+ var t = Q();
362
+ return v(t, "click", e.overview.close, !0), t;
374
363
  })(), (() => {
375
- var t = ne();
376
- return c(t, n(x, {
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(v, {
396
+ }), n(d, {
408
397
  get children() {
409
- return n(X, {
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(g, {
428
+ }), n(s, {
440
429
  get when() {
441
430
  return e.contextMenu.state();
442
431
  },
443
432
  get children() {
444
- return n(v, {
433
+ return n(d, {
445
434
  get children() {
446
435
  return [(() => {
447
- var t = ae();
448
- return h(t, "contextmenu", e.contextMenu.retarget, !0), h(t, "click", e.contextMenu.close, !0), t;
449
- })(), n(j, {
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(g, {
452
+ }), n(s, {
464
453
  get when() {
465
454
  return !!e.editor.note();
466
455
  },
467
456
  get children() {
468
- return n(v, {
457
+ return n(d, {
469
458
  get children() {
470
- return n(V, {
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(v, {
491
+ }), n(d, {
503
492
  get children() {
504
- return n(Y, {
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
- K(["click", "contextmenu"]);
517
+ L(["click", "contextmenu"]);
529
518
  export {
530
- De as NotesOverlay
519
+ _e as NotesOverlay
531
520
  };