@unmade/text-renderer 1.3.2 → 1.3.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.js +15 -14
- package/dist/worker/index.js +37 -32
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1337,20 +1337,21 @@ var be = (e) => e === void 0 || e === "flat" ? { type: "flat" } : e === "curved"
|
|
|
1337
1337
|
"rotate",
|
|
1338
1338
|
"scale",
|
|
1339
1339
|
"skew"
|
|
1340
|
-
].some((t) => e.includes(t)) && /[XYZ]/.test(e) && s && [c, l].every((e) => e === void 0))
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
"
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1340
|
+
].some((t) => e.includes(t)) && /[XYZ]/.test(e) && s && [c, l].every((e) => e === void 0)) {
|
|
1341
|
+
if (e === "skewX" || e === "skewY") n[e === "skewX" ? "skewXSelf" : "skewYSelf"](s);
|
|
1342
|
+
else {
|
|
1343
|
+
let t = e.replace(/[XYZ]/, ""), r = e.replace(t, ""), i = [
|
|
1344
|
+
"X",
|
|
1345
|
+
"Y",
|
|
1346
|
+
"Z"
|
|
1347
|
+
].indexOf(r), a = +(t === "scale"), o = t + "Self", c = [
|
|
1348
|
+
i === 0 ? s : a,
|
|
1349
|
+
i === 1 ? s : a,
|
|
1350
|
+
i === 2 ? s : a
|
|
1351
|
+
];
|
|
1352
|
+
n[o](...c);
|
|
1353
|
+
}
|
|
1354
|
+
} else throw TypeError(r);
|
|
1354
1355
|
}
|
|
1355
1356
|
if (a !== t.length) throw TypeError(r);
|
|
1356
1357
|
return n;
|
package/dist/worker/index.js
CHANGED
|
@@ -1337,20 +1337,21 @@ var Pe = (e) => e === void 0 || e === "flat" ? { type: "flat" } : e === "curved"
|
|
|
1337
1337
|
"rotate",
|
|
1338
1338
|
"scale",
|
|
1339
1339
|
"skew"
|
|
1340
|
-
].some((t) => e.includes(t)) && /[XYZ]/.test(e) && s && [c, l].every((e) => e === void 0))
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
"
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1340
|
+
].some((t) => e.includes(t)) && /[XYZ]/.test(e) && s && [c, l].every((e) => e === void 0)) {
|
|
1341
|
+
if (e === "skewX" || e === "skewY") n[e === "skewX" ? "skewXSelf" : "skewYSelf"](s);
|
|
1342
|
+
else {
|
|
1343
|
+
let t = e.replace(/[XYZ]/, ""), r = e.replace(t, ""), i = [
|
|
1344
|
+
"X",
|
|
1345
|
+
"Y",
|
|
1346
|
+
"Z"
|
|
1347
|
+
].indexOf(r), a = +(t === "scale"), o = t + "Self", c = [
|
|
1348
|
+
i === 0 ? s : a,
|
|
1349
|
+
i === 1 ? s : a,
|
|
1350
|
+
i === 2 ? s : a
|
|
1351
|
+
];
|
|
1352
|
+
n[o](...c);
|
|
1353
|
+
}
|
|
1354
|
+
} else throw TypeError(r);
|
|
1354
1355
|
}
|
|
1355
1356
|
if (a !== t.length) throw TypeError(r);
|
|
1356
1357
|
return n;
|
|
@@ -3289,16 +3290,18 @@ function Xr(e, t, n) {
|
|
|
3289
3290
|
break;
|
|
3290
3291
|
}
|
|
3291
3292
|
let a = null;
|
|
3292
|
-
if (t.charCodeAt(n) === J.LeftParenthesis)
|
|
3293
|
-
if (
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3293
|
+
if (t.charCodeAt(n) === J.LeftParenthesis) {
|
|
3294
|
+
if (Vr.has(e)) {
|
|
3295
|
+
if (qr(t.charCodeAt(n + 1))) throw Error(`Pseudo-selector ${e} cannot be quoted`);
|
|
3296
|
+
if (a = [], n = Xr(a, t, n + 1), t.charCodeAt(n) !== J.RightParenthesis) throw Error(`Missing closing parenthesis in :${e} (${t})`);
|
|
3297
|
+
n += 1;
|
|
3298
|
+
} else {
|
|
3299
|
+
if (a = o(), Wr.has(e)) {
|
|
3300
|
+
let e = a.charCodeAt(0);
|
|
3301
|
+
e === a.charCodeAt(a.length - 1) && qr(e) && (a = a.slice(1, -1));
|
|
3302
|
+
}
|
|
3303
|
+
a = Kr(a);
|
|
3300
3304
|
}
|
|
3301
|
-
a = Kr(a);
|
|
3302
3305
|
}
|
|
3303
3306
|
r.push({
|
|
3304
3307
|
type: K.Pseudo,
|
|
@@ -4320,8 +4323,10 @@ var mo = { type: K.Descendant }, ho = { type: "_flexibleDescendant" }, go = {
|
|
|
4320
4323
|
function _o(e, { adapter: t }, n) {
|
|
4321
4324
|
let r = !!n?.every((e) => e === so || t.isTag(e) && La(e, t) !== null);
|
|
4322
4325
|
for (let t of e) {
|
|
4323
|
-
if (!(t.length > 0 && no(t[0]) && t[0].type !== K.Descendant))
|
|
4324
|
-
|
|
4326
|
+
if (!(t.length > 0 && no(t[0]) && t[0].type !== K.Descendant)) {
|
|
4327
|
+
if (r && !t.some(oo)) t.unshift(mo);
|
|
4328
|
+
else continue;
|
|
4329
|
+
}
|
|
4325
4330
|
t.unshift(go);
|
|
4326
4331
|
}
|
|
4327
4332
|
}
|
|
@@ -6521,11 +6526,12 @@ function ol() {
|
|
|
6521
6526
|
r === "name" ? (m = a.trim(), a = "", r = "before-value") : a += T;
|
|
6522
6527
|
break;
|
|
6523
6528
|
case "(":
|
|
6524
|
-
if (r === "value")
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
+
if (r === "value") {
|
|
6530
|
+
if (a.trim() === "expression") {
|
|
6531
|
+
var ne = new e.CSSValueExpression(t, n).parse();
|
|
6532
|
+
ne.error ? ee(ne.error) : (a += ne.expression, n = ne.idx);
|
|
6533
|
+
} else r = "value-parenthesis", o = 1, a += T;
|
|
6534
|
+
} else r === "value-parenthesis" && o++, a += T;
|
|
6529
6535
|
break;
|
|
6530
6536
|
case ")":
|
|
6531
6537
|
r === "value-parenthesis" && (o--, o === 0 && (r = "value")), a += T;
|
|
@@ -6621,8 +6627,7 @@ function cl() {
|
|
|
6621
6627
|
return e.join(" ");
|
|
6622
6628
|
},
|
|
6623
6629
|
set cssText(t) {
|
|
6624
|
-
var n, r;
|
|
6625
|
-
for (n = this.length; n--;) r = this[n], this[r] = "";
|
|
6630
|
+
for (var n = this.length, r; n--;) r = this[n], this[r] = "";
|
|
6626
6631
|
Array.prototype.splice.call(this, 0, this.length), this._importants = {};
|
|
6627
6632
|
var i = e.parse("#bogus{" + t + "}").cssRules[0].style, a = i.length;
|
|
6628
6633
|
for (n = 0; n < a; ++n) r = i[n], this.setProperty(i[n], i.getPropertyValue(r), i.getPropertyPriority(r));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unmade/text-renderer",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "Pure function text renderer for SVG output",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"typecheck": "tsc --noEmit"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@unmade/platform": "^0.1.
|
|
80
|
-
"@unmade/svg-helpers": "^0.1.
|
|
79
|
+
"@unmade/platform": "^0.1.7",
|
|
80
|
+
"@unmade/svg-helpers": "^0.1.5",
|
|
81
81
|
"harfbuzzjs": "^1.6.1"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
@@ -92,9 +92,9 @@
|
|
|
92
92
|
"pngjs": "^7.0.0",
|
|
93
93
|
"svg-path-properties": "^2.1.0",
|
|
94
94
|
"typescript": "^7.0.2",
|
|
95
|
-
"vite": "^8.
|
|
95
|
+
"vite": "^8.3.0",
|
|
96
96
|
"vite-plugin-dts": "^5.1.0",
|
|
97
|
-
"vitest": "^
|
|
97
|
+
"vitest": "^5.0.1"
|
|
98
98
|
},
|
|
99
99
|
"keywords": [
|
|
100
100
|
"text",
|