@flowselections/layout-maker 1.7.2 → 1.8.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.
Files changed (99) hide show
  1. package/README.md +78 -1
  2. package/dist-lib/components/AfdrukKnop.d.ts +1 -1
  3. package/dist-lib/components/AfdrukKnop.js +2 -2
  4. package/dist-lib/components/AiLayoutImportDialog.js +4 -4
  5. package/dist-lib/components/BlokOntwerperPage.js +5 -5
  6. package/dist-lib/components/ComputersLijst.js +2 -2
  7. package/dist-lib/components/DocumentSettingsPanel.d.ts +2 -2
  8. package/dist-lib/components/DocumentSettingsPanel.js +3 -3
  9. package/dist-lib/components/FormaatOrientatieBar.d.ts +1 -1
  10. package/dist-lib/components/FormaatOrientatieBar.js +2 -2
  11. package/dist-lib/components/LayoutsPage.js +4 -4
  12. package/dist-lib/components/LogoBibliotheekDialog.d.ts +1 -1
  13. package/dist-lib/components/LogoBibliotheekDialog.js +2 -2
  14. package/dist-lib/components/LogosPage.d.ts +1 -1
  15. package/dist-lib/components/LogosPage.js +2 -2
  16. package/dist-lib/components/NetwerkPrintersDialog.js +2 -2
  17. package/dist-lib/components/PakbonBuilderPage.js +8 -8
  18. package/dist-lib/components/PakbonPreview.d.ts +1 -1
  19. package/dist-lib/components/PakbonPreview.js +3 -3
  20. package/dist-lib/components/PakbonSectiesPanel.d.ts +1 -1
  21. package/dist-lib/components/PakbonSectiesPanel.js +4 -4
  22. package/dist-lib/components/PrintQueuePage.d.ts.map +1 -1
  23. package/dist-lib/components/PrintQueuePage.js +7 -6
  24. package/dist-lib/components/PrinterSetupWizard.js +5 -5
  25. package/dist-lib/components/PrintersPage.js +7 -7
  26. package/dist-lib/components/ProductiebonBlokkenPanel.d.ts +1 -1
  27. package/dist-lib/components/ProductiebonBlokkenPanel.js +1 -1
  28. package/dist-lib/components/ProductiebonBuilderPage.js +6 -6
  29. package/dist-lib/components/ProductiebonPreview.d.ts +1 -1
  30. package/dist-lib/components/ProductiebonPreview.js +2 -2
  31. package/dist-lib/components/WerkplekConfiguratiePage.js +7 -7
  32. package/dist-lib/index.d.ts +62 -46
  33. package/dist-lib/index.d.ts.map +1 -1
  34. package/dist-lib/index.js +47 -47
  35. package/dist-lib/integrations/supabase/auth-attacher.js +1 -1
  36. package/dist-lib/integrations/supabase/auth-middleware.d.ts +1600 -780
  37. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  38. package/dist-lib/integrations/supabase/client.d.ts +1 -1
  39. package/dist-lib/integrations/supabase/client.js +1 -1
  40. package/dist-lib/integrations/supabase/client.server.d.ts +1600 -780
  41. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  42. package/dist-lib/integrations/supabase/client.server.js +1 -1
  43. package/dist-lib/integrations/supabase/types.d.ts +1001 -165
  44. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  45. package/dist-lib/integrations/supabase/types.js +3 -0
  46. package/dist-lib/lib/aiLayout.functions.d.ts +1679 -859
  47. package/dist-lib/lib/aiLayout.functions.d.ts.map +1 -1
  48. package/dist-lib/lib/aiLayout.functions.js +2 -2
  49. package/dist-lib/lib/aiLayout.server.d.ts +1 -1
  50. package/dist-lib/lib/browserPrint.d.ts +1 -1
  51. package/dist-lib/lib/browserPrint.js +3 -3
  52. package/dist-lib/lib/directPrint.d.ts +1 -1
  53. package/dist-lib/lib/directPrint.js +4 -4
  54. package/dist-lib/lib/documentPdf.d.ts +1 -1
  55. package/dist-lib/lib/documentProfiles.d.ts +1 -1
  56. package/dist-lib/lib/documentProfiles.d.ts.map +1 -1
  57. package/dist-lib/lib/documentProfiles.js +3 -0
  58. package/dist-lib/lib/documentTypes.d.ts +1 -1
  59. package/dist-lib/lib/documentTypes.d.ts.map +1 -1
  60. package/dist-lib/lib/documentTypes.js +3 -0
  61. package/dist-lib/lib/formaatPrinters.js +1 -1
  62. package/dist-lib/lib/htmlNaarPdf.server.js +1 -1
  63. package/dist-lib/lib/layoutPreview.d.ts +1 -1
  64. package/dist-lib/lib/layoutPreview.js +1 -1
  65. package/dist-lib/lib/logoLibrary.js +1 -1
  66. package/dist-lib/lib/orderData.server.d.ts +2 -1
  67. package/dist-lib/lib/orderData.server.d.ts.map +1 -1
  68. package/dist-lib/lib/orderData.server.js +7 -8
  69. package/dist-lib/lib/pakbonBuilder.d.ts +1 -1
  70. package/dist-lib/lib/pakbonHtml.d.ts +1 -1
  71. package/dist-lib/lib/pakbonHtml.js +2 -2
  72. package/dist-lib/lib/printApi.d.ts +72 -1
  73. package/dist-lib/lib/printApi.d.ts.map +1 -1
  74. package/dist-lib/lib/printApi.js +155 -15
  75. package/dist-lib/lib/printQueue.server.d.ts +12 -3
  76. package/dist-lib/lib/printQueue.server.d.ts.map +1 -1
  77. package/dist-lib/lib/printQueue.server.js +66 -48
  78. package/dist-lib/lib/printService.functions.d.ts +6628 -24446
  79. package/dist-lib/lib/printService.functions.d.ts.map +1 -1
  80. package/dist-lib/lib/printService.functions.js +5 -31
  81. package/dist-lib/lib/printService.server.js +1 -1
  82. package/dist-lib/lib/productiebonBuilder.d.ts +1 -1
  83. package/dist-lib/lib/productiebonHtml.js +2 -2
  84. package/dist-lib/lib/profielHtml.js +2 -2
  85. package/dist-lib/lib/queueTick.d.ts +11 -3
  86. package/dist-lib/lib/queueTick.d.ts.map +1 -1
  87. package/dist-lib/lib/queueTick.js +68 -21
  88. package/dist-lib/lib/queueTickClient.d.ts +8 -0
  89. package/dist-lib/lib/queueTickClient.d.ts.map +1 -0
  90. package/dist-lib/lib/queueTickClient.js +37 -0
  91. package/dist-lib/lib/runnerRegistry.server.d.ts +3 -2
  92. package/dist-lib/lib/runnerRegistry.server.d.ts.map +1 -1
  93. package/dist-lib/lib/runnerRegistry.server.js +6 -8
  94. package/dist-lib/lib/supabaseClient.d.ts +1 -1
  95. package/dist-lib/lib/testpagina.js +2 -2
  96. package/dist-lib/lib/useDocumentData.d.ts +1 -1
  97. package/dist-lib/lib/useDocumentData.js +1 -1
  98. package/dist-lib/lib/useNetwerkPrinters.js +1 -1
  99. package/package.json +2 -2
