@dudousxd/nestjs-catalog-react 0.24.0 → 0.25.1

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.
@@ -49,7 +49,7 @@ export function usesConnection(kind) {
49
49
  export const KIND_OPTIONS = [
50
50
  { value: 'http', label: 'HTTP — a JSON endpoint' },
51
51
  { value: 'sql', label: 'SQL — a database query' },
52
- { value: 'file', label: 'File — CSV, NDJSON, JSON or Excel' },
52
+ { value: 'file', label: 'File — CSV, NDJSON, JSON, Excel or Parquet' },
53
53
  { value: 's3', label: 'S3 — a bucket prefix' },
54
54
  { value: 'inline', label: 'Inline — records pasted below' },
55
55
  ];
@@ -67,6 +67,7 @@ const FORMAT_LABELS = {
67
67
  ndjson: 'NDJSON',
68
68
  json: 'JSON',
69
69
  xlsx: 'Excel workbook (.xlsx)',
70
+ parquet: 'Parquet',
70
71
  };
71
72
  /**
72
73
  * The formats, with the leading "work it out" option.
@@ -58,6 +58,30 @@ export declare function CanvasContextMenu({ opening, sections, label, onClose, }
58
58
  * pointer has to travel from the node to the toolbar, and any gap is canvas —
59
59
  * `onNodeMouseLeave` would fire with nothing to catch it and the control would
60
60
  * vanish on the way to itself.
61
+ *
62
+ * ## Why `nopan` is what makes the pill openable at all
63
+ *
64
+ * `NodeToolbar` renders as a **direct child of `.react-flow__renderer`** — the
65
+ * element React Flow attaches d3-zoom to — rather than inside the node it points
66
+ * at. So a `mousedown` anywhere on this toolbar bubbles straight into the pan
67
+ * gesture, and d3-zoom's `mousedowned` opens with `nopropagation(event)`, which
68
+ * is `stopImmediatePropagation`. React 17+ delegates its listeners to the ROOT
69
+ * container, which is an ancestor of the renderer, so an event stopped there
70
+ * never reaches React at all: `onMouseDown` simply does not fire.
71
+ *
72
+ * That is fatal here and nowhere else on this toolbar, because Base UI's
73
+ * `Menu.Trigger` opens on **mousedown**, not click (`useClick({ event:
74
+ * 'mousedown' })`). The trash button beside it opens on `click`, which d3-zoom
75
+ * leaves alone — so the toolbar looked half-working: delete fine, "Actions"
76
+ * inert, with no error and nothing rendered to inspect.
77
+ *
78
+ * `nopan` is React Flow's own escape hatch and the only thing needed: its zoom
79
+ * filter refuses the gesture outright when the event's target is inside an
80
+ * element carrying that class, so `mousedowned` returns before it stops
81
+ * anything. `nodrag` would be cargo — that one is read by the per-node drag
82
+ * handler, and this toolbar is a sibling of every node rather than inside one.
83
+ * The edge's × wrapper in `edges.tsx` has carried the same guard since it
84
+ * shipped; this toolbar was the one control inside the flow that went without.
61
85
  */
62
86
  export declare function NodeActionsToolbar({ node, canEdit, open, sections, deleteHint, onOpenChange, onHoverChange, onDelete, }: {
63
87
  /** Null whenever nothing is hovered or selected, which is most of the time. */
@@ -165,10 +165,38 @@ export function CanvasContextMenu({ opening, sections, label, onClose, }) {
165
165
  * pointer has to travel from the node to the toolbar, and any gap is canvas —
166
166
  * `onNodeMouseLeave` would fire with nothing to catch it and the control would
167
167
  * vanish on the way to itself.
168
+ *
169
+ * ## Why `nopan` is what makes the pill openable at all
170
+ *
171
+ * `NodeToolbar` renders as a **direct child of `.react-flow__renderer`** — the
172
+ * element React Flow attaches d3-zoom to — rather than inside the node it points
173
+ * at. So a `mousedown` anywhere on this toolbar bubbles straight into the pan
174
+ * gesture, and d3-zoom's `mousedowned` opens with `nopropagation(event)`, which
175
+ * is `stopImmediatePropagation`. React 17+ delegates its listeners to the ROOT
176
+ * container, which is an ancestor of the renderer, so an event stopped there
177
+ * never reaches React at all: `onMouseDown` simply does not fire.
178
+ *
179
+ * That is fatal here and nowhere else on this toolbar, because Base UI's
180
+ * `Menu.Trigger` opens on **mousedown**, not click (`useClick({ event:
181
+ * 'mousedown' })`). The trash button beside it opens on `click`, which d3-zoom
182
+ * leaves alone — so the toolbar looked half-working: delete fine, "Actions"
183
+ * inert, with no error and nothing rendered to inspect.
184
+ *
185
+ * `nopan` is React Flow's own escape hatch and the only thing needed: its zoom
186
+ * filter refuses the gesture outright when the event's target is inside an
187
+ * element carrying that class, so `mousedowned` returns before it stops
188
+ * anything. `nodrag` would be cargo — that one is read by the per-node drag
189
+ * handler, and this toolbar is a sibling of every node rather than inside one.
190
+ * The edge's × wrapper in `edges.tsx` has carried the same guard since it
191
+ * shipped; this toolbar was the one control inside the flow that went without.
168
192
  */
169
193
  export function NodeActionsToolbar({ node, canEdit, open, sections, deleteHint, onOpenChange, onHoverChange, onDelete, }) {
170
194
  if (!node || !canEdit)
171
195
  return null;
172
196
  const name = nodeName(node);
173
- return (_jsxs(NodeToolbar, { nodeId: node.id, isVisible: true, position: Position.Top, align: "end", offset: 0, onMouseEnter: () => onHoverChange(true), onMouseLeave: () => onHoverChange(false), className: "flex items-center gap-1", children: [_jsxs(BaseMenu.Root, { open: open, onOpenChange: onOpenChange, modal: false, children: [_jsxs(BaseMenu.Trigger, { "aria-label": `Actions for ${name}`, className: cn('flex items-center gap-1 rounded-md border px-1.5 py-1 text-[10px] shadow-sm outline-none', RULE, PANEL, 'hover:bg-zinc-50 dark:hover:bg-zinc-800', 'focus-visible:ring-2 focus-visible:ring-sky-500/40'), children: [_jsx(MoreHorizontal, { size: 11 }), "Actions"] }), _jsx(BaseMenu.Portal, { children: _jsx(BaseMenu.Positioner, { side: "bottom", align: "end", sideOffset: 4, collisionPadding: 8, className: "z-50", children: _jsx(BaseMenu.Popup, { className: POPUP, "aria-label": `Actions for ${name}`, children: _jsx(MenuBody, { sections: sections }) }) }) })] }), _jsx(Tooltip, { content: deleteHint, children: _jsx("button", { type: "button", onClick: onDelete, "aria-label": `Delete ${name}`, className: cn('flex items-center rounded-md border px-1.5 py-1 shadow-sm outline-none', RULE, PANEL, 'text-rose-600 hover:bg-rose-50 dark:text-rose-400 dark:hover:bg-rose-950/40', 'focus-visible:ring-2 focus-visible:ring-rose-500/40'), children: _jsx(Trash2, { size: 11 }) }) })] }));
197
+ return (_jsxs(NodeToolbar, { nodeId: node.id, isVisible: true, position: Position.Top, align: "end", offset: 0, onMouseEnter: () => onHoverChange(true), onMouseLeave: () => onHoverChange(false),
198
+ // `nopan` first, because it is the reason anything on this toolbar can be
199
+ // pressed — see the note above. Without it d3-zoom eats the mousedown and
200
+ // Base UI's trigger never hears the press that opens it.
201
+ className: "nopan flex items-center gap-1", children: [_jsxs(BaseMenu.Root, { open: open, onOpenChange: onOpenChange, modal: false, children: [_jsxs(BaseMenu.Trigger, { "aria-label": `Actions for ${name}`, className: cn('flex items-center gap-1 rounded-md border px-1.5 py-1 text-[10px] shadow-sm outline-none', RULE, PANEL, 'hover:bg-zinc-50 dark:hover:bg-zinc-800', 'focus-visible:ring-2 focus-visible:ring-sky-500/40'), children: [_jsx(MoreHorizontal, { size: 11 }), "Actions"] }), _jsx(BaseMenu.Portal, { children: _jsx(BaseMenu.Positioner, { side: "bottom", align: "end", sideOffset: 4, collisionPadding: 8, className: "z-50", children: _jsx(BaseMenu.Popup, { className: POPUP, "aria-label": `Actions for ${name}`, children: _jsx(MenuBody, { sections: sections }) }) }) })] }), _jsx(Tooltip, { content: deleteHint, children: _jsx("button", { type: "button", onClick: onDelete, "aria-label": `Delete ${name}`, className: cn('flex items-center rounded-md border px-1.5 py-1 shadow-sm outline-none', RULE, PANEL, 'text-rose-600 hover:bg-rose-50 dark:text-rose-400 dark:hover:bg-rose-950/40', 'focus-visible:ring-2 focus-visible:ring-rose-500/40'), children: _jsx(Trash2, { size: 11 }) }) })] }));
174
202
  }
@@ -15,7 +15,7 @@ export const SOURCE_KINDS = {
15
15
  file: {
16
16
  label: 'a file',
17
17
  required: ['path'],
18
- optional: ['format', 'jsonPath', 'delimiter', 'sheet', 'maxBytes'],
18
+ optional: ['format', 'jsonPath', 'delimiter', 'sheet', 'maxBytes', 'readIdleTimeoutMs'],
19
19
  keysRecordsBySourceName: true,
20
20
  },
21
21
  s3: {
@@ -28,6 +28,7 @@ export const SOURCE_KINDS = {
28
28
  'delimiter',
29
29
  'sheet',
30
30
  'maxBytes',
31
+ 'readIdleTimeoutMs',
31
32
  'region',
32
33
  'maxObjectsPerRun',
33
34
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dudousxd/nestjs-catalog-react",
3
- "version": "0.24.0",
3
+ "version": "0.25.1",
4
4
  "description": "Ready-made React screens for @dudousxd/nestjs-catalog — a model manager and a generic object explorer you can drop into your own app shell.",
5
5
  "license": "MIT",
6
6
  "author": "Davide Carvalho",
@@ -110,7 +110,7 @@
110
110
  "tailwind-merge": "3.4.1",
111
111
  "tiptap-markdown": "0.9.0",
112
112
  "typescript": "5.9.3",
113
- "@dudousxd/nestjs-catalog": "0.20.0"
113
+ "@dudousxd/nestjs-catalog": "0.21.0"
114
114
  },
115
115
  "dependencies": {
116
116
  "clsx": "2.1.1",