@skillre/dsh-plugin-sticky-wall 0.3.0 → 0.4.0

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/lib/client.js CHANGED
@@ -62,6 +62,7 @@ window.__ModuleLoader__.load({
62
62
  md: 222,
63
63
  lg: 276
64
64
  });
65
+ var CENTRE_RADIUS = 300;
65
66
  var LAYOUT_LIMITS = Object.freeze({
66
67
  /** Absolute value of x and y, in world pixels. */
67
68
  coord: 2e4,
@@ -195,7 +196,14 @@ window.__ModuleLoader__.load({
195
196
  "zoomOut": "\u7F29\u5C0F",
196
197
  "zoomReset": "\u91CD\u7F6E\u89C6\u56FE",
197
198
  "dragHint": "\u62D6\u52A8\u5361\u7247\u6446\u653E\u4F4D\u7F6E\uFF0C\u2318/Ctrl + \u6EDA\u8F6E\u7F29\u653E",
198
- "markdownHint": "\u6B63\u6587\u652F\u6301 Markdown\uFF1A\u6807\u9898\u3001\u5217\u8868\u3001\u7C97\u4F53\u3001\u4EE3\u7801\u5757\u3001\u94FE\u63A5\u3001\u8868\u683C"
199
+ "markdownHint": "\u6B63\u6587\u652F\u6301 Markdown\uFF1A\u6807\u9898\u3001\u5217\u8868\u3001\u7C97\u4F53\u3001\u4EE3\u7801\u5757\u3001\u94FE\u63A5\u3001\u8868\u683C",
200
+ "greetMorning": "\u65E9\u4E0A\u597D\uFF0C\u4ECA\u5929\u60F3\u8BB0\u70B9\u4EC0\u4E48\uFF1F",
201
+ "greetAfternoon": "\u4E0B\u5348\u597D\uFF0C\u6709\u4EC0\u4E48\u60F3\u7559\u4E0B\u6765\u7684\uFF1F",
202
+ "greetEvening": "\u665A\u4E0A\u597D\uFF0C\u6536\u4E00\u4E0B\u4ECA\u5929\u7684\u788E\u7247\u3002",
203
+ "greetNight": "\u591C\u6DF1\u4E86\uFF0C\u60F3\u5230\u4EC0\u4E48\u5C31\u5148\u8BB0\u4E0B\u6765\u3002",
204
+ "centreTally": "{count} \u5F20\u4FBF\u7B7E \xB7 {archived} \u5F20\u5DF2\u5F52\u6863",
205
+ "capturePlaceholder": "\u8BB0\u4E0B\u4E00\u4E2A\u7075\u611F\uFF0C\u6216\u7C98\u8D34\u4E00\u4E2A\u94FE\u63A5",
206
+ "captureGo": "\u8BB0\u4E0B"
199
207
  };
200
208
  var en = {
201
209
  "nav": "Notes",
@@ -260,7 +268,14 @@ window.__ModuleLoader__.load({
260
268
  "zoomOut": "Zoom out",
261
269
  "zoomReset": "Reset view",
262
270
  "dragHint": "Drag a card to place it \xB7 \u2318/Ctrl + wheel to zoom",
263
- "markdownHint": "The body renders Markdown: headings, lists, bold, code blocks, links, tables"
271
+ "markdownHint": "The body renders Markdown: headings, lists, bold, code blocks, links, tables",
272
+ "greetMorning": "Good morning \u2014 what is worth keeping today?",
273
+ "greetAfternoon": "Good afternoon \u2014 anything to jot down?",
274
+ "greetEvening": "Good evening \u2014 collect the loose pieces.",
275
+ "greetNight": "Late night \u2014 capture it before it goes.",
276
+ "centreTally": "{count} notes \xB7 {archived} archived",
277
+ "capturePlaceholder": "Jot an idea, or paste a link",
278
+ "captureGo": "Capture"
264
279
  };
265
280
 
266
281
  // src/client/view.tsx
@@ -345,7 +360,7 @@ window.__ModuleLoader__.load({
345
360
  }
346
361
  function previewLayout(note, index) {
347
362
  const width = previewWidth(note.id);
348
- const radius = PREVIEW_STEP * Math.sqrt(Math.max(0, index));
363
+ const radius = PREVIEW_STEP * Math.sqrt(Math.max(0, index) + (CENTRE_RADIUS / PREVIEW_STEP) ** 2);
349
364
  const theta = index * GOLDEN_ANGLE + (unit(`${note.id}:pa`) - 0.5) * 0.55;
350
365
  return clampLayout({
351
366
  x: Math.cos(theta) * radius - WIDTH_PX[width] / 2,
@@ -562,22 +577,11 @@ window.__ModuleLoader__.load({
562
577
  .skw-page {
563
578
  position: relative; height: 100%; display: flex; flex-direction: column;
564
579
  background-color: var(--dsw-alias-bg-base);
565
- /* A barely-there dot grid reads as paper without competing with the notes. */
566
- background-image: radial-gradient(circle at 1px 1px, var(--dsw-alias-border-l1) 1px, transparent 0);
567
- background-size: 18px 18px;
568
580
  color: var(--dsw-alias-label-primary); font-size: 13px; line-height: 20px;
569
581
  overflow: hidden; -webkit-font-smoothing: antialiased;
570
582
  }
571
583
  .skw-page *, .skw-page *::before, .skw-page *::after { box-sizing: border-box; }
572
584
  .skw-page button { font: inherit; }
573
- .skw-head { flex: 0 0 auto; display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px 14px; }
574
- .skw-head-text { min-width: 0; flex: 1; }
575
- .skw-title { margin: 0; font-size: 19px; line-height: 27px; font-weight: 650; letter-spacing: -.2px; display: flex; align-items: center; gap: 9px; }
576
- /* The title mark echoes the sidebar glyph in the brand color, so the page and
577
- the sidebar entry read as the same object. */
578
- .skw-title-mark { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: none; border-radius: 8px; background: var(--dsw-alias-brand-primary); color: var(--dsw-alias-label-primary-foreground); }
579
- .skw-subtitle { margin: 3px 0 0; font-size: 12px; line-height: 18px; color: var(--dsw-alias-label-secondary); }
580
- .skw-actions { display: flex; align-items: center; gap: 6px; flex: none; }
581
585
  .skw-btn { height: 28px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--dsw-alias-border-l2); border-radius: 7px; background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-secondary); cursor: pointer; white-space: nowrap; }
582
586
  .skw-btn:hover { background: var(--dsw-alias-bg-layer-2); color: var(--dsw-alias-label-primary); }
583
587
  .skw-btn:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }
@@ -588,28 +592,34 @@ window.__ModuleLoader__.load({
588
592
  .skw-btn-danger { color: var(--dsw-alias-state-error-primary); border-color: transparent; background: transparent; }
589
593
  .skw-btn-danger:hover { background: var(--dsw-alias-state-error-secondary); color: var(--dsw-alias-label-primary-foreground); }
590
594
 
591
- .skw-toolbar { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 0 22px 14px; flex-wrap: wrap; }
592
- .skw-search-wrap { position: relative; flex: 1 1 240px; min-width: 160px; display: flex; align-items: center; }
593
- .skw-search-icon { position: absolute; left: 10px; display: flex; color: var(--dsw-alias-label-tertiary); pointer-events: none; }
594
- .skw-search { width: 100%; height: 32px; padding: 0 11px 0 31px; border: 1px solid var(--dsw-alias-border-l2); border-radius: 9px; background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-primary); transition: border-color .12s ease, box-shadow .12s ease; }
595
+ .skw-dock .skw-search-wrap { position: relative; flex: 0 1 190px; min-width: 96px; display: flex; align-items: center; }
596
+ .skw-search-icon { position: absolute; left: 9px; display: flex; color: var(--dsw-alias-label-tertiary); pointer-events: none; }
597
+ .skw-search { width: 100%; height: 30px; padding: 0 10px 0 29px; border: 1px solid var(--dsw-alias-border-l2); border-radius: 9px; background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-primary); transition: border-color .12s ease, box-shadow .12s ease; }
595
598
  .skw-search::placeholder { color: var(--dsw-alias-label-tertiary); }
596
599
  .skw-search:focus-visible { outline: none; border-color: var(--dsw-alias-brand-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent); }
597
600
  /* Chips: one row of quiet pills, the active one filled. No boxed segments, so
598
601
  filters, sorting and the archive toggle stop reading as three boxes. */
599
602
  .skw-seg { display: inline-flex; gap: 4px; }
600
- .skw-seg button { height: 30px; padding: 0 12px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--dsw-alias-label-secondary); cursor: pointer; font-size: 12.5px; transition: background .12s ease, color .12s ease; }
603
+ .skw-seg button { height: 28px; padding: 0 9px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--dsw-alias-label-secondary); cursor: pointer; font-size: 12.5px; transition: background .12s ease, color .12s ease; }
601
604
  .skw-seg button:hover { background: var(--dsw-alias-bg-layer-2); color: var(--dsw-alias-label-primary); }
602
605
  .skw-seg button[data-on="true"] { background: var(--dsw-alias-label-primary); color: var(--dsw-alias-bg-base); font-weight: 550; }
606
+ @media (max-width: 1180px) {
607
+ /* Narrow window: keep the row, drop the least-used groups' labels down a step. */
608
+ .skw-dock { gap: 6px; padding: 5px 6px; }
609
+ .skw-seg button { padding: 0 7px; font-size: 11.5px; }
610
+ }
603
611
  .skw-seg button:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }
604
- .skw-toolbar-sep { width: 1px; height: 18px; background: var(--dsw-alias-border-l2); flex: none; }
605
- .skw-toggle { height: 30px; padding: 0 11px; display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--dsw-alias-border-l2); border-radius: 999px; background: transparent; color: var(--dsw-alias-label-secondary); cursor: pointer; font-size: 12.5px; transition: background .12s ease, color .12s ease, border-color .12s ease; }
612
+ .skw-toggle { height: 28px; padding: 0 9px; display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--dsw-alias-border-l2); border-radius: 999px; background: transparent; color: var(--dsw-alias-label-secondary); cursor: pointer; font-size: 12.5px; transition: background .12s ease, color .12s ease, border-color .12s ease; }
606
613
  .skw-toggle:hover { color: var(--dsw-alias-label-primary); border-color: var(--dsw-alias-border-l4); }
607
614
  .skw-toggle[data-on="true"] { border-style: solid; border-color: var(--dsw-alias-border-l3); background: var(--dsw-alias-bg-layer-2); color: var(--dsw-alias-label-primary); }
608
615
  .skw-toggle:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }
609
- .skw-count { margin-left: auto; font-size: 12px; color: var(--dsw-alias-label-tertiary); font-variant-numeric: tabular-nums; white-space: nowrap; }
616
+ .skw-count { font-size: 11.5px; color: var(--dsw-alias-label-tertiary); font-variant-numeric: tabular-nums; white-space: nowrap; padding: 0 4px; }
610
617
 
611
- .skw-body { flex: 1 1 auto; overflow: auto; overscroll-behavior: contain; padding: 4px 22px 40px; }
618
+ .skw-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 18px 22px 118px; }
612
619
  .skw-body[data-view="canvas"] { padding: 0; overflow: hidden; position: relative; }
620
+ /* The grid and the list are scrolled under the floating dock, so their bottom
621
+ padding clears it instead of hiding the last row behind it. */
622
+ .skw-list-empty { margin: 40px auto; text-align: center; color: var(--dsw-alias-label-secondary); font-size: 13px; }
613
623
  /* Masonry-style columns, not a row grid: cards keep their natural height and
614
624
  short notes no longer sit in a tall row with dead space underneath. */
615
625
  .skw-grid { column-count: 5; column-gap: 14px; }
@@ -668,9 +678,15 @@ window.__ModuleLoader__.load({
668
678
  MAX_CARD_HEIGHT in src/layout.ts. */
669
679
  overflow: hidden;
670
680
  }
681
+ /* The card's height is written inline from the Host's own estimate, so the
682
+ rendered box IS the box the packer collision-checked. These are only the
683
+ fallback for a card rendered without that inline height. */
671
684
  .skw-canvas .skw-note[data-width="sm"] { max-height: 236px; }
672
685
  .skw-canvas .skw-note[data-width="md"] { max-height: 288px; }
673
686
  .skw-canvas .skw-note[data-width="lg"] { max-height: 336px; }
687
+ /* With a fixed height the body must absorb the remainder and clip, rather than
688
+ pushing the footer out of the card. */
689
+ .skw-canvas .skw-note .skw-note-body { min-height: 0; overflow: hidden; }
674
690
  /* While dragging: no hover lift, no text selection, a lifted shadow, and no
675
691
  pointer events on the card's own children so the drag cannot be interrupted
676
692
  by a child capturing the pointer. Containment keeps the lifted card's paint
@@ -710,22 +726,98 @@ window.__ModuleLoader__.load({
710
726
  .skw-row[data-color="purple"] { --skw-note-accent: #9b81e0; }
711
727
  .skw-row[data-color="orange"] { --skw-note-accent: #e79a4e; }
712
728
 
713
- /* Floating camera control, bottom-left: it belongs to the canvas, not to the
714
- toolbar, so the toolbar stays about filtering and the view switch. */
715
- .skw-cameras {
716
- position: absolute; left: 22px; bottom: 18px; z-index: 12;
717
- display: inline-flex; align-items: center; gap: 2px;
718
- padding: 3px; border-radius: 999px; border: 1px solid var(--dsw-alias-border-l2);
719
- background: var(--dsw-alias-bg-layer-1); box-shadow: 0 4px 14px var(--dsw-alias-bg-mask-2);
729
+ /* The floating dock.
730
+ One row of quiet pills across the bottom of the canvas. The wall gets the whole
731
+ window, and the controls sit where the pointer already is after a drag. */
732
+ .skw-dock {
733
+ position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 14;
734
+ max-width: calc(100% - 32px); white-space: nowrap;
735
+ display: flex; align-items: center; gap: 8px;
736
+ padding: 6px 8px 6px 10px; border-radius: 16px;
737
+ border: 1px solid var(--dsw-alias-border-l2);
738
+ background: color-mix(in srgb, var(--dsw-alias-bg-layer-1) 88%, transparent);
739
+ backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
740
+ box-shadow: 0 8px 28px var(--dsw-alias-bg-mask-2), 0 1px 0 color-mix(in srgb, var(--dsw-alias-label-primary) 5%, transparent) inset;
741
+ /* One row, never a wrapped stack: the dock is a floating control strip, and a
742
+ two-line block over the canvas eats the wall it is floating above. */
743
+ flex-wrap: nowrap; justify-content: center;
744
+ }
745
+ .skw-dock-group { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
746
+ .skw-dock-group + .skw-dock-group { padding-left: 8px; border-left: 1px solid var(--dsw-alias-border-l1); }
747
+ .skw-dock-zoom { gap: 1px; }
748
+ .skw-dock-quiet {
749
+ height: 28px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent;
750
+ color: var(--dsw-alias-label-tertiary); cursor: pointer; font-size: 11.5px; white-space: nowrap;
751
+ }
752
+ .skw-dock-quiet:hover { background: var(--dsw-alias-bg-layer-2); color: var(--dsw-alias-label-primary); }
753
+ .skw-dock-quiet[disabled] { opacity: .45; cursor: default; }
754
+ /* The one filled control: creating a note is the primary action. */
755
+ .skw-dock-new {
756
+ width: 32px; height: 32px; flex: none; display: inline-flex; align-items: center; justify-content: center;
757
+ border: 0; border-radius: 50%; background: var(--dsw-alias-brand-primary);
758
+ color: var(--dsw-alias-label-primary-foreground); cursor: pointer;
759
+ font-size: 19px; line-height: 1; font-weight: 400; padding: 0 0 2px;
760
+ transition: transform .12s ease, filter .12s ease;
720
761
  }
762
+ .skw-dock-new:hover { filter: brightness(1.08); transform: scale(1.06); }
763
+ .skw-dock-new:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 2px; }
764
+ .skw-dock-new[disabled] { opacity: .5; cursor: default; transform: none; }
721
765
  .skw-camera-btn {
722
766
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
723
767
  border: 0; border-radius: 50%; background: transparent; color: var(--dsw-alias-label-secondary);
724
768
  cursor: pointer; font-size: 13px; line-height: 1;
725
769
  }
726
770
  .skw-camera-btn:hover { background: var(--dsw-alias-bg-layer-2); color: var(--dsw-alias-label-primary); }
771
+ .skw-camera-btn[disabled] { opacity: .4; cursor: default; background: transparent; }
727
772
  .skw-camera-btn:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }
728
- .skw-camera-value { min-width: 38px; text-align: center; font-size: 11px; color: var(--dsw-alias-label-tertiary); font-variant-numeric: tabular-nums; }
773
+ .skw-camera-value { min-width: 36px; text-align: center; font-size: 11px; color: var(--dsw-alias-label-tertiary); font-variant-numeric: tabular-nums; }
774
+
775
+ /* The wall's centrepiece: greeting, tally and quick capture.
776
+ Screen space, not world space, so it stays put when the wall pans or zooms.
777
+ The wrapper ignores the pointer (the paper behind it stays draggable) and only
778
+ the field itself takes input. */
779
+ .skw-centre {
780
+ position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
781
+ width: min(560px, calc(100% - 48px)); z-index: 10;
782
+ display: flex; flex-direction: column; align-items: center; gap: 8px;
783
+ pointer-events: none; text-align: center;
784
+ }
785
+ .skw-centre-hello {
786
+ margin: 0; font-size: 21px; line-height: 30px; font-weight: 650; letter-spacing: -.3px;
787
+ color: var(--dsw-alias-label-primary);
788
+ }
789
+ .skw-centre-tally {
790
+ margin: 0 0 6px; font-size: 12.5px; line-height: 19px; color: var(--dsw-alias-label-tertiary);
791
+ font-variant-numeric: tabular-nums;
792
+ }
793
+ .skw-capture {
794
+ pointer-events: auto; width: 100%; display: flex; align-items: center; gap: 8px;
795
+ padding: 8px 8px 8px 14px; border-radius: 14px;
796
+ border: 1px solid var(--dsw-alias-border-l2);
797
+ background: color-mix(in srgb, var(--dsw-alias-bg-layer-1) 92%, transparent);
798
+ backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
799
+ box-shadow: 0 8px 24px var(--dsw-alias-bg-mask-2);
800
+ transition: border-color .14s ease, box-shadow .14s ease;
801
+ }
802
+ .skw-capture:focus-within {
803
+ border-color: color-mix(in srgb, var(--dsw-alias-brand-primary) 55%, var(--dsw-alias-border-l2));
804
+ box-shadow: 0 8px 24px var(--dsw-alias-bg-mask-2), 0 0 0 3px color-mix(in srgb, var(--dsw-alias-brand-primary) 14%, transparent);
805
+ }
806
+ .skw-capture-icon { flex: none; color: var(--dsw-alias-label-tertiary); font-size: 13px; line-height: 1; }
807
+ .skw-capture-input {
808
+ flex: 1; min-width: 0; height: 26px; border: 0; background: transparent;
809
+ color: var(--dsw-alias-label-primary); font-size: 13px; line-height: 26px;
810
+ }
811
+ .skw-capture-input:focus-visible { outline: none; }
812
+ .skw-capture-input::placeholder { color: var(--dsw-alias-label-tertiary); }
813
+ .skw-capture-go {
814
+ width: 30px; height: 30px; flex: none; display: inline-flex; align-items: center; justify-content: center;
815
+ border: 0; border-radius: 9px; background: var(--dsw-alias-brand-primary);
816
+ color: var(--dsw-alias-label-primary-foreground); cursor: pointer; font-size: 13px; line-height: 1;
817
+ }
818
+ .skw-capture-go[disabled] { opacity: .35; cursor: default; }
819
+ .skw-capture-go:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 2px; }
820
+
729
821
  .skw-empty { margin: 64px auto 0; max-width: 380px; text-align: center; color: var(--dsw-alias-label-secondary); }
730
822
  .skw-empty p { margin: 0 0 14px; font-size: 13px; }
731
823
  .skw-empty-icon { font-size: 30px; line-height: 1; display: block; margin-bottom: 12px; opacity: .65; }
@@ -1194,7 +1286,20 @@ window.__ModuleLoader__.load({
1194
1286
  actions
1195
1287
  }) {
1196
1288
  const layout = layoutOf(note, index);
1197
- const style = surface === "canvas" ? { left: `${layout.x}px`, top: `${layout.y}px`, width: `${WIDTH_PX[layout.width]}px`, transform: `rotate(${layout.rotate}deg)` } : {};
1289
+ const style = surface === "canvas" ? {
1290
+ left: `${layout.x}px`,
1291
+ top: `${layout.y}px`,
1292
+ width: `${WIDTH_PX[layout.width]}px`,
1293
+ // The HEIGHT is the Host's own estimate, not a CSS max-height.
1294
+ //
1295
+ // This is what makes the packer's geometry exact: the collision check runs
1296
+ // on `estimateHeight`, so unless the rendered box is that same height, a
1297
+ // card whose content renders taller than its estimate overlaps its
1298
+ // neighbour — which is precisely the residual overlap this fixes (a code
1299
+ // block's padding and border are not something a line count can see).
1300
+ height: `${estimateHeight(note, layout.width)}px`,
1301
+ transform: `rotate(${layout.rotate}deg)`
1302
+ } : {};
1198
1303
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1199
1304
  "article",
1200
1305
  {
@@ -1327,6 +1432,7 @@ window.__ModuleLoader__.load({
1327
1432
  const [confirming, setConfirming] = (0, import_react.useState)(null);
1328
1433
  const [zoom, setZoom] = (0, import_react.useState)(1);
1329
1434
  const [viewportTick, setViewportTick] = (0, import_react.useState)(0);
1435
+ const [capture, setCapture] = (0, import_react.useState)("");
1330
1436
  const [, setLocaleRevision] = (0, import_react.useState)(0);
1331
1437
  const alive = (0, import_react.useRef)(true);
1332
1438
  const life = (0, import_react.useRef)(new AbortController());
@@ -1384,7 +1490,7 @@ window.__ModuleLoader__.load({
1384
1490
  };
1385
1491
  }, [reload, includeArchived, sort]);
1386
1492
  async function mutate(run) {
1387
- if (inFlight.current) return;
1493
+ if (inFlight.current) return false;
1388
1494
  inFlight.current = true;
1389
1495
  setBusy(true);
1390
1496
  setError("");
@@ -1400,6 +1506,19 @@ window.__ModuleLoader__.load({
1400
1506
  }
1401
1507
  inFlight.current = false;
1402
1508
  }
1509
+ return true;
1510
+ }
1511
+ async function tidyWall() {
1512
+ const ran = await mutate(async () => {
1513
+ await api.arrange(life.current.signal);
1514
+ });
1515
+ if (!ran) return;
1516
+ await new Promise((resolve) => {
1517
+ requestAnimationFrame(() => resolve());
1518
+ });
1519
+ if (!alive.current) return;
1520
+ centreRequest.current = true;
1521
+ setViewportTick((value) => value + 1);
1403
1522
  }
1404
1523
  function openComposer(note) {
1405
1524
  setDraftError("");
@@ -1439,6 +1558,12 @@ window.__ModuleLoader__.load({
1439
1558
  });
1440
1559
  }, [notes, filter, query, showArchived]);
1441
1560
  const archivedCount = notes.filter((note) => note.archived).length;
1561
+ const greeting = (0, import_react.useMemo)(() => {
1562
+ const hour = (/* @__PURE__ */ new Date()).getHours();
1563
+ const key = hour < 5 ? "greetNight" : hour < 12 ? "greetMorning" : hour < 18 ? "greetAfternoon" : "greetEvening";
1564
+ return t(key);
1565
+ }, [t, activeLocale]);
1566
+ const emptyCopy = filter === "archived" ? t("emptyArchived") : query.trim() !== "" ? t("noResults") : t("empty");
1442
1567
  const wallBounds = (0, import_react.useMemo)(() => {
1443
1568
  let minX = Number.POSITIVE_INFINITY;
1444
1569
  let minY = Number.POSITIVE_INFINITY;
@@ -1464,14 +1589,18 @@ window.__ModuleLoader__.load({
1464
1589
  }
1465
1590
  if (count === 0) return { centre: { x: 0, y: 0 }, width: 0, height: 0 };
1466
1591
  return {
1467
- // The centroid, not the box's middle: an uneven disc has a centre of mass
1468
- // that reads as "the middle" to the eye even when its bounds are lopsided.
1469
- centre: { x: sumX / count, y: sumY / count },
1592
+ // The bounding box's middle, not the centroid: "frame the whole wall" means
1593
+ // the wall's outer edges are equidistant from the viewport edges, and only
1594
+ // the box middle guarantees that. A lopsided two-card wall has a centroid
1595
+ // far from its visual middle, which left one card half off screen.
1596
+ centre: { x: (minX + maxX) / 2, y: (minY + maxY) / 2 },
1470
1597
  width: maxX - minX,
1471
1598
  height: maxY - minY
1472
1599
  };
1473
1600
  }, [visible, stableIndex]);
1474
1601
  const wallCentre = wallBounds.centre;
1602
+ const boundsRef = (0, import_react.useRef)(wallBounds);
1603
+ boundsRef.current = wallBounds;
1475
1604
  const hasNotes = visible.length > 0;
1476
1605
  const applyCamera = (0, import_react.useCallback)(() => {
1477
1606
  const current = camera.current;
@@ -1518,19 +1647,46 @@ window.__ModuleLoader__.load({
1518
1647
  const fitWall = (0, import_react.useCallback)(() => {
1519
1648
  const viewport = viewportRefCurrent.current;
1520
1649
  if (viewport === null) return;
1521
- const availableWidth = viewport.clientWidth;
1522
- const availableHeight = viewport.clientHeight;
1650
+ const availableWidth = viewport.clientWidth || 960;
1651
+ const availableHeight = viewport.clientHeight || 640;
1652
+ const world = worldRef.current;
1653
+ let minX = Number.POSITIVE_INFINITY;
1654
+ let minY = Number.POSITIVE_INFINITY;
1655
+ let maxX = Number.NEGATIVE_INFINITY;
1656
+ let maxY = Number.NEGATIVE_INFINITY;
1657
+ if (world !== null) {
1658
+ for (const node of world.querySelectorAll(".skw-note")) {
1659
+ const x = node.offsetLeft;
1660
+ const y = node.offsetTop;
1661
+ const width = node.offsetWidth;
1662
+ const height = node.offsetHeight;
1663
+ if (width === 0 || height === 0) continue;
1664
+ minX = Math.min(minX, x);
1665
+ minY = Math.min(minY, y);
1666
+ maxX = Math.max(maxX, x + width);
1667
+ maxY = Math.max(maxY, y + height);
1668
+ }
1669
+ }
1670
+ const measured = Number.isFinite(minX) && Number.isFinite(minY) && maxX > minX;
1671
+ const bounds = boundsRef.current;
1672
+ const boxWidth = measured ? maxX - minX : bounds.width;
1673
+ const boxHeight = measured ? maxY - minY : bounds.height;
1674
+ const centreX = measured ? (minX + maxX) / 2 : bounds.centre.x;
1675
+ const centreY = measured ? (minY + maxY) / 2 : bounds.centre.y;
1523
1676
  const margin = 48;
1524
1677
  const fit = Math.min(
1525
- availableWidth > 0 ? (availableWidth - margin * 2) / Math.max(1, wallBounds.width) : 1,
1526
- availableHeight > 0 ? (availableHeight - margin * 2) / Math.max(1, wallBounds.height) : 1
1678
+ (availableWidth - margin * 2) / Math.max(1, boxWidth),
1679
+ (availableHeight - margin * 2) / Math.max(1, boxHeight)
1527
1680
  );
1528
- const target = clampZoom(Math.min(1, fit));
1681
+ const FIT_FLOOR = 0.5;
1682
+ const target = clampZoom(Math.min(1, Math.max(FIT_FLOOR, fit)));
1529
1683
  camera.current.zoom = target;
1530
1684
  setZoom(target);
1531
- centreOn(wallBounds.centre.x, wallBounds.centre.y);
1532
- }, [centreOn, wallBounds]);
1533
- const resetView = (0, import_react.useCallback)(() => fitWall(), [fitWall]);
1685
+ centreOn(centreX, centreY);
1686
+ }, [centreOn]);
1687
+ const resetView = (0, import_react.useCallback)(() => {
1688
+ fitWall();
1689
+ }, [fitWall]);
1534
1690
  const onWheel = (0, import_react.useCallback)((event) => {
1535
1691
  const node = viewportRefCurrent.current;
1536
1692
  if (node === null) return;
@@ -1579,7 +1735,7 @@ window.__ModuleLoader__.load({
1579
1735
  return;
1580
1736
  }
1581
1737
  applyCamera();
1582
- }, [applyCamera, centreOn, fitWall, view, viewportTick]);
1738
+ }, [applyCamera, fitWall, view, viewportTick]);
1583
1739
  function startDrag(note, event) {
1584
1740
  if (event.button !== 0 || event.isPrimary === false) return;
1585
1741
  const layout = layoutOf(note, indexOf(note));
@@ -1749,39 +1905,59 @@ window.__ModuleLoader__.load({
1749
1905
  }), []);
1750
1906
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { className: "skw-page", "aria-label": t("title"), children: [
1751
1907
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("style", { children: WALL_CSS }),
1752
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", { className: "skw-head", children: [
1753
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-head-text", children: [
1754
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("h1", { className: "skw-title", children: [
1755
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "skw-title-mark", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SidebarGlyph, { size: 15 }) }),
1756
- t("title")
1757
- ] }),
1758
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "skw-subtitle", children: t("subtitle") })
1908
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-body", "data-view": view, children: [
1909
+ error !== "" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("p", { className: "skw-error", role: "alert", children: [
1910
+ error,
1911
+ " ",
1912
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { className: "skw-btn skw-btn-quiet", type: "button", onClick: () => void reload({ includeArchived, sort }), children: t("retry") })
1759
1913
  ] }),
1760
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-actions", children: [
1761
- archivedCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { className: "skw-btn skw-btn-quiet", type: "button", onClick: () => setConfirming("clear"), disabled: busy, children: t("clearArchived") }),
1762
- view === "canvas" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1763
- "button",
1764
- {
1765
- className: "skw-btn skw-btn-quiet",
1766
- type: "button",
1767
- disabled: busy || visible.length === 0,
1768
- onClick: () => void mutate(async () => {
1769
- await api.arrange(life.current.signal);
1770
- centreRequest.current = true;
1771
- setViewportTick((value) => value + 1);
1772
- }),
1773
- children: t("arrange")
1774
- }
1775
- ),
1776
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", { className: "skw-btn skw-btn-primary", type: "button", onClick: () => openComposer(), disabled: busy, children: [
1777
- "+ ",
1778
- t("new")
1914
+ loading && notes.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "skw-empty", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: t("loading") }) }) : view === "list" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-list", children: [
1915
+ visible.map((note) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(NoteRow, { note, t, locale: activeLocale, onEdit: openComposer }, note.id)),
1916
+ visible.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "skw-list-empty", children: emptyCopy })
1917
+ ] }) : view === "grid" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-grid", children: [
1918
+ visible.map((note) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(NoteCard, { note, index: indexOf(note), surface: "grid", t, locale: activeLocale, actions }, note.id)),
1919
+ visible.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "skw-list-empty", children: emptyCopy })
1920
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { ref: bindViewport, className: "skw-canvas", "data-zoomed": zoom !== 1, onPointerDown: startPan, children: [
1921
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { ref: worldRef, className: "skw-world", children: visible.map((note) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(NoteCard, { note, index: indexOf(note), surface: "canvas", t, locale: activeLocale, actions }, note.id)) }),
1922
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-centre", "aria-hidden": false, children: [
1923
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "skw-centre-hello", children: greeting }),
1924
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "skw-centre-tally", "data-empty": visible.length === 0, children: visible.length === 0 ? emptyCopy : t("centreTally", { count: visible.length, archived: archivedCount }) }),
1925
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1926
+ "form",
1927
+ {
1928
+ className: "skw-capture",
1929
+ onSubmit: (event) => {
1930
+ event.preventDefault();
1931
+ const body = capture.trim();
1932
+ if (body === "" || busy) return;
1933
+ void mutate(async () => {
1934
+ await api.create({ body }, life.current.signal);
1935
+ setCapture("");
1936
+ });
1937
+ },
1938
+ children: [
1939
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "skw-capture-icon", "aria-hidden": "true", children: "\u270E" }),
1940
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1941
+ "input",
1942
+ {
1943
+ className: "skw-capture-input",
1944
+ value: capture,
1945
+ placeholder: t("capturePlaceholder"),
1946
+ "aria-label": t("capturePlaceholder"),
1947
+ maxLength: LIMITS.body,
1948
+ onChange: (event) => setCapture(event.target.value)
1949
+ }
1950
+ ),
1951
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { className: "skw-capture-go", type: "submit", disabled: busy || capture.trim() === "", "aria-label": t("captureGo"), children: "\u21B5" })
1952
+ ]
1953
+ }
1954
+ )
1779
1955
  ] })
