@vscode/markdown-editor 0.0.2-17 → 0.0.2-19

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 CHANGED
@@ -395,9 +395,9 @@ export declare interface CommentInputWidgetOptions {
395
395
  * - While the box has focus or holds a draft it is frozen in place (selection
396
396
  * changes, drags and clicks no longer move it). It is dismissed by Escape,
397
397
  * by submitting, or by blurring an empty box.
398
- * - The editor's painted caret is hidden only while the box has focus (the
399
- * blinking caret then belongs to the comment input); it stays visible while
400
- * the box is merely shown, so keyboard selection remains visible.
398
+ * - The editor's logical caret geometry remains available for anchoring in
399
+ * read-only mode even though the painted caret is hidden. While the box has
400
+ * focus, `.md-comment-active` also suppresses the painted caret in any mode.
401
401
  */
402
402
  export declare class CommentModeController extends Disposable {
403
403
  private readonly _model;
package/dist/index.js CHANGED
@@ -4713,10 +4713,22 @@ class Br extends W {
4713
4713
  o.className = "md-readonly-toggle-label", t.append(n, i, o), e.appendChild(t), this.element.style.position || (this.element.style.position = "relative");
4714
4714
  const r = () => {
4715
4715
  this._model.readonlyMode.set(!this._model.readonlyMode.get(), void 0);
4716
+ }, c = (u) => {
4717
+ u.button === 0 && (u.preventDefault(), u.stopPropagation(), this.focus());
4718
+ }, a = (u) => {
4719
+ u.stopPropagation();
4720
+ }, l = () => {
4721
+ this.element.editContext = null;
4722
+ }, d = () => {
4723
+ this.element.editContext = this.editContext;
4716
4724
  };
4717
- t.addEventListener("click", r), this._register({ dispose: () => t.removeEventListener("click", r) }), this._register(P((c) => {
4718
- const a = this._model.readonlyMode.read(c);
4719
- o.textContent = a ? "Locked" : "Editing", t.classList.toggle("md-readonly-toggle-locked", a), t.setAttribute("aria-pressed", String(a)), t.title = a ? "Read-only: markers hidden, editing disabled. Click to edit." : "Editing: click to lock (hide markers, disable editing).", this.element.classList.toggle("md-readonly", a);
4725
+ t.addEventListener("pointerdown", c), t.addEventListener("keydown", a), t.addEventListener("focus", l), t.addEventListener("blur", d), t.addEventListener("click", r), this._register({
4726
+ dispose: () => {
4727
+ t.removeEventListener("pointerdown", c), t.removeEventListener("keydown", a), t.removeEventListener("focus", l), t.removeEventListener("blur", d), t.removeEventListener("click", r), this.element.editContext === null && (this.element.editContext = this.editContext);
4728
+ }
4729
+ }), this._register(P((u) => {
4730
+ const f = this._model.readonlyMode.read(u);
4731
+ o.textContent = f ? "Locked" : "Editing", t.classList.toggle("md-readonly-toggle-locked", f), t.setAttribute("aria-pressed", String(f)), t.title = f ? "Read-only: markers hidden, editing disabled. Click to edit." : "Editing: click to lock (hide markers, disable editing).", this.element.classList.toggle("md-readonly", f);
4720
4732
  })), this.element.insertBefore(e, this.element.firstChild);
4721
4733
  }
4722
4734
  focus() {