@flowselections/layout-maker 1.7.3 → 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 (34) hide show
  1. package/README.md +131 -69
  2. package/dist-lib/components/PrinterSetupWizard.js +1 -1
  3. package/dist-lib/index.d.ts +2 -2
  4. package/dist-lib/index.d.ts.map +1 -1
  5. package/dist-lib/index.js +2 -2
  6. package/dist-lib/integrations/supabase/auth-middleware.d.ts +280 -13
  7. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  8. package/dist-lib/integrations/supabase/client.server.d.ts +280 -13
  9. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  10. package/dist-lib/integrations/supabase/types.d.ts +292 -14
  11. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  12. package/dist-lib/integrations/supabase/types.js +3 -0
  13. package/dist-lib/lib/aiLayout.functions.d.ts +280 -13
  14. package/dist-lib/lib/aiLayout.functions.d.ts.map +1 -1
  15. package/dist-lib/lib/aiLayout.server.js +9 -9
  16. package/dist-lib/lib/browserPrint.js +5 -5
  17. package/dist-lib/lib/documentProfiles.d.ts.map +1 -1
  18. package/dist-lib/lib/documentProfiles.js +3 -0
  19. package/dist-lib/lib/documentTypes.d.ts +1 -1
  20. package/dist-lib/lib/documentTypes.d.ts.map +1 -1
  21. package/dist-lib/lib/documentTypes.js +3 -0
  22. package/dist-lib/lib/layoutPreview.js +7 -7
  23. package/dist-lib/lib/pakbonHtml.js +50 -50
  24. package/dist-lib/lib/printApi.d.ts +71 -0
  25. package/dist-lib/lib/printApi.d.ts.map +1 -1
  26. package/dist-lib/lib/printApi.js +152 -12
  27. package/dist-lib/lib/printService.functions.d.ts +1120 -52
  28. package/dist-lib/lib/printService.functions.d.ts.map +1 -1
  29. package/dist-lib/lib/productiebonHtml.js +15 -15
  30. package/dist-lib/lib/profielHtml.js +18 -18
  31. package/dist-lib/lib/supabaseAdmin.server.d.ts +5 -5
  32. package/dist-lib/lib/supabaseAdmin.server.js +43 -43
  33. package/dist-lib/lib/testpagina.js +1 -1
  34. package/package.json +1 -1
@@ -147,20 +147,20 @@ export function renderProductiebonDocument(config, gegevens, opties = {}) {
147
147
  return inhoud ? `<div class="blok">${inhoud}</div>` : "";
148
148
  })
149
149
  .join("");