1780
1956
  ] })
1781
1957
  ] }),
1782
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-toolbar", children: [
1783
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-search-wrap", children: [
1784
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "skw-search-icon", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", children: [
1958
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-dock", role: "toolbar", "aria-label": t("title"), children: [
1959
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "skw-dock-group", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-search-wrap", children: [
1960
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "skw-search-icon", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", children: [
1785
1961
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "10.5", cy: "10.5", r: "6.2", stroke: "currentColor", strokeWidth: "1.8" }),
1786
1962
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M15.4 15.4L20 20", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" })
1787
1963
  ] }) }),
@@ -1796,46 +1972,49 @@ window.__ModuleLoader__.load({
1796
1972
  onChange: (event) => setQuery(event.target.value)
1797
1973
  }
1798
1974
  )
1975
+ ] }) }),
1976
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-dock-group", children: [
1977
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "skw-seg", role: "group", "aria-label": t("filters"), children: ["all", "pinned", "archived"].map((key) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", "data-on": filter === key, onClick: () => setFilter(key), children: key === "all" ? t("all") : key === "pinned" ? t("pin") : t("archive") }, key)) }),
1978
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1979
+ "button",
1980
+ {
1981
+ className: "skw-toggle",
1982
+ type: "button",
1983
+ "data-on": showArchived,
1984
+ "aria-pressed": showArchived,
1985
+ onClick: () => setShowArchived((value) => !value),
1986
+ children: showArchived ? t("hideArchived") : t("showArchived")
1987
+ }
1988
+ )
1799
1989
  ] }),
