@pixldocs/canvas-renderer 0.5.72 → 0.5.73

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.
package/dist/index.cjs CHANGED
@@ -12337,6 +12337,25 @@ async function awaitFontsForConfig(config, maxWaitMs) {
12337
12337
  document.fonts.ready.catch(() => void 0).then(() => void 0),
12338
12338
  new Promise((r) => setTimeout(r, Math.min(500, maxWaitMs)))
12339
12339
  ]);
12340
+ const checkSpecs = [];
12341
+ for (const d of descriptors) {
12342
+ const stylePrefix = d.style === "italic" ? "italic " : "";
12343
+ checkSpecs.push(`${stylePrefix}${d.weight} 16px "${d.family}"`);
12344
+ }
12345
+ const startedAt = Date.now();
12346
+ const pollBudget = Math.min(maxWaitMs, 2500);
12347
+ const allReady = () => {
12348
+ for (const spec of checkSpecs) {
12349
+ try {
12350
+ if (!document.fonts.check(spec)) return false;
12351
+ } catch {
12352
+ }
12353
+ }
12354
+ return true;
12355
+ };
12356
+ while (!allReady() && Date.now() - startedAt < pollBudget) {
12357
+ await new Promise((resolve) => setTimeout(resolve, 50));
12358
+ }
12340
12359
  await new Promise(
12341
12360
  (resolve) => requestAnimationFrame(() => requestAnimationFrame(() => resolve()))
12342
12361
  );
@@ -12531,7 +12550,7 @@ function PixldocsPreview(props) {
12531
12550
  !canvasSettled && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", minHeight: 200 }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { color: "#888", fontSize: 14 }, children: "Loading preview..." }) })
12532
12551
  ] });
12533
12552
  }
12534
- const PACKAGE_VERSION = "0.5.72";
12553
+ const PACKAGE_VERSION = "0.5.73";
12535
12554
  let __underlineFixInstalled = false;
12536
12555
  function installUnderlineFix(fab) {
12537
12556
  var _a;