modern-text 2.0.1 → 2.0.3

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.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { T as Text } from './shared/modern-text.EUexrM_5.mjs';
2
- export { C as Canvas2DRenderer, a as Character, D as DomMeasurer, F as FontMeasurer, b as Fragment, P as Paragraph, c as backgroundPlugin, d as createSvgLoader, e as createSvgParser, g as getEffectTransform2D, f as getHighlightStyle, h as highlightPlugin, i as isEqualObject, j as isEqualValue, l as listStylePlugin, o as outlinePlugin, p as parseColormap, k as parseTransformOrigin, m as parseValueNumber, r as renderPlugin, t as textDecorationPlugin, n as textDefaultStyle } from './shared/modern-text.EUexrM_5.mjs';
1
+ import { T as Text } from './shared/modern-text.BZDfPcWk.mjs';
2
+ export { C as Canvas2DRenderer, a as Character, D as DomMeasurer, F as FontMeasurer, b as Fragment, P as Paragraph, c as backgroundPlugin, d as createSvgLoader, e as createSvgParser, g as getEffectTransform2D, f as getHighlightStyle, h as highlightPlugin, i as isEqualObject, j as isEqualValue, l as listStylePlugin, o as outlinePlugin, p as parseColormap, k as parseTransformOrigin, m as parseValueNumber, r as renderPlugin, t as textDecorationPlugin, n as textDefaultStyle } from './shared/modern-text.BZDfPcWk.mjs';
3
3
  export { d as defineDeformation, a as definePlugin, b as deformationPlugin, g as getDeformationNames, r as removeDeformation } from './shared/modern-text.JF1ny7A-.mjs';
4
4
  export { C as CircleCurve, E as EllipseCurve, H as HeartCurve, P as PolygonCurve, R as RectangularCurve } from './shared/modern-text.fT17R5HY.mjs';
5
5
  import 'modern-font';