package/README.md CHANGED
@@ -42,13 +42,90 @@ npm run dev
42
42
  import { behandelQueueTick } from "@flowselections/layout-maker/print";
43
43
 
44
44
  export const Route = createFileRoute("/api/public/print/queue-tick")({
45
- server: { handlers: { POST: async ({ request }) => behandelQueueTick(request) } },
45
+ server: {
46
+ handlers: {
47
+ POST: async ({ request }) => {
48
+ // De shell levert de databaseverbinding; de module maakt er nooit zelf een.
49
+ const { supabaseAdmin } = await import(
50
+ "../../../../integrations/supabase/client.server"
51
+ );
52
+ return behandelQueueTick(request, supabaseAdmin);
53
+ },
54
+ },
55
+ },
46
56
  });
47
57
  ```
48
58
 
59
+ Het eindpunt accepteert drie toegangsbewijzen: een runner-sleutel uit
60
+ `print_queue_runners.tick_sleutel`, `SUPABASE_PUBLISHABLE_KEY` (de cron) of
61
+ het sessietoken van een ingelogde gebruiker (de knop in de Printwachtrij).
62
+
63
+
49
64
  4. Klaar. Zodra de module in de shell draait meldt hij zichzelf aan als
50
65
  verwerker van de printwachtrij. Een nieuwe printopdracht wordt meteen
51
66
  opgepakt; daarnaast verwerkt de geplande taak `print-queue-tick` elke minuut
52
67
  de wachtende opdrachten. Reageert een shell een uur lang niet, dan wordt hij
53
68
  automatisch op inactief gezet. De taak `print-queue-cleanup` ruimt dagelijks
54
69
  oude opdrachten en bestanden op.
70
+
71
+ ## Printen vanuit een andere module
72
+
73
+ Andere modules in dezelfde shell gebruiken uitsluitend de print-API van deze
74
+ module; zij hoeven de printtabellen niet te kennen en mogen er ook niet zelf in
75
+ schrijven (dan blijft de opdracht wachten tot de volgende cronronde).
76
+
77
+ ```ts
78
+ import {
79
+ printDocument, printPdf, printHtml,
80
+ printerVoorWerkplek, printerVoorDocumenttype, volgJobStatus,
81
+ } from "@flowselections/layout-maker";
82
+
83
+ // 1. Document dat via een ontwerp uit deze module wordt opgemaakt
84
+ const { jobId } = await printDocument({
85
+ documenttype: "pakbon", // moet een bestaande documentsoort zijn
86
+ documentnaam: "PB-2601284",
87
+ payload: { order }, // gegevens voor de layout
88
+ });
89
+
90
+ // 2. Kant-en-klare PDF (Floriday-document, klantsticker, externe factuur)
91
+ // Zonder printerId wordt de printer bepaald via de gekoppelde layout van
92
+ // de documentsoort (of de koppeling op papierformaat).
93
+ await printPdf({
94
+ documenttype: "factuur",
95
+ documentnaam: "F-2026-00123",
96
+ pdfBase64, // met of zonder data:-voorvoegsel
97
+ });
98
+
99
+ // Of expliciet per werkplek:
100
+ const printerId = await printerVoorWerkplek("PICKSTATION-1", "A4");
101
+ await printPdf({
102
+ documenttype: "afleverbrief",
103
+ documentnaam: "AFL-12345",
104
+ pdfBase64,
105
+ printerId: printerId!,
106
+ });
107
+
108
+
109
+ // 3. Eigen opmaak afdrukken (geen layout, anders wint de layout)
110
+ await printHtml({
111
+ documenttype: "controlelijst",
112
+ documentnaam: "Controlelijst kar 12",
113
+ html,
114
+ printerId: printerId!,
115
+ });
116
+
117
+ // Status live volgen (realtime staat aan op print_jobs)
118
+ const stop = volgJobStatus(jobId, (s) => console.log(s.status, s.foutmelding));
119
+ ```
120
+
121
+ Belangrijk:
122
+
123
+ - **Documentsoorten** liggen vast in de database: pakbon, factuur, offerte,
124
+ orderbevestiging, etiket, verzendlabel, productlabel, barcode_label,
125
+ magazijnlijst, controlelijst, transportdocument, sticker, productiebon,
126
+ veilingbon, afleverbrief, veilingbrief en vrij.
127
+ - **Beslisvolgorde bij het afdrukken**: kant-en-klare PDF > gekoppelde layout >
128
+ meegestuurde opmaak > actieve layout van de documentsoort.
129
+ - **Dubbelbeveiliging**: een identieke aanvraag binnen 10 minuten wordt
130
+ genegeerd; de aanroep werpt dan `DubbeleAanvraagFout`. Geef bij bulkprints per
131
+ document een eigen `documentnaam` zodat elke opdracht uniek is.
@@ -1,4 +1,4 @@
1
- import { type Orientatie } from "../lib/browserPrint";
1
+ import { type Orientatie } from "../lib/browserPrint.js";
2
2
  export interface AfdrukKnopProps {
3
3
  documenttype: string;
4
4
  formaatCode: string | null;
@@ -7,8 +7,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
7
  import { useState } from "react";
8
8
  import { Button, toast } from "@flowselections/core";
9
9
  import { Loader2, Printer } from "lucide-react";
10
- import { drukAf } from "../lib/browserPrint";
11
- import { printDirect } from "../lib/directPrint";
10
+ import { drukAf } from "../lib/browserPrint.js";
11
+ import { printDirect } from "../lib/directPrint.js";
12
12
  export function AfdrukKnop({ documenttype, formaatCode, orientatie, getHtml, css, documentnaam, label = "Afdrukken", layoutId, kopieen, }) {
13
13
  const [bezig, setBezig] = useState(false);
14
14
  const afdrukken = async () => {
@@ -3,10 +3,10 @@ import { useState } from "react";
3
3
  import { useNavigate } from "@tanstack/react-router";
4
4
  import { Badge, Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Input, Label, toast, } from "@flowselections/core";
5
5
  import { Sparkles, Upload } from "lucide-react";
6
- import { analyseerDocumentLayout } from "../lib/aiLayout.functions";
7
- import { supabase } from "../lib/supabaseClient";
8
- import { useLogos } from "../lib/logoLibrary";
9
- import { documentProfiel, standaardConfig } from "../lib/documentProfiles";
6
+ import { analyseerDocumentLayout } from "../lib/aiLayout.functions.js";
7
+ import { supabase } from "../lib/supabaseClient.js";
8
+ import { useLogos } from "../lib/logoLibrary.js";
9
+ import { documentProfiel, standaardConfig } from "../lib/documentProfiles.js";
10
10
  export function AiLayoutImportDialog({ open, onOpenChange, onKlaar, }) {
11
11
  const navigate = useNavigate();
12
12
  const { logos } = useLogos();
@@ -3,11 +3,11 @@ import { useEffect, useMemo, useState } from "react";
3
3
  import { Link } from "@tanstack/react-router";
4
4
  import { Badge, Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Separator, toast, } from "@flowselections/core";
5
5
  import { ArrowLeft, Plus, Save } from "lucide-react";
6
- import { PakbonSectieEditor, PakbonBlokKaderEditor } from "./PakbonSectiesPanel";
7
- import { PakbonSectiePreview } from "./PakbonPreview";
8
- import { SECTIE_REGISTER, leesPakbonConfig, nieuweSectie, sectieDef, } from "../lib/pakbonBuilder";
9
- import { updateLayout, useLayoutDetail } from "../lib/useDocumentData";
10
- import { useLayoutIdParam } from "../lib/useLayoutIdParam";
6
+ import { PakbonSectieEditor, PakbonBlokKaderEditor } from "./PakbonSectiesPanel.js";
7
+ import { PakbonSectiePreview } from "./PakbonPreview.js";
8
+ import { SECTIE_REGISTER, leesPakbonConfig, nieuweSectie, sectieDef, } from "../lib/pakbonBuilder.js";
9
+ import { updateLayout, useLayoutDetail } from "../lib/useDocumentData.js";
10
+ import { useLayoutIdParam } from "../lib/useLayoutIdParam.js";
11
11
  /** Ontwerp elk pakbon-blok afzonderlijk, los van de volledige pagina. */
12
12
  export function BlokOntwerperPage({ layoutId: layoutIdProp } = {}) {
13
13
  const layoutId = useLayoutIdParam(layoutIdProp);
@@ -6,8 +6,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
6
  import { useCallback, useEffect, useState } from "react";
7
7
  import { Button, Card, CardContent, Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "@flowselections/core";
8
8
  import { Loader2, Monitor, Plus, RefreshCw } from "lucide-react";
9
- import { netwerkComputers, netwerkPrinters } from "../lib/printService.functions";
10
- import { PrintProgrammaUitleg, WerktHetNiet } from "./PrintProgrammaUitleg";
9
+ import { netwerkComputers, netwerkPrinters } from "../lib/printService.functions.js";
10
+ import { PrintProgrammaUitleg, WerktHetNiet } from "./PrintProgrammaUitleg.js";
11
11
  export function useComputers() {
12
12
  const [computers, setComputers] = useState([]);
13
13
  const [loading, setLoading] = useState(true);
@@ -1,5 +1,5 @@
1
- import { type DocumentConfig } from "../lib/documentProfiles";
2
- import type { LayoutModel } from "../lib/documentTypes";
1
+ import { type DocumentConfig } from "../lib/documentProfiles.js";
2
+ import type { LayoutModel } from "../lib/documentTypes.js";
3
3
  /**
4
4
  * Documentspecifieke instellingen. Wat hier verschijnt komt volledig uit het
5
5
  * profiel van het documenttype — nieuwe documentsoorten werken automatisch.
@@ -2,9 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useState } from "react";
3
3
  import { Badge, Button, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Separator, Switch, toast, } from "@flowselections/core";
4
4
  import { Save } from "lucide-react";
5
- import { configWaarde, documentProfiel, standaardConfig, } from "../lib/documentProfiles";
6
- import { updateLayout, usePrinters } from "../lib/useDocumentData";
7
- import { useFormaatPrinters, zetFormaatPrinter } from "../lib/formaatPrinters";
5
+ import { configWaarde, documentProfiel, standaardConfig, } from "../lib/documentProfiles.js";
6
+ import { updateLayout, usePrinters } from "../lib/useDocumentData.js";
7
+ import { useFormaatPrinters, zetFormaatPrinter } from "../lib/formaatPrinters.js";
8
8
  /**
9
9
  * Documentspecifieke instellingen. Wat hier verschijnt komt volledig uit het
10
10
  * profiel van het documenttype — nieuwe documentsoorten werken automatisch.
@@ -1,4 +1,4 @@
1
- import { type LayoutModel } from "../lib/documentTypes";
1
+ import { type LayoutModel } from "../lib/documentTypes.js";
2
2
  /**
3
3
  * Formaat- en oriëntatiekeuze die in elke ontwerp-editor beschikbaar is.
4
4
  * Wijzigingen worden direct opgeslagen en lokaal doorgegeven aan de preview.
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
3
  import { Button, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, toast, } from "@flowselections/core";
4
4
  import { RectangleHorizontal, RectangleVertical } from "lucide-react";
5
- import { PAPIERFORMATEN } from "../lib/documentTypes";
6
- import { updateLayout } from "../lib/useDocumentData";
5
+ import { PAPIERFORMATEN } from "../lib/documentTypes.js";
6
+ import { updateLayout } from "../lib/useDocumentData.js";
7
7
  /**
8
8
  * Formaat- en oriëntatiekeuze die in elke ontwerp-editor beschikbaar is.
9
9
  * Wijzigingen worden direct opgeslagen en lokaal doorgegeven aan de preview.
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useMemo, useState } from "react";
3
- import { useAutoRefresh } from "../lib/useAutoRefresh";
3
+ import { useAutoRefresh } from "../lib/useAutoRefresh.js";
4
4
  import { useNavigate } from "@tanstack/react-router";
5
5
  import { Badge, Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Separator, Switch, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Textarea, toast, } from "@flowselections/core";
6
6
  import { Copy, FileText, Images, Pencil, Plus, Search, Settings2, Trash2 } from "lucide-react";
7
- import { dupliceerLayout, maakLayout, updateLayout, useLayouts, verwijderLayout, } from "../lib/useDocumentData";
8
- import { DOCUMENT_TYPES, PAPIERFORMATEN, documentTypeLabel } from "../lib/documentTypes";
9
- import { DOCUMENT_PROFIELEN, documentProfiel, primaireProfielen, standaardConfig, } from "../lib/documentProfiles";
7
+ import { dupliceerLayout, maakLayout, updateLayout, useLayouts, verwijderLayout, } from "../lib/useDocumentData.js";
8
+ import { DOCUMENT_TYPES, PAPIERFORMATEN, documentTypeLabel } from "../lib/documentTypes.js";
9
+ import { DOCUMENT_PROFIELEN, documentProfiel, primaireProfielen, standaardConfig, } from "../lib/documentProfiles.js";
10
10
  function klantOntwerpLayout(l) {
11
11
  if (l.documenttype !== "sticker")
12
12
  return false;
@@ -1,4 +1,4 @@
1
- import { type LogoModel } from "../lib/logoLibrary";
1
+ import { type LogoModel } from "../lib/logoLibrary.js";
2
2
  export declare function LogoBibliotheekDialog({ open, onOpenChange, onKies, }: {
3
3
  open: boolean;
4
4
  onOpenChange: (v: boolean) => void;
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useMemo, useState } from "react";
3
3
  import { Badge, Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Input, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@flowselections/core";
4
- import { LOGO_CATEGORIEEN, logoCategorieLabel, useLogos } from "../lib/logoLibrary";
5
- import { LogoThumbnail } from "./LogosPage";
4
+ import { LOGO_CATEGORIEEN, logoCategorieLabel, useLogos } from "../lib/logoLibrary.js";
5
+ import { LogoThumbnail } from "./LogosPage.js";
6
6
  export function LogoBibliotheekDialog({ open, onOpenChange, onKies, }) {
7
7
  const { logos, loading } = useLogos();
8
8
  const [zoek, setZoek] = useState("");
@@ -1,4 +1,4 @@
1
- import { type LogoModel } from "../lib/logoLibrary";
1
+ import { type LogoModel } from "../lib/logoLibrary.js";
2
2
  export declare function LogoThumbnail({ logo, className }: {
3
3
  logo: LogoModel;
4
4
  className?: string;
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useMemo, useState } from "react";
3
3
  import { Badge, Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Switch, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Textarea, toast, } from "@flowselections/core";
4
4
  import { Download, ImagePlus, Pencil, RefreshCw, Trash2, Upload } from "lucide-react";
5
- import { useAutoRefresh } from "../lib/useAutoRefresh";
6
- import { LOGO_CATEGORIEEN, TOEGESTANE_LOGO_TYPES, downloadLogo, formatteerBytes, logoCategorieLabel, maakLogo, useLogos, vervangLogoBestand, verwijderLogo, werkLogoBij, } from "../lib/logoLibrary";
5
+ import { useAutoRefresh } from "../lib/useAutoRefresh.js";
6
+ import { LOGO_CATEGORIEEN, TOEGESTANE_LOGO_TYPES, downloadLogo, formatteerBytes, logoCategorieLabel, maakLogo, useLogos, vervangLogoBestand, verwijderLogo, werkLogoBij, } from "../lib/logoLibrary.js";
7
7
  export function LogoThumbnail({ logo, className = "" }) {
8
8
  return (_jsx("div", { className: `flex h-12 w-16 items-center justify-center overflow-hidden rounded border bg-[repeating-conic-gradient(#e5e7eb_0%_25%,#fff_0%_50%)] bg-[length:10px_10px] ${className}`, children: logo.viewUrl ? (_jsx("img", { src: logo.viewUrl, alt: logo.naam, className: "max-h-full max-w-full object-contain" })) : (_jsx(ImagePlus, { className: "h-4 w-4 text-muted-foreground" })) }));
9
9
  }
@@ -6,8 +6,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
6
  import { useCallback, useEffect, useState } from "react";
7
7
  import { Button, Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, toast, } from "@flowselections/core";
8
8
  import { Loader2, Printer, RefreshCw } from "lucide-react";
9
- import { supabase } from "../lib/supabaseClient";
10
- import { netwerkPrinters } from "../lib/printService.functions";
9
+ import { supabase } from "../lib/supabaseClient.js";
10
+ import { netwerkPrinters } from "../lib/printService.functions.js";
11
11
  export function NetwerkPrintersDialog({ open, onOpenChange, huidigePrinterId, huidigePrinterNaam, onKlaar, }) {
12
12
  const [bezig, setBezig] = useState(false);
13
13
  const [fout, setFout] = useState(null);
@@ -3,14 +3,14 @@ import { useEffect, useMemo, useState } from "react";
3
3
  import { Link } from "@tanstack/react-router";
4
4
  import { Badge, Button, Card, CardContent, CardDescription, CardHeader, CardTitle, toast, } from "@flowselections/core";
5
5
  import { ArrowLeft, Loader2, Printer, Save } from "lucide-react";
6
- import { PakbonSectiesPanel } from "./PakbonSectiesPanel";
7
- import { PakbonPreview } from "./PakbonPreview";
8
- import { FormaatOrientatieBar } from "./FormaatOrientatieBar";
9
- import { leesPakbonConfig } from "../lib/pakbonBuilder";
10
- import { printPakbon, voorbeeldPakbonOrder } from "../lib/pakbonHtml";
11
- import { haalPrintLogos } from "../lib/logoLibrary";
12
- import { updateLayout, useLayoutDetail } from "../lib/useDocumentData";
13
- import { useLayoutIdParam } from "../lib/useLayoutIdParam";
6
+ import { PakbonSectiesPanel } from "./PakbonSectiesPanel.js";
7
+ import { PakbonPreview } from "./PakbonPreview.js";
8
+ import { FormaatOrientatieBar } from "./FormaatOrientatieBar.js";
9
+ import { leesPakbonConfig } from "../lib/pakbonBuilder.js";
10
+ import { printPakbon, voorbeeldPakbonOrder } from "../lib/pakbonHtml.js";
11
+ import { haalPrintLogos } from "../lib/logoLibrary.js";
12
+ import { updateLayout, useLayoutDetail } from "../lib/useDocumentData.js";
13
+ import { useLayoutIdParam } from "../lib/useLayoutIdParam.js";
14
14
  /** Sectiegebaseerde pakbon-builder met live voorbeeld op echte ordergegevens. */
15
15
  export function PakbonBuilderPage({ layoutId: layoutIdProp } = {}) {
16
16
  const layoutId = useLayoutIdParam(layoutIdProp);
@@ -1,4 +1,4 @@
1
- import { type PakbonConfig, type PakbonSectie } from "../lib/pakbonBuilder";
1
+ import { type PakbonConfig, type PakbonSectie } from "../lib/pakbonBuilder.js";
2
2
  export declare function PakbonPreview({ config, breedteMm, hoogteMm, }: {
3
3
  config: PakbonConfig;
4
4
  breedteMm?: number;
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useMemo } from "react";
3
- import { PaginaDocument } from "./PaginaDocument";
4
- import { useLogos } from "../lib/logoLibrary";
5
- import { DEMO_ORDER, conditieContext, groepeerIdentiekeKarren, groepeerIdentiekeLagen, karBundelTekst, fustVerzamellijst, pickMethode, productVeldBreedtes, sectieOnderdrukt, kolomLabel, laagBundelTekst, sectieZichtbaar, sorteerProducten, totalen, vulVeldcodes, } from "../lib/pakbonBuilder";
3
+ import { PaginaDocument } from "./PaginaDocument.js";
4
+ import { useLogos } from "../lib/logoLibrary.js";
5
+ import { DEMO_ORDER, conditieContext, groepeerIdentiekeKarren, groepeerIdentiekeLagen, karBundelTekst, fustVerzamellijst, pickMethode, productVeldBreedtes, sectieOnderdrukt, kolomLabel, laagBundelTekst, sectieZichtbaar, sorteerProducten, totalen, vulVeldcodes, } from "../lib/pakbonBuilder.js";
6
6
  export function PakbonPreview({ config, breedteMm = 210, hoogteMm = 297, }) {
7
7
  const order = DEMO_ORDER;
8
8
  const ctx = conditieContext(order);
@@ -1,4 +1,4 @@
1
- import { type PakbonConfig, type PakbonSectie } from "../lib/pakbonBuilder";
1
+ import { type PakbonConfig, type PakbonSectie } from "../lib/pakbonBuilder.js";
2
2
  /** Beheer van de secties waaruit de pakbon is opgebouwd. */
3
3
  export declare function PakbonSectiesPanel({ config, onChange, }: {
4
4
  config: PakbonConfig;
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
3
  import { Badge, Button, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Separator, Switch, } from "@flowselections/core";
4
4
  import { ChevronDown, ChevronUp, ImagePlus, Plus, Trash2 } from "lucide-react";
5
- import { useLogos } from "../lib/logoLibrary";
6
- import { LogoBibliotheekDialog } from "./LogoBibliotheekDialog";
7
- import { LogoThumbnail } from "./LogosPage";
8
- import { BESCHIKBARE_KOLOMMEN, CONDITIE_VELDEN, SECTIE_REGISTER, nieuweKolom, nieuweSectie, pickMethode, sectieDef, sectieOnderdrukt, } from "../lib/pakbonBuilder";
5
+ import { useLogos } from "../lib/logoLibrary.js";
6
+ import { LogoBibliotheekDialog } from "./LogoBibliotheekDialog.js";
7
+ import { LogoThumbnail } from "./LogosPage.js";
8
+ import { BESCHIKBARE_KOLOMMEN, CONDITIE_VELDEN, SECTIE_REGISTER, nieuweKolom, nieuweSectie, pickMethode, sectieDef, sectieOnderdrukt, } from "../lib/pakbonBuilder.js";
9
9
  /** Beheer van de secties waaruit de pakbon is opgebouwd. */
10
10
  export function PakbonSectiesPanel({ config, onChange, }) {
11
11
  const alleSecties = Array.isArray(config?.secties) ? config.secties : [];
@@ -1 +1 @@
1
- {"version":3,"file":"PrintQueuePage.d.ts","sourceRoot":"","sources":["../../src/components/PrintQueuePage.tsx"],"names":[],"mappings":"AAsCA,wBAAgB,cAAc,gCAuN7B"}
1
+ {"version":3,"file":"PrintQueuePage.d.ts","sourceRoot":"","sources":["../../src/components/PrintQueuePage.tsx"],"names":[],"mappings":"AAuCA,wBAAgB,cAAc,gCAoN7B"}
@@ -2,10 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useMemo, useRef, useState } from "react";
3
3
  import { Badge, Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Input, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, toast, } from "@flowselections/core";
4
4
  import { RotateCcw, Search, XCircle } from "lucide-react";
5
- import { bijgewerktTekst, useAutoRefresh } from "../lib/useAutoRefresh";
6
- import { maakPrintJob, updateJobStatus, useLayouts, usePrinters, usePrintJobs } from "../lib/useDocumentData";
7
- import { printStatus, wachtrijTick } from "../lib/printService.functions";
8
- import { documentTypeLabel } from "../lib/documentTypes";
5
+ import { bijgewerktTekst, useAutoRefresh } from "../lib/useAutoRefresh.js";
6
+ import { maakPrintJob, updateJobStatus, useLayouts, usePrinters, usePrintJobs } from "../lib/useDocumentData.js";
7
+ import { printStatus } from "../lib/printService.functions.js";
8
+ import { vraagWachtrijRonde } from "../lib/queueTickClient.js";
9
+ import { documentTypeLabel } from "../lib/documentTypes.js";
9
10
  const STATUS_VARIANT = {
10
11
  wachtend: "outline",
11
12
  bezig: "secondary",
@@ -44,8 +45,8 @@ export function PrintQueuePage() {
44
45
  // achtergrondtaak nog niet is langsgekomen in een verse installatie.
45
46
  if (jobsRef.current.some((j) => j.status === "wachtend")) {
46
47
  try {
47
- const res = (await wachtrijTick({ data: undefined }));
48
- setTickFout(res?.ok === false ? res.fout ?? "Verwerken mislukt" : null);
48
+ const res = await vraagWachtrijRonde();
49
+ setTickFout(res.ok ? null : res.fout ?? "Verwerken mislukt");
49
50
  }
50
51
  catch (e) {
51
52
  setTickFout(e instanceof Error ? e.message : "Achtergrondprinten werkt nu niet.");
@@ -6,11 +6,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
6
  import { useCallback, useEffect, useMemo, useState } from "react";
7
7
  import { Button, Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, Input, Label, toast, } from "@flowselections/core";
8
8
  import { Check, CheckCircle2, FileText, Loader2, Printer, RefreshCw, Search, Tag, } from "lucide-react";
9
- import { supabase } from "../lib/supabaseClient";
10
- import { drukAf } from "../lib/browserPrint";
11
- import { printDirect } from "../lib/directPrint";
12
- import { netwerkPrinters } from "../lib/printService.functions";
13
- import { PrintProgrammaUitleg, WerktHetNiet } from "./PrintProgrammaUitleg";
9
+ import { supabase } from "../lib/supabaseClient.js";
10
+ import { drukAf } from "../lib/browserPrint.js";
11
+ import { printDirect } from "../lib/directPrint.js";
12
+ import { netwerkPrinters } from "../lib/printService.functions.js";
13
+ import { PrintProgrammaUitleg, WerktHetNiet } from "./PrintProgrammaUitleg.js";
14
14
  const STAPPEN = ["Printer kiezen", "Naam en locatie", "Klaar"];
15
15
  function instellingenVoor(gebruik) {
16
16
  return gebruik === "etiket"
@@ -7,13 +7,13 @@ import { useMemo, useState } from "react";
7
7
  import { Button, Input, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@flowselections/core";
8
8
  import { Link } from "@tanstack/react-router";
9
9
  import { CheckCircle2, FileText, ListChecks, Monitor, Plus, Printer, Search } from "lucide-react";
10
- import { bijgewerktTekst, useAutoRefresh } from "../lib/useAutoRefresh";
11
- import { useLayouts, usePrinters } from "../lib/useDocumentData";
12
- import { useNetwerkPrinters } from "../lib/useNetwerkPrinters";
13
- import { PrinterSetupWizard } from "./PrinterSetupWizard";
14
- import { ComputersLijst, useComputers } from "./ComputersLijst";
15
- import { PrinterStatsKaarten } from "./PrinterStatsKaarten";
16
- import { WerkplekkenTabel } from "./WerkplekkenTabel";
10
+ import { bijgewerktTekst, useAutoRefresh } from "../lib/useAutoRefresh.js";
11
+ import { useLayouts, usePrinters } from "../lib/useDocumentData.js";
12
+ import { useNetwerkPrinters } from "../lib/useNetwerkPrinters.js";
13
+ import { PrinterSetupWizard } from "./PrinterSetupWizard.js";
14
+ import { ComputersLijst, useComputers } from "./ComputersLijst.js";
15
+ import { PrinterStatsKaarten } from "./PrinterStatsKaarten.js";
16
+ import { WerkplekkenTabel } from "./WerkplekkenTabel.js";
17
17
  export function PrintersPage() {
18
18
  const { printers, koppelingen, reload } = usePrinters();
19
19
  const { layouts } = useLayouts();
@@ -1,4 +1,4 @@
1
- import { type ProductiebonConfig } from "../lib/productiebonBuilder";
1
+ import { type ProductiebonConfig } from "../lib/productiebonBuilder.js";
2
2
  /** Beheer van de blokken waaruit de productiebon is opgebouwd. */
3
3
  export declare function ProductiebonBlokkenPanel({ config, onChange, }: {
4
4
  config: ProductiebonConfig;
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { useState } from "react";
3
3
  import { Badge, Button, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Separator, Switch, } from "@flowselections/core";
4
4
  import { ChevronDown, ChevronUp, Plus, Trash2 } from "lucide-react";
5
- import { LETTERTYPEN, MATERIAAL_KOLOMMEN, PB_BLOK_REGISTER, PB_CONDITIE_VELDEN, PRODUCTINFO_VELDEN, SAMENSTELLING_KOLOMMEN, nieuwBlok, pbNieuweKolom, nieuwVeld, pbBlokDef, } from "../lib/productiebonBuilder";
5
+ import { LETTERTYPEN, MATERIAAL_KOLOMMEN, PB_BLOK_REGISTER, PB_CONDITIE_VELDEN, PRODUCTINFO_VELDEN, SAMENSTELLING_KOLOMMEN, nieuwBlok, pbNieuweKolom, nieuwVeld, pbBlokDef, } from "../lib/productiebonBuilder.js";
6
6
  /** Beheer van de blokken waaruit de productiebon is opgebouwd. */
7
7
  export function ProductiebonBlokkenPanel({ config, onChange, }) {
8
8
  const blokken = Array.isArray(config?.blokken) ? config.blokken : [];
@@ -3,12 +3,12 @@ import { useEffect, useMemo, useState } from "react";
3
3
  import { Link } from "@tanstack/react-router";
4
4
  import { Badge, Button, Card, CardContent, CardDescription, CardHeader, CardTitle, toast, } from "@flowselections/core";
5
5
  import { ArrowLeft, Save } from "lucide-react";
6
- import { ProductiebonBlokkenPanel } from "./ProductiebonBlokkenPanel";
7
- import { ProductiebonPreview } from "./ProductiebonPreview";
8
- import { FormaatOrientatieBar } from "./FormaatOrientatieBar";
9
- import { leesProductiebonConfig } from "../lib/productiebonBuilder";
10
- import { updateLayout, useLayoutDetail } from "../lib/useDocumentData";
11
- import { useLayoutIdParam } from "../lib/useLayoutIdParam";
6
+ import { ProductiebonBlokkenPanel } from "./ProductiebonBlokkenPanel.js";
7
+ import { ProductiebonPreview } from "./ProductiebonPreview.js";
8
+ import { FormaatOrientatieBar } from "./FormaatOrientatieBar.js";
9
+ import { leesProductiebonConfig } from "../lib/productiebonBuilder.js";
10
+ import { updateLayout, useLayoutDetail } from "../lib/useDocumentData.js";
11
+ import { useLayoutIdParam } from "../lib/useLayoutIdParam.js";
12
12
  /** Eigen editor voor de productiebon: modulaire blokken met live voorbeeld. */
13
13
  export function ProductiebonBuilderPage({ layoutId: layoutIdProp } = {}) {
14
14
  const layoutId = useLayoutIdParam(layoutIdProp);
@@ -1,4 +1,4 @@
1
- import { type ProductiebonBlok, type ProductiebonConfig } from "../lib/productiebonBuilder";
1
+ import { type ProductiebonBlok, type ProductiebonConfig } from "../lib/productiebonBuilder.js";
2
2
  /** Live voorbeeld van de volledige productiebon, verdeeld over pagina's. */
3
3
  export declare function ProductiebonPreview({ config, breedteMm, hoogteMm, }: {
4
4
  config: ProductiebonConfig;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { PaginaDocument } from "./PaginaDocument";
3
- import { BELADING_LABELS, DEMO_PRODUCTIEBON, EXTRA_LABELS, FUST_LABELS, ONDERDEEL_LABELS, QR_LABELS, pbBlokZichtbaar, pbConditieContext, splitsLijst, vulPbVeldcodes, } from "../lib/productiebonBuilder";
2
+ import { PaginaDocument } from "./PaginaDocument.js";
3
+ import { BELADING_LABELS, DEMO_PRODUCTIEBON, EXTRA_LABELS, FUST_LABELS, ONDERDEEL_LABELS, QR_LABELS, pbBlokZichtbaar, pbConditieContext, splitsLijst, vulPbVeldcodes, } from "../lib/productiebonBuilder.js";
4
4
  const data = DEMO_PRODUCTIEBON;
5
5
  /** Live voorbeeld van de volledige productiebon, verdeeld over pagina's. */
6
6
  export function ProductiebonPreview({ config, breedteMm = 210, hoogteMm = 297, }) {
@@ -7,13 +7,13 @@ import { useMemo, useState } from "react";
7
7
  import { Button, Card, CardContent, CardDescription, CardHeader, CardTitle, Checkbox, Input, toast, } from "@flowselections/core";
8
8
  import { Link, useParams } from "@tanstack/react-router";
9
9
  import { ChevronRight, Monitor, Plus, Printer, Search } from "lucide-react";
10
- import { bijgewerktTekst, useAutoRefresh } from "../lib/useAutoRefresh";
11
- import { toggleKoppeling, useLayouts, usePrinters, verwijderPrinter } from "../lib/useDocumentData";
12
- import { useNetwerkPrinters } from "../lib/useNetwerkPrinters";
13
- import { drukTestpaginaAf } from "../lib/testpagina";
14
- import { useComputers } from "./ComputersLijst";
15
- import { PrinterKaart } from "./PrinterKaart";
16
- import { PrinterSetupWizard } from "./PrinterSetupWizard";
10
+ import { bijgewerktTekst, useAutoRefresh } from "../lib/useAutoRefresh.js";
11
+ import { toggleKoppeling, useLayouts, usePrinters, verwijderPrinter } from "../lib/useDocumentData.js";
12
+ import { useNetwerkPrinters } from "../lib/useNetwerkPrinters.js";
13
+ import { drukTestpaginaAf } from "../lib/testpagina.js";
14
+ import { useComputers } from "./ComputersLijst.js";
15
+ import { PrinterKaart } from "./PrinterKaart.js";
16
+ import { PrinterSetupWizard } from "./PrinterSetupWizard.js";
17
17
  export function WerkplekConfiguratiePage() {
18
18
  const params = useParams({ strict: false });
19
19
  const computerId = params.computerId ?? "";