@vscode/markdown-editor 0.0.2-30 → 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 +43 -7
- package/dist/index.js +1346 -1189
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/view/editor.css +63 -2
- package/src/view/themes/vscode-default.css +7 -3
- package/src/view/themes/vscode-github.css +8 -1
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,17 +1241,50 @@ 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;
|
|
1245
1262
|
/**
|
|
1246
|
-
*
|
|
1247
|
-
*
|
|
1248
|
-
*
|
|
1249
|
-
*
|
|
1250
|
-
|
|
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;
|
|
1269
|
+
/**
|
|
1270
|
+
* One-shot guarded focus attempt: focuses the editor only if doing so will
|
|
1271
|
+
* not steal focus from an explicit user target — the window must already be
|
|
1272
|
+
* focused and no other element may have claimed focus yet. Returns whether
|
|
1273
|
+
* focus was taken. A no-op for a background window or when the user has
|
|
1274
|
+
* already focused something else. {@link autoFocusOnOpen} builds the
|
|
1275
|
+
* open-time behavior on top of this primitive.
|
|
1251
1276
|
*/
|
|
1252
1277
|
tryAutoFocus(): boolean;
|
|
1278
|
+
/**
|
|
1279
|
+
* Focuses the editor when it opens without ever stealing focus from an
|
|
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.
|
|
1286
|
+
*/
|
|
1287
|
+
autoFocusOnOpen(): void;
|
|
1253
1288
|
/**
|
|
1254
1289
|
* Own point→offset resolution. When `true` (the default),
|
|
1255
1290
|
* {@link resolveOffsetFromPoint} ignores the platform DOM hit-test
|
|
@@ -1322,8 +1357,9 @@ export declare interface EditorViewOptions extends BlockViewOptions {
|
|
|
1322
1357
|
readonly classNames?: readonly string[];
|
|
1323
1358
|
/**
|
|
1324
1359
|
* Whether to render the sticky edit/read-only toggle at the top-right edge
|
|
1325
|
-
* of the content. Defaults to `true`;
|
|
1326
|
-
*
|
|
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.
|
|
1327
1363
|
*/
|
|
1328
1364
|
readonly showReadonlyToggle?: boolean;
|
|
1329
1365
|
/**
|