@floegence/floe-webapp-core 0.35.42 → 0.35.44

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 (30) 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 +9 -1
  9. package/dist/components/notes/NotesOverlay.js +445 -0
  10. package/dist/components/notes/NotesOverlayLegacy.d.ts +1 -8
  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/useNotesOverlayModel.d.ts +196 -0
  21. package/dist/components/notes/useNotesOverlayModel.js +559 -0
  22. package/dist/floe.css +3 -1
  23. package/dist/full.js +1 -1
  24. package/dist/hooks/useOverlayMask.d.ts +3 -2
  25. package/dist/hooks/useOverlayMask.js +37 -27
  26. package/dist/notes-legacy.css +46 -12
  27. package/dist/notes.js +1 -1
  28. package/dist/styles.css +1 -1
  29. package/package.json +1 -1
  30. package/dist/components/notes/NotesOverlayLegacy.js +0 -1551
@@ -1,26 +1,26 @@
1
- import { createEffect as g, onCleanup as T } from "solid-js";
2
- import { lockBodyStyle as B } from "../utils/bodyStyleLock.js";
3
- import { deferAfterPaint as E } from "../utils/defer.js";
4
- import { getFocusableElements as F, getFirstFocusableElement as M } from "../utils/focus.js";
5
- function k(t) {
1
+ import { createEffect as L, onCleanup as M } from "solid-js";
2
+ import { lockBodyStyle as O } from "../utils/bodyStyleLock.js";
3
+ import { deferAfterPaint as k } from "../utils/defer.js";
4
+ import { getFocusableElements as T, getFirstFocusableElement as B } from "../utils/focus.js";
5
+ function i(t) {
6
6
  return typeof Node < "u" && t instanceof Node;
7
7
  }
8
- function p(t, c, r) {
9
- return r === "none" ? !1 : r === "all" || !t || !k(c) ? !0 : !t.contains(c);
8
+ function p(t, u, c) {
9
+ return c === "none" ? !1 : c === "all" || !t || !i(u) ? !0 : !t.contains(u);
10
10
  }
11
11
  function H(t) {
12
- const c = () => t.lockBodyScroll !== !1, r = () => t.trapFocus !== !1, s = () => t.closeOnEscape !== !1, b = () => t.blockHotkeys !== !1, w = () => t.restoreFocus !== !1;
13
- g(() => {
12
+ const u = () => t.lockBodyScroll !== !1, c = () => t.trapFocus !== !1, s = () => t.closeOnEscape === !1 ? "none" : t.closeOnEscape === "inside" ? "inside" : t.closeOnEscape === "none" ? "none" : "always", b = () => t.blockHotkeys !== !1, w = () => t.restoreFocus !== !1;
13
+ L(() => {
14
14
  if (!t.open() || typeof document > "u") return;
15
- const a = document.activeElement instanceof HTMLElement ? document.activeElement : null, L = c() ? B({ overflow: "hidden" }) : null;
16
- E(() => {
15
+ const f = document.activeElement instanceof HTMLElement ? document.activeElement : null, g = u() ? O({ overflow: "hidden" }) : null;
16
+ k(() => {
17
17
  const e = t.root();
18
18
  if (!e) return;
19
19
  const n = t.autoFocus;
20
20
  if (n === !1) return;
21
- const o = typeof n == "object" ? n.selector : void 0, u = (o ? e.querySelector(o) : null) ?? e.querySelector("[data-floe-autofocus]") ?? M(e) ?? e;
21
+ const o = typeof n == "object" ? n.selector : void 0, a = (o ? e.querySelector(o) : null) ?? e.querySelector("[data-floe-autofocus]") ?? B(e) ?? e;
22
22
  try {
23
- u.focus();
23
+ a.focus();
24
24
  } catch {
25
25
  }
26
26
  });
@@ -28,7 +28,7 @@ function H(t) {
28
28
  if (e.key !== "Tab") return;
29
29
  const n = t.root();
30
30
  if (!n) return;
31
- const o = F(n);
31
+ const o = T(n);
32
32
  if (!o.length) {
33
33
  e.preventDefault();
34
34
  try {
@@ -37,43 +37,53 @@ function H(t) {
37
37
  }
38
38
  return;
39
39
  }
40
- const f = o[0], u = o[o.length - 1], l = document.activeElement instanceof HTMLElement ? document.activeElement : null;
40
+ const r = o[0], a = o[o.length - 1], l = document.activeElement instanceof HTMLElement ? document.activeElement : null;
41
41
  if (e.shiftKey) {
42
- if (l === f || !l || !n.contains(l)) {
42
+ if (l === r || !l || !n.contains(l)) {
43
43
  e.preventDefault();
44
44
  try {
45
- u.focus();
45
+ a.focus();
46
46
  } catch {
47
47
  }
48
48
  }
49
- } else if (l === u) {
49
+ } else if (l === a) {
50
50
  e.preventDefault();
51
51
  try {
52
- f.focus();
52
+ r.focus();
53
53
  } catch {
54
54
  }
55
55
  }
56
- }, i = (e) => {
57
- e.key === "Escape" && (e.preventDefault(), e.stopImmediatePropagation(), t.onClose?.());
58
56
  }, m = (e) => {
59
- const n = t.root();
60
- n && b() && k(e.target) && n.contains(e.target) && e.stopPropagation();
57
+ if (e.key !== "Escape") return;
58
+ const n = s();
59
+ if (n !== "none") {
60
+ if (n === "inside") {
61
+ const o = t.root();
62
+ if (!o) return;
63
+ const r = i(e.target) ? e.target : document.activeElement;
64
+ if (!r || !o.contains(r)) return;
65
+ }
66
+ e.preventDefault(), e.stopImmediatePropagation(), t.onClose?.();
67
+ }
61
68
  }, v = (e) => {
69
+ const n = t.root();
70
+ n && b() && i(e.target) && n.contains(e.target) && e.stopPropagation();
71
+ }, y = (e) => {
62
72
  const n = t.blockWheel ?? "none", o = t.root();
63
73
  p(o, e.target, n) && e.cancelable && e.preventDefault();
64
74
  }, h = (e) => {
65
75
  e.stopPropagation();
66
- }, y = (e) => {
76
+ }, E = (e) => {
67
77
  const n = t.blockTouchMove ?? "none", o = t.root();
68
78
  p(o, e.target, n) && e.cancelable && e.preventDefault();
69
79
  };
70
- r() && document.addEventListener("keydown", d, !0), s() && window.addEventListener("keydown", i, !0), document.addEventListener("keydown", m), (t.blockWheel ?? "none") !== "none" && (document.addEventListener("wheel", v, { capture: !0, passive: !1 }), document.addEventListener("wheel", h)), (t.blockTouchMove ?? "none") !== "none" && document.addEventListener("touchmove", y, { capture: !0, passive: !1 }), T(() => {
71
- r() && document.removeEventListener("keydown", d, !0), s() && window.removeEventListener("keydown", i, !0), document.removeEventListener("keydown", m), (t.blockWheel ?? "none") !== "none" && (document.removeEventListener("wheel", v, !0), document.removeEventListener("wheel", h)), (t.blockTouchMove ?? "none") !== "none" && document.removeEventListener("touchmove", y, !0), L?.(), w() && a && a.isConnected && E(() => {
80
+ c() && document.addEventListener("keydown", d, !0), s() !== "none" && window.addEventListener("keydown", m, !0), document.addEventListener("keydown", v), (t.blockWheel ?? "none") !== "none" && (document.addEventListener("wheel", y, { capture: !0, passive: !1 }), document.addEventListener("wheel", h)), (t.blockTouchMove ?? "none") !== "none" && document.addEventListener("touchmove", E, { capture: !0, passive: !1 }), M(() => {
81
+ c() && document.removeEventListener("keydown", d, !0), s() !== "none" && window.removeEventListener("keydown", m, !0), document.removeEventListener("keydown", v), (t.blockWheel ?? "none") !== "none" && (document.removeEventListener("wheel", y, !0), document.removeEventListener("wheel", h)), (t.blockTouchMove ?? "none") !== "none" && document.removeEventListener("touchmove", E, !0), g?.(), w() && f && f.isConnected && k(() => {
72
82
  if (typeof document > "u") return;
73
83
  const e = document.activeElement;
74
84
  if (!(e && e !== document.body && e !== document.documentElement))
75
85
  try {
76
- a.focus();
86
+ f.focus();
77
87
  } catch {
78
88
  }
79
89
  });
@@ -680,6 +680,10 @@
680
680
  height: var(--note-height);
681
681
  }
682
682
 
683
+ .notes-note.is-dragging {
684
+ will-change: transform;
685
+ }
686
+
683
687
  .notes-note__surface {
684
688
  position: relative;
685
689
  display: flex;
@@ -1302,7 +1306,8 @@
1302
1306
  background: color-mix(in srgb, var(--background) 8%, transparent);
1303
1307
  }
1304
1308
 
1305
- .notes-menu {
1309
+ .notes-menu,
1310
+ .notes-context-menu {
1306
1311
  position: fixed;
1307
1312
  z-index: 75;
1308
1313
  width: 13rem;
@@ -1314,7 +1319,8 @@
1314
1319
  box-shadow: 0 18px 36px color-mix(in srgb, var(--foreground) 14%, transparent);
1315
1320
  }
1316
1321
 
1317
- .notes-menu__item {
1322
+ .notes-menu__item,
1323
+ .notes-context-menu__item {
1318
1324
  display: flex;
1319
1325
  align-items: center;
1320
1326
  gap: 0.68rem;
@@ -1331,30 +1337,46 @@
1331
1337
  transform 140ms ease;
1332
1338
  }
1333
1339
 
1334
- .notes-menu__item svg {
1340
+ .notes-context-menu__separator {
1341
+ height: 1px;
1342
+ margin: 0.35rem 0.45rem;
1343
+ background: color-mix(in srgb, var(--border) 76%, transparent);
1344
+ }
1345
+
1346
+ .notes-menu__item svg,
1347
+ .notes-context-menu__item svg {
1335
1348
  color: color-mix(in srgb, var(--popover-foreground) 56%, var(--muted-foreground));
1336
1349
  transition: color 140ms ease;
1337
1350
  }
1338
1351
 
1339
- .notes-menu__item:hover {
1352
+ .notes-context-menu__label {
1353
+ flex: 1;
1354
+ }
1355
+
1356
+ .notes-menu__item:hover,
1357
+ .notes-context-menu__item:hover {
1340
1358
  background: color-mix(in srgb, var(--accent) 82%, transparent);
1341
1359
  color: var(--accent-foreground);
1342
1360
  transform: translateX(1px);
1343
1361
  }
1344
1362
 
1345
- .notes-menu__item:hover svg {
1363
+ .notes-menu__item:hover svg,
1364
+ .notes-context-menu__item:hover svg {
1346
1365
  color: currentColor;
1347
1366
  }
1348
1367
 
1349
- .notes-menu__item.is-danger {
1368
+ .notes-menu__item.is-danger,
1369
+ .notes-context-menu__item.is-destructive {
1350
1370
  color: color-mix(in srgb, var(--error) 82%, var(--popover-foreground));
1351
1371
  }
1352
1372
 
1353
- .notes-menu__item.is-danger svg {
1373
+ .notes-menu__item.is-danger svg,
1374
+ .notes-context-menu__item.is-destructive svg {
1354
1375
  color: color-mix(in srgb, var(--error) 66%, var(--muted-foreground));
1355
1376
  }
1356
1377
 
1357
- .notes-menu__item.is-danger:hover {
1378
+ .notes-menu__item.is-danger:hover,
1379
+ .notes-context-menu__item.is-destructive:hover {
1358
1380
  background: color-mix(in srgb, var(--error) 12%, transparent);
1359
1381
  color: color-mix(in srgb, var(--error) 92%, var(--popover-foreground));
1360
1382
  }
@@ -1365,6 +1387,12 @@
1365
1387
  gap: 1rem;
1366
1388
  }
1367
1389
 
1390
+ .notes-editor__field {
1391
+ display: flex;
1392
+ flex-direction: column;
1393
+ gap: 0.5rem;
1394
+ }
1395
+
1368
1396
  .notes-editor__swatches {
1369
1397
  display: grid;
1370
1398
  grid-template-columns: repeat(3, minmax(0, 1fr));
@@ -1423,6 +1451,7 @@
1423
1451
  .notes-trash-section__clear:focus-visible,
1424
1452
  .notes-trash-note__actions button:focus-visible,
1425
1453
  .notes-menu__item:focus-visible,
1454
+ .notes-context-menu__item:focus-visible,
1426
1455
  .notes-note__drag:focus-visible,
1427
1456
  .notes-note__icon-button:focus-visible,
1428
1457
  .notes-note__body:focus-visible,
@@ -1441,7 +1470,8 @@
1441
1470
  .dark .notes-mobile-dock,
1442
1471
  .dark .notes-trash__toggle,
1443
1472
  .dark .notes-trash__panel,
1444
- .dark .notes-menu {
1473
+ .dark .notes-menu,
1474
+ .dark .notes-context-menu {
1445
1475
  box-shadow: 0 22px 42px color-mix(in srgb, black 34%, transparent);
1446
1476
  }
1447
1477
 
@@ -2219,6 +2249,7 @@
2219
2249
  .notes-overview__surface,
2220
2250
  .notes-trash__panel,
2221
2251
  .notes-menu,
2252
+ .notes-context-menu,
2222
2253
  .notes-flyout {
2223
2254
  border-radius: 0.62rem;
2224
2255
  }
@@ -2289,7 +2320,8 @@
2289
2320
 
2290
2321
  .notes-trash-note__actions button,
2291
2322
  .notes-trash-section__clear,
2292
- .notes-menu__item {
2323
+ .notes-menu__item,
2324
+ .notes-context-menu__item {
2293
2325
  cursor: pointer;
2294
2326
  }
2295
2327
 
@@ -2297,7 +2329,8 @@
2297
2329
  background: transparent;
2298
2330
  }
2299
2331
 
2300
- .notes-menu {
2332
+ .notes-menu,
2333
+ .notes-context-menu {
2301
2334
  width: 12.5rem;
2302
2335
  }
2303
2336
 
@@ -2387,7 +2420,8 @@
2387
2420
  .dark .notes-overlay__frame,
2388
2421
  .dark .notes-flyout,
2389
2422
  .dark .notes-trash__panel,
2390
- .dark .notes-menu {
2423
+ .dark .notes-menu,
2424
+ .dark .notes-context-menu {
2391
2425
  box-shadow: 0 26px 56px color-mix(in srgb, black 36%, transparent);
2392
2426
  }
2393
2427
 
package/dist/notes.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { NOTES_CONTEXT_MENU_WIDTH_PX as t, NotesContextMenu as r, estimateNotesContextMenuHeight as a } from "./components/notes/NotesContextMenu.js";
2
2
  import { NOTES_SCALE_MAX as s, NOTES_SCALE_MIN as T, NOTE_BUCKET_METRICS as p, NOTE_COLOR_TOKENS as N, TOPIC_ACCENT_TOKENS as m, TOPIC_ICON_KEYS as S, applyNotesEvent as c, centerViewportOnWorldPoint as E, clampScale as O, computeBoardBounds as _, createDefaultNotesSnapshot as l, groupTrashItems as C, mergeBoardBounds as I, nextLocalZIndex as h, normalizeNotesSnapshot as i, noteBucketMetrics as L, promoteLocalItem as d, removeSnapshotItem as A, removeSnapshotTopic as u, removeSnapshotTrashItem as x, replaceSnapshotItem as B, replaceSnapshotTopic as v, replaceSnapshotTrashItem as M, screenToWorld as P, visibleWorldRect as f, worldToScreen as K, zoomViewportAtPoint as R } from "./components/notes/types.js";
3
3
  import { NOTE_COLOR_LABELS as g, NotesAnimalIcon as w, NotesOverlayIcon as y, NotesTrashCanIcon as X, TOPIC_ACCENT_LABELS as z } from "./components/notes/notesAppearance.js";
4
- import { NotesOverlay as H } from "./components/notes/NotesOverlayLegacy.js";
4
+ import { NotesOverlay as H } from "./components/notes/NotesOverlay.js";
5
5
  export {
6
6
  t as NOTES_CONTEXT_MENU_WIDTH_PX,
7
7
  s as NOTES_SCALE_MAX,