@vscode/markdown-editor 0.0.2-31 → 0.0.2-32
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 +33 -9
- package/dist/index.js +1316 -1181
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/view/editor.css +63 -2
package/dist/index.d.ts
CHANGED
|
@@ -1146,6 +1146,8 @@ export declare class EditorView extends Disposable {
|
|
|
1146
1146
|
private readonly _gutterMarkersView;
|
|
1147
1147
|
private readonly _diffHighlightsView;
|
|
1148
1148
|
private _readonlyToggleButton;
|
|
1149
|
+
private _readonlyEditAtButton;
|
|
1150
|
+
private _readonlyEditTarget;
|
|
1149
1151
|
/**
|
|
1150
1152
|
* The mounted block sequence, in source order. Rebuilt (not mutated) each
|
|
1151
1153
|
* frame by {@link DocumentViewNode.create}; the view just swaps one
|
|
@@ -1239,9 +1241,31 @@ export declare class EditorView extends Disposable {
|
|
|
1239
1241
|
* for any CSS hooks.
|
|
1240
1242
|
*/
|
|
1241
1243
|
private _setupReadonlyToggle;
|
|
1244
|
+
/**
|
|
1245
|
+
* Creates the transient click-local affordance that unlocks the editor at the
|
|
1246
|
+
* source offset captured by {@link showReadonlyEditAt}.
|
|
1247
|
+
*/
|
|
1248
|
+
private _setupReadonlyEditAt;
|
|
1249
|
+
/**
|
|
1250
|
+
* Shows an unlock affordance beside a locked-content click. `point` is in
|
|
1251
|
+
* viewport client coordinates; `offset` is retained so activation restores
|
|
1252
|
+
* the caret to the exact source position represented by that click.
|
|
1253
|
+
*/
|
|
1254
|
+
showReadonlyEditAt(point: Point2D, offset: SourceOffset): void;
|
|
1255
|
+
private _revealReadonlyEditAt;
|
|
1256
|
+
private _readonlyEditVisibleRect;
|
|
1257
|
+
/** Hides the transient click-local unlock affordance, if present. */
|
|
1258
|
+
hideReadonlyEditAt(): void;
|
|
1242
1259
|
/** Draws attention to the mode toggle after text input is attempted while locked. */
|
|
1243
1260
|
showReadonlyEditingAttempt(): void;
|
|
1244
1261
|
focus(): void;
|
|
1262
|
+
/**
|
|
1263
|
+
* Samples the ambient focus state that decides whether taking focus on open
|
|
1264
|
+
* would steal it from an explicit user target: whether the window is focused
|
|
1265
|
+
* and whether focus is still unclaimed (no active element, or the `<body>`
|
|
1266
|
+
* fallback).
|
|
1267
|
+
*/
|
|
1268
|
+
private _sampleAutoFocusEnvironment;
|
|
1245
1269
|
/**
|
|
1246
1270
|
* One-shot guarded focus attempt: focuses the editor only if doing so will
|
|
1247
1271
|
* not steal focus from an explicit user target — the window must already be
|
|
@@ -1253,13 +1277,12 @@ export declare class EditorView extends Disposable {
|
|
|
1253
1277
|
tryAutoFocus(): boolean;
|
|
1254
1278
|
/**
|
|
1255
1279
|
* Focuses the editor when it opens without ever stealing focus from an
|
|
1256
|
-
* explicit user target. Tries once immediately
|
|
1257
|
-
*
|
|
1258
|
-
*
|
|
1259
|
-
*
|
|
1260
|
-
*
|
|
1261
|
-
*
|
|
1262
|
-
* the meantime.
|
|
1280
|
+
* explicit user target. Tries once immediately; if the window is not focused
|
|
1281
|
+
* yet — a common open-time race where the editor is mounted before the host
|
|
1282
|
+
* routes focus to its window — the guarded attempt is deferred to the next
|
|
1283
|
+
* time the window gains focus and re-evaluated then. The deferral is
|
|
1284
|
+
* one-shot, so a later, unrelated window refocus never grabs focus, and the
|
|
1285
|
+
* re-check still respects any target the user has claimed in the meantime.
|
|
1263
1286
|
*/
|
|
1264
1287
|
autoFocusOnOpen(): void;
|
|
1265
1288
|
/**
|
|
@@ -1334,8 +1357,9 @@ export declare interface EditorViewOptions extends BlockViewOptions {
|
|
|
1334
1357
|
readonly classNames?: readonly string[];
|
|
1335
1358
|
/**
|
|
1336
1359
|
* Whether to render the sticky edit/read-only toggle at the top-right edge
|
|
1337
|
-
* of the content. Defaults to `true`;
|
|
1338
|
-
*
|
|
1360
|
+
* of the content and the click-local unlock affordance. Defaults to `true`;
|
|
1361
|
+
* set to `false` when read-only state is host-enforced or when fixtures focus
|
|
1362
|
+
* on selection rendering.
|
|
1339
1363
|
*/
|
|
1340
1364
|
readonly showReadonlyToggle?: boolean;
|
|
1341
1365
|
/**
|