1800
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "skw-seg", role: "group", "aria-label": t("filters"), children: ["all", "pinned", "archived"].map((key) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", "data-on": filter === key, onClick: () => setFilter(key), children: key === "all" ? t("all") : key === "pinned" ? t("pin") : t("archive") }, key)) }),
1801
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1802
- "button",
1803
- {
1804
- className: "skw-toggle",
1805
- type: "button",
1806
- "data-on": showArchived,
1807
- "aria-pressed": showArchived,
1808
- onClick: () => setShowArchived((value) => !value),
1809
- children: showArchived ? t("hideArchived") : t("showArchived")
1810
- }
1811
- ),
1812
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "skw-seg", role: "group", "aria-label": t("sortPinned"), children: ["pinned", "created", "updated"].map((key) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", "data-on": sort === key, onClick: () => setSort(key), children: key === "pinned" ? t("sortPinned") : key === "created" ? t("sortCreated") : t("sortUpdated") }, key)) }),
1813
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "skw-seg skw-view-seg", role: "group", "aria-label": t("viewLabel"), children: ["canvas", "grid", "list"].map((mode) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", "data-on": view === mode, onClick: () => setView(mode), "aria-label": t(`view_${mode}`), children: t(`view_${mode}`) }, mode)) }),
1814
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "skw-count", children: t("count", { count: visible.length }) })
1815
- ] }),
1816
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-body", "data-view": view, children: [
1817
- error !== "" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("p", { className: "skw-error", role: "alert", children: [
1818
- error,
1819
- " ",
1820
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { className: "skw-btn skw-btn-quiet", type: "button", onClick: () => void reload({ includeArchived, sort }), children: t("retry") })
1990
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-dock-group", children: [
1991
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "skw-seg", role: "group", "aria-label": t("viewLabel"), children: ["canvas", "grid", "list"].map((mode) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", "data-on": view === mode, onClick: () => setView(mode), "aria-label": t(`view_${mode}`), children: t(`view_${mode}`) }, mode)) }),
1992
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "skw-seg", role: "group", "aria-label": t("sortPinned"), children: ["pinned", "created", "updated"].map((key) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", "data-on": sort === key, onClick: () => setSort(key), children: key === "pinned" ? t("sortPinned") : key === "created" ? t("sortCreated") : t("sortUpdated") }, key)) })
1821
1993
  ] }),
1822
- loading && notes.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "skw-empty", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: t("loading") }) }) : visible.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-empty", children: [
1823
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "skw-empty-icon", "aria-hidden": "true", children: "\u{1F5D2}\uFE0F" }),
1824
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: filter === "archived" ? t("emptyArchived") : query.trim() !== "" ? t("noResults") : t("empty") }),
1825
- filter !== "archived" && query.trim() === "" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { className: "skw-btn", type: "button", onClick: () => openComposer(), children: t("new") })
1826
- ] }) : view === "list" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "skw-list", children: visible.map((note) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(NoteRow, { note, t, locale: activeLocale, onEdit: openComposer }, note.id)) }) : view === "grid" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "skw-grid", children: visible.map((note) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(NoteCard, { note, index: indexOf(note), surface: "grid", t, locale: activeLocale, actions }, note.id)) }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { ref: bindViewport, className: "skw-canvas", "data-zoomed": zoom !== 1, onPointerDown: startPan, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { ref: worldRef, className: "skw-world", children: [
1827
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "skw-origin-glow", style: { left: `${wallCentre.x}px`, top: `${wallCentre.y}px` }, "aria-hidden": "true" }),
1828
- visible.map((note) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(NoteCard, { note, index: indexOf(note), surface: "canvas", t, locale: activeLocale, actions }, note.id))
1829
- ] }) })
1830
- ] }),
1831
- view === "canvas" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-cameras", role: "group", "aria-label": t("zoomLabel"), children: [
1832
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { className: "skw-camera-btn", type: "button", "aria-label": t("zoomOut"), onClick: () => zoomTo(zoom - 0.15), children: "\u2212" }),
1833
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "skw-camera-value", children: [
1834
- Math.round(zoom * 100),
1835
- "%"
1994
+ view === "canvas" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-dock-group skw-dock-zoom", role: "group", "aria-label": t("zoomLabel"), children: [
1995
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { className: "skw-camera-btn", type: "button", "aria-label": t("zoomOut"), onClick: () => zoomTo(zoom - 0.15), children: "\u2212" }),
1996
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "skw-camera-value", children: [
1997
+ Math.round(zoom * 100),
1998
+ "%"
1999
+ ] }),
2000
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { className: "skw-camera-btn", type: "button", "aria-label": t("zoomIn"), onClick: () => zoomTo(zoom + 0.15), children: "+" }),
2001
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { className: "skw-camera-btn", type: "button", "aria-label": t("zoomReset"), onClick: resetView, children: "\u2316" }),
2002
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2003
+ "button",
2004
+ {
2005
+ className: "skw-camera-btn",
2006
+ type: "button",
2007
+ "aria-label": t("arrange"),
2008
+ title: t("arrange"),
2009
+ disabled: busy || visible.length === 0,
2010
+ onClick: () => void tidyWall(),
2011
+ children: "\u2727"
2012
+ }
2013
+ )
1836
2014
  ] }),
