@vscode/markdown-editor 0.0.2-137 → 0.0.2-138
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.d.ts +2 -0
- package/dist/index.js +96 -90
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -949,6 +949,8 @@ export declare class EditorController extends Disposable {
|
|
|
949
949
|
private _clickCount;
|
|
950
950
|
/** Timestamp and position of the previous pointer-down, for multi-click detection. */
|
|
951
951
|
private _lastPointerDown;
|
|
952
|
+
/** Timestamp of the last locked-mode reveal caused by a pointer click. */
|
|
953
|
+
private _lastReadonlyClickRevealTime;
|
|
952
954
|
constructor(_model: EditorModel, _view: EditorView, options?: EditorControllerOptions);
|
|
953
955
|
private readonly _handleTextUpdate;
|
|
954
956
|
insertText(text: string, selectionOverride?: Selection_2): void;
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { O as v, S as L, b as ge, d as fi, R as P, P as Ee, a as mi, e as $n, f
|
|
|
3
3
|
import pi from "katex";
|
|
4
4
|
import { observableValue as x, derived as R, transaction as z, Disposable as W, runOnChange as mn, autorun as T, constObservable as Kn } from "@vscode/observables";
|
|
5
5
|
import { D as Fo, f as Vo, a as Wo, b as $o, c as Ko, d as gi, i as st } from "./config-BGeaJqWk.js";
|
|
6
|
-
import { e as
|
|
6
|
+
import { e as ph } from "./config-BGeaJqWk.js";
|
|
7
7
|
import { decodeHTMLAttribute as Hn } from "entities/decode";
|
|
8
8
|
import { decodeString as zn } from "micromark-util-decode-string";
|
|
9
9
|
import { parse as Ho, preprocess as zo, postprocess as qo } from "micromark";
|
|
@@ -1960,7 +1960,7 @@ function Cr(n) {
|
|
|
1960
1960
|
let e = Qn.get(n);
|
|
1961
1961
|
return e === void 0 && (e = xr++, Qn.set(n, e)), e;
|
|
1962
1962
|
}
|
|
1963
|
-
function
|
|
1963
|
+
function jd(n, e) {
|
|
1964
1964
|
let t = 0;
|
|
1965
1965
|
function s(i) {
|
|
1966
1966
|
const o = t, r = i.children;
|
|
@@ -2084,7 +2084,7 @@ function mt(n, e, t, s, i) {
|
|
|
2084
2084
|
return o;
|
|
2085
2085
|
}
|
|
2086
2086
|
const Dr = Symbol("NO_ACTIVE_BLOCKS");
|
|
2087
|
-
class
|
|
2087
|
+
class Yd {
|
|
2088
2088
|
_parser = new br();
|
|
2089
2089
|
_sourceEditListeners = /* @__PURE__ */ new Set();
|
|
2090
2090
|
_sourceTextIds = /* @__PURE__ */ new WeakMap();
|
|
@@ -6899,7 +6899,7 @@ function Ll(n) {
|
|
|
6899
6899
|
return !n.windowHasFocus;
|
|
6900
6900
|
}
|
|
6901
6901
|
const Tl = 900, ze = 2, xo = 5, ye = 16;
|
|
6902
|
-
class
|
|
6902
|
+
class Jd extends W {
|
|
6903
6903
|
constructor(e, t) {
|
|
6904
6904
|
super(), this._model = e, this._options = t, this._options?.presentation !== void 0 && this._model.presentation.set(this._options.presentation, void 0), this._register({ dispose: () => this._pendingTopReveal?.dispose() }), this.element = document.createElement("div"), this.element.className = "md-editor", this._options?.classNames && this.element.classList.add(...this._options.classNames), this.element.tabIndex = 0, this._contentContainer = document.createElement("div"), this._contentContainer.className = "md-editor-content", this.element.appendChild(this._contentContainer);
|
|
6905
6905
|
const s = this._options?.limitedWidth ?? Kn(Tl);
|
|
@@ -8619,7 +8619,7 @@ function Js(n) {
|
|
|
8619
8619
|
}
|
|
8620
8620
|
return !0;
|
|
8621
8621
|
}
|
|
8622
|
-
function
|
|
8622
|
+
function Zd(n, e = () => {
|
|
8623
8623
|
n.ownerDocument.execCommand("paste");
|
|
8624
8624
|
}) {
|
|
8625
8625
|
const t = n.ownerDocument, s = Lo(t);
|
|
@@ -8663,7 +8663,7 @@ class Zl {
|
|
|
8663
8663
|
};
|
|
8664
8664
|
}
|
|
8665
8665
|
}
|
|
8666
|
-
class
|
|
8666
|
+
class eh {
|
|
8667
8667
|
constructor(e = navigator.clipboard, t) {
|
|
8668
8668
|
this._clipboard = e, this._paste = t;
|
|
8669
8669
|
}
|
|
@@ -8816,12 +8816,12 @@ const un = {
|
|
|
8816
8816
|
...e,
|
|
8817
8817
|
action: n.action
|
|
8818
8818
|
})))
|
|
8819
|
-
},
|
|
8819
|
+
}, th = {
|
|
8820
8820
|
bindings: fn.filter((n) => n.routing === "local").flatMap((n) => n.keybindings.map((e) => ({
|
|
8821
8821
|
...e,
|
|
8822
8822
|
action: n.action
|
|
8823
8823
|
})))
|
|
8824
|
-
},
|
|
8824
|
+
}, nh = {
|
|
8825
8825
|
bindings: fn.filter((n) => n.routing !== "local").flatMap((n) => n.keybindings.map((e) => ({
|
|
8826
8826
|
...e,
|
|
8827
8827
|
action: n.action
|
|
@@ -8865,8 +8865,8 @@ function id(n) {
|
|
|
8865
8865
|
function od(n, e = {}) {
|
|
8866
8866
|
return n.shiftKey === !!e.shift && n.altKey === !!e.alt && n.ctrlKey === !!e.ctrl && n.metaKey === !!e.meta;
|
|
8867
8867
|
}
|
|
8868
|
-
const rd = 500, si = 5;
|
|
8869
|
-
class
|
|
8868
|
+
const rd = 500, si = 5, cd = 120 * 1e3;
|
|
8869
|
+
class sh extends W {
|
|
8870
8870
|
constructor(e, t, s) {
|
|
8871
8871
|
super(), this._model = e, this._view = t;
|
|
8872
8872
|
const i = this._view.element, o = i.ownerDocument.defaultView ?? window;
|
|
@@ -8912,6 +8912,8 @@ class nh extends W {
|
|
|
8912
8912
|
_clickCount = 0;
|
|
8913
8913
|
/** Timestamp and position of the previous pointer-down, for multi-click detection. */
|
|
8914
8914
|
_lastPointerDown;
|
|
8915
|
+
/** Timestamp of the last locked-mode reveal caused by a pointer click. */
|
|
8916
|
+
_lastReadonlyClickRevealTime;
|
|
8915
8917
|
_handleTextUpdate = (e) => {
|
|
8916
8918
|
this.insertText(e.text, new y(e.updateRangeStart, e.updateRangeEnd));
|
|
8917
8919
|
};
|
|
@@ -8974,7 +8976,7 @@ class nh extends W {
|
|
|
8974
8976
|
return;
|
|
8975
8977
|
}
|
|
8976
8978
|
if (this._clickCount === 3) {
|
|
8977
|
-
const h =
|
|
8979
|
+
const h = ld(this._model.document.get(), r);
|
|
8978
8980
|
h && this._setUserSelection(Yc(this._makeCursorContext(), h));
|
|
8979
8981
|
return;
|
|
8980
8982
|
}
|
|
@@ -8990,7 +8992,11 @@ class nh extends W {
|
|
|
8990
8992
|
const u = this._model.selection.get() ?? y.collapsed(r), m = this._view.resolveCursorPositionFromPoint(new Ee(h.clientX, h.clientY)) ?? I.source(u.active, u.activeAffinity);
|
|
8991
8993
|
this._setUserSelection(u.withActive(m.offset, m.affinity));
|
|
8992
8994
|
}, f = () => {
|
|
8993
|
-
this._model.isSelecting.set(!1, void 0), c && (this._model.selection.get()?.isCollapsed ?? !0)
|
|
8995
|
+
if (this._model.isSelecting.set(!1, void 0), c && (this._model.selection.get()?.isCollapsed ?? !0)) {
|
|
8996
|
+
const h = Date.now();
|
|
8997
|
+
(this._lastReadonlyClickRevealTime === void 0 || h - this._lastReadonlyClickRevealTime >= cd) && (this._lastReadonlyClickRevealTime = h, this._view.showReadonlyEditingAttempt());
|
|
8998
|
+
}
|
|
8999
|
+
a.removeEventListener("pointermove", d), a.removeEventListener("pointerup", f), a.removeEventListener("pointercancel", f), a.removeEventListener("lostpointercapture", f);
|
|
8994
9000
|
};
|
|
8995
9001
|
a.addEventListener("pointermove", d), a.addEventListener("pointerup", f), a.addEventListener("pointercancel", f), a.addEventListener("lostpointercapture", f);
|
|
8996
9002
|
};
|
|
@@ -9113,7 +9119,7 @@ class nh extends W {
|
|
|
9113
9119
|
}
|
|
9114
9120
|
};
|
|
9115
9121
|
_handleKeyDown = (e) => {
|
|
9116
|
-
if (e.isComposing ||
|
|
9122
|
+
if (e.isComposing || ad(e, this._view.element) || (this._updateModifierState(e), e.key === "Tab" && (this._model.readonlyMode.get() || this._tabMovesFocus)))
|
|
9117
9123
|
return;
|
|
9118
9124
|
if (e.key === "Escape" && !e.defaultPrevented && !e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey && (this._model.selection.get() !== void 0 || this._model.pendingParagraph.get() !== void 0)) {
|
|
9119
9125
|
ii(e), this._view.stopFollowingCaret(), this._generatedIndentation = void 0, this._desiredColumn = void 0, this._setUserSelection(void 0);
|
|
@@ -9357,10 +9363,10 @@ function Me(n) {
|
|
|
9357
9363
|
function ii(n) {
|
|
9358
9364
|
n.preventDefault(), n.stopPropagation();
|
|
9359
9365
|
}
|
|
9360
|
-
function
|
|
9366
|
+
function ad(n, e) {
|
|
9361
9367
|
return n.target !== e;
|
|
9362
9368
|
}
|
|
9363
|
-
function
|
|
9369
|
+
function ld(n, e) {
|
|
9364
9370
|
const t = new Set(n.blocks);
|
|
9365
9371
|
let s = 0;
|
|
9366
9372
|
for (const i of n.children) {
|
|
@@ -9375,8 +9381,8 @@ function ad(n, e) {
|
|
|
9375
9381
|
function oi(n, e, t) {
|
|
9376
9382
|
t === null ? n.removeAttribute(e) : n.setAttribute(e, t);
|
|
9377
9383
|
}
|
|
9378
|
-
const
|
|
9379
|
-
class
|
|
9384
|
+
const dd = 200;
|
|
9385
|
+
class ih {
|
|
9380
9386
|
constructor(e) {
|
|
9381
9387
|
this._model = e, this._lastKnownText = e.sourceText.get().value;
|
|
9382
9388
|
}
|
|
@@ -9402,7 +9408,7 @@ class sh {
|
|
|
9402
9408
|
redoEdit: c,
|
|
9403
9409
|
beforeSelection: i,
|
|
9404
9410
|
afterSelection: r
|
|
9405
|
-
}), this._past.length >
|
|
9411
|
+
}), this._past.length > dd && this._past.shift(), this._future.length = 0;
|
|
9406
9412
|
}
|
|
9407
9413
|
undo() {
|
|
9408
9414
|
const e = this._peekApplicable(this._past);
|
|
@@ -9435,7 +9441,7 @@ class sh {
|
|
|
9435
9441
|
}
|
|
9436
9442
|
}
|
|
9437
9443
|
const ri = "md-debug-show-line-rects";
|
|
9438
|
-
function
|
|
9444
|
+
function hd(n, e) {
|
|
9439
9445
|
try {
|
|
9440
9446
|
const t = localStorage.getItem(n);
|
|
9441
9447
|
return t === null ? e : t === "true";
|
|
@@ -9443,20 +9449,20 @@ function dd(n, e) {
|
|
|
9443
9449
|
return e;
|
|
9444
9450
|
}
|
|
9445
9451
|
}
|
|
9446
|
-
function
|
|
9452
|
+
function ud(n, e) {
|
|
9447
9453
|
try {
|
|
9448
9454
|
localStorage.setItem(n, String(e));
|
|
9449
9455
|
} catch {
|
|
9450
9456
|
}
|
|
9451
9457
|
}
|
|
9452
|
-
class
|
|
9458
|
+
class oh extends W {
|
|
9453
9459
|
overlayElement;
|
|
9454
9460
|
infoElement;
|
|
9455
9461
|
rendering;
|
|
9456
9462
|
/** Absolute source offsets that map to a rendered DOM character. */
|
|
9457
9463
|
mappedOffsets;
|
|
9458
9464
|
/** Whether the dashed line-bands and run boxes are drawn (persisted). */
|
|
9459
|
-
_showLineRects = x(this,
|
|
9465
|
+
_showLineRects = x(this, hd(ri, !0));
|
|
9460
9466
|
constructor(e, t) {
|
|
9461
9467
|
super(), this.overlayElement = document.createElement("div"), this.overlayElement.className = "md-debug-layout-overlay", Object.assign(this.overlayElement.style, {
|
|
9462
9468
|
position: "absolute",
|
|
@@ -9485,12 +9491,12 @@ class ih extends W {
|
|
|
9485
9491
|
});
|
|
9486
9492
|
const i = document.createElement("input");
|
|
9487
9493
|
i.type = "checkbox", i.checked = this._showLineRects.get(), i.addEventListener("change", () => {
|
|
9488
|
-
this._showLineRects.set(i.checked, void 0),
|
|
9494
|
+
this._showLineRects.set(i.checked, void 0), ud(ri, i.checked);
|
|
9489
9495
|
}), s.appendChild(i), s.appendChild(document.createTextNode("show line rects")), this.infoElement.appendChild(s);
|
|
9490
9496
|
const o = document.createElement("pre");
|
|
9491
9497
|
o.style.margin = "0", o.style.whiteSpace = "pre", this.infoElement.appendChild(o), this.rendering = R(this, (r) => {
|
|
9492
9498
|
const c = r.readObservable(t.model.measurements), a = r.readObservable(this._showLineRects);
|
|
9493
|
-
return
|
|
9499
|
+
return md(
|
|
9494
9500
|
this.overlayElement,
|
|
9495
9501
|
o,
|
|
9496
9502
|
c,
|
|
@@ -9502,16 +9508,16 @@ class ih extends W {
|
|
|
9502
9508
|
}), this.mappedOffsets = R(this, (r) => r.readObservable(this.rendering).mappedOffsets), this._register(T((r) => {
|
|
9503
9509
|
r.readObservable(this.rendering);
|
|
9504
9510
|
const c = t.hoveredOffset ? r.readObservable(t.hoveredOffset) : void 0;
|
|
9505
|
-
t.hoveredOffset &&
|
|
9511
|
+
t.hoveredOffset && gd(this.overlayElement, c);
|
|
9506
9512
|
}));
|
|
9507
9513
|
}
|
|
9508
9514
|
}
|
|
9509
|
-
class
|
|
9515
|
+
class fd {
|
|
9510
9516
|
constructor(e, t, s, i) {
|
|
9511
9517
|
this.blockCount = e, this.mountedCount = t, this.lineCount = s, this.mappedOffsets = i;
|
|
9512
9518
|
}
|
|
9513
9519
|
}
|
|
9514
|
-
function
|
|
9520
|
+
function md(n, e, t, s, i, o, r) {
|
|
9515
9521
|
n.textContent = "";
|
|
9516
9522
|
const c = s.capture();
|
|
9517
9523
|
let a = 0, l = 0, d = 0;
|
|
@@ -9543,16 +9549,16 @@ function fd(n, e, t, s, i, o, r) {
|
|
|
9543
9549
|
}), n.appendChild(N);
|
|
9544
9550
|
}
|
|
9545
9551
|
}
|
|
9546
|
-
p.viewNode && (d +=
|
|
9552
|
+
p.viewNode && (d += pd(n, c, p.viewNode, p.absoluteStart, f, o, r));
|
|
9547
9553
|
}
|
|
9548
9554
|
const h = `blocks: ${t.length} mounted: ${a} lines: ${l} chars: ${d}`, u = t.map((m, p) => {
|
|
9549
9555
|
const g = m.isMeasured ? "M" : "e", _ = m.visualLineMap?.lines.length ?? 0;
|
|
9550
9556
|
return `${String(p).padStart(2)} ${g} start=${String(m.absoluteStart).padStart(4)} h=${m.height.toFixed(1).padStart(6)} lines=${_} kind=${m.block.kind}`;
|
|
9551
9557
|
});
|
|
9552
9558
|
return e.textContent = [h, ...u].join(`
|
|
9553
|
-
`), new
|
|
9559
|
+
`), new fd(t.length, a, l, f);
|
|
9554
9560
|
}
|
|
9555
|
-
function
|
|
9561
|
+
function pd(n, e, t, s, i, o, r) {
|
|
9556
9562
|
let c = 0;
|
|
9557
9563
|
const a = document.createRange(), l = s + t.sourceLength, d = [];
|
|
9558
9564
|
t.forEachTextLeaf(s, (h, u) => {
|
|
@@ -9585,7 +9591,7 @@ function md(n, e, t, s, i, o, r) {
|
|
|
9585
9591
|
}
|
|
9586
9592
|
return c;
|
|
9587
9593
|
}
|
|
9588
|
-
function
|
|
9594
|
+
function gd(n, e) {
|
|
9589
9595
|
for (const t of Array.from(n.children)) {
|
|
9590
9596
|
if (!t.style)
|
|
9591
9597
|
continue;
|
|
@@ -9602,7 +9608,7 @@ class Je {
|
|
|
9602
9608
|
this.length = e, this.className = t;
|
|
9603
9609
|
}
|
|
9604
9610
|
}
|
|
9605
|
-
class
|
|
9611
|
+
class _d {
|
|
9606
9612
|
/**
|
|
9607
9613
|
* @param _monaco The Monarch runtime ({@link IMonarchApi}), injected so this
|
|
9608
9614
|
* package depends on `monaco-editor` for types only.
|
|
@@ -9613,7 +9619,7 @@ class gd {
|
|
|
9613
9619
|
}
|
|
9614
9620
|
_tokenizers = /* @__PURE__ */ new Map();
|
|
9615
9621
|
create(e, t) {
|
|
9616
|
-
return new
|
|
9622
|
+
return new vd(this._tokenizerFor(e), t);
|
|
9617
9623
|
}
|
|
9618
9624
|
dispose() {
|
|
9619
9625
|
for (const e of this._tokenizers.values())
|
|
@@ -9625,10 +9631,10 @@ class gd {
|
|
|
9625
9631
|
if (t === void 0)
|
|
9626
9632
|
return;
|
|
9627
9633
|
let s = this._tokenizers.get(e);
|
|
9628
|
-
return s || (s = new this._monaco.MonarchTokenizer(
|
|
9634
|
+
return s || (s = new this._monaco.MonarchTokenizer(yd, Ed, e, this._monaco.compile(e, t), xd), this._tokenizers.set(e, s)), s;
|
|
9629
9635
|
}
|
|
9630
9636
|
}
|
|
9631
|
-
class
|
|
9637
|
+
class vd {
|
|
9632
9638
|
constructor(e, t) {
|
|
9633
9639
|
this._tokenizer = e, this._initialState = e?.getInitialState(), this._text = t, this._lines = this._tokenizeFrom(0, [], this._initialState, t.split(`
|
|
9634
9640
|
`)), this._lineStarts = this._computeLineStarts(), this._snapshotObs = x("syntaxSnapshot", new ai(this, this._version));
|
|
@@ -9652,7 +9658,7 @@ class _d {
|
|
|
9652
9658
|
const s = li(this._lines), i = e.apply(this._text), o = e.replacements[0].replaceRange.start, r = this._lineIndexAt(o), c = this._lines.slice(0, r), a = r === 0 ? this._initialState : this._lines[r - 1].endState;
|
|
9653
9659
|
this._text = i, this._lines = this._tokenizeFrom(r, c, a, i.split(`
|
|
9654
9660
|
`)), this._lineStarts = this._computeLineStarts(), this._version++;
|
|
9655
|
-
const l =
|
|
9661
|
+
const l = bd(s, li(this._lines));
|
|
9656
9662
|
this._snapshotObs.set(new ai(this, this._version), t, l);
|
|
9657
9663
|
}
|
|
9658
9664
|
dispose() {
|
|
@@ -9670,7 +9676,7 @@ class _d {
|
|
|
9670
9676
|
const a = i[c], l = c < i.length - 1;
|
|
9671
9677
|
if (this._tokenizer && r) {
|
|
9672
9678
|
const d = this._tokenizer.tokenize(a, l, r);
|
|
9673
|
-
o.push({ text: a, tokens:
|
|
9679
|
+
o.push({ text: a, tokens: wd(d.tokens, a.length), endState: d.endState }), r = d.endState;
|
|
9674
9680
|
} else
|
|
9675
9681
|
o.push({ text: a, tokens: a.length === 0 ? [] : [new Je(a.length, void 0)], endState: r });
|
|
9676
9682
|
}
|
|
@@ -9715,16 +9721,16 @@ class ai {
|
|
|
9715
9721
|
return this._doc._getTokens(this._version, e);
|
|
9716
9722
|
}
|
|
9717
9723
|
}
|
|
9718
|
-
function
|
|
9724
|
+
function kd(n) {
|
|
9719
9725
|
return n === "" ? void 0 : n;
|
|
9720
9726
|
}
|
|
9721
|
-
function
|
|
9727
|
+
function wd(n, e) {
|
|
9722
9728
|
if (n.length === 0)
|
|
9723
9729
|
return e === 0 ? [] : [new Je(e, void 0)];
|
|
9724
9730
|
const t = [];
|
|
9725
9731
|
for (let s = 0; s < n.length; s++) {
|
|
9726
9732
|
const i = n[s].offset, o = s + 1 < n.length ? n[s + 1].offset : e;
|
|
9727
|
-
o > i && t.push(new Je(o - i,
|
|
9733
|
+
o > i && t.push(new Je(o - i, kd(n[s].type)));
|
|
9728
9734
|
}
|
|
9729
9735
|
return t;
|
|
9730
9736
|
}
|
|
@@ -9746,7 +9752,7 @@ function hi(n) {
|
|
|
9746
9752
|
e += t.length;
|
|
9747
9753
|
return e;
|
|
9748
9754
|
}
|
|
9749
|
-
function
|
|
9755
|
+
function bd(n, e) {
|
|
9750
9756
|
const t = n.length, s = e.length;
|
|
9751
9757
|
let i = 0, o = 0;
|
|
9752
9758
|
for (; i < t && i < s && di(n[i], e[i]); )
|
|
@@ -9757,21 +9763,21 @@ function wd(n, e) {
|
|
|
9757
9763
|
const a = hi(n), l = hi(e), d = new v(o, a - c), f = l - c - o;
|
|
9758
9764
|
return d.isEmpty && f === 0 ? Re.empty : Re.replace(d, f);
|
|
9759
9765
|
}
|
|
9760
|
-
const
|
|
9766
|
+
const yd = {
|
|
9761
9767
|
languageIdCodec: { encodeLanguageId: () => 0, decodeLanguageId: () => "" },
|
|
9762
9768
|
isRegisteredLanguageId: () => !1,
|
|
9763
9769
|
getLanguageIdByLanguageName: () => null,
|
|
9764
9770
|
getLanguageIdByMimeType: () => null,
|
|
9765
9771
|
requestBasicLanguageFeatures: () => {
|
|
9766
9772
|
}
|
|
9767
|
-
}, yd = {
|
|
9768
|
-
getColorTheme: () => ({ tokenTheme: {} })
|
|
9769
9773
|
}, Ed = {
|
|
9774
|
+
getColorTheme: () => ({ tokenTheme: {} })
|
|
9775
|
+
}, xd = {
|
|
9770
9776
|
getValue: () => 2e4,
|
|
9771
9777
|
onDidChangeConfiguration: () => ({ dispose() {
|
|
9772
9778
|
} })
|
|
9773
9779
|
};
|
|
9774
|
-
function
|
|
9780
|
+
function rh(n, e) {
|
|
9775
9781
|
const t = /* @__PURE__ */ new Map([
|
|
9776
9782
|
["typescript", e.typescript],
|
|
9777
9783
|
["ts", e.typescript],
|
|
@@ -9789,14 +9795,14 @@ function oh(n, e) {
|
|
|
9789
9795
|
["yaml", e.yaml],
|
|
9790
9796
|
["yml", e.yaml]
|
|
9791
9797
|
]);
|
|
9792
|
-
return new
|
|
9798
|
+
return new _d(n, t);
|
|
9793
9799
|
}
|
|
9794
9800
|
function To(n) {
|
|
9795
9801
|
const e = document.createElement("span");
|
|
9796
9802
|
return e.className = `codicon codicon-${n}`, e.setAttribute("aria-hidden", "true"), e;
|
|
9797
9803
|
}
|
|
9798
|
-
const
|
|
9799
|
-
class
|
|
9804
|
+
const Cd = 165, Sd = 400, Ld = 33;
|
|
9805
|
+
class Td extends W {
|
|
9800
9806
|
constructor(e) {
|
|
9801
9807
|
super(), this._options = e, this.element = document.createElement("div"), this.element.className = "md-comment-input", this._textarea = document.createElement("textarea"), this._textarea.className = "md-comment-input-textarea", this._textarea.rows = 1, this._textarea.placeholder = e?.placeholder ?? "Add comment", this._textarea.setAttribute("aria-label", this._textarea.placeholder), this.element.appendChild(this._textarea), this._measure = document.createElement("span"), this._measure.className = "md-comment-input-measure", this._measure.setAttribute("aria-hidden", "true"), this.element.appendChild(this._measure), this._submitButton = document.createElement("button"), this._submitButton.type = "button", this._submitButton.className = "md-comment-input-submit", this._submitButton.title = "Add comment", this._submitButton.setAttribute("aria-label", "Add comment"), this._submitButton.appendChild(To("add")), this.element.appendChild(this._submitButton);
|
|
9802
9808
|
const t = (r) => {
|
|
@@ -9851,15 +9857,15 @@ class Ld extends W {
|
|
|
9851
9857
|
}
|
|
9852
9858
|
_autoSize() {
|
|
9853
9859
|
this._measure.textContent = this._textarea.value || this._textarea.placeholder;
|
|
9854
|
-
const e = this._measure.scrollWidth +
|
|
9855
|
-
this.element.style.width = `${Math.min(Math.max(
|
|
9860
|
+
const e = this._measure.scrollWidth + Ld;
|
|
9861
|
+
this.element.style.width = `${Math.min(Math.max(Cd, e), Sd)}px`, this._textarea.style.height = "auto";
|
|
9856
9862
|
const t = this._textarea.scrollHeight;
|
|
9857
9863
|
t > 0 && (this._textarea.style.height = `${Math.min(t, 160)}px`, this._textarea.style.overflowY = t > 160 ? "auto" : "hidden"), this._options?.onDidChangeSize?.();
|
|
9858
9864
|
}
|
|
9859
9865
|
}
|
|
9860
9866
|
class Mo extends W {
|
|
9861
9867
|
constructor(e, t, s) {
|
|
9862
|
-
super(), this._model = e, this._view = t, this._options = s, this._gap = s?.gap ?? 8, this._widget = this._register(new
|
|
9868
|
+
super(), this._model = e, this._view = t, this._options = s, this._gap = s?.gap ?? 8, this._widget = this._register(new Td({
|
|
9863
9869
|
onDidChangeSize: () => {
|
|
9864
9870
|
this._visible && this._layoutHorizontally();
|
|
9865
9871
|
},
|
|
@@ -9892,7 +9898,7 @@ class Mo extends W {
|
|
|
9892
9898
|
case "find":
|
|
9893
9899
|
return !1;
|
|
9894
9900
|
default:
|
|
9895
|
-
return
|
|
9901
|
+
return Md(e);
|
|
9896
9902
|
}
|
|
9897
9903
|
}
|
|
9898
9904
|
_widget;
|
|
@@ -9990,10 +9996,10 @@ class Mo extends W {
|
|
|
9990
9996
|
this._hideAndRefocus(), t && this._options?.onSubmit?.({ text: e, range: t });
|
|
9991
9997
|
}
|
|
9992
9998
|
}
|
|
9993
|
-
function
|
|
9999
|
+
function Md(n) {
|
|
9994
10000
|
throw new Error(`Unhandled selection source: ${JSON.stringify(n)}`);
|
|
9995
10001
|
}
|
|
9996
|
-
class
|
|
10002
|
+
class Od {
|
|
9997
10003
|
_domNode;
|
|
9998
10004
|
_disposables = [];
|
|
9999
10005
|
get element() {
|
|
@@ -10017,7 +10023,7 @@ class Md {
|
|
|
10017
10023
|
this._domNode.remove();
|
|
10018
10024
|
}
|
|
10019
10025
|
}
|
|
10020
|
-
class
|
|
10026
|
+
class ch {
|
|
10021
10027
|
_comments = x(this, []);
|
|
10022
10028
|
/** Monotonic counter for ids of comments created via {@link create}. */
|
|
10023
10029
|
_sequence = 0;
|
|
@@ -10053,9 +10059,9 @@ class rh {
|
|
|
10053
10059
|
this._comments.set(this._comments.get().filter((t) => t.id !== e), void 0);
|
|
10054
10060
|
}
|
|
10055
10061
|
}
|
|
10056
|
-
const
|
|
10057
|
-
function
|
|
10058
|
-
const t = n.element, s = n.overlayContainer, i = t.clientWidth -
|
|
10062
|
+
const Rd = 12, Id = 8;
|
|
10063
|
+
function Nd(n, e) {
|
|
10064
|
+
const t = n.element, s = n.overlayContainer, i = t.clientWidth - Id - s.offsetLeft, o = [];
|
|
10059
10065
|
for (const c of e) {
|
|
10060
10066
|
if (c.element.style.setProperty("--md-comment-available-width", `${Math.max(0, i)}px`), c.rects.length === 0) {
|
|
10061
10067
|
c.element.style.visibility = "hidden";
|
|
@@ -10066,11 +10072,11 @@ function Id(n, e) {
|
|
|
10066
10072
|
o.sort((c, a) => c.y - a.y);
|
|
10067
10073
|
let r = -1 / 0;
|
|
10068
10074
|
for (const c of o) {
|
|
10069
|
-
const a = Math.max(c.y, r +
|
|
10075
|
+
const a = Math.max(c.y, r + Rd), l = i - c.element.offsetWidth;
|
|
10070
10076
|
c.element.style.left = `${l}px`, c.element.style.top = `${a}px`, r = a + c.element.offsetHeight;
|
|
10071
10077
|
}
|
|
10072
10078
|
}
|
|
10073
|
-
class
|
|
10079
|
+
class ah extends W {
|
|
10074
10080
|
constructor(e, t) {
|
|
10075
10081
|
super(), this._model = e, this._view = t, this._layer = document.createElement("div"), this._layer.className = "md-comments-layer", this._layer.style.position = "absolute", this._layer.style.inset = "0", this._layer.style.pointerEvents = "none", this._layer.style.overflow = "visible", this._layer.style.background = "transparent", this._view.overlayContainer.appendChild(this._layer), this._register({
|
|
10076
10082
|
dispose: () => {
|
|
@@ -10101,7 +10107,7 @@ class ch extends W {
|
|
|
10101
10107
|
for (const s of e) {
|
|
10102
10108
|
if (this._entries.has(s.id))
|
|
10103
10109
|
continue;
|
|
10104
|
-
const i = new
|
|
10110
|
+
const i = new Od({
|
|
10105
10111
|
body: s.body,
|
|
10106
10112
|
onDelete: () => this._model.remove(s.id)
|
|
10107
10113
|
});
|
|
@@ -10115,7 +10121,7 @@ class ch extends W {
|
|
|
10115
10121
|
}
|
|
10116
10122
|
_relayout() {
|
|
10117
10123
|
const e = this._order.map((t) => this._entries.get(t)).filter((t) => t !== void 0).map((t) => ({ element: t.widget.element, rects: t.rects.get() }));
|
|
10118
|
-
|
|
10124
|
+
Nd(this._view, e), this._revealPendingComment();
|
|
10119
10125
|
}
|
|
10120
10126
|
_revealPendingComment() {
|
|
10121
10127
|
const e = this._pendingRevealCommentId;
|
|
@@ -10125,7 +10131,7 @@ class ch extends W {
|
|
|
10125
10131
|
!t || t.style.visibility === "hidden" || (this._pendingRevealCommentId = void 0, t.scrollIntoView({ block: "center", inline: "nearest" }));
|
|
10126
10132
|
}
|
|
10127
10133
|
}
|
|
10128
|
-
class
|
|
10134
|
+
class lh {
|
|
10129
10135
|
constructor(e) {
|
|
10130
10136
|
this._options = e;
|
|
10131
10137
|
let t = this.name.get();
|
|
@@ -10221,7 +10227,7 @@ class ah {
|
|
|
10221
10227
|
function ui(n) {
|
|
10222
10228
|
return n instanceof Error && n.message ? n : new Error(String(n) || "Rename failed.");
|
|
10223
10229
|
}
|
|
10224
|
-
class
|
|
10230
|
+
class dh extends W {
|
|
10225
10231
|
constructor(e, t, s = {}) {
|
|
10226
10232
|
super(), this._container = e, this._model = t, this._options = s;
|
|
10227
10233
|
const i = e.ownerDocument;
|
|
@@ -10261,7 +10267,7 @@ class lh extends W {
|
|
|
10261
10267
|
this.element.style.left = `${Math.max(0, Math.min(e.left, t - this.element.offsetWidth))}px`, this.element.style.top = `${Math.max(0, Math.min(r, s - i))}px`;
|
|
10262
10268
|
}
|
|
10263
10269
|
}
|
|
10264
|
-
class
|
|
10270
|
+
class hh {
|
|
10265
10271
|
constructor(e) {
|
|
10266
10272
|
this._callbacks = e;
|
|
10267
10273
|
}
|
|
@@ -10345,7 +10351,7 @@ class dh {
|
|
|
10345
10351
|
s !== t && this._callbacks.onSelect?.(s);
|
|
10346
10352
|
}
|
|
10347
10353
|
}
|
|
10348
|
-
class
|
|
10354
|
+
class uh extends W {
|
|
10349
10355
|
constructor(e) {
|
|
10350
10356
|
if (super(), this._options = e, !e.id || /\s/.test(e.id))
|
|
10351
10357
|
throw new Error("Suggest widget id must be nonempty and contain no whitespace.");
|
|
@@ -10442,7 +10448,7 @@ class hh extends W {
|
|
|
10442
10448
|
const s = this.element.ownerDocument, i = s.createElement("div");
|
|
10443
10449
|
i.className = "md-suggest-row", i.id = `${this.listElement.id}-option-${t}`, i.dataset.suggestId = e.id, i.setAttribute("role", "option"), i.setAttribute("aria-label", [e.label, e.type].filter(Boolean).join(", ")), i.title = [e.label, e.detail, e.type].filter(Boolean).join(" - ");
|
|
10444
10450
|
const o = s.createElement("span");
|
|
10445
|
-
o.className = `md-suggest-icon codicon codicon-${
|
|
10451
|
+
o.className = `md-suggest-icon codicon codicon-${Ad[e.type ?? "Text"] ?? "symbol-property"}`, o.setAttribute("aria-hidden", "true"), i.appendChild(o);
|
|
10446
10452
|
const r = s.createElement("span");
|
|
10447
10453
|
r.className = "md-suggest-label";
|
|
10448
10454
|
const c = Math.max(0, Math.min(e.highlightLength ?? 0, e.label.length)), a = s.createElement("span");
|
|
@@ -10458,7 +10464,7 @@ class hh extends W {
|
|
|
10458
10464
|
this._savedAttributes.clear();
|
|
10459
10465
|
}
|
|
10460
10466
|
}
|
|
10461
|
-
const
|
|
10467
|
+
const Ad = {
|
|
10462
10468
|
Text: "symbol-text",
|
|
10463
10469
|
Method: "symbol-method",
|
|
10464
10470
|
Function: "symbol-method",
|
|
@@ -10487,29 +10493,29 @@ const Nd = {
|
|
|
10487
10493
|
};
|
|
10488
10494
|
export {
|
|
10489
10495
|
ee as AstNode,
|
|
10490
|
-
|
|
10496
|
+
eh as AsyncClipboardStrategy,
|
|
10491
10497
|
_e as BlockQuoteAstNode,
|
|
10492
10498
|
M as BlockViewNode,
|
|
10493
10499
|
ce as CodeBlockAstNode,
|
|
10494
10500
|
An as CodeBlockViewNode,
|
|
10495
|
-
|
|
10501
|
+
Td as CommentInputWidget,
|
|
10496
10502
|
Mo as CommentModeController,
|
|
10497
|
-
|
|
10498
|
-
|
|
10499
|
-
|
|
10503
|
+
Od as CommentWidget,
|
|
10504
|
+
ch as CommentsModel,
|
|
10505
|
+
ah as CommentsView,
|
|
10500
10506
|
I as CursorPosition,
|
|
10501
10507
|
yl as CursorView,
|
|
10502
10508
|
at as CursorViewRendering,
|
|
10503
10509
|
tt as DEFAULT_INDENTATION_CONFIG,
|
|
10504
10510
|
Fo as DEFAULT_WORD_NAVIGATION_CONFIG,
|
|
10505
|
-
|
|
10511
|
+
ph as DEFAULT_WORD_SEPARATORS,
|
|
10506
10512
|
bn as DocumentAstNode,
|
|
10507
10513
|
Bn as DocumentViewNode,
|
|
10508
|
-
|
|
10514
|
+
sh as EditorController,
|
|
10509
10515
|
Rt as EditorCoordinateSpace,
|
|
10510
10516
|
Ca as EditorCoordinateTransform,
|
|
10511
|
-
|
|
10512
|
-
|
|
10517
|
+
Yd as EditorModel,
|
|
10518
|
+
Jd as EditorView,
|
|
10513
10519
|
_n as EmphasisAstNode,
|
|
10514
10520
|
Ae as EmptyBlockAstNode,
|
|
10515
10521
|
Vl as FIND_MATCH_LIMIT,
|
|
@@ -10529,21 +10535,21 @@ export {
|
|
|
10529
10535
|
Ce as LinkAstNode,
|
|
10530
10536
|
H as ListAstNode,
|
|
10531
10537
|
$ as ListItemAstNode,
|
|
10532
|
-
|
|
10538
|
+
ih as LocalHistoryStrategy,
|
|
10533
10539
|
br as MarkdownParser,
|
|
10534
10540
|
E as MarkerAstNode,
|
|
10535
10541
|
Se as MathBlockAstNode,
|
|
10536
|
-
|
|
10537
|
-
|
|
10542
|
+
fd as MeasuredLayoutDebugRendering,
|
|
10543
|
+
oh as MeasuredLayoutDebugView,
|
|
10538
10544
|
qr as MeasuredLayoutModel,
|
|
10539
|
-
|
|
10545
|
+
_d as MonacoSyntaxHighlighter,
|
|
10540
10546
|
Zl as NativeClipboardStrategy,
|
|
10541
10547
|
v as OffsetRange,
|
|
10542
10548
|
se as ParagraphAstNode,
|
|
10543
10549
|
Ee as Point2D,
|
|
10544
10550
|
P as Rect2D,
|
|
10545
|
-
|
|
10546
|
-
|
|
10551
|
+
lh as RenameModel,
|
|
10552
|
+
dh as RenameWidget,
|
|
10547
10553
|
je as RichLink,
|
|
10548
10554
|
y as Selection,
|
|
10549
10555
|
ml as SelectionView,
|
|
@@ -10553,8 +10559,8 @@ export {
|
|
|
10553
10559
|
ge as StringReplacement,
|
|
10554
10560
|
qn as StringValue,
|
|
10555
10561
|
gn as StrongAstNode,
|
|
10556
|
-
|
|
10557
|
-
|
|
10562
|
+
hh as SuggestModel,
|
|
10563
|
+
uh as SuggestWidget,
|
|
10558
10564
|
Be as TableAstNode,
|
|
10559
10565
|
Ge as TableCellAstNode,
|
|
10560
10566
|
Ue as TableRowAstNode,
|
|
@@ -10571,7 +10577,7 @@ export {
|
|
|
10571
10577
|
fn as commands,
|
|
10572
10578
|
Hc as copyLinesDown,
|
|
10573
10579
|
Kc as copyLinesUp,
|
|
10574
|
-
|
|
10580
|
+
rh as createDefaultMonacoSyntaxHighlighter,
|
|
10575
10581
|
cc as cursorDocumentEnd,
|
|
10576
10582
|
rc as cursorDocumentStart,
|
|
10577
10583
|
dc as cursorDown,
|
|
@@ -10616,14 +10622,14 @@ export {
|
|
|
10616
10622
|
fe as normalizeCursorPosition,
|
|
10617
10623
|
Di as outdent,
|
|
10618
10624
|
Sr as presentationPolicies,
|
|
10619
|
-
|
|
10625
|
+
Zd as readNativeClipboard,
|
|
10620
10626
|
Xc as selectAll,
|
|
10621
10627
|
Yc as selectBlock,
|
|
10622
10628
|
jc as selectWord,
|
|
10623
10629
|
sr as taskCheckboxRange,
|
|
10624
|
-
|
|
10625
|
-
|
|
10630
|
+
jd as visualizeAst,
|
|
10631
|
+
nh as vscodeHostKeyboardProfile,
|
|
10626
10632
|
un as vscodeKeyboardProfile,
|
|
10627
|
-
|
|
10633
|
+
th as vscodeLocalKeyboardProfile
|
|
10628
10634
|
};
|
|
10629
10635
|
//# sourceMappingURL=index.js.map
|