@lavalogic/scoria 0.37.5 → 0.37.6

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.
@@ -18,9 +18,16 @@
18
18
 
19
19
  // Barcode icons are derived from literal constants. Build them once at
20
20
  // module load so they are not re-encoded on every render.
21
- const yesIcon = DATAMatrix(AlertShortcuts.yes);
22
- const noIcon = DATAMatrix(AlertShortcuts.no);
23
- const otherIcon = DATAMatrix(AlertShortcuts.other);
21
+ //
22
+ // `DATAMatrix` reaches for `document.createElement` internally, so we
23
+ // guard the calls against SSR module evaluation - the modal itself is
24
+ // `dialog.open === false` during SSR (no user-visible barcode rendered),
25
+ // and the client-side module re-evaluates with a real `document` so the
26
+ // icons get their proper SVG payload on the browser side.
27
+ const HAS_DOM = typeof document !== 'undefined';
28
+ const yesIcon = HAS_DOM ? DATAMatrix(AlertShortcuts.yes) : '';
29
+ const noIcon = HAS_DOM ? DATAMatrix(AlertShortcuts.no) : '';
30
+ const otherIcon = HAS_DOM ? DATAMatrix(AlertShortcuts.other) : '';
24
31
  </script>
25
32
 
26
33
  <script lang="ts">
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lavalogic/scoria",
3
3
  "description": "Svelte components used for the FloWMS Web Frontend",
4
- "version": "0.37.5",
4
+ "version": "0.37.6",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },