monowind 0.2.0 → 0.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.
- package/dist/cdn.js +5 -6
- package/dist/cdn.js.map +1 -1
- package/dist/element.d.ts.map +1 -1
- package/dist/index.js +14 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/styles.css +12 -4
package/dist/element.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../src/element.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../src/element.ts"],"names":[],"mappings":"AAiFA,QAAA,MAAM,eAAe,EAEhB,OAAO,WAAW,CAAC;AAExB,qBAAa,eAAgB,SAAQ,eAAe;;IAClD,MAAM,CAAC,kBAAkB,WAAc;IAiFvC,cAsBC;IAED,iBAAiB,IAAI,IAAI,CAmFxB;IAED,oBAAoB,IAAI,IAAI,CA8B3B;IAsLD,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAkB1F;IAED;;;;0DAIsD;IACtD,WAAW,IAAI,MAAM,CAIpB;CAsOF;AAED;+DAC+D;AAC/D,wBAAgB,cAAc,IAAI,IAAI,CAIrC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,eAAe,CAAC;KAC9B;CACF"}
|
package/dist/index.js
CHANGED
|
@@ -4216,27 +4216,29 @@ function gi(e, t, n, r) {
|
|
|
4216
4216
|
function _i(e, t, n) {
|
|
4217
4217
|
let r = oe(n, e), i = r?.lines ?? [], a = i.join("\n");
|
|
4218
4218
|
t.whiteSpace = "pre", (t.width === void 0 || t.width.kind === "auto") && (t.width = { kind: "max-content" });
|
|
4219
|
-
let o =
|
|
4219
|
+
let o = Array.from({ length: a.length }, () => 1 + t.tracking), s = Oi(a, o, t.tracking), c = i.length, l = {
|
|
4220
4220
|
source: e,
|
|
4221
4221
|
style: t,
|
|
4222
4222
|
children: [],
|
|
4223
4223
|
text: a,
|
|
4224
|
-
intrinsicWidth:
|
|
4225
|
-
intrinsicHeight:
|
|
4224
|
+
intrinsicWidth: s,
|
|
4225
|
+
intrinsicHeight: c,
|
|
4226
4226
|
localRect: {
|
|
4227
4227
|
x: 0,
|
|
4228
4228
|
y: 0,
|
|
4229
|
-
width:
|
|
4230
|
-
height:
|
|
4229
|
+
width: s,
|
|
4230
|
+
height: c
|
|
4231
4231
|
},
|
|
4232
4232
|
unclampedHeight: 0,
|
|
4233
4233
|
resolvedPadding: z()
|
|
4234
|
-
}
|
|
4235
|
-
|
|
4234
|
+
};
|
|
4235
|
+
t.tracking > 0 && (l.advances = o);
|
|
4236
|
+
let u = r?.runs ?? [];
|
|
4237
|
+
if (u.length > 0 && a.length > 0) {
|
|
4236
4238
|
let t = [0];
|
|
4237
4239
|
for (let e of i) t.push(t[t.length - 1] + e.length + 1);
|
|
4238
4240
|
let n = Array.from({ length: a.length }, () => -1);
|
|
4239
|
-
|
|
4241
|
+
l.inlineElements = u.map((t) => ({
|
|
4240
4242
|
element: e,
|
|
4241
4243
|
tracking: 0,
|
|
4242
4244
|
padLeft: 0,
|
|
@@ -4247,14 +4249,14 @@ function _i(e, t, n) {
|
|
|
4247
4249
|
fontWeight: t.paint.fontWeight ?? "",
|
|
4248
4250
|
fontStyle: t.paint.fontStyle ?? "",
|
|
4249
4251
|
textDecorationLine: t.paint.textDecorationLine ?? ""
|
|
4250
|
-
})),
|
|
4252
|
+
})), u.forEach((e, r) => {
|
|
4251
4253
|
let a = i[e.line];
|
|
4252
4254
|
if (a === void 0) return;
|
|
4253
4255
|
let o = Math.max(0, e.start), s = Math.min(a.length, e.end);
|
|
4254
4256
|
for (let i = o; i < s; i++) n[t[e.line] + i] = r;
|
|
4255
|
-
}),
|
|
4257
|
+
}), l.charInline = n;
|
|
4256
4258
|
}
|
|
4257
|
-
return
|
|
4259
|
+
return l;
|
|
4258
4260
|
}
|
|
4259
4261
|
var vi = /* @__PURE__ */ new Set(/* @__PURE__ */ "A.ABBR.B.BDI.BDO.BR.CITE.CODE.DATA.DFN.EM.I.KBD.MARK.Q.S.SAMP.SMALL.SPAN.STRONG.SUB.SUP.TIME.U.VAR.WBR".split("."));
|
|
4260
4262
|
function yi(e, t) {
|
|
@@ -4401,7 +4403,7 @@ function Pi(e, t) {
|
|
|
4401
4403
|
}
|
|
4402
4404
|
//#endregion
|
|
4403
4405
|
//#region src/element.ts
|
|
4404
|
-
var Fi = "\n<style>\n :host { display: block; position: relative; contain: layout style; }\n #viewport { position: relative; width: 100%; height: 100%; }\n /* When the host hides its own dropped direct text (visibility, see\n * styles.css), the render layer must not sink with it. Scoped to that\n * state so an authored 'invisible' on the host stays intact. */\n :host([data-mw-dropped-text]) #viewport { visibility: visible; }\n /* The unified grid: one <pre> with same-paint-run spans, cell-precise\n * (one monospace character = one cell). In select=\"grid\" (the\n * default, reflected onto the attribute — see DEFAULT_SELECT) the\n * grid catches drags for native selection of the ASCII; interactive\n * elements opt back into pointer-events via styles.css so clicks\n * still work. In select=\"text\" the grid is inert to events and drag\n * selects the light DOM natively. */\n #grid { position: absolute; inset: 0; margin: 0; font: inherit; line-height: inherit; letter-spacing: inherit; white-space: pre; pointer-events: none; user-select: none; -webkit-user-select: none; }\n :host([select=\"grid\"]) #grid { pointer-events: auto; user-select: text; -webkit-user-select: text; }\n :host([select=\"grid\"]) slot { pointer-events: none; user-select: none; -webkit-user-select: none; }\n /*
|
|
4406
|
+
var Fi = "\n<style>\n :host { display: block; position: relative; contain: layout style; }\n #viewport { position: relative; width: 100%; height: 100%; }\n /* When the host hides its own dropped direct text (visibility, see\n * styles.css), the render layer must not sink with it. Scoped to that\n * state so an authored 'invisible' on the host stays intact. */\n :host([data-mw-dropped-text]) #viewport { visibility: visible; }\n /* The unified grid: one <pre> with same-paint-run spans, cell-precise\n * (one monospace character = one cell). In select=\"grid\" (the\n * default, reflected onto the attribute — see DEFAULT_SELECT) the\n * grid catches drags for native selection of the ASCII; interactive\n * elements opt back into pointer-events via styles.css so clicks\n * still work. In select=\"text\" the grid is inert to events and drag\n * selects the light DOM natively. */\n #grid { position: absolute; inset: 0; margin: 0; font: inherit; line-height: inherit; letter-spacing: inherit; white-space: pre; pointer-events: none; user-select: none; -webkit-user-select: none; }\n :host([select=\"grid\"]) #grid { pointer-events: auto; user-select: text; -webkit-user-select: text; }\n :host([select=\"grid\"]) slot { pointer-events: none; user-select: none; -webkit-user-select: none; }\n /* Selection invert — mirror of the canonical rule in styles.css\n * (which explains the field choices); update together. */\n ::selection { color: var(--mw-bg, canvas); text-shadow: 0 0 0 var(--mw-bg, canvas); background: var(--mw-fg, canvastext); }\n</style>\n<div id=\"viewport\">\n <pre id=\"grid\" aria-hidden=\"true\"></pre>\n <slot></slot>\n</div>\n", Ii = "grid", Li = [
|
|
4405
4407
|
"pointerover",
|
|
4406
4408
|
"pointerleave",
|
|
4407
4409
|
"pointerdown",
|