@mw-kit/mw-ui 1.8.19 → 1.8.21

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.js CHANGED
@@ -1291,7 +1291,7 @@ var ensureFontLoaded = async (fontFamily, fontSize = 64, text = " ") => {
1291
1291
  return false;
1292
1292
  }
1293
1293
  const sampleText = text.trim().length > 0 ? text : " ";
1294
- const fontSpec = `${fontSize}px "${fontFamily}"`;
1294
+ const fontSpec = `${fontSize}px ${fontFamily}`;
1295
1295
  const maxAttempts = 5;
1296
1296
  for (let attempt = 0; attempt < maxAttempts; attempt += 1) {
1297
1297
  try {
@@ -1695,7 +1695,7 @@ var getColor = (color, opacity = 100) => `${colors[color]}${opacities[opacity]}`
1695
1695
  var useTypography = (typography, options = {}) => {
1696
1696
  const { fontFamily, fontSize, fontWeight, lineHeight, letterSpacing } = typographies[typography];
1697
1697
  return import_styled_components6.css`
1698
- font-family: ${fontFamily};
1698
+ font-family: ${fonts_default[fontFamily]};
1699
1699
  font-size: ${fontSize};
1700
1700
  font-weight: ${options.fontWeight || fontWeight};
1701
1701
  line-height: ${options.lineHeight || lineHeight};
@@ -17681,7 +17681,11 @@ var CanvasContainer = import_styled_components72.default.div`
17681
17681
 
17682
17682
  // src/components/Signature/index.tsx
17683
17683
  var import_jsx_runtime360 = require("react/jsx-runtime");
17684
- var FONTS = ["Great Vibes", "Pacifico", "Allura"];
17684
+ var FONTS = [
17685
+ "GreatVibes",
17686
+ "Pacifico",
17687
+ "Allura"
17688
+ ];
17685
17689
  var FONT_SIZE = 64;
17686
17690
  var voidFn = () => {
17687
17691
  };
@@ -17724,7 +17728,7 @@ var SignatureInput = ({
17724
17728
  return;
17725
17729
  }
17726
17730
  setLoading(true);
17727
- const ready = await ensureFontLoaded(font2, FONT_SIZE, trimmed);
17731
+ const ready = await ensureFontLoaded(fonts_default[font2], FONT_SIZE, trimmed);
17728
17732
  setLoading(false);
17729
17733
  if (!ready) return;
17730
17734
  const c = document.createElement("canvas");
@@ -17736,7 +17740,7 @@ var SignatureInput = ({
17736
17740
  ctx.fillStyle = "#000";
17737
17741
  ctx.textAlign = "center";
17738
17742
  ctx.textBaseline = "middle";
17739
- ctx.font = `${FONT_SIZE}px "${font2}"`;
17743
+ ctx.font = `${FONT_SIZE}px ${fonts_default[font2]}`;
17740
17744
  ctx.fillText(trimmed, c.width / 2, c.height / 2);
17741
17745
  const base64 = c.toDataURL("image/png");
17742
17746
  ref.clear();
package/dist/index.mjs CHANGED
@@ -1233,7 +1233,7 @@ var ensureFontLoaded = async (fontFamily, fontSize = 64, text = " ") => {
1233
1233
  return false;
1234
1234
  }
1235
1235
  const sampleText = text.trim().length > 0 ? text : " ";
1236
- const fontSpec = `${fontSize}px "${fontFamily}"`;
1236
+ const fontSpec = `${fontSize}px ${fontFamily}`;
1237
1237
  const maxAttempts = 5;
1238
1238
  for (let attempt = 0; attempt < maxAttempts; attempt += 1) {
1239
1239
  try {
@@ -1637,7 +1637,7 @@ var getColor = (color, opacity = 100) => `${colors[color]}${opacities[opacity]}`
1637
1637
  var useTypography = (typography, options = {}) => {
1638
1638
  const { fontFamily, fontSize, fontWeight, lineHeight, letterSpacing } = typographies[typography];
1639
1639
  return css5`
1640
- font-family: ${fontFamily};
1640
+ font-family: ${fonts_default[fontFamily]};
1641
1641
  font-size: ${fontSize};
1642
1642
  font-weight: ${options.fontWeight || fontWeight};
1643
1643
  line-height: ${options.lineHeight || lineHeight};
@@ -17623,7 +17623,11 @@ var CanvasContainer = styled69.div`
17623
17623
 
17624
17624
  // src/components/Signature/index.tsx
17625
17625
  import { jsx as jsx360, jsxs as jsxs183 } from "react/jsx-runtime";
17626
- var FONTS = ["Great Vibes", "Pacifico", "Allura"];
17626
+ var FONTS = [
17627
+ "GreatVibes",
17628
+ "Pacifico",
17629
+ "Allura"
17630
+ ];
17627
17631
  var FONT_SIZE = 64;
17628
17632
  var voidFn = () => {
17629
17633
  };
@@ -17666,7 +17670,7 @@ var SignatureInput = ({
17666
17670
  return;
17667
17671
  }
17668
17672
  setLoading(true);
17669
- const ready = await ensureFontLoaded(font2, FONT_SIZE, trimmed);
17673
+ const ready = await ensureFontLoaded(fonts_default[font2], FONT_SIZE, trimmed);
17670
17674
  setLoading(false);
17671
17675
  if (!ready) return;
17672
17676
  const c = document.createElement("canvas");
@@ -17678,7 +17682,7 @@ var SignatureInput = ({
17678
17682
  ctx.fillStyle = "#000";
17679
17683
  ctx.textAlign = "center";
17680
17684
  ctx.textBaseline = "middle";
17681
- ctx.font = `${FONT_SIZE}px "${font2}"`;
17685
+ ctx.font = `${FONT_SIZE}px ${fonts_default[font2]}`;
17682
17686
  ctx.fillText(trimmed, c.width / 2, c.height / 2);
17683
17687
  const base64 = c.toDataURL("image/png");
17684
17688
  ref.clear();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mw-kit/mw-ui",
3
- "version": "1.8.19",
3
+ "version": "1.8.21",
4
4
  "description": "Made with create-react-library",
5
5
  "author": "fmgusmao",
6
6
  "license": "MIT",