@burdenoff/microfe-eventfullymanaged 2026.1108.1 → 2026.1110.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.
Files changed (23) hide show
  1. package/dist/eventfullymanaged/api/eventApi.d.ts +16 -0
  2. package/dist/eventfullymanaged/api/eventApi.js +107 -97
  3. package/dist/eventfullymanaged/api/eventApi.js.map +1 -1
  4. package/dist/eventfullymanaged/lib/printBadge.d.ts +1 -0
  5. package/dist/eventfullymanaged/lib/printBadge.js +30 -0
  6. package/dist/eventfullymanaged/lib/printBadge.js.map +1 -0
  7. package/dist/eventfullymanaged/lib/useBadgePrint.d.ts +11 -0
  8. package/dist/eventfullymanaged/lib/useBadgePrint.js +38 -0
  9. package/dist/eventfullymanaged/lib/useBadgePrint.js.map +1 -0
  10. package/dist/eventfullymanaged/pages/events/EventDetailPage.js +252 -249
  11. package/dist/eventfullymanaged/pages/events/EventDetailPage.js.map +1 -1
  12. package/dist/eventfullymanaged/pages/modules/KioskPage.js +321 -285
  13. package/dist/eventfullymanaged/pages/modules/KioskPage.js.map +1 -1
  14. package/dist/eventfullymanaged/pages/modules/SponsorDetailsPage.js +81 -78
  15. package/dist/eventfullymanaged/pages/modules/SponsorDetailsPage.js.map +1 -1
  16. package/dist/eventfullymanaged/pages/speakers/SpeakerFormPage.js +87 -86
  17. package/dist/eventfullymanaged/pages/speakers/SpeakerFormPage.js.map +1 -1
  18. package/dist/eventfullymanaged/pages/venues/VenueDetailPage.js +93 -91
  19. package/dist/eventfullymanaged/pages/venues/VenueDetailPage.js.map +1 -1
  20. package/dist/eventfullymanaged/utils/breadcrumbRegistry.d.ts +2 -0
  21. package/dist/eventfullymanaged/utils/breadcrumbRegistry.js +13 -0
  22. package/dist/eventfullymanaged/utils/breadcrumbRegistry.js.map +1 -0
  23. package/package.json +1 -1