1837
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { className: "skw-camera-btn", type: "button", "aria-label": t("zoomIn"), onClick: () => zoomTo(zoom + 0.15), children: "+" }),
1838
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { className: "skw-camera-btn", type: "button", "aria-label": t("zoomReset"), onClick: resetView, children: "\u2316" })
2015
+ archivedCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { className: "skw-dock-quiet", type: "button", onClick: () => setConfirming("clear"), disabled: busy, children: t("clearArchived") }),
2016
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "skw-count", children: t("count", { count: visible.length }) }),
2017
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { className: "skw-dock-new", type: "button", onClick: () => openComposer(), disabled: busy, "aria-label": t("new"), children: "+" })
1839
2018
  ] }),
1840
2019
  draft && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1841
2020
  Composer,
package/lib/layout.d.ts CHANGED
@@ -80,6 +80,8 @@ export declare function rotatedExtent(width: number, height: number, rotate: num
80
80
  * move. Notes already at exactly that layout are omitted by the caller, so
81
81
  * pressing tidy on an already-tidy wall writes nothing.
82
82
  */
83
- export declare function arrangeLayouts(notes: readonly Note[]): Map<string, NoteLayout>;
83
+ export declare function arrangeLayouts(notes: readonly Note[], options?: {
84
+ centreRadius?: number;
85
+ }): Map<string, NoteLayout>;
84
86
  /** Normalize a submitted width preset, defaulting to the middle size. */
85
87
  export declare function normalizeWidth(raw: unknown): NoteWidth;