@joewinke/jatui 0.2.9 → 0.2.10
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/CLAUDE.md +2 -0
- package/dist/dnd/createDndBoard.js +25 -11
- package/package.json +1 -1
package/CLAUDE.md
CHANGED
|
@@ -65,6 +65,8 @@ Then import:
|
|
|
65
65
|
| `Sparkline` | Inline mini chart | `data: number[]`, `width`, `height`, `color` |
|
|
66
66
|
| `LazyImage` | Image with lazy loading + placeholder | `src`, `alt`, `placeholder` |
|
|
67
67
|
| `HunkDiffView` | Side-by-side diff with line numbers, red/green backgrounds, strikethrough on removed lines, inline word-level highlights via the `diff` lib. Used for reviewing YAML/text changes per hunk. | `oldText: string \| null`, `newText: string \| null`, `unified?: boolean` |
|
|
68
|
+
| `ContextMenu` | Floating right-click (or programmatic) action menu, positioned via `use:floating` at a cursor point. Real `<button>`s, per-item `icon`/`variant`/`disabled`, dividers, click-outside + Escape dismiss, arrow-key/Home/End roving nav (focus starts on the first item). | `open` (bindable), `x`, `y`, `items: ContextMenuItem[]`, `header?`, `zIndex?`, `onClose?` |
|
|
69
|
+
| `ContextMenuTrigger` | Wraps content with the standard right-click + "⋯" touch affordance, backed by `ContextMenu`. Use instead of hand-rolling `oncontextmenu` + a kebab button per row/card. | `items: ContextMenuItem[]`, `children` (snippet), `header?`, `triggerLabel?`, `hideButton?`, `zIndex?`, `class?` |
|
|
68
70
|
|
|
69
71
|
### Media
|
|
70
72
|
|
|
@@ -45,17 +45,29 @@ export function createDndBoard(opts) {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
// Seed synchronously at creation so the render mirror is populated for the very
|
|
49
|
+
// first render — SSR (where effects never run) and a client mount where items
|
|
50
|
+
// are already present. Without this the grid renders empty until an effect
|
|
51
|
+
// fires.
|
|
52
|
+
seed();
|
|
53
|
+
|
|
54
|
+
// Reactive re-seed on items() change — CLIENT ONLY. createDndBoard ships as a
|
|
55
|
+
// client build (svelte/internal/client); creating this effect during SSR calls
|
|
56
|
+
// user_effect with no active reaction → effect_orphan (a 500 on any page that
|
|
57
|
+
// server-renders a board). The synchronous seed above covers the SSR render.
|
|
58
|
+
if (typeof window !== 'undefined') {
|
|
59
|
+
$.user_effect(function () {
|
|
60
|
+
opts.items();
|
|
61
|
+
|
|
62
|
+
if ($.safe_get(dragging) || inFlight > 0) {
|
|
63
|
+
seedQueued = true;
|
|
64
|
+
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
56
67
|
|
|
57
|
-
|
|
58
|
-
|
|
68
|
+
seed();
|
|
69
|
+
});
|
|
70
|
+
}
|
|
59
71
|
|
|
60
72
|
function placementFrom(dropTargets) {
|
|
61
73
|
var _a;
|
|
@@ -219,7 +231,9 @@ export function createDndBoard(opts) {
|
|
|
219
231
|
});
|
|
220
232
|
}
|
|
221
233
|
|
|
222
|
-
|
|
234
|
+
// Drag monitor — CLIENT ONLY (same effect_orphan reason as the seed effect;
|
|
235
|
+
// monitorForElements also needs the DOM, which does not exist during SSR).
|
|
236
|
+
if (typeof window !== 'undefined') $.user_effect(function () {
|
|
223
237
|
return monitorForElements({
|
|
224
238
|
canMonitor(_a) {
|
|
225
239
|
var source = _a.source;
|