@rse/ink-editor 0.9.0 → 0.9.2
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/CHANGELOG.md +6 -0
- package/dst-stage1/ink-editor-cli.js +1 -1
- package/dst-stage1/ink-editor-engine-emacs.d.ts +1 -1
- package/dst-stage1/ink-editor-engine-emacs.js +1 -1
- package/dst-stage1/ink-editor-engine-nano.d.ts +1 -1
- package/dst-stage1/ink-editor-engine-nano.js +1 -1
- package/dst-stage1/ink-editor-engine-vim.d.ts +1 -1
- package/dst-stage1/ink-editor-engine-vim.js +1 -1
- package/dst-stage1/ink-editor-engine-vscode.d.ts +1 -1
- package/dst-stage1/ink-editor-engine-vscode.js +1 -1
- package/dst-stage1/ink-editor-mode-emacs.d.ts +2 -2
- package/dst-stage1/ink-editor-mode-emacs.js +2 -2
- package/dst-stage1/ink-editor-mode-nano.d.ts +2 -2
- package/dst-stage1/ink-editor-mode-nano.js +2 -2
- package/dst-stage1/ink-editor-mode-vim.d.ts +2 -2
- package/dst-stage1/ink-editor-mode-vim.js +2 -2
- package/dst-stage1/ink-editor-mode-vscode.d.ts +2 -2
- package/dst-stage1/ink-editor-mode-vscode.js +2 -2
- package/dst-stage1/ink-editor-mode.d.ts +1 -1
- package/dst-stage1/ink-editor-widget.d.ts +2 -2
- package/dst-stage1/ink-editor.d.ts +11 -11
- package/dst-stage1/ink-editor.js +6 -6
- package/dst-stage2/ink-editor-C-JxUrxy.js +5972 -0
- package/dst-stage2/ink-editor-cli.esm.js +1 -1
- package/dst-stage2/ink-editor.esm.js +1 -5972
- package/package.json +2 -2
- package/src/ink-editor-cli.ts +2 -2
- package/src/ink-editor-engine-emacs.ts +2 -2
- package/src/ink-editor-engine-nano.ts +2 -2
- package/src/ink-editor-engine-vim.ts +2 -2
- package/src/ink-editor-engine-vscode.ts +2 -2
- package/src/ink-editor-mode-emacs.ts +4 -4
- package/src/ink-editor-mode-nano.ts +4 -4
- package/src/ink-editor-mode-vim.ts +4 -4
- package/src/ink-editor-mode-vscode.ts +4 -4
- package/src/ink-editor-mode.ts +1 -1
- package/src/ink-editor-widget.ts +3 -3
- package/src/ink-editor.ts +11 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rse/ink-editor",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "Text Editor with Exchangeable Editing Modes for Ink",
|
|
5
5
|
"publishConfig": { "access": "public" },
|
|
6
6
|
"keywords": [ "ink", "react", "terminal", "tui",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
".": { "types": "./dst-stage1/ink-editor.d.ts", "default": "./dst-stage2/ink-editor.esm.js" }
|
|
24
24
|
},
|
|
25
25
|
"bin": {
|
|
26
|
-
"ink-editor": "
|
|
26
|
+
"ink-editor": "dst-stage2/ink-editor-cli.esm.js"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"patch-package": "8.0.1",
|
package/src/ink-editor-cli.ts
CHANGED
|
@@ -34,9 +34,9 @@ import { render } from "better-ink-ui"
|
|
|
34
34
|
|
|
35
35
|
/* internal dependencies */
|
|
36
36
|
import { Editor, editorModes as modes,
|
|
37
|
-
syntaxLanguage, syntaxLoad } from "./ink-editor"
|
|
37
|
+
syntaxLanguage, syntaxLoad } from "./ink-editor.js"
|
|
38
38
|
import type { Syntax, EditorModeFactory,
|
|
39
|
-
EditorHost, EditorResult } from "./ink-editor"
|
|
39
|
+
EditorHost, EditorResult } from "./ink-editor.js"
|
|
40
40
|
|
|
41
41
|
const h = React.createElement
|
|
42
42
|
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
/* internal dependencies */
|
|
29
29
|
import { lineStart, lineEnd, lineNo, lineAt, toCursor, toOffset,
|
|
30
30
|
isSpace, isBlank, wordEnd, wordBegin, paragraphEnd, paragraphBegin,
|
|
31
|
-
literalRegExp, goalColumn, rowMove, fillParagraph } from "./ink-editor-text"
|
|
32
|
-
import type { TextOps } from "./ink-editor-text"
|
|
31
|
+
literalRegExp, goalColumn, rowMove, fillParagraph } from "./ink-editor-text.js"
|
|
32
|
+
import type { TextOps } from "./ink-editor-text.js"
|
|
33
33
|
|
|
34
34
|
/* the outcome of a file operation: a message, whether it is an error,
|
|
35
35
|
and whether forcing it would overwrite an existing other file */
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
|
|
28
28
|
/* internal dependencies */
|
|
29
29
|
import { lineStart, lineEnd, lineNo, lineAt, toOffset, isWord, wordBegin, paragraphEnd, paragraphBegin, isBlank,
|
|
30
|
-
literalRegExp, findNext, findPrevious, goalColumn, rowMove, fillParagraph } from "./ink-editor-text"
|
|
31
|
-
import type { TextOps } from "./ink-editor-text"
|
|
30
|
+
literalRegExp, findNext, findPrevious, goalColumn, rowMove, fillParagraph } from "./ink-editor-text.js"
|
|
31
|
+
import type { TextOps } from "./ink-editor-text.js"
|
|
32
32
|
|
|
33
33
|
/* the outcome of a file operation: a message, whether it is an error,
|
|
34
34
|
and whether forcing it would overwrite an existing other file */
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
(dependency-free: it knows nothing about React, Ink, or any terminal) */
|
|
27
27
|
|
|
28
28
|
/* internal dependencies */
|
|
29
|
-
import { lineStart, lineEnd, lineNo, lineAt, toCursor, toOffset, isSpace, isIdent } from "./ink-editor-text"
|
|
30
|
-
import type { TextOps } from "./ink-editor-text"
|
|
29
|
+
import { lineStart, lineEnd, lineNo, lineAt, toCursor, toOffset, isSpace, isIdent } from "./ink-editor-text.js"
|
|
30
|
+
import type { TextOps } from "./ink-editor-text.js"
|
|
31
31
|
|
|
32
32
|
/* the editing modes */
|
|
33
33
|
export type Mode = "normal" | "insert" | "replace" | "visual" | "vline" | "cmdline"
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
|
|
28
28
|
/* internal dependencies */
|
|
29
29
|
import { lineStart, lineEnd, lineNo, lineAt, toOffset, isIdent, isSpace, wordEnd, wordBegin,
|
|
30
|
-
escapeRegExp, literalRegExp, findNext, findPrevious, goalColumn, rowMove } from "./ink-editor-text"
|
|
31
|
-
import type { TextOps } from "./ink-editor-text"
|
|
30
|
+
escapeRegExp, literalRegExp, findNext, findPrevious, goalColumn, rowMove } from "./ink-editor-text.js"
|
|
31
|
+
import type { TextOps } from "./ink-editor-text.js"
|
|
32
32
|
|
|
33
33
|
/* the outcome of a file operation: a message, whether it is an error,
|
|
34
34
|
and whether forcing it would overwrite an existing other file */
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
(dependency-free: it knows nothing about React, Ink, or any terminal) */
|
|
27
27
|
|
|
28
28
|
/* internal dependencies */
|
|
29
|
-
import { literalRegExp } from "./ink-editor-text"
|
|
30
|
-
import { Emacs } from "./ink-editor-engine-emacs"
|
|
31
|
-
import type { EmacsOutcome } from "./ink-editor-engine-emacs"
|
|
32
|
-
import type { EditorKey, EditorBinding, EditorMode, EditorResult, EditorStatus } from "./ink-editor-mode"
|
|
29
|
+
import { literalRegExp } from "./ink-editor-text.js"
|
|
30
|
+
import { Emacs } from "./ink-editor-engine-emacs.js"
|
|
31
|
+
import type { EmacsOutcome } from "./ink-editor-engine-emacs.js"
|
|
32
|
+
import type { EditorKey, EditorBinding, EditorMode, EditorResult, EditorStatus } from "./ink-editor-mode.js"
|
|
33
33
|
|
|
34
34
|
/* mapping of a key press onto Emacs key tokens like "x", "C-x", "M-f", or "<up>" */
|
|
35
35
|
const keyOf = (input: string, key: EditorKey): string[] => {
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
(dependency-free: it knows nothing about React, Ink, or any terminal) */
|
|
27
27
|
|
|
28
28
|
/* internal dependencies */
|
|
29
|
-
import { literalRegExp } from "./ink-editor-text"
|
|
30
|
-
import { Nano } from "./ink-editor-engine-nano"
|
|
31
|
-
import type { NanoOutcome } from "./ink-editor-engine-nano"
|
|
32
|
-
import type { EditorKey, EditorBinding, EditorMode, EditorResult, EditorStatus } from "./ink-editor-mode"
|
|
29
|
+
import { literalRegExp } from "./ink-editor-text.js"
|
|
30
|
+
import { Nano } from "./ink-editor-engine-nano.js"
|
|
31
|
+
import type { NanoOutcome } from "./ink-editor-engine-nano.js"
|
|
32
|
+
import type { EditorKey, EditorBinding, EditorMode, EditorResult, EditorStatus } from "./ink-editor-mode.js"
|
|
33
33
|
|
|
34
34
|
/* mapping of a key press onto Nano key tokens like "x", "^X", "M-U", or "Up" */
|
|
35
35
|
const keyOf = (input: string, key: EditorKey): string[] => {
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
(dependency-free: it knows nothing about React, Ink, or any terminal) */
|
|
27
27
|
|
|
28
28
|
/* internal dependencies */
|
|
29
|
-
import { lineAt, lineEnd } from "./ink-editor-text"
|
|
30
|
-
import { Vim, toRegExp } from "./ink-editor-engine-vim"
|
|
31
|
-
import type { Mode } from "./ink-editor-engine-vim"
|
|
32
|
-
import type { EditorKey, EditorBinding, EditorMode, EditorHost, EditorError, EditorResult, EditorStatus } from "./ink-editor-mode"
|
|
29
|
+
import { lineAt, lineEnd } from "./ink-editor-text.js"
|
|
30
|
+
import { Vim, toRegExp } from "./ink-editor-engine-vim.js"
|
|
31
|
+
import type { Mode } from "./ink-editor-engine-vim.js"
|
|
32
|
+
import type { EditorKey, EditorBinding, EditorMode, EditorHost, EditorError, EditorResult, EditorStatus } from "./ink-editor-mode.js"
|
|
33
33
|
|
|
34
34
|
/* mapping of a key press onto Vim key tokens like "x" or "<C-r>" */
|
|
35
35
|
const keyOf = (input: string, key: EditorKey): string[] => {
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
(dependency-free: it knows nothing about React, Ink, or any terminal) */
|
|
27
27
|
|
|
28
28
|
/* internal dependencies */
|
|
29
|
-
import { literalRegExp } from "./ink-editor-text"
|
|
30
|
-
import { Code } from "./ink-editor-engine-vscode"
|
|
31
|
-
import type { CodeOutcome } from "./ink-editor-engine-vscode"
|
|
32
|
-
import type { EditorKey, EditorBinding, EditorMode, EditorResult, EditorStatus } from "./ink-editor-mode"
|
|
29
|
+
import { literalRegExp } from "./ink-editor-text.js"
|
|
30
|
+
import { Code } from "./ink-editor-engine-vscode.js"
|
|
31
|
+
import type { CodeOutcome } from "./ink-editor-engine-vscode.js"
|
|
32
|
+
import type { EditorKey, EditorBinding, EditorMode, EditorResult, EditorStatus } from "./ink-editor-mode.js"
|
|
33
33
|
|
|
34
34
|
/* mapping of a key press onto VS Code key tokens like "x", "ctrl+s", or "shift+alt+down" */
|
|
35
35
|
const keyOf = (input: string, key: EditorKey): string[] => {
|
package/src/ink-editor-mode.ts
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
(dependency-free: it knows nothing about React, Ink, or any terminal) */
|
|
27
27
|
|
|
28
28
|
/* internal dependencies */
|
|
29
|
-
import type { TextOps } from "./ink-editor-text"
|
|
29
|
+
import type { TextOps } from "./ink-editor-text.js"
|
|
30
30
|
|
|
31
31
|
/* a key press (structurally a subset of the "Key" of Ink) */
|
|
32
32
|
export interface EditorKey {
|
package/src/ink-editor-widget.ts
CHANGED
|
@@ -30,9 +30,9 @@ import { Box, Text, useInput, usePaste, useStdout, useWindowSize } from "ink"
|
|
|
30
30
|
import { Textarea, TextareaUtils, osc52 } from "better-ink-ui"
|
|
31
31
|
|
|
32
32
|
/* internal dependencies */
|
|
33
|
-
import type { TextOps } from "./ink-editor-text"
|
|
34
|
-
import type { EditorMode, EditorModeFactory, EditorHost, EditorResult } from "./ink-editor-mode"
|
|
35
|
-
import type { Syntax } from "./ink-editor-syntax"
|
|
33
|
+
import type { TextOps } from "./ink-editor-text.js"
|
|
34
|
+
import type { EditorMode, EditorModeFactory, EditorHost, EditorResult } from "./ink-editor-mode.js"
|
|
35
|
+
import type { Syntax } from "./ink-editor-syntax.js"
|
|
36
36
|
|
|
37
37
|
const h = React.createElement
|
|
38
38
|
|
package/src/ink-editor.ts
CHANGED
|
@@ -23,19 +23,19 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
/* internal dependencies */
|
|
26
|
-
import type { EditorModeFactory } from "./ink-editor-mode"
|
|
27
|
-
import { VimMode } from "./ink-editor-mode-vim"
|
|
28
|
-
import { EmacsMode } from "./ink-editor-mode-emacs"
|
|
29
|
-
import { NanoMode } from "./ink-editor-mode-nano"
|
|
30
|
-
import { CodeMode } from "./ink-editor-mode-vscode"
|
|
26
|
+
import type { EditorModeFactory } from "./ink-editor-mode.js"
|
|
27
|
+
import { VimMode } from "./ink-editor-mode-vim.js"
|
|
28
|
+
import { EmacsMode } from "./ink-editor-mode-emacs.js"
|
|
29
|
+
import { NanoMode } from "./ink-editor-mode-nano.js"
|
|
30
|
+
import { CodeMode } from "./ink-editor-mode-vscode.js"
|
|
31
31
|
|
|
32
32
|
/* re-export the public API */
|
|
33
|
-
export type * from "./ink-editor-mode"
|
|
34
|
-
export type { TextOps } from "./ink-editor-text"
|
|
35
|
-
export type { Syntax, SyntaxRange, SyntaxStyle } from "./ink-editor-syntax"
|
|
36
|
-
export type { EditorProps } from "./ink-editor-widget"
|
|
37
|
-
export { Editor } from "./ink-editor-widget"
|
|
38
|
-
export { syntaxLanguage, syntaxLoad } from "./ink-editor-syntax"
|
|
33
|
+
export type * from "./ink-editor-mode.js"
|
|
34
|
+
export type { TextOps } from "./ink-editor-text.js"
|
|
35
|
+
export type { Syntax, SyntaxRange, SyntaxStyle } from "./ink-editor-syntax.js"
|
|
36
|
+
export type { EditorProps } from "./ink-editor-widget.js"
|
|
37
|
+
export { Editor } from "./ink-editor-widget.js"
|
|
38
|
+
export { syntaxLanguage, syntaxLoad } from "./ink-editor-syntax.js"
|
|
39
39
|
export { VimMode, EmacsMode, NanoMode, CodeMode }
|
|
40
40
|
|
|
41
41
|
/* the editing modes, by their name */
|