150
- return `<!doctype html><html lang="nl"><head><meta charset="utf-8" />
151
- <title>${esc(opties.titel ?? "Productiebon")}</title>
152
- <style>
153
- @page { size: ${b}mm ${h}mm; margin: ${marge}mm; }
154
- * { box-sizing: border-box; }
155
- html, body { margin: 0; padding: 0; }
156
- body { font-family: Arial, Helvetica, sans-serif; font-size: 9pt; color: #111827; line-height: 1.35; }
157
- .blok { margin-bottom: 2.5mm; }
158
- .sectitel { font-size: 90%; font-weight: 600; text-transform: uppercase; color: #6b7280; margin-bottom: 0.6mm; }
159
- .vet { font-weight: 600; }
160
- .kv { display: flex; justify-content: space-between; gap: 3mm; }
161
- .kv .k { color: #6b7280; }
162
- .tabel { width: 100%; border-collapse: collapse; table-layout: fixed; }
163
- .tabel th { text-align: left; font-weight: 600; }
164
- .regel { padding: 0.4mm 0; }
150
+ return `<!doctype html><html lang="nl"><head><meta charset="utf-8" />
151
+ <title>${esc(opties.titel ?? "Productiebon")}</title>
152
+ <style>
153
+ @page { size: ${b}mm ${h}mm; margin: ${marge}mm; }
154
+ * { box-sizing: border-box; }
155
+ html, body { margin: 0; padding: 0; }
156
+ body { font-family: Arial, Helvetica, sans-serif; font-size: 9pt; color: #111827; line-height: 1.35; }
157
+ .blok { margin-bottom: 2.5mm; }
158
+ .sectitel { font-size: 90%; font-weight: 600; text-transform: uppercase; color: #6b7280; margin-bottom: 0.6mm; }
159
+ .vet { font-weight: 600; }
160
+ .kv { display: flex; justify-content: space-between; gap: 3mm; }
161
+ .kv .k { color: #6b7280; }
162
+ .tabel { width: 100%; border-collapse: collapse; table-layout: fixed; }
163
+ .tabel th { text-align: left; font-weight: 600; }
164
+ .regel { padding: 0.4mm 0; }
165
165
  </style></head><body>${body}</body></html>`;
166
166
  }
@@ -110,8 +110,8 @@ function regeltabel(regels) {
110
110
  const eenheid = r["eenheid"] ?? "";
111
111
  return `<tr><td>${esc(code)}</td><td>${esc(omschrijving)}</td><td style="text-align:right">${esc(aantal)}</td><td>${esc(eenheid)}</td></tr>`;
112
112
  };
113
- return `<table class="tabel"><colgroup><col style="width:20%" /><col style="width:52%" /><col style="width:16%" /><col style="width:12%" /></colgroup>
114
- <thead><tr class="onder"><th>Code</th><th>Omschrijving</th><th style="text-align:right">Aantal</th><th>Eenheid</th></tr></thead>
113
+ return `<table class="tabel"><colgroup><col style="width:20%" /><col style="width:52%" /><col style="width:16%" /><col style="width:12%" /></colgroup>
114
+ <thead><tr class="onder"><th>Code</th><th>Omschrijving</th><th style="text-align:right">Aantal</th><th>Eenheid</th></tr></thead>
115
115
  <tbody>${regels.map(rij).join("")}</tbody></table>`;
116
116
  }
117
117
  function totalenBlok(regels, velden) {
@@ -236,21 +236,21 @@ export function renderProfielDocument(documenttype, config, gegevens, opties = {
236
236
  .map((groep) => groepHtml(groep, cfg, velden, data, opties))
237
237
  .filter(Boolean)
238
238
  .join("");
239
- return `<!doctype html><html lang="nl"><head><meta charset="utf-8" />
240
- <title>${esc(opties.titel ?? profiel.label)}</title>
241
- <style>
242
- @page { size: ${b}mm ${h}mm; margin: ${marge}mm; }
243
- * { box-sizing: border-box; }
244
- html, body { margin: 0; padding: 0; }
245
- body { font-family: Arial, Helvetica, sans-serif; font-size: 9pt; color: #111827; line-height: 1.35; }
246
- .blok { margin-bottom: 2.5mm; }
247
- .kop { border-bottom: 0.3mm solid #d1d5db; padding-bottom: 1mm; }
248
- .sectitel { font-size: 90%; font-weight: 600; text-transform: uppercase; color: #6b7280; margin-bottom: 0.6mm; }
249
- .vet { font-weight: 600; }
250
- .klein { font-size: 85%; color: #6b7280; }
251
- .kv { display: flex; justify-content: space-between; gap: 3mm; }
252
- .kv .k { color: #6b7280; }
253
- .tabel { width: 100%; border-collapse: collapse; table-layout: fixed; }
254
- .tabel th { text-align: left; font-weight: 600; }
239
+ return `<!doctype html><html lang="nl"><head><meta charset="utf-8" />
240
+ <title>${esc(opties.titel ?? profiel.label)}</title>
241
+ <style>
242
+ @page { size: ${b}mm ${h}mm; margin: ${marge}mm; }
243
+ * { box-sizing: border-box; }
244
+ html, body { margin: 0; padding: 0; }
245
+ body { font-family: Arial, Helvetica, sans-serif; font-size: 9pt; color: #111827; line-height: 1.35; }
246
+ .blok { margin-bottom: 2.5mm; }
247
+ .kop { border-bottom: 0.3mm solid #d1d5db; padding-bottom: 1mm; }
248
+ .sectitel { font-size: 90%; font-weight: 600; text-transform: uppercase; color: #6b7280; margin-bottom: 0.6mm; }
249
+ .vet { font-weight: 600; }
250
+ .klein { font-size: 85%; color: #6b7280; }
251
+ .kv { display: flex; justify-content: space-between; gap: 3mm; }
252
+ .kv .k { color: #6b7280; }
253
+ .tabel { width: 100%; border-collapse: collapse; table-layout: fixed; }
254
+ .tabel th { text-align: left; font-weight: 600; }
255
255
  </style></head><body>${kop}${body}</body></html>`;
256
256
  }
@@ -1,6 +1,6 @@
1
- import { type SupabaseClient } from "@supabase/supabase-js";
2
- /** Uitleg voor de gebruiker als de serverinstellingen ontbreken. */
3
- export declare function adminConfiguratieFout(): string | null;
4
- /** Lazy adminclient: pas bij het eerste gebruik worden de instellingen gelezen. */
5
- export declare const adminDb: SupabaseClient<any, any, any, any, any>;
1
+ import { type SupabaseClient } from "@supabase/supabase-js";
2
+ /** Uitleg voor de gebruiker als de serverinstellingen ontbreken. */
3
+ export declare function adminConfiguratieFout(): string | null;
4
+ /** Lazy adminclient: pas bij het eerste gebruik worden de instellingen gelezen. */
5
+ export declare const adminDb: SupabaseClient<any, any, any, any, any>;
6
6
  //# sourceMappingURL=supabaseAdmin.server.d.ts.map
@@ -1,43 +1,43 @@
1
- // ============================================================================
2
- // src/lib/supabaseAdmin.server.ts — adminclient die in elke shell werkt.
3
- // Leest de service-role sleutel uit meerdere mogelijke namen, zodat de module
4
- // niet afhankelijk is van hoe een shell zijn omgeving heeft ingericht.
5
- // ============================================================================
6
- import { createClient } from "@supabase/supabase-js";
7
- function lees(...namen) {
8
- for (const naam of namen) {
9
- const waarde = process.env[naam];
10
- if (waarde && waarde.trim().length > 0)
11
- return waarde.trim();
12
- }
13
- return undefined;
14
- }
15
- /** Uitleg voor de gebruiker als de serverinstellingen ontbreken. */
16
- export function adminConfiguratieFout() {
17
- const url = lees("SUPABASE_URL", "VITE_SUPABASE_URL");
18
- const key = lees("SERVICE_ROLE_KEY", "SUPABASE_SERVICE_ROLE_KEY");
19
- if (url && key)
20
- return null;
21
- const mist = [!url ? "SUPABASE_URL" : null, !key ? "SERVICE_ROLE_KEY" : null]
22
- .filter(Boolean)
23
- .join(" en ");
24
- return `Achtergrondprinten is niet ingesteld: ${mist} ontbreekt in deze omgeving.`;
25
- }
26
- function maakClient() {
27
- const url = lees("SUPABASE_URL", "VITE_SUPABASE_URL");
28
- const key = lees("SERVICE_ROLE_KEY", "SUPABASE_SERVICE_ROLE_KEY");
29
- if (!url || !key)
30
- throw new Error(adminConfiguratieFout() ?? "Serverinstellingen ontbreken.");
31
- return createClient(url, key, {
32
- auth: { storage: undefined, persistSession: false, autoRefreshToken: false },
33
- });
34
- }
35
- let _client;
36
- /** Lazy adminclient: pas bij het eerste gebruik worden de instellingen gelezen. */
37
- export const adminDb = new Proxy({}, {
38
- get(_t, prop, receiver) {
39
- if (!_client)
40
- _client = maakClient();
41
- return Reflect.get(_client, prop, receiver);
42
- },
43
- });
1
+ // ============================================================================
2
+ // src/lib/supabaseAdmin.server.ts — adminclient die in elke shell werkt.
3
+ // Leest de service-role sleutel uit meerdere mogelijke namen, zodat de module
4
+ // niet afhankelijk is van hoe een shell zijn omgeving heeft ingericht.
5
+ // ============================================================================
6
+ import { createClient } from "@supabase/supabase-js";
7
+ function lees(...namen) {
8
+ for (const naam of namen) {
9
+ const waarde = process.env[naam];
10
+ if (waarde && waarde.trim().length > 0)
11
+ return waarde.trim();
12
+ }
13
+ return undefined;
14
+ }
15
+ /** Uitleg voor de gebruiker als de serverinstellingen ontbreken. */
16
+ export function adminConfiguratieFout() {
17
+ const url = lees("SUPABASE_URL", "VITE_SUPABASE_URL");
18
+ const key = lees("SERVICE_ROLE_KEY", "SUPABASE_SERVICE_ROLE_KEY");
19
+ if (url && key)
20
+ return null;
21
+ const mist = [!url ? "SUPABASE_URL" : null, !key ? "SERVICE_ROLE_KEY" : null]
22
+ .filter(Boolean)
23
+ .join(" en ");
24
+ return `Achtergrondprinten is niet ingesteld: ${mist} ontbreekt in deze omgeving.`;
25
+ }
26
+ function maakClient() {
27
+ const url = lees("SUPABASE_URL", "VITE_SUPABASE_URL");
28
+ const key = lees("SERVICE_ROLE_KEY", "SUPABASE_SERVICE_ROLE_KEY");
29
+ if (!url || !key)
30
+ throw new Error(adminConfiguratieFout() ?? "Serverinstellingen ontbreken.");
31
+ return createClient(url, key, {
32
+ auth: { storage: undefined, persistSession: false, autoRefreshToken: false },
33
+ });
34
+ }
35
+ let _client;
36
+ /** Lazy adminclient: pas bij het eerste gebruik worden de instellingen gelezen. */
37
+ export const adminDb = new Proxy({}, {
38
+ get(_t, prop, receiver) {
39
+ if (!_client)
40
+ _client = maakClient();
41
+ return Reflect.get(_client, prop, receiver);
42
+ },
43
+ });
@@ -5,7 +5,7 @@ import { toast } from "@flowselections/core";
5
5
  import { drukAf } from "./browserPrint.js";
6
6
  import { printDirect } from "./directPrint.js";
7
7
  export async function drukTestpaginaAf(printerId, naam) {
8
- const html = `<div style="padding:20mm;font-size:14pt"><h1 style="font-size:20pt">Testpagina</h1>
8
+ const html = `<div style="padding:20mm;font-size:14pt"><h1 style="font-size:20pt">Testpagina</h1>
9
9
  <p>Deze pagina hoort uit: <strong>${naam}</strong></p></div>`;
10
10
  const opdracht = {
11
11
  documenttype: "pakbon",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowselections/layout-maker",
3
- "version": "1.7.3",
3
+ "version": "1.8.0",
4
4
  "flowselections": {
5
5
  "moduleId": "layout-maker",
6
6
  "pages": [