@altano/satori-fit-text 3.1.0 → 3.2.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.
@@ -1,7 +1,7 @@
1
1
  import log from "../log.js";
2
2
  import { TextMeasurer } from "./TextMeasurer.js";
3
3
 
4
- //#region src/TextMeasurer/BrowserTextMeasurer.ts
4
+ // src/TextMeasurer/BrowserTextMeasurer.ts
5
5
  /* v8 ignore start */
6
6
  var BrowserTextMeasurer = class extends TextMeasurer {
7
7
  #createSvgElement(svgXML) {
@@ -37,6 +37,5 @@ var BrowserTextMeasurer = class extends TextMeasurer {
37
37
  };
38
38
  /* v8 ignore stop */
39
39
 
40
- //#endregion
41
40
  export { BrowserTextMeasurer as default };
42
41
  //# sourceMappingURL=BrowserTextMeasurer.js.map
@@ -3,7 +3,7 @@ import { TextMeasurer } from "./TextMeasurer.js";
3
3
  import { SVG, registerWindow } from "@svgdotjs/svg.js";
4
4
  import { createSVGWindow } from "svgdom";
5
5
 
6
- //#region src/TextMeasurer/HeadlessTextMeasurer.ts
6
+ // src/TextMeasurer/HeadlessTextMeasurer.ts
7
7
  var HeadlessTextMeasurer = class extends TextMeasurer {
8
8
  #canvas;
9
9
  constructor(text, font, maxWidth, maxHeight, lineHeight) {
@@ -37,6 +37,5 @@ var HeadlessTextMeasurer = class extends TextMeasurer {
37
37
  }
38
38
  };
39
39
 
40
- //#endregion
41
40
  export { HeadlessTextMeasurer as default };
42
41
  //# sourceMappingURL=HeadlessTextMeasurer.js.map
@@ -1,6 +1,6 @@
1
1
  import satori from "satori";
2
2
 
3
- //#region src/TextMeasurer/TextMeasurer.ts
3
+ // src/TextMeasurer/TextMeasurer.ts
4
4
  const epsilon = 1e-4;
5
5
  var TextMeasurer = class {
6
6
  text;
@@ -50,6 +50,5 @@ var TextMeasurer = class {
50
50
  }
51
51
  };
52
52
 
53
- //#endregion
54
53
  export { TextMeasurer };
55
54
  //# sourceMappingURL=TextMeasurer.js.map
@@ -1,10 +1,9 @@
1
- //#region src/TextMeasurer/getTextMeasurer.ts
1
+ // src/TextMeasurer/getTextMeasurer.ts
2
2
  async function getTextMeasurer(...args) {
3
3
  /* v8 ignore next 3 */
4
4
  if (typeof window !== "undefined") return new (await (import("./BrowserTextMeasurer.js"))).default(...args);
5
5
  else return new (await (import("./HeadlessTextMeasurer.js"))).default(...args);
6
6
  }
7
7
 
8
- //#endregion
9
8
  export { getTextMeasurer };
10
9
  //# sourceMappingURL=getTextMeasurer.js.map
package/dist/fitText.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { Font } from "./types.js";
2
- //#region src/fitText.d.ts
3
2
  export type FindOptions = {
4
3
  /**
5
4
  * The text you want to fit
@@ -41,5 +40,4 @@ export type FindOptions = {
41
40
  * would keep the text contained within the dimensions.
42
41
  */
43
42
  export declare function findLargestUsableFontSize({ text, font, maxWidth, maxHeight, lineHeight, minFontSize, maxFontSize, maxTries }: FindOptions): Promise<number>;
44
- //#endregion
45
43
  //# sourceMappingURL=fitText.d.ts.map
package/dist/fitText.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { getTextMeasurer } from "./TextMeasurer/getTextMeasurer.js";
2
2
 
3
- //#region src/fitText.ts
3
+ // src/fitText.ts
4
4
  /**
5
5
  * Given text, dimensions, and some options, returns the largest font size that
6
6
  * would keep the text contained within the dimensions.
@@ -18,6 +18,5 @@ async function findLargestUsableFontSize({ text, font, maxWidth, maxHeight, line
18
18
  throw new Error(`Could not find a valid font size in ${maxTries - 1} attempts. Giving up. Please try again after constraining the search space, e.g. by restricting the min/max font size difference.`);
19
19
  }
20
20
 
21
- //#endregion
22
21
  export { findLargestUsableFontSize };
23
22
  //# sourceMappingURL=fitText.js.map
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { Dimensions, Font } from "./types.js";
2
1
  import { FindOptions, findLargestUsableFontSize } from "./fitText.js";
2
+ import { Dimensions, Font } from "./types.js";
3
3
  export { Dimensions, FindOptions, Font, findLargestUsableFontSize };
package/dist/log.d.ts CHANGED
@@ -1,6 +1,4 @@
1
1
  import debug from "debug";
2
- //#region src/log.d.ts
3
2
  declare const log: debug.Debugger;
4
- //#endregion
5
3
  export { log as default };
6
4
  //# sourceMappingURL=log.d.ts.map
package/dist/log.js CHANGED
@@ -1,8 +1,7 @@
1
1
  import debug from "debug";
2
2
 
3
- //#region src/log.ts
3
+ // src/log.ts
4
4
  const log = debug("satori-text-fit");
5
5
 
6
- //#endregion
7
6
  export { log as default };
8
7
  //# sourceMappingURL=log.js.map
package/dist/types.d.ts CHANGED
@@ -1,6 +1,4 @@
1
1
  import { Font as Font$1 } from "satori";
2
- //#region src/types.d.ts
3
2
  export type Dimensions = Pick<DOMRect, "width" | "height">;
4
3
  export type Font = Font$1;
5
- //#endregion
6
4
  //# sourceMappingURL=types.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altano/satori-fit-text",
3
- "version": "3.1.0",
3
+ "version": "3.2.1",
4
4
  "description": "Fit text to a bounding box in Node or the browser",
5
5
  "keywords": [
6
6
  "fit-text",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@svgdotjs/svg.js": "^3.2.8",
35
35
  "debug": "^4.4.3",
36
- "satori": "^0.55.5",
36
+ "satori": "^0.63.2",
37
37
  "svgdom": "^0.1.29"
38
38
  },
39
39
  "devDependencies": {
@@ -45,22 +45,22 @@
45
45
  "@types/debug": "^4.1.13",
46
46
  "@types/he": "^1.2.3",
47
47
  "@types/jest-image-snapshot": "^6.4.2",
48
- "@types/node": "^26.6.4",
48
+ "@types/node": "^26.6.6",
49
49
  "@types/react": "^19.3.0",
50
50
  "@types/react-dom": "^19.3.0",
51
51
  "@types/svgdom": "^0.1.2",
52
- "@vitest/coverage-v8": "^5.0.3",
52
+ "@vitest/coverage-v8": "^5.1.0",
53
53
  "depcheck": "^1.4.7",
54
54
  "jest-image-snapshot": "^6.5.2",
55
- "prettier": "3.9.9",
56
- "react": "^19.3.0",
57
- "tsdown": "^0.23.0",
55
+ "prettier": "3.9.10",
56
+ "react": "^19.3.1",
57
+ "tsdown": "^0.23.5",
58
58
  "typescript": "^6.0.3",
59
- "vite": "^8.3.2",
60
- "vitest": "^5.0.3",
59
+ "vite": "^8.3.5",
60
+ "vitest": "^5.1.0",
61
61
  "@altano/assets": "0.0.1",
62
- "@altano/testing": "0.0.1",
63
62
  "@altano/build-config": "0.0.1",
63
+ "@altano/testing": "0.0.1",
64
64
  "@altano/tsconfig": "0.0.1"
65
65
  },
66
66
  "peerDependencies": {