@flowselections/layout-maker 1.69.57 → 1.69.59

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.
@@ -1,64 +1,64 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // ============================================================================
3
- // src/components/AfdrukKnop.tsx — afdrukken met automatisch ingesteld
4
- // papierformaat, stand en de bedoelde printer. Waar mogelijk gaat het
5
- // document direct naar de printer; anders opent het printvenster.
6
- // ============================================================================
7
- import { useState } from "react";
8
- import { Button, toast } from "@flowselections/core";
9
- import { Loader2, Printer } from "lucide-react";
10
- import { drukAf } from "../lib/browserPrint.js";
11
- import { printDirect } from "../lib/directPrint.js";
12
- /**
13
- * @deprecated Verouderd — deze knop gebruikt het browser-printvenster als
14
- * terugval. Gebruik `printHtml()` / `printPdf()` uit `printApi` zodat alles
15
- * via PrintNode loopt.
16
- */
17
- export function AfdrukKnop({ documenttype, formaatCode, orientatie, getHtml, css, documentnaam, label = "Afdrukken", layoutId, kopieen, }) {
18
- const [bezig, setBezig] = useState(false);
19
- const afdrukken = async () => {
20
- setBezig(true);
21
- try {
22
- const html = getHtml();
23
- const direct = await printDirect({
24
- documenttype,
25
- formaatCode,
26
- orientatie,
27
- html,
28
- css,
29
- documentnaam,
30
- layoutId: layoutId ?? null,
31
- kopieen,
32
- });
33
- if (direct.gelukt) {
34
- toast.success(direct.printernaam
35
- ? `Verstuurd naar ${direct.printernaam}`
36
- : "Het document is naar de printer verstuurd");
37
- return;
38
- }
39
- if (direct.reden)
40
- toast.error(direct.reden);
41
- const { printer } = await drukAf({
42
- documenttype,
43
- formaatCode,
44
- orientatie,
45
- html,
46
- css,
47
- documentnaam,
48
- });
49
- if (printer) {
50
- toast.info(`Kies in het printvenster: ${printer.systeemnaam ?? printer.naam}`);
51
- }
52
- else {
53
- toast.info("Er is nog geen vaste printer ingesteld voor dit document.");
54
- }
55
- }
56
- catch {
57
- toast.error("Afdrukken mislukt");
58
- }
59
- finally {
60
- setBezig(false);
61
- }
62
- };
63
- return (_jsxs(Button, { variant: "outline", disabled: bezig, onClick: () => void afdrukken(), children: [bezig ? _jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }) : _jsx(Printer, { className: "mr-2 h-4 w-4" }), label] }));
64
- }
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // ============================================================================
3
+ // src/components/AfdrukKnop.tsx — afdrukken met automatisch ingesteld
4
+ // papierformaat, stand en de bedoelde printer. Waar mogelijk gaat het
5
+ // document direct naar de printer; anders opent het printvenster.
6
+ // ============================================================================
7
+ import { useState } from "react";
8
+ import { Button, toast } from "@flowselections/core";
9
+ import { Loader2, Printer } from "lucide-react";
10
+ import { drukAf } from "../lib/browserPrint.js";
11
+ import { printDirect } from "../lib/directPrint.js";
12
+ /**
13
+ * @deprecated Verouderd — deze knop gebruikt het browser-printvenster als
14
+ * terugval. Gebruik `printHtml()` / `printPdf()` uit `printApi` zodat alles
15
+ * via PrintNode loopt.
16
+ */
17
+ export function AfdrukKnop({ documenttype, formaatCode, orientatie, getHtml, css, documentnaam, label = "Afdrukken", layoutId, kopieen, }) {
18
+ const [bezig, setBezig] = useState(false);
19
+ const afdrukken = async () => {
20
+ setBezig(true);
21
+ try {
22
+ const html = getHtml();
23
+ const direct = await printDirect({
24
+ documenttype,
25
+ formaatCode,
26
+ orientatie,
27
+ html,
28
+ css,
29
+ documentnaam,
30
+ layoutId: layoutId ?? null,
31
+ kopieen,
32
+ });
33
+ if (direct.gelukt) {
34
+ toast.success(direct.printernaam
35
+ ? `Verstuurd naar ${direct.printernaam}`
36
+ : "Het document is naar de printer verstuurd");
37
+ return;
38
+ }
39
+ if (direct.reden)
40
+ toast.error(direct.reden);
41
+ const { printer } = await drukAf({
42
+ documenttype,
43
+ formaatCode,
44
+ orientatie,
45
+ html,
46
+ css,
47
+ documentnaam,
48
+ });
49
+ if (printer) {
50
+ toast.info(`Kies in het printvenster: ${printer.systeemnaam ?? printer.naam}`);
51
+ }
52
+ else {
53
+ toast.info("Er is nog geen vaste printer ingesteld voor dit document.");
54
+ }
55
+ }
56
+ catch {
57
+ toast.error("Afdrukken mislukt");
58
+ }
59
+ finally {
60
+ setBezig(false);
61
+ }
62
+ };
63
+ return (_jsxs(Button, { variant: "outline", disabled: bezig, onClick: () => void afdrukken(), children: [bezig ? _jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }) : _jsx(Printer, { className: "mr-2 h-4 w-4" }), label] }));
64
+ }
@@ -1,79 +1,79 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // ============================================================================
3
- // src/components/NetwerkPrintersDialog.tsx — printers uit het netwerk zoeken,
4
- // toevoegen of koppelen aan een bestaande printer.
5
- // ============================================================================
6
- import { useCallback, useEffect, useState } from "react";
7
- import { Button, Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, toast, } from "@flowselections/core";
8
- import { Loader2, Printer, RefreshCw } from "lucide-react";
9
- import { supabase } from "../lib/supabaseClient.js";
10
- import { netwerkPrinters } from "../lib/printService.functions.js";
11
- export function NetwerkPrintersDialog({ open, onOpenChange, huidigePrinterId, huidigePrinterNaam, onKlaar, }) {
12
- const [bezig, setBezig] = useState(false);
13
- const [fout, setFout] = useState(null);
14
- const [lijst, setLijst] = useState([]);
15
- const zoeken = useCallback(async () => {
16
- setBezig(true);
17
- setFout(null);
18
- try {
19
- const res = await netwerkPrinters({ data: undefined });
20
- if (!res.ok) {
21
- setFout(res.fout);
22
- setLijst([]);
23
- }
24
- else {
25
- setLijst(Array.isArray(res.printers) ? res.printers : []);
26
- }
27
- }
28
- catch {
29
- setFout("Er kon niet in het netwerk worden gezocht. Probeer het zo opnieuw.");
30
- }
31
- finally {
32
- setBezig(false);
33
- }
34
- }, []);
35
- useEffect(() => {
36
- if (open)
37
- void zoeken();
38
- }, [open, zoeken]);
39
- const toevoegen = async (p) => {
40
- try {
41
- const { error } = await supabase.from("printers").insert({
42
- naam: p.naam,
43
- systeemnaam: p.naam,
44
- locatie: p.computer,
45
- omschrijving: p.omschrijving,
46
- online: p.online,
47
- actief: true,
48
- extern_printer_id: p.id,
49
- });
50
- if (error)
51
- throw error;
52
- toast.success(`${p.naam} is toegevoegd`);
53
- onKlaar?.();
54
- onOpenChange(false);
55
- }
56
- catch {
57
- toast.error("Toevoegen mislukt");
58
- }
59
- };
60
- const koppelen = async (p) => {
61
- if (!huidigePrinterId)
62
- return;
63
- try {
64
- const { error } = await supabase
65
- .from("printers")
66
- .update({ extern_printer_id: p.id, systeemnaam: p.naam, locatie: p.computer })
67
- .eq("id", huidigePrinterId);
68
- if (error)
69
- throw error;
70
- toast.success("Printer gekoppeld");
71
- onKlaar?.();
72
- onOpenChange(false);
73
- }
74
- catch {
75
- toast.error("Koppelen mislukt");
76
- }
77
- };
78
- return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { className: "max-w-lg", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Printers in het netwerk" }), _jsx(DialogDescription, { children: "Kies een printer om toe te voegen. Staat een printer er niet bij? Zet dan de computer aan waar de printer op is aangesloten." })] }), _jsxs("div", { className: "space-y-2", children: [bezig && (_jsxs("p", { className: "text-muted-foreground flex items-center gap-2 text-sm", children: [_jsx(Loader2, { className: "h-4 w-4 animate-spin" }), " Zoeken\u2026"] })), !bezig && fout && _jsx("p", { className: "text-destructive text-sm", children: fout }), !bezig && !fout && lijst.length === 0 && (_jsx("p", { className: "text-muted-foreground text-sm", children: "Er zijn geen printers gevonden." })), lijst.map((p) => (_jsxs("div", { className: "flex items-center gap-3 rounded-lg border p-3", children: [_jsx(Printer, { className: "text-muted-foreground h-5 w-5" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "truncate text-sm font-medium", children: p.naam }), _jsxs("p", { className: "text-muted-foreground truncate text-xs", children: [p.computer || "Onbekende computer", " \u00B7 ", p.online ? "online" : "offline"] })] }), huidigePrinterId && (_jsxs(Button, { variant: "outline", size: "sm", onClick: () => void koppelen(p), children: ["Koppelen aan ", huidigePrinterNaam ?? "printer"] })), _jsx(Button, { size: "sm", onClick: () => void toevoegen(p), children: "Toevoegen" })] }, p.id)))] }), _jsx("div", { className: "flex justify-end", children: _jsxs(Button, { variant: "ghost", onClick: () => void zoeken(), disabled: bezig, children: [_jsx(RefreshCw, { className: "mr-2 h-4 w-4" }), " Opnieuw zoeken"] }) })] }) }));
79
- }
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // ============================================================================
3
+ // src/components/NetwerkPrintersDialog.tsx — printers uit het netwerk zoeken,
4
+ // toevoegen of koppelen aan een bestaande printer.
5
+ // ============================================================================
6
+ import { useCallback, useEffect, useState } from "react";
7
+ import { Button, Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, toast, } from "@flowselections/core";
8
+ import { Loader2, Printer, RefreshCw } from "lucide-react";
9
+ import { supabase } from "../lib/supabaseClient.js";
10
+ import { netwerkPrinters } from "../lib/printService.functions.js";
11
+ export function NetwerkPrintersDialog({ open, onOpenChange, huidigePrinterId, huidigePrinterNaam, onKlaar, }) {
12
+ const [bezig, setBezig] = useState(false);
13
+ const [fout, setFout] = useState(null);
14
+ const [lijst, setLijst] = useState([]);
15
+ const zoeken = useCallback(async () => {
16
+ setBezig(true);
17
+ setFout(null);
18
+ try {
19
+ const res = await netwerkPrinters({ data: undefined });
20
+ if (!res.ok) {
21
+ setFout(res.fout);
22
+ setLijst([]);
23
+ }
24
+ else {
25
+ setLijst(Array.isArray(res.printers) ? res.printers : []);
26
+ }
27
+ }
28
+ catch {
29
+ setFout("Er kon niet in het netwerk worden gezocht. Probeer het zo opnieuw.");
30
+ }
31
+ finally {
32
+ setBezig(false);
33
+ }
34
+ }, []);
35
+ useEffect(() => {
36
+ if (open)
37
+ void zoeken();
38
+ }, [open, zoeken]);
39
+ const toevoegen = async (p) => {
40
+ try {
41
+ const { error } = await supabase.from("printers").insert({
42
+ naam: p.naam,
43
+ systeemnaam: p.naam,
44
+ locatie: p.computer,
45
+ omschrijving: p.omschrijving,
46
+ online: p.online,
47
+ actief: true,
48
+ extern_printer_id: p.id,
49
+ });
50
+ if (error)
51
+ throw error;
52
+ toast.success(`${p.naam} is toegevoegd`);
53
+ onKlaar?.();
54
+ onOpenChange(false);
55
+ }
56
+ catch {
57
+ toast.error("Toevoegen mislukt");
58
+ }
59
+ };
60
+ const koppelen = async (p) => {
61
+ if (!huidigePrinterId)
62
+ return;
63
+ try {
64
+ const { error } = await supabase
65
+ .from("printers")
66
+ .update({ extern_printer_id: p.id, systeemnaam: p.naam, locatie: p.computer })
67
+ .eq("id", huidigePrinterId);
68
+ if (error)
69
+ throw error;
70
+ toast.success("Printer gekoppeld");
71
+ onKlaar?.();
72
+ onOpenChange(false);
73
+ }
74
+ catch {
75
+ toast.error("Koppelen mislukt");
76
+ }
77
+ };
78
+ return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { className: "max-w-lg", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Printers in het netwerk" }), _jsx(DialogDescription, { children: "Kies een printer om toe te voegen. Staat een printer er niet bij? Zet dan de computer aan waar de printer op is aangesloten." })] }), _jsxs("div", { className: "space-y-2", children: [bezig && (_jsxs("p", { className: "text-muted-foreground flex items-center gap-2 text-sm", children: [_jsx(Loader2, { className: "h-4 w-4 animate-spin" }), " Zoeken\u2026"] })), !bezig && fout && _jsx("p", { className: "text-destructive text-sm", children: fout }), !bezig && !fout && lijst.length === 0 && (_jsx("p", { className: "text-muted-foreground text-sm", children: "Er zijn geen printers gevonden." })), lijst.map((p) => (_jsxs("div", { className: "flex items-center gap-3 rounded-lg border p-3", children: [_jsx(Printer, { className: "text-muted-foreground h-5 w-5" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "truncate text-sm font-medium", children: p.naam }), _jsxs("p", { className: "text-muted-foreground truncate text-xs", children: [p.computer || "Onbekende computer", " \u00B7 ", p.online ? "online" : "offline"] })] }), huidigePrinterId && (_jsxs(Button, { variant: "outline", size: "sm", onClick: () => void koppelen(p), children: ["Koppelen aan ", huidigePrinterNaam ?? "printer"] })), _jsx(Button, { size: "sm", onClick: () => void toevoegen(p), children: "Toevoegen" })] }, p.id)))] }), _jsx("div", { className: "flex justify-end", children: _jsxs(Button, { variant: "ghost", onClick: () => void zoeken(), disabled: bezig, children: [_jsx(RefreshCw, { className: "mr-2 h-4 w-4" }), " Opnieuw zoeken"] }) })] }) }));
79
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"PlekInstellingen.d.ts","sourceRoot":"","sources":["../../src/components/PlekInstellingen.tsx"],"names":[],"mappings":"AAeA,OAAO,EAE6H,KAAK,SAAS,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EACjL,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAiF,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAIxI,OAAO,EAA6C,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEjJ,OAAO,EAA2T,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAwB7Z,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,kDAAkD;IAClD,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,UAAU,EAAE;QAAE,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,SAAS,CAAC;IAC9F,OAAO,EAAE;QAAE,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,CAAC,EAAE,qBAAqB,+BA+cxD"}
@@ -19,7 +19,7 @@ import { isEtiketSoort } from "../lib/documentTypes.js";
19
19
  import { heleMm, metHoofdletter } from "../lib/lijstDetail.js";
20
20
  import { NIEUWE_COMPUTER, printerOptiesPerComputer } from "../lib/computerGroepen.js";
21
21
  import { proefprintDocumenten } from "../lib/plekProefprint.js";
22
- import { alleenVanComputers, beginOpenDocument, documentAfwijkingen, documentSamenvatting, samenvattingFormaat, wisselOpen, gekoppeldeComputers, koppelbareComputers, kortePrinterOpties, plekMenuItems, PLEK_MENU_HERNOEMEN, PLEK_MENU_CONTROLEPLEK, printerFormaten, standaardPrinterLabel, versieLabel, documentProbleemTekst } from "../lib/plekRechterblok.js";
22
+ import { alleenVanComputers, beginOpenDocument, documentAfwijkingen, documentSamenvatting, samenvattingFormaat, wisselOpen, gekoppeldeComputers, koppelbareComputers, kortePrinterOpties, plekMenuItems, PLEK_MENU_HERNOEMEN, PLEK_MENU_CONTROLEPLEK, printerFormaten, standaardPrinterLabel, versieLabel, documentProbleemTekst, veilingbriefVanServer } from "../lib/plekRechterblok.js";
23
23
  import { supabase } from "../lib/supabaseClient.js";
24
24
  import { NieuweComputerStappen } from "./NieuweComputerStappen.js";
25
25
  const STATUS_KLEUR = { past: "text-success", passend: "text-muted-foreground", niet: "text-warning" };
@@ -71,6 +71,8 @@ export function PlekInstellingen(p) {
71
71
  const [proefOpen, setProefOpen] = useState(false);
72
72
  const [proefKeuze, setProefKeuze] = useState([]);
73
73
  const [proefBezig, setProefBezig] = useState(false);
74
+ // 23-11: veilingbrief (Floriday) — de database beslist of hij hier hoort en welke printer hij krijgt.
75
+ const [veilingbrief, setVeilingbrief] = useState(null);
74
76
  useEffect(() => { setNaam(plek.naam); setNaamBewerken(false); setKoppelOpen(false); setNieuweComputer(false); }, [plek.id, plek.naam]);
75
77
  useEffect(() => {
76
78
  if (!naamBewerken)
@@ -102,6 +104,16 @@ export function PlekInstellingen(p) {
102
104
  const pp = Array.isArray(pr.data) ? pr.data : [];
103
105
  setFormaten(Object.fromEntries(pp.map((x) => [x.id, x.ondersteunde_formaten])));
104
106
  setGeladenVoor(plek.id);
107
+ const vb = await supabase
108
+ .rpc("print_plek_veilingbrief_v1", { p_plek: plek.id });
109
+ if (weg)
110
+ return;
111
+ if (vb.error) {
112
+ console.error("[printplek] veilingbrief lezen mislukt", vb.error);
113
+ setVeilingbrief(null);
114
+ }
115
+ else
116
+ setVeilingbrief(veilingbriefVanServer(vb.data));
105
117
  if (wp.error) {
106
118
  console.error("[printplek] werkplekken lezen mislukt", wp.error);
107
119
  return;
@@ -228,6 +240,14 @@ export function PlekInstellingen(p) {
228
240
  setOpenDoc(beginOpenDocument(docRijen.map((d) => ({ id: d.r.kaart.id, probleem: d.probleem }))));
229
241
  // eslint-disable-next-line react-hooks/exhaustive-deps
230
242
  }, [probleemSleutel, formaten]);
243
+ // 23-11: veilingbrief van Floriday: 1-op-1 PDF, geen eigen versie; alleen de printer is in te stellen. Niet in de proefprint.
244
+ const vbRegel = regels["veilingbrief"] ?? "";
245
+ const zetVbPrinter = (v) => void slaOp(async () => {
246
+ const id = v ? await bewaarDienstPrinter(v, p.dienst.printers) : null;
247
+ await zetPrintplekPrinter(plek.id, "veilingbrief", id);
248
+ }, () => zetPrintplekPrinter(plek.id, "veilingbrief", vbRegel || null), klaar);
249
+ const vbOpen = openDoc === "veilingbrief";
250
+ const veilingbriefRij = veilingbrief ? (_jsxs("li", { children: [_jsxs("button", { type: "button", "aria-expanded": vbOpen, "aria-controls": "doc-paneel-veilingbrief", onClick: () => setOpenDoc((h) => wisselOpen(h, "veilingbrief")), className: "flex w-full items-center gap-3 px-3 py-2 text-left hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: [_jsx("span", { className: "min-w-0 flex-1 text-sm font-semibold text-foreground", children: "Veilingbrief" }), _jsx(ChevronDown, { className: `h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200 motion-reduce:transition-none ${vbOpen ? "rotate-180" : ""}`, "aria-hidden": "true" })] }), _jsx("div", { id: "doc-paneel-veilingbrief", role: "region", "aria-label": "Veilingbrief", className: `grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-none ${vbOpen ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"}`, children: _jsx("div", { className: "min-h-0 overflow-hidden", inert: !vbOpen ? true : undefined, children: _jsxs("div", { className: "space-y-2 px-3 pb-3 pt-1", children: [veilingbrief.reden && _jsx("p", { className: "text-xs font-medium text-warning", children: veilingbrief.reden }), _jsxs("div", { className: "min-w-0 space-y-1", children: [_jsx("p", { className: "text-xs text-muted-foreground", children: "Versie" }), _jsx("p", { className: "text-sm text-foreground", children: veilingbrief.versie })] }), _jsxs("div", { className: "min-w-0 space-y-1", children: [_jsx("p", { className: "text-xs text-muted-foreground", children: "Printer" }), _jsx(ZoekbareKeuzelijst, { value: vbRegel, onChange: zetVbPrinter, options: [{ value: "", label: standaardPrinterLabel(printerNaam(papierId), false) }, ...docOpties(vbRegel || undefined).filter((o) => o.value !== "")] }), !!vbRegel && terugKnop(() => zetVbPrinter(""))] }), _jsxs("p", { className: "text-xs text-muted-foreground", children: ["Formaat: ", veilingbrief.papierformaat, " \u00B7 Floriday levert dit document kant-en-klaar aan"] }), veilingbrief.kan_printen && _jsx("p", { className: "text-xs text-success", children: "Klaar om te printen" })] }) }) })] }, "veilingbrief")) : null;
231
251
  // 19-11: één controleplek tegelijk; Ongedaan maken zet de vorige terug (of weer geen).
232
252
  const controleplekInstellen = async () => {
233
253
  try {
@@ -251,12 +271,12 @@ export function PlekInstellingen(p) {
251
271
  const rijen = docRijen.filter((d) => (d.etiket ? "label" : "papier") === groep);
252
272
  if (!rijen.length)
253
273
  return null;
254
- return (_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "pt-1 text-xs font-medium uppercase tracking-wide text-muted-foreground", children: groep === "papier" ? "Papier" : "Etiketten" }), _jsx("ul", { className: "divide-y divide-border rounded-md border border-border", children: rijen.map((d) => {
255
- const { r } = d;
256
- const isOpen = openDoc === r.kaart.id;
257
- const paneelId = `doc-paneel-${r.kaart.id}`;
258
- return (_jsxs("li", { children: [_jsxs("button", { type: "button", "aria-expanded": isOpen, "aria-controls": paneelId, onClick: () => setOpenDoc((h) => wisselOpen(h, r.kaart.id)), className: "flex w-full items-center gap-3 px-3 py-2 text-left hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: [_jsx("span", { className: "min-w-0 flex-1 text-sm font-semibold text-foreground", children: r.kaart.naam }), _jsx(ChevronDown, { className: `h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200 motion-reduce:transition-none ${isOpen ? "rotate-180" : ""}`, "aria-hidden": "true" })] }), _jsx("div", { id: paneelId, role: "region", "aria-label": r.kaart.naam, className: `grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-none ${isOpen ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"}`, children: _jsx("div", { className: "min-h-0 overflow-hidden", inert: !isOpen ? true : undefined, children: _jsxs("div", { className: "space-y-2 px-3 pb-3 pt-1", children: [d.afwijkingen.length > 0 && (_jsx("p", { title: d.afwijkingen.join("\n"), className: "w-fit rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground", children: "Afwijkend van standaard" })), d.inhoud] }) }) })] }, r.kaart.id));
259
- }) })] }, groep));
274
+ return (_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "pt-1 text-xs font-medium uppercase tracking-wide text-muted-foreground", children: groep === "papier" ? "Papier" : "Etiketten" }), _jsxs("ul", { className: "divide-y divide-border rounded-md border border-border", children: [rijen.map((d) => {
275
+ const { r } = d;
276
+ const isOpen = openDoc === r.kaart.id;
277
+ const paneelId = `doc-paneel-${r.kaart.id}`;
278
+ return (_jsxs("li", { children: [_jsxs("button", { type: "button", "aria-expanded": isOpen, "aria-controls": paneelId, onClick: () => setOpenDoc((h) => wisselOpen(h, r.kaart.id)), className: "flex w-full items-center gap-3 px-3 py-2 text-left hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: [_jsx("span", { className: "min-w-0 flex-1 text-sm font-semibold text-foreground", children: r.kaart.naam }), _jsx(ChevronDown, { className: `h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200 motion-reduce:transition-none ${isOpen ? "rotate-180" : ""}`, "aria-hidden": "true" })] }), _jsx("div", { id: paneelId, role: "region", "aria-label": r.kaart.naam, className: `grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-none ${isOpen ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"}`, children: _jsx("div", { className: "min-h-0 overflow-hidden", inert: !isOpen ? true : undefined, children: _jsxs("div", { className: "space-y-2 px-3 pb-3 pt-1", children: [d.afwijkingen.length > 0 && (_jsx("p", { title: d.afwijkingen.join("\n"), className: "w-fit rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground", children: "Afwijkend van standaard" })), d.inhoud] }) }) })] }, r.kaart.id));
279
+ }), groep === "papier" && veilingbriefRij] })] }, groep));
260
280
  })] }), _jsxs("section", { className: "border-t border-border pt-4", children: [_jsxs("div", { className: "mb-1 flex items-center justify-between gap-2", children: [_jsx("h3", { className: "font-semibold text-card-foreground", children: "Printopdrachten van" }), (p.magPickKoppelen || p.heeftScanners) && _jsxs(Button, { variant: "link", className: "h-auto p-0", onClick: () => p.onPickKoppel(), children: [_jsx(Plus, { className: "mr-1 h-4 w-4" }), " Toevoegen"] })] }), _jsxs("ul", { className: "divide-y divide-border", children: [koppelingen.map((c) => {
261
281
  const isPick = c.bron === "pickstation" || c.bron === "pick_station";
262
282
  const magMenu = (isPick && p.magPickKoppelen) || c.bron === "scanner";
@@ -1,6 +1,6 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
2
  // Vaste link naar de kaart van een plek op Printen:
3
- // ?plek=<id> -> scrolt naar die kaart en laat hem even oplichten
3
+ // ?plek=<id> -> scrolt naar die kaart, laat hem even oplichten en opent de instellingen
4
4
  // ?pickstation=<id> -> naar de plek van dat pickstation; zonder plek de vraag
5
5
  // "Op welke plek print <naam>?"
6
6
  // ?scanner=<id|slug> -> naar de plek van die scanner
@@ -1 +1 @@
1
- {"version":3,"file":"PrintplekkenPage.d.ts","sourceRoot":"","sources":["../../src/components/PrintplekkenPage.tsx"],"names":[],"mappings":"AAwCA,OAAO,EAAgC,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AA6BlF,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,YAAY,CAAA;CAAO,+BAuL3F"}
1
+ {"version":3,"file":"PrintplekkenPage.d.ts","sourceRoot":"","sources":["../../src/components/PrintplekkenPage.tsx"],"names":[],"mappings":"AAwCA,OAAO,EAAgC,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AA6BlF,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,YAAY,CAAA;CAAO,+BAwL3F"}
@@ -60,7 +60,8 @@ export function PrintplekkenPage({ focus } = {}) {
60
60
  const [koppelen, setKoppelen] = useState(null);
61
61
  const [nieuw, setNieuw] = useState(false);
62
62
  // Na "Maken" is de nieuwe plek meteen gekozen; het rechterblok toont de lege onderdelen.
63
- const [openNaMaken, setOpenNaMaken] = useState(null);
63
+ // 20-11: ?plek=<id> opent die plek meteen (zelfde weg als na "Maken"); onbekend nummer doet niets.
64
+ const [openNaMaken, setOpenNaMaken] = useState(focus?.plek ?? null);
64
65
  const [pickKoppel, setPickKoppel] = useState(null);
65
66
  const [bezig, setBezig] = useState(false);
66
67
  const [zoek, setZoek] = useState("");
@@ -20,7 +20,7 @@ function createSupabaseAdminClient() {
20
20
  let _supabaseAdmin;
21
21
  // Server-side Supabase client with service role - bypasses RLS
22
22
  // SECURITY: Only use this for trusted server-side operations, never expose to client code
23
- // Import like: import { supabaseAdmin } from "./client.server.js";
23
+ // Import like: import { supabaseAdmin } from "../../integrations/supabase/client.server.js";
24
24
  export const supabaseAdmin = new Proxy({}, {
25
25
  get(_, prop, receiver) {
26
26
  if (!_supabaseAdmin)