modern-text 1.8.2 → 1.9.0
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 +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +33 -6
- package/dist/index.mjs +2 -2
- package/dist/shared/{modern-text.CLAcY4KK.d.ts → modern-text.WbWB6f3d.d.cts} +10 -10
- package/dist/shared/{modern-text.CLAcY4KK.d.cts → modern-text.WbWB6f3d.d.mts} +10 -10
- package/dist/shared/{modern-text.CLAcY4KK.d.mts → modern-text.WbWB6f3d.d.ts} +10 -10
- package/dist/shared/{modern-text.C2aRxwl9.cjs → modern-text.XBrC1nBJ.cjs} +3 -3
- package/dist/shared/{modern-text.BpOqkWRj.mjs → modern-text.y0a7DPYV.mjs} +3 -3
- package/dist/web-components/index.cjs +1 -1
- package/dist/web-components/index.d.cts +1 -1
- package/dist/web-components/index.d.mts +1 -1
- package/dist/web-components/index.d.ts +1 -1
- package/dist/web-components/index.mjs +1 -1
- package/package.json +12 -12
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as Text } from './shared/modern-text.
|
|
2
|
-
export { C as Character, F as Fragment, M as Measurer, P as Paragraph, c as backgroundPlugin, i as createSVGLoader, j as createSVGParser, b as definePlugin, d as drawPath, w as filterEmpty, g as getHighlightStyle, e as getTransform2D, v as hexToRgb, h as highlightPlugin, n as isEqualObject, q as isEqualValue, l as listStylePlugin, o as outlinePlugin, p as parseColor, m as parseColormap, k as parseValueNumber, r as renderPlugin, s as setupView, t as textDecorationPlugin, f as textDefaultStyle, u as uploadColor, a as uploadColors } from './shared/modern-text.
|
|
1
|
+
import { T as Text } from './shared/modern-text.y0a7DPYV.mjs';
|
|
2
|
+
export { C as Character, F as Fragment, M as Measurer, P as Paragraph, c as backgroundPlugin, i as createSVGLoader, j as createSVGParser, b as definePlugin, d as drawPath, w as filterEmpty, g as getHighlightStyle, e as getTransform2D, v as hexToRgb, h as highlightPlugin, n as isEqualObject, q as isEqualValue, l as listStylePlugin, o as outlinePlugin, p as parseColor, m as parseColormap, k as parseValueNumber, r as renderPlugin, s as setupView, t as textDecorationPlugin, f as textDefaultStyle, u as uploadColor, a as uploadColors } from './shared/modern-text.y0a7DPYV.mjs';
|
|
3
3
|
import 'modern-idoc';
|
|
4
4
|
import 'modern-path2d';
|
|
5
5
|
import 'modern-font';
|
|
@@ -177,24 +177,24 @@ interface MeasureResult {
|
|
|
177
177
|
}
|
|
178
178
|
declare const textDefaultStyle: FullStyle;
|
|
179
179
|
interface TextEvents extends ReactivableEvents {
|
|
180
|
-
update:
|
|
180
|
+
update: [ctx: {
|
|
181
181
|
text: Text$1;
|
|
182
|
-
}
|
|
183
|
-
measure:
|
|
182
|
+
}];
|
|
183
|
+
measure: [ctx: {
|
|
184
184
|
text: Text$1;
|
|
185
185
|
result: MeasureResult;
|
|
186
|
-
}
|
|
187
|
-
render:
|
|
186
|
+
}];
|
|
187
|
+
render: [ctx: {
|
|
188
188
|
text: Text$1;
|
|
189
189
|
view: HTMLCanvasElement;
|
|
190
190
|
pixelRatio: number;
|
|
191
|
-
}
|
|
191
|
+
}];
|
|
192
192
|
}
|
|
193
193
|
interface Text$1 {
|
|
194
|
-
on: <K extends keyof TextEvents & string>(event: K, listener: TextEvents[K]) => this;
|
|
195
|
-
once: <K extends keyof TextEvents & string>(event: K, listener: TextEvents[K]) => this;
|
|
196
|
-
off: <K extends keyof TextEvents & string>(event: K, listener: TextEvents[K]) => this;
|
|
197
|
-
emit: <K extends keyof TextEvents & string>(event: K, ...args:
|
|
194
|
+
on: <K extends keyof TextEvents & string>(event: K, listener: (...args: TextEvents[K]) => void) => this;
|
|
195
|
+
once: <K extends keyof TextEvents & string>(event: K, listener: (...args: TextEvents[K]) => void) => this;
|
|
196
|
+
off: <K extends keyof TextEvents & string>(event: K, listener: (...args: TextEvents[K]) => void) => this;
|
|
197
|
+
emit: <K extends keyof TextEvents & string>(event: K, ...args: TextEvents[K]) => this;
|
|
198
198
|
}
|
|
199
199
|
declare class Text$1 extends Reactivable {
|
|
200
200
|
debug: boolean;
|
|
@@ -177,24 +177,24 @@ interface MeasureResult {
|
|
|
177
177
|
}
|
|
178
178
|
declare const textDefaultStyle: FullStyle;
|
|
179
179
|
interface TextEvents extends ReactivableEvents {
|
|
180
|
-
update:
|
|
180
|
+
update: [ctx: {
|
|
181
181
|
text: Text$1;
|
|
182
|
-
}
|
|
183
|
-
measure:
|
|
182
|
+
}];
|
|
183
|
+
measure: [ctx: {
|
|
184
184
|
text: Text$1;
|
|
185
185
|
result: MeasureResult;
|
|
186
|
-
}
|
|
187
|
-
render:
|
|
186
|
+
}];
|
|
187
|
+
render: [ctx: {
|
|
188
188
|
text: Text$1;
|
|
189
189
|
view: HTMLCanvasElement;
|
|
190
190
|
pixelRatio: number;
|
|
191
|
-
}
|
|
191
|
+
}];
|
|
192
192
|
}
|
|
193
193
|
interface Text$1 {
|
|
194
|
-
on: <K extends keyof TextEvents & string>(event: K, listener: TextEvents[K]) => this;
|
|
195
|
-
once: <K extends keyof TextEvents & string>(event: K, listener: TextEvents[K]) => this;
|
|
196
|
-
off: <K extends keyof TextEvents & string>(event: K, listener: TextEvents[K]) => this;
|
|
197
|
-
emit: <K extends keyof TextEvents & string>(event: K, ...args:
|
|
194
|
+
on: <K extends keyof TextEvents & string>(event: K, listener: (...args: TextEvents[K]) => void) => this;
|
|
195
|
+
once: <K extends keyof TextEvents & string>(event: K, listener: (...args: TextEvents[K]) => void) => this;
|
|
196
|
+
off: <K extends keyof TextEvents & string>(event: K, listener: (...args: TextEvents[K]) => void) => this;
|
|
197
|
+
emit: <K extends keyof TextEvents & string>(event: K, ...args: TextEvents[K]) => this;
|
|
198
198
|
}
|
|
199
199
|
declare class Text$1 extends Reactivable {
|
|
200
200
|
debug: boolean;
|
|
@@ -177,24 +177,24 @@ interface MeasureResult {
|
|
|
177
177
|
}
|
|
178
178
|
declare const textDefaultStyle: FullStyle;
|
|
179
179
|
interface TextEvents extends ReactivableEvents {
|
|
180
|
-
update:
|
|
180
|
+
update: [ctx: {
|
|
181
181
|
text: Text$1;
|
|
182
|
-
}
|
|
183
|
-
measure:
|
|
182
|
+
}];
|
|
183
|
+
measure: [ctx: {
|
|
184
184
|
text: Text$1;
|
|
185
185
|
result: MeasureResult;
|
|
186
|
-
}
|
|
187
|
-
render:
|
|
186
|
+
}];
|
|
187
|
+
render: [ctx: {
|
|
188
188
|
text: Text$1;
|
|
189
189
|
view: HTMLCanvasElement;
|
|
190
190
|
pixelRatio: number;
|
|
191
|
-
}
|
|
191
|
+
}];
|
|
192
192
|
}
|
|
193
193
|
interface Text$1 {
|
|
194
|
-
on: <K extends keyof TextEvents & string>(event: K, listener: TextEvents[K]) => this;
|
|
195
|
-
once: <K extends keyof TextEvents & string>(event: K, listener: TextEvents[K]) => this;
|
|
196
|
-
off: <K extends keyof TextEvents & string>(event: K, listener: TextEvents[K]) => this;
|
|
197
|
-
emit: <K extends keyof TextEvents & string>(event: K, ...args:
|
|
194
|
+
on: <K extends keyof TextEvents & string>(event: K, listener: (...args: TextEvents[K]) => void) => this;
|
|
195
|
+
once: <K extends keyof TextEvents & string>(event: K, listener: (...args: TextEvents[K]) => void) => this;
|
|
196
|
+
off: <K extends keyof TextEvents & string>(event: K, listener: (...args: TextEvents[K]) => void) => this;
|
|
197
|
+
emit: <K extends keyof TextEvents & string>(event: K, ...args: TextEvents[K]) => this;
|
|
198
198
|
}
|
|
199
199
|
declare class Text$1 extends Reactivable {
|
|
200
200
|
debug: boolean;
|
|
@@ -1797,7 +1797,7 @@ class Text extends modernIdoc.Reactivable {
|
|
|
1797
1797
|
}
|
|
1798
1798
|
}
|
|
1799
1799
|
__decorateClass([
|
|
1800
|
-
modernIdoc.property()
|
|
1800
|
+
modernIdoc.property({ internal: true })
|
|
1801
1801
|
], Text.prototype, "debug");
|
|
1802
1802
|
__decorateClass([
|
|
1803
1803
|
modernIdoc.property()
|
|
@@ -1815,10 +1815,10 @@ __decorateClass([
|
|
|
1815
1815
|
modernIdoc.property()
|
|
1816
1816
|
], Text.prototype, "outline");
|
|
1817
1817
|
__decorateClass([
|
|
1818
|
-
modernIdoc.property()
|
|
1818
|
+
modernIdoc.property({ internal: true })
|
|
1819
1819
|
], Text.prototype, "measureDom");
|
|
1820
1820
|
__decorateClass([
|
|
1821
|
-
modernIdoc.property()
|
|
1821
|
+
modernIdoc.property({ internal: true })
|
|
1822
1822
|
], Text.prototype, "fonts");
|
|
1823
1823
|
|
|
1824
1824
|
exports.Character = Character;
|
|
@@ -1795,7 +1795,7 @@ class Text extends Reactivable {
|
|
|
1795
1795
|
}
|
|
1796
1796
|
}
|
|
1797
1797
|
__decorateClass([
|
|
1798
|
-
property()
|
|
1798
|
+
property({ internal: true })
|
|
1799
1799
|
], Text.prototype, "debug");
|
|
1800
1800
|
__decorateClass([
|
|
1801
1801
|
property()
|
|
@@ -1813,10 +1813,10 @@ __decorateClass([
|
|
|
1813
1813
|
property()
|
|
1814
1814
|
], Text.prototype, "outline");
|
|
1815
1815
|
__decorateClass([
|
|
1816
|
-
property()
|
|
1816
|
+
property({ internal: true })
|
|
1817
1817
|
], Text.prototype, "measureDom");
|
|
1818
1818
|
__decorateClass([
|
|
1819
|
-
property()
|
|
1819
|
+
property({ internal: true })
|
|
1820
1820
|
], Text.prototype, "fonts");
|
|
1821
1821
|
|
|
1822
1822
|
export { Character as C, Fragment as F, Measurer as M, Paragraph as P, Text as T, uploadColors as a, definePlugin as b, backgroundPlugin as c, drawPath as d, getTransform2D as e, textDefaultStyle as f, getHighlightStyle as g, highlightPlugin as h, createSVGLoader as i, createSVGParser as j, parseValueNumber as k, listStylePlugin as l, parseColormap as m, isEqualObject as n, outlinePlugin as o, parseColor as p, isEqualValue as q, renderPlugin as r, setupView as s, textDecorationPlugin as t, uploadColor as u, hexToRgb as v, filterEmpty as w };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactiveObject, PropertyDeclaration, NormalizedTextContent } from 'modern-idoc';
|
|
2
|
-
import { T as Text } from '../shared/modern-text.
|
|
2
|
+
import { T as Text } from '../shared/modern-text.WbWB6f3d.cjs';
|
|
3
3
|
import 'modern-font';
|
|
4
4
|
import 'modern-path2d';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactiveObject, PropertyDeclaration, NormalizedTextContent } from 'modern-idoc';
|
|
2
|
-
import { T as Text } from '../shared/modern-text.
|
|
2
|
+
import { T as Text } from '../shared/modern-text.WbWB6f3d.mjs';
|
|
3
3
|
import 'modern-font';
|
|
4
4
|
import 'modern-path2d';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactiveObject, PropertyDeclaration, NormalizedTextContent } from 'modern-idoc';
|
|
2
|
-
import { T as Text } from '../shared/modern-text.
|
|
2
|
+
import { T as Text } from '../shared/modern-text.WbWB6f3d.js';
|
|
3
3
|
import 'modern-font';
|
|
4
4
|
import 'modern-path2d';
|
|
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.
|
|
3
|
+
import { T as Text } from '../shared/modern-text.y0a7DPYV.mjs';
|
|
4
4
|
import 'modern-path2d';
|
|
5
5
|
import 'modern-font';
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "modern-text",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"packageManager": "pnpm@
|
|
4
|
+
"version": "1.9.0",
|
|
5
|
+
"packageManager": "pnpm@10.18.1",
|
|
6
6
|
"description": "Measure and render text in a way that describes the DOM.",
|
|
7
7
|
"author": "wxm",
|
|
8
8
|
"license": "MIT",
|
|
@@ -56,21 +56,21 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"diff": "^8.0.2",
|
|
59
|
-
"modern-font": "^0.4.
|
|
60
|
-
"modern-idoc": "^0.
|
|
61
|
-
"modern-path2d": "^1.4.
|
|
59
|
+
"modern-font": "^0.4.4",
|
|
60
|
+
"modern-idoc": "^0.10.1",
|
|
61
|
+
"modern-path2d": "^1.4.10"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@antfu/eslint-config": "^5.
|
|
65
|
-
"@types/node": "^24.
|
|
66
|
-
"bumpp": "^10.
|
|
64
|
+
"@antfu/eslint-config": "^5.4.1",
|
|
65
|
+
"@types/node": "^24.7.0",
|
|
66
|
+
"bumpp": "^10.3.1",
|
|
67
67
|
"conventional-changelog-cli": "^5.0.0",
|
|
68
|
-
"eslint": "^9.
|
|
69
|
-
"lint-staged": "^16.
|
|
68
|
+
"eslint": "^9.37.0",
|
|
69
|
+
"lint-staged": "^16.2.3",
|
|
70
70
|
"simple-git-hooks": "^2.13.1",
|
|
71
|
-
"typescript": "^5.9.
|
|
71
|
+
"typescript": "^5.9.3",
|
|
72
72
|
"unbuild": "^3.6.1",
|
|
73
|
-
"vite": "^7.1.
|
|
73
|
+
"vite": "^7.1.9",
|
|
74
74
|
"vitest": "^3.2.4"
|
|
75
75
|
},
|
|
76
76
|
"simple-git-hooks": {
|