@@ -2143,7 +2143,7 @@ class Text extends Reactivable {
2143
2143
  if (options.measurer && typeof options.measurer !== "string") {
2144
2144
  this.measurer = options.measurer;
2145
2145
  } else {
2146
- const kind = options.measurer ?? (fonts ? "font" : "dom");
2146
+ const kind = options.measurer ?? "font";
2147
2147
  this.measurer = kind === "font" ? new FontMeasurer() : new DomMeasurer();
2148
2148
  }
2149
2149
  this.debug = options.debug ?? false;
@@ -1,5 +1,5 @@
1
1
  import { Vector2Like, BoundingBox, Vector2 } from 'modern-path2d';
2
- import { a as Character } from './modern-text.C6VOXPvn.mjs';
2
+ import { a as Character } from './modern-text.D7MgNoyD.cjs';
3
3
 
4
4
  /** 逐字沿形状排布所需的曲线最小接口(实现了这三个方法即可当作变形曲线) */
5
5
  interface DeformationCurve {
@@ -2145,7 +2145,7 @@ class Text extends modernIdoc.Reactivable {
2145
2145
  if (options.measurer && typeof options.measurer !== "string") {
2146
2146
  this.measurer = options.measurer;
2147
2147
  } else {
2148
- const kind = options.measurer ?? (fonts ? "font" : "dom");
2148
+ const kind = options.measurer ?? "font";
2149
2149
  this.measurer = kind === "font" ? new FontMeasurer() : new DomMeasurer();
2150
2150
  }
2151
2151
  this.debug = options.debug ?? false;
@@ -194,7 +194,7 @@ interface Options extends TextObject {
194
194
  plugins?: Plugin[];
195
195
  /**
196
196
  * Layout backend: `'font'` (pure-JS) or `'dom'` (browser), or a custom
197
- * `TextMeasurer`. Defaults to `'font'` when `fonts` are provided, else `'dom'`.
197
+ * `TextMeasurer`. Defaults to `'font'`.
198
198
  */
199
199
  measurer?: MeasurerKind | TextMeasurer;
200
200
  }
@@ -194,7 +194,7 @@ interface Options extends TextObject {
194
194
  plugins?: Plugin[];
195
195
  /**
196
196
  * Layout backend: `'font'` (pure-JS) or `'dom'` (browser), or a custom
197
- * `TextMeasurer`. Defaults to `'font'` when `fonts` are provided, else `'dom'`.
197
+ * `TextMeasurer`. Defaults to `'font'`.
198
198
  */
199
199
  measurer?: MeasurerKind | TextMeasurer;
200
200
  }
@@ -194,7 +194,7 @@ interface Options extends TextObject {
194
194
  plugins?: Plugin[];
195
195
  /**
196
196
  * Layout backend: `'font'` (pure-JS) or `'dom'` (browser), or a custom
197
- * `TextMeasurer`. Defaults to `'font'` when `fonts` are provided, else `'dom'`.
197
+ * `TextMeasurer`. Defaults to `'font'`.
198
198
  */
199
199
  measurer?: MeasurerKind | TextMeasurer;
200
200
  }
@@ -1,5 +1,5 @@
1
1
  import { Vector2Like, BoundingBox, Vector2 } from 'modern-path2d';
2
- import { a as Character } from './modern-text.C6VOXPvn.js';
2
+ import { a as Character } from './modern-text.D7MgNoyD.js';
3
3
 
4
4
  /** 逐字沿形状排布所需的曲线最小接口(实现了这三个方法即可当作变形曲线) */
5
5
  interface DeformationCurve {
@@ -1,5 +1,5 @@
1
1
  import { Vector2Like, BoundingBox, Vector2 } from 'modern-path2d';
2
- import { a as Character } from './modern-text.C6VOXPvn.cjs';
2
+ import { a as Character } from './modern-text.D7MgNoyD.mjs';
3
3
 
4
4
  /** 逐字沿形状排布所需的曲线最小接口(实现了这三个方法即可当作变形曲线) */
5
5
  interface DeformationCurve {
@@ -2,7 +2,7 @@
2
2
 
3
3
  const diff = require('diff');
4
4
  const modernIdoc = require('modern-idoc');
5
- const Text = require('../shared/modern-text.9z5yZjKR.cjs');
5
+ const Text = require('../shared/modern-text.BZmgmU_p.cjs');
6
6
  require('modern-font');
7
7
  require('modern-path2d');
8
8
  require('../shared/modern-text.B2xfrqDc.cjs');
@@ -1,5 +1,5 @@
1
1
  import { PropertyAccessor, NormalizedTextContent } from 'modern-idoc';
2
- import { T as Text } from '../shared/modern-text.C6VOXPvn.cjs';
2
+ import { T as Text } from '../shared/modern-text.D7MgNoyD.cjs';
3
3
  import 'modern-path2d';
4
4
  import 'modern-font';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { PropertyAccessor, NormalizedTextContent } from 'modern-idoc';
2
- import { T as Text } from '../shared/modern-text.C6VOXPvn.mjs';
2
+ import { T as Text } from '../shared/modern-text.D7MgNoyD.mjs';
3
3
  import 'modern-path2d';
4
4
  import 'modern-font';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { PropertyAccessor, NormalizedTextContent } from 'modern-idoc';
2
- import { T as Text } from '../shared/modern-text.C6VOXPvn.js';
2
+ import { T as Text } from '../shared/modern-text.D7MgNoyD.js';
3
3
  import 'modern-path2d';
4
4
  import 'modern-font';
5
5
 
@@ -1,6 +1,6 @@
1
1
  import { diffChars } from 'diff';
2
2
  import { isCRLF, textContentToString, normalizeCRLF, normalizeTextContent, property } from 'modern-idoc';
3
- import { T as Text } from '../shared/modern-text.EUexrM_5.mjs';
3
+ import { T as Text } from '../shared/modern-text.BZDfPcWk.mjs';
4
4
  import 'modern-font';
5
5
  import 'modern-path2d';
6
6
  import '../shared/modern-text.JF1ny7A-.mjs';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modern-text",
3
3
  "type": "module",
4
- "version": "2.0.1",
4
+ "version": "2.0.3",
5
5
  "packageManager": "pnpm@10.18.1",
6
6
  "description": "Measure and render text in a way that describes the DOM.",
7
7
  "author": "wxm",
@@ -62,7 +62,7 @@
62
62
  "diff": "^9.0.0",
63
63
  "modern-font": "^0.6.0",
64
64
  "modern-idoc": "^0.11.5",
65
- "modern-path2d": "^1.6.0"
65
+ "modern-path2d": "^1.7.0"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@antfu/eslint-config": "^9.0.0",