@skillre/dsh-plugin-sticky-wall 0.4.0 → 0.6.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,7 +62,7 @@ window.__ModuleLoader__.load({
62
62
  md: 222,
63
63
  lg: 276
64
64
  });
65
- var CENTRE_RADIUS = 300;
65
+ var CENTRE_RESERVE = Object.freeze({ halfWidth: 330, halfHeight: 136 });
66
66
  var LAYOUT_LIMITS = Object.freeze({
67
67
  /** Absolute value of x and y, in world pixels. */
68
68
  coord: 2e4,
@@ -94,8 +94,11 @@ window.__ModuleLoader__.load({
94
94
  const value = await call({ action: "list", includeArchived, sort }, signal);
95
95
  return Array.isArray(value?.notes) ? value.notes : [];
96
96
  },
97
- async create(input, signal) {
98
- const value = await call({ action: "create", note: input }, signal);
97
+ async create(input, signal, options) {
98
+ const value = await call(
99
+ options?.centreReserve === void 0 ? { action: "create", note: input } : { action: "create", note: input, centreReserve: options.centreReserve },
100
+ signal
101
+ );
99
102
  const note = value?.changed?.[0];
100
103
  if (!note) throw new ActionError("invalid-response", "The Host created no note.");
101
104
  return note;
@@ -124,8 +127,11 @@ window.__ModuleLoader__.load({
124
127
  if (!note) throw new ActionError("invalid-response", "The Host moved no note.");
125
128
  return note;
126
129
  },
127
- async arrange(signal) {
128
- const value = await call({ action: "arrange" }, signal);
130
+ async arrange(signal, options) {
131
+ const value = await call(
132
+ options?.centreReserve === void 0 ? { action: "arrange" } : { action: "arrange", centreReserve: options.centreReserve },
133
+ signal
134
+ );
129
135
  return Array.isArray(value?.changed) ? value.changed : [];
130
136
  }
131
137
  };
@@ -154,6 +160,7 @@ window.__ModuleLoader__.load({
154
160
  "confirmDelete": "\u786E\u5B9A\u5220\u9664\u9009\u4E2D\u7684\u4FBF\u7B7E\uFF1F",
155
161
  "showArchived": "\u663E\u793A\u5F52\u6863",
156
162
  "hideArchived": "\u9690\u85CF\u5F52\u6863",
163
+ "sortLabel": "\u6392\u5E8F",
157
164
  "sortPinned": "\u7F6E\u9876\u4F18\u5148",
158
165
  "sortCreated": "\u6309\u521B\u5EFA",
159
166
  "sortUpdated": "\u6309\u66F4\u65B0",
@@ -226,6 +233,7 @@ window.__ModuleLoader__.load({
226
233
  "confirmDelete": "Delete the selected notes?",
227
234
  "showArchived": "Show archived",
228
235
  "hideArchived": "Hide archived",
236
+ "sortLabel": "Sort",
229
237
  "sortPinned": "Pinned first",
230
238
  "sortCreated": "By created",
231
239
  "sortUpdated": "By updated",
@@ -285,6 +293,7 @@ window.__ModuleLoader__.load({
285
293
  var GOLDEN_ANGLE = Math.PI * (3 - Math.sqrt(5));
286
294
  var PREVIEW_STEP = 196;
287
295
  var PREVIEW_NOMINAL_HEIGHT = 200;
296
+ var PREVIEW_SQUASH = 1.4;
288
297
  var PREVIEW_TILT = 4;
289
298
  function hash(text) {
290
299
  let value = 2166136261;
@@ -360,10 +369,12 @@ window.__ModuleLoader__.load({
360
369
  }
361
370
  function previewLayout(note, index) {
362
371
  const width = previewWidth(note.id);
363
- const radius = PREVIEW_STEP * Math.sqrt(Math.max(0, index) + (CENTRE_RADIUS / PREVIEW_STEP) ** 2);
372
+ const reserve = CENTRE_RESERVE;
373
+ const startRadius = Math.hypot(reserve.halfWidth, reserve.halfHeight) + Math.hypot(WIDTH_PX[width], PREVIEW_NOMINAL_HEIGHT) / 2;
374
+ const radius = PREVIEW_STEP * Math.sqrt(Math.max(0, index) + (startRadius / PREVIEW_STEP) ** 2);
364
375
  const theta = index * GOLDEN_ANGLE + (unit(`${note.id}:pa`) - 0.5) * 0.55;
365
376
  return clampLayout({
366
- x: Math.cos(theta) * radius - WIDTH_PX[width] / 2,
377
+ x: Math.cos(theta) * radius * PREVIEW_SQUASH - WIDTH_PX[width] / 2,
367
378
  y: Math.sin(theta) * radius - PREVIEW_NOMINAL_HEIGHT / 2,
368
379
  rotate: (unit(`${note.id}:pr`) - 0.5) * 2 * PREVIEW_TILT,
369
380
  width
@@ -375,6 +386,37 @@ window.__ModuleLoader__.load({
375
386
  const sin = Math.sin(radians);
376
387
  return { width: width * cos + height * sin, height: height * cos + width * sin };
377
388
  }
389
+ function intersectsReserve(box, reserve = CENTRE_RESERVE) {
390
+ const clear = clearsReserve(box, reserve);
391
+ return !clear;
392
+ }
393
+ var RESERVE_EPSILON = 0.05;
394
+ function clearsReserve(box, reserve) {
395
+ return !(box.x < reserve.halfWidth - RESERVE_EPSILON && box.x + box.width > -reserve.halfWidth + RESERVE_EPSILON && box.y < reserve.halfHeight - RESERVE_EPSILON && box.y + box.height > -reserve.halfHeight + RESERVE_EPSILON);
396
+ }
397
+ function pushOutOfReserve(note, layout, reserve = CENTRE_RESERVE) {
398
+ const box = footprintOf(note, layout);
399
+ if (!intersectsReserve(box, reserve)) return layout;
400
+ const moves = [
401
+ { dx: -reserve.halfWidth - (box.x + box.width), dy: 0 },
402
+ { dx: reserve.halfWidth - box.x, dy: 0 },
403
+ { dx: 0, dy: -reserve.halfHeight - (box.y + box.height) },
404
+ { dx: 0, dy: reserve.halfHeight - box.y }
405
+ ];
406
+ let best = moves[0];
407
+ for (const move of moves) {
408
+ if (Math.abs(move.dx) + Math.abs(move.dy) < Math.abs(best.dx) + Math.abs(best.dy)) best = move;
409
+ }
410
+ return clampLayout({ ...layout, x: layout.x + best.dx, y: layout.y + best.dy });
411
+ }
412
+ function footprintOf(note, layout) {
413
+ const cardWidth = WIDTH_PX[layout.width];
414
+ const cardHeight = estimateHeight(note, layout.width);
415
+ const extent = rotatedExtent(cardWidth, cardHeight, layout.rotate);
416
+ const centreX = layout.x + cardWidth / 2;
417
+ const centreY = layout.y + cardHeight / 2;
418
+ return { x: centreX - extent.width / 2, y: centreY - extent.height / 2, width: extent.width, height: extent.height };
419
+ }
378
420
 
379
421
  // src/client/markdown.tsx
380
422
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -603,16 +645,7 @@ window.__ModuleLoader__.load({
603
645
  .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; }
604
646
  .skw-seg button:hover { background: var(--dsw-alias-bg-layer-2); color: var(--dsw-alias-label-primary); }
605
647
  .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
- }
611
648
  .skw-seg button:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }
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; }
613
- .skw-toggle:hover { color: var(--dsw-alias-label-primary); border-color: var(--dsw-alias-border-l4); }
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); }
615
- .skw-toggle:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }
616
649
  .skw-count { font-size: 11.5px; color: var(--dsw-alias-label-tertiary); font-variant-numeric: tabular-nums; white-space: nowrap; padding: 0 4px; }
617
650
 
618
651
  .skw-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 18px 22px 118px; }
@@ -698,6 +731,38 @@ window.__ModuleLoader__.load({
698
731
  contain: layout paint;
699
732
  }
700
733
  .skw-canvas .skw-note[data-dragging="true"] * { pointer-events: none; }
734
+ /* Arrival.
735
+ A freshly created card has to be findable: it pops in and holds a ring for a
736
+ beat, so "did my capture actually work" is answered by the wall itself instead
737
+ of by counting cards. The animation is a scale on the card's own transform \u2014
738
+ the same property the drag writes \u2014 so it must not be transitioned and must
739
+ return to exactly the stored rotation. */
740
+ @keyframes skw-arrive {
741
+ /* No overshoot past 1.
742
+ A 4.5% bounce looked nice but it inflated the card's PAINTED box, and a card
743
+ packed exactly on the reserve's edge then overlapped the capture field for
744
+ ~200ms \u2014 a real, if brief, defect that also made the overlap assertion
745
+ intermittent. Growing from .86 to exactly 1 keeps the pop and never exceeds
746
+ the footprint the packer collision-checked. */
747
+ 0% { opacity: 0; scale: .86; }
748
+ 60% { opacity: 1; scale: .985; }
749
+ 100% { opacity: 1; scale: 1; }
750
+ }
751
+ @keyframes skw-arrive-ring {
752
+ 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--skw-note-accent) 70%, transparent), 0 6px 18px -6px var(--skw-note-glow); }
753
+ 70% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--skw-note-accent) 0%, transparent), 0 6px 18px -6px var(--skw-note-glow); }
754
+ 100% { box-shadow: 0 1px 2px var(--dsw-alias-bg-mask-2), 0 6px 16px -8px var(--skw-note-glow); }
755
+ }
756
+ .skw-canvas .skw-note[data-arrived="true"] {
757
+ z-index: 18;
758
+ animation: skw-arrive .42s cubic-bezier(.2, .9, .25, 1) both, skw-arrive-ring .9s ease-out both;
759
+ /* The ring needs room to draw outside the card's box. */
760
+ overflow: visible;
761
+ }
762
+ @media (prefers-reduced-motion: reduce) {
763
+ .skw-canvas .skw-note[data-arrived="true"] { animation: skw-arrive-ring .9s ease-out both; }
764
+ }
765
+
701
766
  /* The hover lift belongs to the grid view only. On the canvas the card already
702
767
  has a stored position, and a translateY(-2px) here would fight the drag's
703
768
  own transform (the two rules would overwrite each other). */
@@ -727,50 +792,109 @@ window.__ModuleLoader__.load({
727
792
  .skw-row[data-color="orange"] { --skw-note-accent: #e79a4e; }
728
793
 
729
794
  /* 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. */
795
+ One quiet strip across the bottom of the canvas. The wall gets the whole
796
+ window, and the controls sit where the pointer already is after a drag.
797
+ Design rules that came out of the "buttons overflow the background" report:
798
+ - it is a SINGLE row that never wraps and never grows past the page;
799
+ - groups are separated by hairlines instead of boxes, so it reads as one bar;
800
+ - anything that is a mode rather than a frequent click moves into the menu, so
801
+ the strip stays short at every window width. */
732
802
  .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;
803
+ position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 14;
804
+ max-width: calc(100% - 28px); box-sizing: border-box;
805
+ display: flex; align-items: center; gap: 6px;
806
+ padding: 5px 6px 5px 6px; border-radius: 15px;
737
807
  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; }
808
+ background: color-mix(in srgb, var(--dsw-alias-bg-layer-1) 92%, transparent);
809
+ backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
810
+ box-shadow: 0 10px 30px -8px var(--dsw-alias-bg-mask-2), 0 1px 0 color-mix(in srgb, var(--dsw-alias-label-primary) 6%, transparent) inset;
811
+ flex-wrap: nowrap; justify-content: center; white-space: nowrap;
812
+ }
813
+ /* A hairline between groups. Softer than a border on every group, which made the
814
+ dock look like three boxes glued together. */
815
+ .skw-dock-divider { width: 1px; height: 18px; flex: none; background: var(--dsw-alias-border-l1); }
816
+ .skw-dock .skw-search-wrap { position: relative; flex: 0 1 168px; min-width: 84px; display: flex; align-items: center; }
817
+ .skw-search-icon { position: absolute; left: 8px; display: flex; color: var(--dsw-alias-label-tertiary); pointer-events: none; }
818
+ .skw-search {
819
+ width: 100%; height: 28px; padding: 0 8px 0 26px; border: 1px solid transparent; border-radius: 9px;
820
+ background: var(--dsw-alias-bg-layer-2); color: var(--dsw-alias-label-primary); font-size: 12.5px;
821
+ transition: border-color .12s ease, background .12s ease;
822
+ }
823
+ .skw-search::placeholder { color: var(--dsw-alias-label-tertiary); }
824
+ .skw-search:focus-visible { outline: none; border-color: var(--dsw-alias-brand-primary); background: var(--dsw-alias-bg-layer-1); }
825
+ /* Chips: one row of quiet pills, the active one filled. */
826
+ .skw-seg { display: inline-flex; gap: 2px; flex: none; }
827
+ .skw-seg button {
828
+ height: 28px; min-width: 28px; padding: 0 8px; border: 0; border-radius: 8px;
829
+ background: transparent; color: var(--dsw-alias-label-secondary); cursor: pointer;
830
+ font-size: 12px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
831
+ transition: background .12s ease, color .12s ease;
832
+ }
833
+ .skw-seg button:hover { background: var(--dsw-alias-bg-layer-2); color: var(--dsw-alias-label-primary); }
834
+ .skw-seg button[data-on="true"] { background: var(--dsw-alias-label-primary); color: var(--dsw-alias-bg-base); font-weight: 550; }
835
+ .skw-seg button:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }
836
+ .skw-seg-icons button { width: 30px; padding: 0; }
837
+ .skw-count {
838
+ font-size: 11px; color: var(--dsw-alias-label-tertiary); font-variant-numeric: tabular-nums;
839
+ white-space: nowrap; padding: 0 2px;
840
+ }
841
+ .skw-dock-zoom { display: flex; align-items: center; gap: 0; flex: none; }
842
+ .skw-camera-btn {
843
+ width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
844
+ border: 0; border-radius: 8px; background: transparent; color: var(--dsw-alias-label-secondary);
845
+ cursor: pointer; font-size: 14px; line-height: 1;
846
+ }
847
+ .skw-camera-btn:hover { background: var(--dsw-alias-bg-layer-2); color: var(--dsw-alias-label-primary); }
848
+ .skw-camera-btn[data-on="true"] { background: var(--dsw-alias-bg-layer-2); color: var(--dsw-alias-label-primary); }
849
+ .skw-camera-btn[disabled] { opacity: .38; cursor: default; background: transparent; }
850
+ .skw-camera-btn:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }
851
+ /* The zoom readout is also the reset button: the number is the most obvious
852
+ place to click when the view is wrong, and a separate \u2316 icon was one more
853
+ glyph in a row that had too many. */
854
+ .skw-camera-value {
855
+ min-width: 40px; height: 28px; padding: 0 4px; border: 0; border-radius: 8px; background: transparent;
856
+ text-align: center; font-size: 11px; color: var(--dsw-alias-label-tertiary);
857
+ font-variant-numeric: tabular-nums; cursor: pointer;
858
+ }
859
+ .skw-camera-value:hover { background: var(--dsw-alias-bg-layer-2); color: var(--dsw-alias-label-primary); }
860
+ .skw-camera-value:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }
754
861
  /* The one filled control: creating a note is the primary action. */
755
862
  .skw-dock-new {
756
- width: 32px; height: 32px; flex: none; display: inline-flex; align-items: center; justify-content: center;
863
+ width: 30px; height: 30px; flex: none; display: inline-flex; align-items: center; justify-content: center;
757
864
  border: 0; border-radius: 50%; background: var(--dsw-alias-brand-primary);
758
865
  color: var(--dsw-alias-label-primary-foreground); cursor: pointer;
759
- font-size: 19px; line-height: 1; font-weight: 400; padding: 0 0 2px;
866
+ font-size: 18px; line-height: 1; font-weight: 400; padding: 0 0 2px;
760
867
  transition: transform .12s ease, filter .12s ease;
761
868
  }
762
869
  .skw-dock-new:hover { filter: brightness(1.08); transform: scale(1.06); }
763
870
  .skw-dock-new:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 2px; }
764
871
  .skw-dock-new[disabled] { opacity: .5; cursor: default; transform: none; }
765
- .skw-camera-btn {
766
- width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
767
- border: 0; border-radius: 50%; background: transparent; color: var(--dsw-alias-label-secondary);
768
- cursor: pointer; font-size: 13px; line-height: 1;
769
- }
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; }
772
- .skw-camera-btn:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }
773
- .skw-camera-value { min-width: 36px; text-align: center; font-size: 11px; color: var(--dsw-alias-label-tertiary); font-variant-numeric: tabular-nums; }
872
+
873
+ /* The dock's overflow menu.
874
+ Opens upward out of the dock, because the dock sits on the bottom edge. */
875
+ .skw-menu-wrap { position: relative; flex: none; display: flex; }
876
+ .skw-menu {
877
+ position: absolute; bottom: calc(100% + 8px); right: 0; z-index: 20;
878
+ min-width: 172px; padding: 5px;
879
+ display: flex; flex-direction: column; gap: 1px;
880
+ border: 1px solid var(--dsw-alias-border-l2); border-radius: 11px;
881
+ background: var(--dsw-alias-bg-layer-1);
882
+ box-shadow: 0 14px 34px -10px var(--dsw-alias-bg-mask-3), 0 1px 0 color-mix(in srgb, var(--dsw-alias-label-primary) 6%, transparent) inset;
883
+ }
884
+ .skw-menu-label { padding: 4px 8px 2px; font-size: 10.5px; letter-spacing: .4px; text-transform: uppercase; color: var(--dsw-alias-label-tertiary); }
885
+ .skw-menu button {
886
+ display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px;
887
+ border: 0; border-radius: 7px; background: transparent; color: var(--dsw-alias-label-secondary);
888
+ cursor: pointer; font-size: 12.5px; text-align: left; white-space: nowrap;
889
+ }
890
+ .skw-menu button:hover { background: var(--dsw-alias-bg-layer-2); color: var(--dsw-alias-label-primary); }
891
+ .skw-menu button:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: -1px; }
892
+ .skw-menu button[data-on="true"] { color: var(--dsw-alias-label-primary); font-weight: 550; }
893
+ .skw-menu button[disabled] { opacity: .45; cursor: default; }
894
+ .skw-menu-tick { width: 12px; flex: none; color: var(--dsw-alias-brand-primary); font-size: 11px; }
895
+ .skw-menu-rule { height: 1px; margin: 4px 6px; background: var(--dsw-alias-border-l1); }
896
+ .skw-menu-danger { color: var(--dsw-alias-state-error-primary) !important; }
897
+ .skw-menu-danger:hover { background: var(--dsw-alias-state-error-secondary) !important; color: var(--dsw-alias-label-primary-foreground) !important; }
774
898
 
775
899
  /* The wall's centrepiece: greeting, tally and quick capture.
776
900
  Screen space, not world space, so it stays put when the wall pans or zooms.
@@ -781,6 +905,20 @@ window.__ModuleLoader__.load({
781
905
  width: min(560px, calc(100% - 48px)); z-index: 10;
782
906
  display: flex; flex-direction: column; align-items: center; gap: 8px;
783
907
  pointer-events: none; text-align: center;
908
+ /* A soft plate under the block.
909
+ The reserve keeps cards out of a rectangle, but a card can still sit just
910
+ outside its edge, and bare paper behind a floating capture field made the
911
+ field look like it was hovering over text. The plate is a feathered radial
912
+ wash rather than a solid panel, so the wall still reads as one surface. */
913
+ padding: 22px 26px 26px;
914
+ }
915
+ .skw-centre::before {
916
+ content: ""; position: absolute; inset: -28px -40px; z-index: -1; pointer-events: none;
917
+ border-radius: 50%;
918
+ background: radial-gradient(ellipse at center,
919
+ color-mix(in srgb, var(--dsw-alias-bg-base) 96%, transparent) 0%,
920
+ color-mix(in srgb, var(--dsw-alias-bg-base) 88%, transparent) 46%,
921
+ color-mix(in srgb, var(--dsw-alias-bg-base) 0%, transparent) 72%);
784
922
  }