@@ -0,0 +1,30 @@
1
+ function e(e, t) {
2
+ if (typeof document > "u") return;
3
+ let n = document.createElement("iframe");
4
+ n.setAttribute("aria-hidden", "true"), n.setAttribute("sandbox", "allow-modals"), n.style.position = "fixed", n.style.right = "100%", n.style.bottom = "100%", n.style.width = "0", n.style.height = "0", n.style.border = "0", document.body.appendChild(n);
5
+ let r = n.contentWindow;
6
+ if (!r) {
7
+ n.remove();
8
+ return;
9
+ }
10
+ let i, a = () => {
11
+ r.removeEventListener("afterprint", a), i !== void 0 && clearTimeout(i), n.remove();
12
+ };
13
+ r.addEventListener("afterprint", a);
14
+ let o = !1, s = () => {
15
+ if (!o) {
16
+ o = !0;
17
+ try {
18
+ r.print();
19
+ } catch (e) {
20
+ t?.(e);
21
+ } finally {
22
+ i = setTimeout(a, 3e5);
23
+ }
24
+ }
25
+ };
26
+ r.addEventListener("load", s, { once: !0 }), n.srcdoc = e, setTimeout(s, 500);
27
+ }
28
+ export { e as printBadgeHtml };
29
+
30
+ //# sourceMappingURL=printBadge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"printBadge.js","names":["printBadgeHtml","iframe","win","fallbackTimer","cleanup","printed","print","err","html"],"sources":["../../../src/eventfullymanaged/lib/printBadge.ts"],"sourcesContent":["/**\n * BOFF-4551 — native badge printing through the browser/OS print dialog.\n *\n * The badge HTML (`eventfullyManagedBadgeHtml`) is self-contained and\n * script-free, so it is assigned to a hidden iframe's `srcdoc` (no `doc.write`)\n * behind `sandbox=\"allow-modals\"` — no script execution, but the\n * `contentWindow.print()` call below is permitted to open the OS print dialog\n * (an empty sandbox silently swallows it).\n *\n * Cleanup: `afterprint` fires on the iframe's contentWindow when the print\n * dialog closes; a fallback timer removes the iframe 5 minutes after the\n * print attempt for kiosk engines that never fire it, so a slow print-dialog\n * interaction cannot have the iframe yanked mid-print, and repeated kiosk\n * prints do not accumulate DOM.\n */\nconst CLEANUP_FALLBACK_MS = 5 * 60 * 1000;\n\nexport function printBadgeHtml(html: string, onError?: (error: unknown) => void): void {\n if (typeof document === 'undefined') {\n return;\n }\n const iframe = document.createElement('iframe');\n iframe.setAttribute('aria-hidden', 'true');\n // allow-modals is required for contentWindow.print() to open the OS print\n // dialog; scripts stay blocked (no allow-scripts).\n iframe.setAttribute('sandbox', 'allow-modals');\n iframe.style.position = 'fixed';\n iframe.style.right = '100%';\n iframe.style.bottom = '100%';\n iframe.style.width = '0';\n iframe.style.height = '0';\n iframe.style.border = '0';\n document.body.appendChild(iframe);\n\n const win = iframe.contentWindow;\n if (!win) {\n iframe.remove();\n return;\n }\n\n let fallbackTimer: ReturnType<typeof setTimeout> | undefined;\n const cleanup = () => {\n win.removeEventListener('afterprint', cleanup);\n if (fallbackTimer !== undefined) {\n clearTimeout(fallbackTimer);\n }\n iframe.remove();\n };\n win.addEventListener('afterprint', cleanup);\n\n let printed = false;\n const print = () => {\n if (printed) {\n return;\n }\n printed = true;\n try {\n win.print();\n } catch (err) {\n // print() runs in a load/timer callback, so the caller cannot catch\n // this — report through the callback instead of leaving it unhandled.\n onError?.(err);\n } finally {\n // Fallback cleanup is unconditional: a kiosk engine where print()\n // throws (or the dialog never opens) never fires afterprint, so the\n // iframe must still be removed.\n fallbackTimer = setTimeout(cleanup, CLEANUP_FALLBACK_MS);\n }\n };\n // Wait for the subdocument's load so print renders fully in all engines.\n win.addEventListener('load', print, { once: true });\n iframe.srcdoc = html;\n // `load` may already have fired (or never fires in some kiosk engines) —\n // the safety timer covers both without double-printing; the fallback\n // cleanup guarantees the iframe never leaks.\n setTimeout(print, 500);\n}\n"],"mappings":"AAiBA,SAAgBA,EAAe,GAAc,GAA0C;CACrF,IAAI,OAAO,WAAa,KACtB;CAEF,IAAMC,IAAS,SAAS,cAAc,QAAQ;CAW9C,AAVAA,EAAO,aAAa,eAAe,MAAM,GAGzCA,EAAO,aAAa,WAAW,cAAc,GAC7C,EAAO,MAAM,WAAW,SACxB,EAAO,MAAM,QAAQ,QACrB,EAAO,MAAM,SAAS,QACtB,EAAO,MAAM,QAAQ,KACrB,EAAO,MAAM,SAAS,KACtB,EAAO,MAAM,SAAS,KACtB,SAAS,KAAK,YAAYA,CAAM;CAEhC,IAAMC,IAAMD,EAAO;CACnB,IAAI,CAACC,GAAK;EACR,EAAO,OAAO;EACd;CACF;CAEA,IAAIC,GACEC,UAAgB;EAKpB,AAJAF,EAAI,oBAAoB,cAAcE,CAAO,GACzCD,MAAkB,KAAA,KACpB,aAAaA,CAAa,GAE5BF,EAAO,OAAO;CAChB;CACA,EAAI,iBAAiB,cAAcG,CAAO;CAE1C,IAAIC,IAAU,IACRC,UAAc;EAClB,IAAI,IAGJ;OAAU;GACV,IAAI;IACF,EAAI,MAAM;GACZ,SAASC,GAAK;IAGZ,IAAUA,CAAG;GACf,UAAU;IAIR,IAAgB,WAAWH,GAAS,GAAmB;GACzD;EAZU;CAaZ;CAOA,AALAF,EAAI,iBAAiB,QAAQI,GAAO,EAAE,MAAM,GAAK,CAAC,GAClD,EAAO,SAASE,GAIhB,WAAWF,GAAO,GAAG;AACvB"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * BOFF-4551 — native badge printing. Fetches the self-contained badge HTML
3
+ * (`eventfullyManagedBadgeHtml`), drives the kiosk's OS print dialog through
4
+ * a hidden iframe (`printBadgeHtml`), then enqueues the print job so the
5
+ * server keeps the audit trail (`Badge.printCount` + `BadgePrintJob`).
6
+ *
7
+ * Never blocks the caller's main flow (a check-in that already succeeded):
8
+ * failures surface as an error toast and the operator can reprint from the
9
+ * records list.
10
+ */
11
+ export declare function useBadgePrint(): (registrationId: string, stationId?: string | null) => Promise<void>;
@@ -0,0 +1,38 @@
1
+ import { useApolloClient as e } from "../../node_modules/@apollo/client/react/hooks/useApolloClient.js";
2
+ import { BADGE_HTML_QUERY as t, useEnqueueBadgePrintMutation as n } from "../api/eventApi.js";
3
+ import { describeError as r } from "./mutationResult.js";
4
+ import { printBadgeHtml as i } from "./printBadge.js";
5
+ import { notify as a } from "./toast.js";
6
+ import { useCallback as o } from "react";
7
+ // src/eventfullymanaged/lib/useBadgePrint.ts
8
+ function s() {
9
+ let s = e(), [c] = n();
10
+ return o(async (e, n) => {
11
+ try {
12
+ let { data: o, error: l } = await s.query({
13
+ query: t,
14
+ variables: { registrationId: e },
15
+ fetchPolicy: "network-only",
16
+ errorPolicy: "all"
17
+ });
18
+ if (l || !o?.badgeHtml) {
19
+ a.error("Badge print failed", l?.message ?? "The badge could not be rendered.");
20
+ return;
21
+ }
22
+ i(o.badgeHtml, (e) => {
23
+ a.error("Badge print failed", r(e));
24
+ });
25
+ let u = await c({ variables: { input: {
26
+ registrationId: e,
27
+ stationId: n ?? null,
28
+ format: "PDF"
29
+ } } }), d = u.error;
30
+ (!u.data?.enqueueBadgePrint || d) && a.error("Could not record badge print", d?.message ?? "The print job was not accepted. The badge still printed.");
31
+ } catch (e) {
32
+ a.error("Badge print failed", r(e));
33
+ }
34
+ }, [s, c]);
35
+ }
36
+ export { s as useBadgePrint };
37
+
38
+ //# sourceMappingURL=useBadgePrint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBadgePrint.js","names":["useBadgePrint","apollo","useApolloClient","enqueueBadgePrint","useEnqueueBadgePrintMutation","useCallback","BADGE_HTML_QUERY","error","data","describeError","printError","res","stationId","enqueueError","notify","err"],"sources":["../../../src/eventfullymanaged/lib/useBadgePrint.ts"],"sourcesContent":["import { useApolloClient } from '@apollo/client/react';\nimport { useCallback } from 'react';\n\nimport { BADGE_HTML_QUERY, useEnqueueBadgePrintMutation } from '../api/eventApi';\nimport { describeError } from './mutationResult';\nimport { printBadgeHtml } from './printBadge';\nimport { notify } from './toast';\n\n/**\n * BOFF-4551 — native badge printing. Fetches the self-contained badge HTML\n * (`eventfullyManagedBadgeHtml`), drives the kiosk's OS print dialog through\n * a hidden iframe (`printBadgeHtml`), then enqueues the print job so the\n * server keeps the audit trail (`Badge.printCount` + `BadgePrintJob`).\n *\n * Never blocks the caller's main flow (a check-in that already succeeded):\n * failures surface as an error toast and the operator can reprint from the\n * records list.\n */\nexport function useBadgePrint(): (registrationId: string, stationId?: string | null) => Promise<void> {\n const apollo = useApolloClient();\n const [enqueueBadgePrint] = useEnqueueBadgePrintMutation();\n\n return useCallback(\n async (registrationId: string, stationId?: string | null) => {\n try {\n const { data, error } = await apollo.query<{ badgeHtml: string }>({\n query: BADGE_HTML_QUERY,\n variables: { registrationId },\n fetchPolicy: 'network-only',\n errorPolicy: 'all',\n });\n if (error || !data?.badgeHtml) {\n notify.error('Badge print failed', error?.message ?? 'The badge could not be rendered.');\n return;\n }\n printBadgeHtml(data.badgeHtml, (printError) => {\n notify.error('Badge print failed', describeError(printError));\n });\n const res = await enqueueBadgePrint({\n variables: { input: { registrationId, stationId: stationId ?? null, format: 'PDF' } },\n });\n const enqueueError = res.error;\n if (!res.data?.enqueueBadgePrint || enqueueError) {\n notify.error(\n 'Could not record badge print',\n enqueueError?.message ?? 'The print job was not accepted. The badge still printed.'\n );\n }\n } catch (err) {\n notify.error('Badge print failed', describeError(err));\n }\n },\n [apollo, enqueueBadgePrint]\n );\n}\n"],"mappings":";;;;;;;AAkBA,SAAgBA,IAAsF;CACpG,IAAMC,IAASC,EAAgB,GACzB,CAACC,KAAqBC,EAA6B;CAEzD,OAAOC,EACL,OAAO,GAAwB,MAA8B;EAC3D,IAAI;GACF,IAAM,EAAE,SAAM,aAAU,MAAMJ,EAAO,MAA6B;IAChE,OAAOK;IACP,WAAW,EAAE,kBAAe;IAC5B,aAAa;IACb,aAAa;GACf,CAAC;GACD,IAAIC,KAAS,CAACC,GAAM,WAAW;IAC7B,EAAO,MAAM,sBAAsBD,GAAO,WAAW,kCAAkC;IACvF;GACF;GACA,EAAeC,EAAK,YAAY,MAAe;IAC7C,EAAO,MAAM,sBAAsBC,EAAcC,CAAU,CAAC;GAC9D,CAAC;GACD,IAAMC,IAAM,MAAMR,EAAkB,EAClC,WAAW,EAAE,OAAO;IAAE;IAAgB,WAAWS,KAAa;IAAM,QAAQ;GAAM,EAAE,EACtF,CAAC,GACKC,IAAeF,EAAI;GACzB,CAAI,CAACA,EAAI,MAAM,qBAAqBE,MAClCC,EAAO,MACL,gCACAD,GAAc,WAAW,0DAC3B;EAEJ,SAASE,GAAK;GACZ,EAAO,MAAM,sBAAsBN,EAAcM,CAAG,CAAC;EACvD;CACF,GACA,CAACd,GAAQE,CAAiB,CAC5B;AACF"}