@vscode/markdown-editor 0.0.2-47 → 0.0.2-49

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/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # Markdown editor
2
+
3
+ `@vscode/markdown-editor` is an experimental, browser-based hybrid Markdown
4
+ editor. It keeps Markdown source as the canonical document while presenting
5
+ inactive blocks in rendered form and active blocks in editable source form.
6
+
7
+ Start with the [current implementation specification](./docs/specification.md).
8
+ It explains the architecture, runtime data flow, public integration surface,
9
+ extension points, the VS Code custom text editor adapter, tests, and current
10
+ limitations.
11
+
12
+ Other package documents:
13
+
14
+ - [Original design](./docs/design.md) - historical design intent.
15
+ - [Original implementation plan](./docs/plan.md) - historical roadmap; its
16
+ checkboxes do not describe current completion.
17
+ - [Engineering backlog](./docs/todo.md) - known issues and future work.
18
+
19
+ From this package directory:
20
+
21
+ ```sh
22
+ pnpm test
23
+ pnpm test:e2e
24
+ pnpm build
25
+ pnpm build:explorer
26
+ ```
package/dist/index.d.ts CHANGED
@@ -663,6 +663,8 @@ export declare const cursorWordLeft: CursorCommand;
663
663
 
664
664
  export declare const cursorWordRight: CursorCommand;
665
665
 
666
+ export declare const DEFAULT_INDENTATION_CONFIG: IndentationConfig;
667
+
666
668
  export declare const DEFAULT_WORD_NAVIGATION_CONFIG: WordNavigationConfig;
667
669
 
668
670
  export declare const DEFAULT_WORD_SEPARATORS = "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";
@@ -886,6 +888,9 @@ export declare class EditorController extends Disposable {
886
888
  private readonly _keyboardPlatform;
887
889
  private readonly _keyboardProfile;
888
890
  private readonly _historyStrategy;
891
+ private readonly _indentation;
892
+ private readonly _tabFocusStatus;
893
+ private _tabMovesFocus;
889
894
  /** Running click count for the current multi-click sequence (1, 2, 3, …). */
890
895
  private _clickCount;
891
896
  /** Timestamp and position of the previous pointer-down, for multi-click detection. */
@@ -933,6 +938,7 @@ export declare class EditorController extends Disposable {
933
938
  * arms a transient empty paragraph when at the end of a paragraph.
934
939
  */
935
940
  private _smartEnter;
941
+ private _registerTabFocusAccessibility;
936
942
  }
937
943
 
938
944
  /** Options for an {@link EditorController}. */
@@ -951,6 +957,8 @@ export declare interface EditorControllerOptions {
951
957
  readonly historyStrategy?: IHistoryStrategy;
952
958
  readonly keyboardPlatform?: KeyboardPlatform;
953
959
  readonly keyboardProfile?: KeyboardProfile;
960
+ /** Tab-stop settings used outside semantic list indentation. */
961
+ readonly indentation?: IndentationConfig;
954
962
  readonly find?: false;
955
963
  }
956
964
 
@@ -992,6 +1000,11 @@ export declare type EditorKeyboardAction = {
992
1000
  } | {
993
1001
  readonly kind: 'history';
994
1002
  readonly command: HistoryKeyboardAction;
1003
+ } | {
1004
+ readonly kind: 'tab';
1005
+ readonly command: TabKeyboardAction;
1006
+ } | {
1007
+ readonly kind: 'toggleTabFocus';
995
1008
  } | {
996
1009
  readonly kind: 'selectAll';
997
1010
  } | {
@@ -1892,6 +1905,14 @@ export declare interface IMonarchApi {
1892
1905
  MonarchTokenizer: new (languageService: unknown, standaloneThemeService: unknown, languageId: string, lexer: unknown, configurationService: unknown) => MonarchTokenizer;
1893
1906
  }
1894
1907
 
1908
+ /** Controls tab-stop insertion and non-list line indentation. */
1909
+ export declare interface IndentationConfig {
1910
+ /** Number of visual columns between tab stops. */
1911
+ readonly tabSize: number;
1912
+ /** Whether indentation uses spaces instead of tab characters. */
1913
+ readonly insertSpaces: boolean;
1914
+ }
1915
+
1895
1916
  export declare type InlineAstNode = TextAstNode | StrongAstNode | EmphasisAstNode | StrikethroughAstNode | InlineCodeAstNode | InlineMathAstNode | LinkAstNode | ImageAstNode;
1896
1917
 
1897
1918
  export declare class InlineCodeAstNode extends AstNode {
@@ -1956,6 +1977,12 @@ export declare const insertParagraph: EditCommand;
1956
1977
  */
1957
1978
  export declare const insertSmartEnter: (ctx: CursorCommandContext) => SmartEnterResult;
1958
1979
 
1980
+ /**
1981
+ * VS Code-style Tab: insert to the next tab stop for a caret or partial
1982
+ * single-line selection, and indent every selected line for a line selection.
1983
+ */
1984
+ export declare function insertTab(config?: IndentationConfig): EditCommand;
1985
+
1959
1986
  export declare function insertText(text: string): EditCommand;
1960
1987
 
1961
1988
  /**
@@ -2413,6 +2440,9 @@ export declare class OffsetRange {
2413
2440
  toString(): string;
2414
2441
  }
2415
2442
 
2443
+ /** Outdent the current line, or every line touched by the selection. */
2444
+ export declare function outdent(config?: IndentationConfig): EditCommand;
2445
+
2416
2446
  export declare class ParagraphAstNode extends BlockAstNodeBase {
2417
2447
  readonly content: readonly (InlineAstNode | GlueAstNode)[];
2418
2448
  readonly leadingTrivia?: GlueAstNode | undefined;
@@ -2752,6 +2782,8 @@ declare class StrongViewData {
2752
2782
  constructor(ast: StrongAstNode, content: readonly AnyViewData[]);
2753
2783
  }
2754
2784
 
2785
+ declare type TabKeyboardAction = 'insert' | 'outdent';
2786
+
2755
2787
  export declare class TableAstNode extends BlockAstNodeBase {
2756
2788
  readonly content: readonly (TableRowAstNode | GlueAstNode)[];
2757
2789
  readonly leadingTrivia?: GlueAstNode | undefined;