785
923
  .skw-centre-hello {
786
924
  margin: 0; font-size: 21px; line-height: 30px; font-weight: 650; letter-spacing: -.3px;
@@ -1056,6 +1194,8 @@ window.__ModuleLoader__.load({
1056
1194
  var WIDTH_CYCLE = ["sm", "md", "lg"];
1057
1195
  var DOT_PITCH = 22;
1058
1196
  var WHEEL_PAN = 1;
1197
+ var REVEAL_MS = 340;
1198
+ var ARRIVAL_MS = 900;
1059
1199
  function SidebarGlyph({ size = 18 }) {
1060
1200
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { className: "skw-glyph", width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
1061
1201
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { x: "4", y: "7.5", width: "11.5", height: "11.5", rx: "2", stroke: "currentColor", strokeWidth: "1.6" }),
@@ -1283,7 +1423,8 @@ window.__ModuleLoader__.load({
1283
1423
  surface,
1284
1424
  t,
1285
1425
  locale,
1286
- actions
1426
+ actions,
1427
+ arrived = false
1287
1428
  }) {
1288
1429
  const layout = layoutOf(note, index);
1289
1430
  const style = surface === "canvas" ? {
@@ -1309,6 +1450,7 @@ window.__ModuleLoader__.load({
1309
1450
  "data-pinned": note.pinned,
1310
1451
  "data-archived": note.archived,
1311
1452
  "data-width": layout.width,
1453
+ "data-arrived": arrived,
1312
1454
  style,
1313
1455
  "aria-label": note.title || note.body.slice(0, 40),
1314
1456
  tabIndex: 0,
@@ -1433,6 +1575,8 @@ window.__ModuleLoader__.load({
1433
1575
  const [zoom, setZoom] = (0, import_react.useState)(1);
1434
1576
  const [viewportTick, setViewportTick] = (0, import_react.useState)(0);
1435
1577
  const [capture, setCapture] = (0, import_react.useState)("");
1578
+ const [arrivedId, setArrivedId] = (0, import_react.useState)(null);
1579
+ const [menuOpen, setMenuOpen] = (0, import_react.useState)(false);
1436
1580
  const [, setLocaleRevision] = (0, import_react.useState)(0);
1437
1581
  const alive = (0, import_react.useRef)(true);
1438
1582
  const life = (0, import_react.useRef)(new AbortController());
@@ -1440,6 +1584,9 @@ window.__ModuleLoader__.load({
1440
1584
  const inFlight = (0, import_react.useRef)(false);
1441
1585
  const viewportRefCurrent = (0, import_react.useRef)(null);
1442
1586
  const worldRef = (0, import_react.useRef)(null);
1587
+ const centreRef = (0, import_react.useRef)(null);
1588
+ const menuRef = (0, import_react.useRef)(null);
1589
+ const dockRef = (0, import_react.useRef)(null);
1443
1590
  const detachWheel = (0, import_react.useRef)(null);
1444
1591
  const camera = (0, import_react.useRef)({ zoom: 1, panX: 0, panY: 0 });
1445
1592
  const centreRequest = (0, import_react.useRef)(true);
@@ -1463,6 +1610,23 @@ window.__ModuleLoader__.load({
1463
1610
  });
1464
1611
  return unsubscribe;
1465
1612
  }, [locale]);
1613
+ (0, import_react.useEffect)(() => {
1614
+ if (!menuOpen) return;
1615
+ const onPointerDown = (event) => {
1616
+ const node = menuRef.current;
1617
+ if (node !== null && event.target instanceof Node && node.contains(event.target)) return;
1618
+ setMenuOpen(false);
1619
+ };
1620
+ const onKeyDown = (event) => {
1621
+ if (event.key === "Escape") setMenuOpen(false);
1622
+ };
1623
+ window.addEventListener("pointerdown", onPointerDown, true);
1624
+ window.addEventListener("keydown", onKeyDown);
1625
+ return () => {
1626
+ window.removeEventListener("pointerdown", onPointerDown, true);
1627
+ window.removeEventListener("keydown", onKeyDown);
1628
+ };
1629
+ }, [menuOpen]);
1466
1630
  const reload = (0, import_react.useMemo)(() => async (options) => {
1467
1631
  const seq = ++sequence.current;
1468
1632
  setLoading(true);
@@ -1510,7 +1674,7 @@ window.__ModuleLoader__.load({
1510
1674
  }
1511
1675
  async function tidyWall() {
1512
1676
  const ran = await mutate(async () => {
1513
- await api.arrange(life.current.signal);
1677
+ await api.arrange(life.current.signal, { centreReserve: centreReserve() });
1514
1678
  });
1515
1679
  if (!ran) return;
1516
1680
  await new Promise((resolve) => {
@@ -1535,7 +1699,13 @@ window.__ModuleLoader__.load({
1535
1699
  await mutate(async () => {
1536
1700
  const tags = parseTags(draft.tags);
1537
1701
  if (draft.id === null) {
1538
- await api.create({ body, title: draft.title.trim(), tags, color: draft.color }, life.current.signal);
1702
+ const note = await api.create(
1703
+ { body, title: draft.title.trim(), tags, color: draft.color },
1704
+ life.current.signal,
1705
+ { centreReserve: centreReserve() }
1706
+ );
1707
+ arrival.current = { id: note.id, token: Date.now() };
1708
+ setArrivedId(note.id);
1539
1709
  } else {
1540
1710
  await api.update(draft.id, { body, title: draft.title.trim(), tags, color: draft.color }, life.current.signal);
1541
1711
  const current = notes.find((note) => note.id === draft.id);
@@ -1607,20 +1777,73 @@ window.__ModuleLoader__.load({
1607
1777
  const world = worldRef.current;
1608
1778
  const viewport = viewportRefCurrent.current;
1609
1779
  if (world !== null) world.style.transform = `translate3d(${current.panX}px, ${current.panY}px, 0) scale(${current.zoom})`;
1780
+ const centre = centreRef.current;
1781
+ if (centre !== null) {
1782
+ const scale = Math.min(1, current.zoom);
1783
+ centre.style.transform = `translate(-50%, -50%) scale(${scale})`;
1784
+ }
1610
1785
  if (viewport !== null) {
1611
1786
  viewport.style.backgroundSize = `${DOT_PITCH * current.zoom}px ${DOT_PITCH * current.zoom}px`;
1612
1787
  viewport.style.backgroundPosition = `${current.panX}px ${current.panY}px`;
1613
1788
  }
1614
1789
  }, []);
1790
+ const tween = (0, import_react.useRef)(0);
1791
+ const stopTween = (0, import_react.useCallback)(() => {
1792
+ if (tween.current !== 0) {
1793
+ cancelAnimationFrame(tween.current);
1794
+ tween.current = 0;
1795
+ }
1796
+ }, []);
1797
+ const glideTo = (0, import_react.useCallback)((zoomTarget, worldX, worldY) => {
1798
+ const viewport = viewportRefCurrent.current;
1799
+ if (viewport === null) return;
1800
+ stopTween();
1801
+ const from = { ...camera.current };
1802
+ const to = {
1803
+ zoom: clampZoom(zoomTarget),
1804
+ panX: viewport.clientWidth / 2 - worldX * clampZoom(zoomTarget),
1805
+ panY: viewport.clientHeight / 2 - worldY * clampZoom(zoomTarget)
1806
+ };
1807
+ if (typeof requestAnimationFrame !== "function") {
1808
+ camera.current = { ...to };
1809
+ setZoom(to.zoom);
1810
+ applyCamera();
1811
+ return;
1812
+ }
1813
+ const started = performance.now();
1814
+ const frame = (now) => {
1815
+ const progress = Math.min(1, (now - started) / REVEAL_MS);
1816
+ const eased = 1 - (1 - progress) ** 3;
1817
+ camera.current = {
1818
+ zoom: from.zoom + (to.zoom - from.zoom) * eased,
1819
+ panX: from.panX + (to.panX - from.panX) * eased,
1820
+ panY: from.panY + (to.panY - from.panY) * eased
1821
+ };
1822
+ applyCamera();
1823
+ if (progress < 1) {
1824
+ tween.current = requestAnimationFrame(frame);
1825
+ return;
1826
+ }
1827
+ tween.current = 0;
1828
+ camera.current = { ...to };
1829
+ setZoom(to.zoom);
1830
+ applyCamera();
1831
+ };
1832
+ tween.current = requestAnimationFrame(frame);
1833
+ setZoom(to.zoom);
1834
+ }, [applyCamera, stopTween]);
1615
1835
  const centreOn = (0, import_react.useCallback)((worldX, worldY) => {
1836
+ stopTween();
1616
1837
  const viewport = viewportRefCurrent.current;
1617
1838
  const current = camera.current;
1618
1839
  if (viewport !== null) {
1840
+ const dock = dockRef.current;
1841
+ const bottomInset = dock === null ? 0 : dock.offsetHeight + 24;
1619
1842
  current.panX = viewport.clientWidth / 2 - worldX * current.zoom;
1620
- current.panY = viewport.clientHeight / 2 - worldY * current.zoom;
1843
+ current.panY = (viewport.clientHeight - bottomInset) / 2 - worldY * current.zoom;
1621
1844
  }
1622
1845
  applyCamera();
1623
- }, [applyCamera]);
1846
+ }, [applyCamera, stopTween]);
1624
1847
  (0, import_react.useEffect)(() => {
1625
1848
  if (hasNotes) centreRequest.current = true;
1626
1849
  setViewportTick((value) => value + 1);
@@ -1674,11 +1897,14 @@ window.__ModuleLoader__.load({
1674
1897
  const centreX = measured ? (minX + maxX) / 2 : bounds.centre.x;
1675
1898
  const centreY = measured ? (minY + maxY) / 2 : bounds.centre.y;
1676
1899
  const margin = 48;
1900
+ const dock = dockRef.current;
1901
+ const bottomInset = dock === null ? 0 : dock.offsetHeight + 24;
1902
+ const usableHeight = Math.max(120, availableHeight - margin - bottomInset);
1677
1903
  const fit = Math.min(
1678
1904
  (availableWidth - margin * 2) / Math.max(1, boxWidth),
1679
- (availableHeight - margin * 2) / Math.max(1, boxHeight)
1905
+ usableHeight / Math.max(1, boxHeight)
1680
1906
  );
1681
- const FIT_FLOOR = 0.5;
1907
+ const FIT_FLOOR = 0.42;
1682
1908
  const target = clampZoom(Math.min(1, Math.max(FIT_FLOOR, fit)));
1683
1909
  camera.current.zoom = target;
1684
1910
  setZoom(target);
@@ -1687,6 +1913,47 @@ window.__ModuleLoader__.load({
1687
1913
  const resetView = (0, import_react.useCallback)(() => {
1688
1914
  fitWall();
1689
1915
  }, [fitWall]);
1916
+ const centreReserve = (0, import_react.useCallback)(() => CENTRE_RESERVE, []);
1917
+ const revealBox = (0, import_react.useCallback)((box) => {
1918
+ const viewport = viewportRefCurrent.current;
1919
+ if (viewport === null) return;
1920
+ const zoomNow = camera.current.zoom;
1921
+ const centreX = box.x + box.width / 2;
1922
+ const centreY = box.y + box.height / 2;
1923
+ const screenX = centreX * zoomNow + camera.current.panX;
1924
+ const screenY = centreY * zoomNow + camera.current.panY;
1925
+ const margin = 72;
1926
+ const visible2 = screenX > margin && screenX < viewport.clientWidth - margin && screenY > margin && screenY < viewport.clientHeight - margin;
1927
+ if (visible2) return;
1928
+ const targetZoom = Math.min(
1929
+ zoomNow,
1930
+ Math.max(ZOOM_MIN, Math.min(
1931
+ (viewport.clientWidth - margin * 2) / Math.max(1, box.width),
1932
+ (viewport.clientHeight - margin * 2) / Math.max(1, box.height)
1933
+ ))
1934
+ );
1935
+ glideTo(targetZoom, centreX, centreY);
1936
+ }, [glideTo]);
1937
+ const arrival = (0, import_react.useRef)(null);
1938
+ (0, import_react.useEffect)(() => {
1939
+ const pending = arrival.current;
1940
+ if (pending === null) return;
1941
+ const note = notes.find((candidate) => candidate.id === pending.id);
1942
+ if (note === void 0) return;
1943
+ arrival.current = null;
1944
+ const layout = layoutOf(note, stableIndex.get(note.id) ?? 0);
1945
+ const frame = requestAnimationFrame(() => {
1946
+ if (!alive.current) return;
1947
+ revealBox(footprintOf(note, layout));
1948
+ });
1949
+ const timer = setTimeout(() => {
1950
+ if (alive.current) setArrivedId((current) => current === pending.id ? null : current);
1951
+ }, ARRIVAL_MS);
1952
+ return () => {
1953
+ cancelAnimationFrame(frame);
1954
+ clearTimeout(timer);
1955
+ };
1956
+ }, [notes]);
1690
1957
  const onWheel = (0, import_react.useCallback)((event) => {
1691
1958
  const node = viewportRefCurrent.current;
1692
1959
  if (node === null) return;
@@ -1743,6 +2010,7 @@ window.__ModuleLoader__.load({
1743
2010
  node.setAttribute("data-dragging", "true");
1744
2011
  drag.current = {
1745
2012
  id: note.id,
2013
+ note,
1746
2014
  pointerId: event.pointerId,
1747
2015
  node,
1748
2016
  startX: event.clientX,
@@ -1852,7 +2120,11 @@ window.__ModuleLoader__.load({
1852
2120
  }
1853
2121
  const dx = (current.lastX - current.startX) / zoomNow;
1854
2122
  const dy = (current.lastY - current.startY) / zoomNow;
1855
- const layout = clampLayout({ x: current.originX + dx, y: current.originY + dy, rotate: current.rotate, width: current.width });
2123
+ const layout = pushOutOfReserve(
2124
+ current.note,
2125
+ clampLayout({ x: current.originX + dx, y: current.originY + dy, rotate: current.rotate, width: current.width }),
2126
+ centreReserve()
2127
+ );
1856
2128
  if (node !== null) {
1857
2129
  node.removeAttribute("data-dragging");
1858
2130
  node.style.transform = `rotate(${current.rotate}deg)`;
@@ -1918,8 +2190,20 @@ window.__ModuleLoader__.load({
1918
2190
  visible.map((note) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(NoteCard, { note, index: indexOf(note), surface: "grid", t, locale: activeLocale, actions }, note.id)),
1919
2191
  visible.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "skw-list-empty", children: emptyCopy })
1920
2192
  ] }) : /* @__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: [
2193
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { ref: worldRef, className: "skw-world", children: visible.map((note) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2194
+ NoteCard,
2195
+ {
2196
+ note,
2197
+ index: indexOf(note),
2198
+ surface: "canvas",
2199
+ t,
2200
+ locale: activeLocale,
2201
+ actions,
2202
+ arrived: note.id === arrivedId
2203
+ },
2204
+ note.id
2205
+ )) }),
2206
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-centre", ref: centreRef, "aria-hidden": false, children: [
1923
2207
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "skw-centre-hello", children: greeting }),
1924
2208
  /* @__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
2209
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
@@ -1931,7 +2215,9 @@ window.__ModuleLoader__.load({
1931
2215
  const body = capture.trim();
1932
2216
  if (body === "" || busy) return;
1933
2217
  void mutate(async () => {
1934
- await api.create({ body }, life.current.signal);
2218
+ const note = await api.create({ body }, life.current.signal, { centreReserve: centreReserve() });
2219
+ arrival.current = { id: note.id, token: Date.now() };
2220
+ setArrivedId(note.id);
1935
2221
  setCapture("");
1936
2222
  });
1937
2223
  },
@@ -1955,8 +2241,8 @@ window.__ModuleLoader__.load({
1955
2241
  ] })
1956
2242
  ] })
1957
2243
  ] }),
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: [
2244
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-dock", ref: dockRef, role: "toolbar", "aria-label": t("title"), children: [
2245
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-search-wrap", children: [
1960
2246
  /* @__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: [
1961
2247
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "10.5", cy: "10.5", r: "6.2", stroke: "currentColor", strokeWidth: "1.8" }),
1962
2248
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M15.4 15.4L20 20", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" })
@@ -1972,49 +2258,182 @@ window.__ModuleLoader__.load({
1972
2258
  onChange: (event) => setQuery(event.target.value)
1973
2259
  }
1974
2260
  )
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
- )
1989
2261
  ] }),
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)) })
2262
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "skw-dock-divider", "aria-hidden": "true" }),
2263
+ /* @__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)(
2264
+ "button",
2265
+ {
2266
+ type: "button",
2267
+ "data-on": filter === key,
2268
+ onClick: () => setFilter(key),
2269
+ title: key === "all" ? t("all") : key === "pinned" ? t("pin") : t("archive"),
2270
+ children: key === "all" ? t("all") : key === "pinned" ? t("pin") : t("archive")
2271
+ },
2272
+ key
2273
+ )) }),
2274
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "skw-dock-divider", "aria-hidden": "true" }),
2275
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "skw-seg skw-seg-icons", role: "group", "aria-label": t("viewLabel"), children: ["canvas", "grid", "list"].map((mode) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2276
+ "button",
2277
+ {
2278
+ type: "button",
2279
+ "data-on": view === mode,
2280
+ onClick: () => setView(mode),
2281
+ "aria-label": t(`view_${mode}`),
2282
+ title: t(`view_${mode}`),
2283
+ "aria-pressed": view === mode,
2284
+ children: mode === "canvas" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
2285
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { x: "3", y: "4", width: "8", height: "7", rx: "1.6", stroke: "currentColor", strokeWidth: "1.7" }),
2286
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { x: "13", y: "7", width: "8", height: "6", rx: "1.6", stroke: "currentColor", strokeWidth: "1.7" }),
2287
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { x: "6", y: "14", width: "8", height: "6", rx: "1.6", stroke: "currentColor", strokeWidth: "1.7" })
2288
+ ] }) : mode === "grid" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
2289
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { x: "3.5", y: "3.5", width: "7", height: "7", rx: "1.6", stroke: "currentColor", strokeWidth: "1.7" }),
2290
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { x: "13.5", y: "3.5", width: "7", height: "7", rx: "1.6", stroke: "currentColor", strokeWidth: "1.7" }),
2291
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { x: "3.5", y: "13.5", width: "7", height: "7", rx: "1.6", stroke: "currentColor", strokeWidth: "1.7" }),
2292
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { x: "13.5", y: "13.5", width: "7", height: "7", rx: "1.6", stroke: "currentColor", strokeWidth: "1.7" })
2293
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M4 6.5h16M4 12h16M4 17.5h11", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" }) })
2294
+ },
2295
+ mode
2296
+ )) }),
2297
+ view === "canvas" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
2298
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "skw-dock-divider", "aria-hidden": "true" }),
2299
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-dock-zoom", role: "group", "aria-label": t("zoomLabel"), children: [
2300
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2301
+ "button",
2302
+ {
2303
+ className: "skw-camera-btn",
2304
+ type: "button",
2305
+ "aria-label": t("zoomOut"),
2306
+ title: t("zoomOut"),
2307
+ onClick: () => zoomTo(zoom - 0.15),
2308
+ children: "\u2212"
2309
+ }
2310
+ ),
2311
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
2312
+ "button",
2313
+ {
2314
+ className: "skw-camera-value",
2315
+ type: "button",
2316
+ "aria-label": t("zoomReset"),
2317
+ title: t("zoomReset"),
2318
+ onClick: resetView,
2319
+ children: [
2320
+ Math.round(zoom * 100),
2321
+ "%"
2322
+ ]
2323
+ }
2324
+ ),
2325
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2326
+ "button",
2327
+ {
2328
+ className: "skw-camera-btn",
2329
+ type: "button",
2330
+ "aria-label": t("zoomIn"),
2331
+ title: t("zoomIn"),
2332
+ onClick: () => zoomTo(zoom + 0.15),
2333
+ children: "+"
2334
+ }
2335
+ ),
2336
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2337
+ "button",
2338
+ {
2339
+ className: "skw-camera-btn",
2340
+ type: "button",
2341
+ "aria-label": t("arrange"),
2342
+ title: t("arrange"),
2343
+ disabled: busy || visible.length === 0,
2344
+ onClick: () => void tidyWall(),
2345
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
2346
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2347
+ "path",
2348
+ {
2349
+ d: "M12 3.5l1.9 5.1 5.1 1.9-5.1 1.9L12 17.5l-1.9-5.1L5 10.5l5.1-1.9L12 3.5Z",
2350
+ stroke: "currentColor",
2351
+ strokeWidth: "1.6",
2352
+ strokeLinejoin: "round"
2353
+ }
2354
+ ),
2355
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M18.5 16.5l.8 2 2 .8-2 .8-.8 2-.8-2-2-.8 2-.8.8-2Z", fill: "currentColor" })
2356
+ ] })
2357
+ }
2358
+ )
2359
+ ] })
1993
2360
  ] }),
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" }),
2361
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "skw-dock-divider", "aria-hidden": "true" }),
2362
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-menu-wrap", ref: menuRef, children: [
2002
2363
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2003
2364
  "button",
2004
2365
  {
2005
2366
  className: "skw-camera-btn",
2006
2367
  type: "button",
2007
- "aria-label": t("arrange"),
2008
- title: t("arrange"),
2009
- disabled: busy || visible.length === 0,
2010
- onClick: () => void tidyWall(),
2011
- children: "\u2727"
2368
+ "data-on": menuOpen,
2369
+ "aria-label": t("more"),
2370
+ title: t("more"),
2371
+ "aria-expanded": menuOpen,
2372
+ "aria-haspopup": "menu",
2373
+ onClick: () => setMenuOpen((value) => !value),
2374
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
2375
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "6", cy: "12", r: "1.6", fill: "currentColor" }),
2376
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "12", cy: "12", r: "1.6", fill: "currentColor" }),
2377
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "18", cy: "12", r: "1.6", fill: "currentColor" })
2378
+ ] })
2012
2379
  }
2013
- )
2380
+ ),
2381
+ menuOpen && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "skw-menu", role: "menu", "aria-label": t("more"), children: [
2382
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "skw-menu-label", children: t("sortLabel") }),
2383
+ ["pinned", "created", "updated"].map((key) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
2384
+ "button",
2385
+ {
2386
+ type: "button",
2387
+ role: "menuitemradio",
2388
+ "aria-checked": sort === key,
2389
+ "data-on": sort === key,
2390
+ onClick: () => {
2391
+ setSort(key);
2392
+ setMenuOpen(false);
2393
+ },
2394
+ children: [
2395
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "skw-menu-tick", "aria-hidden": "true", children: sort === key ? "\u2713" : "" }),
2396
+ key === "pinned" ? t("sortPinned") : key === "created" ? t("sortCreated") : t("sortUpdated")
2397
+ ]
2398
+ },
2399
+ key
2400
+ )),
2401
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "skw-menu-rule", role: "separator" }),
2402
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
2403
+ "button",
2404
+ {
2405
+ type: "button",
2406
+ role: "menuitemcheckbox",
2407
+ "aria-checked": showArchived,
2408
+ "data-on": showArchived,
2409
+ onClick: () => setShowArchived((value) => !value),
2410
+ children: [
2411
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "skw-menu-tick", "aria-hidden": "true", children: showArchived ? "\u2713" : "" }),
2412
+ showArchived ? t("hideArchived") : t("showArchived")
2413
+ ]
2414
+ }
2415
+ ),
2416
+ archivedCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
2417
+ "button",
2418
+ {
2419
+ type: "button",
2420
+ role: "menuitem",
2421
+ className: "skw-menu-danger",
2422
+ disabled: busy,
2423
+ onClick: () => {
2424
+ setMenuOpen(false);
2425
+ setConfirming("clear");
2426
+ },
2427
+ children: [
2428
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "skw-menu-tick", "aria-hidden": "true" }),
2429
+ t("clearArchived")
2430
+ ]
2431
+ }
2432
+ )
2433
+ ] })
2014
2434
  ] }),
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
2435
  /* @__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: "+" })
2436
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { className: "skw-dock-new", type: "button", onClick: () => openComposer(), disabled: busy, "aria-label": t("new"), title: t("new"), children: "+" })
2018
2437
  ] }),
2019
2438
  draft && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2020
2439
  Composer,