mnfst 0.5.77 → 0.5.78

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.
@@ -241,7 +241,7 @@ function initializeExportPlugin() {
241
241
  const safer = {
242
242
  ...so,
243
243
  scale: Math.min(so.scale || 2, 1),
244
- font: { skip: true },
244
+ font: false,
245
245
  };
246
246
  return await lib[fn](target, safer);
247
247
  }
@@ -433,14 +433,21 @@ function initializeExportPlugin() {
433
433
  // html-to-image with proper CSS AST parsing. It handles @layer rules,
434
434
  // CSS custom properties, modern color functions, and url(data:...) values
435
435
  // inside cross-origin stylesheets — all of which html-to-image mishandles.
436
+ // It ships ESM-only, so we load via dynamic import() rather than a script
437
+ // tag. jsDelivr serves the ESM bundle directly.
436
438
  let snapshotLibPromise = null;
437
439
  function loadSnapshotLib() {
438
440
  if (snapshotLibPromise) return snapshotLibPromise;
439
- snapshotLibPromise = loadScript('https://cdn.jsdelivr.net/npm/modern-screenshot/dist/index.iife.min.js')
440
- .then(() => {
441
- const lib = window.modernScreenshot;
442
- if (!lib) throw new Error('modern-screenshot failed to load');
443
- return lib;
441
+ snapshotLibPromise = import('https://cdn.jsdelivr.net/npm/modern-screenshot@4/dist/index.mjs')
442
+ .then((mod) => {
443
+ if (!mod || typeof mod.domToPng !== 'function') {
444
+ throw new Error('modern-screenshot failed to load (missing expected exports)');
445
+ }
446
+ return mod;
447
+ })
448
+ .catch((err) => {
449
+ snapshotLibPromise = null; // allow retry on next call
450
+ throw err;
444
451
  });
445
452
  return snapshotLibPromise;
446
453
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mnfst",
3
- "version": "0.5.77",
3
+ "version": "0.5.78",
4
4
  "private": false,
5
5
  "workspaces": [
6
6
  "templates/starter",