@wingleeio/mugen-markdown 0.4.1 → 0.4.2
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 +8 -6
- package/dist/index.mjs +8 -6
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -2238,11 +2238,13 @@ var FadePainter = class {
|
|
|
2238
2238
|
const groups = /* @__PURE__ */ new Map();
|
|
2239
2239
|
const minStart = this.veils.reduce((m, v) => Math.min(m, v.start), Infinity);
|
|
2240
2240
|
const walker = document.createTreeWalker(content, NodeFilter.SHOW_TEXT, contentTextFilter(content));
|
|
2241
|
-
|
|
2242
|
-
let node = walker.
|
|
2243
|
-
|
|
2241
|
+
walker.currentNode = content;
|
|
2242
|
+
let node = walker.lastChild();
|
|
2243
|
+
let end = this.length;
|
|
2244
|
+
while (node != null && end > minStart) {
|
|
2244
2245
|
const len = node.data.length;
|
|
2245
|
-
|
|
2246
|
+
const base = end - len;
|
|
2247
|
+
if (len > 0) for (let vi = 0; vi < this.veils.length; vi++) {
|
|
2246
2248
|
const v = this.veils[vi];
|
|
2247
2249
|
const s = Math.max(v.start - base, 0);
|
|
2248
2250
|
const e = Math.min(v.end - base, len);
|
|
@@ -2266,8 +2268,8 @@ var FadePainter = class {
|
|
|
2266
2268
|
range.setEnd(node, e);
|
|
2267
2269
|
for (const r of range.getClientRects()) group.path.rect(r.left - origin.left - 1, r.top - origin.top - 1, r.width + 2, r.height + 2);
|
|
2268
2270
|
}
|
|
2269
|
-
|
|
2270
|
-
node = walker.
|
|
2271
|
+
end = base;
|
|
2272
|
+
node = walker.previousNode();
|
|
2271
2273
|
}
|
|
2272
2274
|
for (const group of groups.values()) {
|
|
2273
2275
|
ctx.globalAlpha = group.alpha;
|
package/dist/index.mjs
CHANGED
|
@@ -2237,11 +2237,13 @@ var FadePainter = class {
|
|
|
2237
2237
|
const groups = /* @__PURE__ */ new Map();
|
|
2238
2238
|
const minStart = this.veils.reduce((m, v) => Math.min(m, v.start), Infinity);
|
|
2239
2239
|
const walker = document.createTreeWalker(content, NodeFilter.SHOW_TEXT, contentTextFilter(content));
|
|
2240
|
-
|
|
2241
|
-
let node = walker.
|
|
2242
|
-
|
|
2240
|
+
walker.currentNode = content;
|
|
2241
|
+
let node = walker.lastChild();
|
|
2242
|
+
let end = this.length;
|
|
2243
|
+
while (node != null && end > minStart) {
|
|
2243
2244
|
const len = node.data.length;
|
|
2244
|
-
|
|
2245
|
+
const base = end - len;
|
|
2246
|
+
if (len > 0) for (let vi = 0; vi < this.veils.length; vi++) {
|
|
2245
2247
|
const v = this.veils[vi];
|
|
2246
2248
|
const s = Math.max(v.start - base, 0);
|
|
2247
2249
|
const e = Math.min(v.end - base, len);
|
|
@@ -2265,8 +2267,8 @@ var FadePainter = class {
|
|
|
2265
2267
|
range.setEnd(node, e);
|
|
2266
2268
|
for (const r of range.getClientRects()) group.path.rect(r.left - origin.left - 1, r.top - origin.top - 1, r.width + 2, r.height + 2);
|
|
2267
2269
|
}
|
|
2268
|
-
|
|
2269
|
-
node = walker.
|
|
2270
|
+
end = base;
|
|
2271
|
+
node = walker.previousNode();
|
|
2270
2272
|
}
|
|
2271
2273
|
for (const group of groups.values()) {
|
|
2272
2274
|
ctx.globalAlpha = group.alpha;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wingleeio/mugen-markdown",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Measurable markdown for mugen — incremark-parsed, rendered with mugen primitives so the virtualizer's tree walker computes exact row heights.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Wing Lee <contact@winglee.io>",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"tsdown": "^0.22.2",
|
|
66
66
|
"typescript": "^6.0.3",
|
|
67
67
|
"vitest": "^4.1.8",
|
|
68
|
-
"@wingleeio/mugen": "0.3.
|
|
68
|
+
"@wingleeio/mugen": "0.3.5"
|
|
69
69
|
},
|
|
70
70
|
"scripts": {
|
|
71
71
|
"build": "tsdown",
|