oasis-editor 0.0.341 → 0.0.343
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/OasisEditorApp-B9Wryu1u.js +1 -0
- package/dist/app/controllers/EditorKeyboardDeps.d.ts +6 -1
- package/dist/app/controllers/handleDocumentTab.d.ts +19 -0
- package/dist/app/controllers/tableOpsRowColumnCommands.d.ts +1 -0
- package/dist/app/controllers/tableOpsSelectionNavigation.d.ts +9 -1
- package/dist/app/controllers/useEditorTableOperations.d.ts +2 -0
- package/dist/app/services/userPreferences.d.ts +3 -0
- package/dist/core/commands/paragraphTabIndent.d.ts +12 -0
- package/dist/{defaultToolbar-DPGP5xau.js → defaultToolbar-THqAGan9.js} +1 -1
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +1 -1
- package/dist/ui/app/createEditorInteractionRuntime.d.ts +2 -0
- package/dist/ui/app/createEditorKeyboardBinding.d.ts +2 -1
- package/package.json +1 -1
- package/dist/OasisEditorApp-c7A9DufX.js +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { EditorDocument, EditorPosition, EditorState } from '../../core/model.js';
|
|
1
|
+
import { EditorDocument, EditorPosition, EditorState, EditorTextStyle } from '../../core/model.js';
|
|
2
|
+
import { TableTabTarget } from './tableOpsSelectionNavigation.js';
|
|
2
3
|
import { BooleanStyleKey } from '../../ui/toolbarStyleState.js';
|
|
3
4
|
import { EditorTransactionPort, FocusInputPort, SelectedImageQueryPort } from './controllerPorts.js';
|
|
4
5
|
/**
|
|
@@ -13,6 +14,8 @@ import { EditorTransactionPort, FocusInputPort, SelectedImageQueryPort } from '.
|
|
|
13
14
|
export interface EditorKeyboardDeps extends EditorTransactionPort, FocusInputPort, SelectedImageQueryPort {
|
|
14
15
|
state: () => EditorState;
|
|
15
16
|
isReadOnly: () => boolean;
|
|
17
|
+
pendingCaretTextStyle?: () => EditorTextStyle | undefined;
|
|
18
|
+
autoTabIndentEnabled?: () => boolean;
|
|
16
19
|
commandsController: {
|
|
17
20
|
promptForImageAlt: () => void;
|
|
18
21
|
promptForLink: () => void;
|
|
@@ -35,6 +38,8 @@ export interface EditorKeyboardDeps extends EditorTransactionPort, FocusInputPor
|
|
|
35
38
|
moveVerticalSelection: (direction: -1 | 1, extend: boolean) => boolean;
|
|
36
39
|
moveVerticalByBlock: (direction: -1 | 1) => boolean;
|
|
37
40
|
resolveAdjacentTableCellPosition: (document: EditorDocument, paragraphId: string, delta: -1 | 1) => EditorPosition | null;
|
|
41
|
+
resolveTableTabTarget?: (document: EditorDocument, paragraphId: string, delta: -1 | 1) => TableTabTarget;
|
|
42
|
+
appendTableRowForTab?: (current: EditorState) => EditorState;
|
|
38
43
|
applySelectionPreservingStructure: (selection: EditorState["selection"]) => void;
|
|
39
44
|
toggleFindReplace: (open?: boolean) => void;
|
|
40
45
|
toggleReplace: (open?: boolean) => void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EditorState } from '../../core/model.js';
|
|
2
|
+
import { EditorKeyboardDeps } from './EditorKeyboardDeps.js';
|
|
3
|
+
export type TabAction = "passThrough" | "insertLiteralTab" | "navigateCell" | "changeParagraphIndent" | "changeFirstLineIndent";
|
|
4
|
+
export interface TabContext {
|
|
5
|
+
inTable: boolean;
|
|
6
|
+
shift: boolean;
|
|
7
|
+
ctrl: boolean;
|
|
8
|
+
meta: boolean;
|
|
9
|
+
alt: boolean;
|
|
10
|
+
wholeParagraphs: boolean;
|
|
11
|
+
atListStart: boolean;
|
|
12
|
+
autoIndentAtStart?: boolean;
|
|
13
|
+
reverseFirstLineIndent?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** Pure routing policy: table context and host modifiers take precedence. */
|
|
16
|
+
export declare function resolveTabAction(context: TabContext): TabAction;
|
|
17
|
+
export declare function handleDocumentTab(deps: EditorKeyboardDeps, state: EditorState, event: KeyboardEvent & {
|
|
18
|
+
currentTarget: HTMLTextAreaElement;
|
|
19
|
+
}): void;
|
|
@@ -5,6 +5,7 @@ interface TableRowColumnOperationsDeps {
|
|
|
5
5
|
export declare function createTableRowColumnOperations(deps: TableRowColumnOperationsDeps): ReturnType<typeof createTableRowColumnOperationsImpl>;
|
|
6
6
|
declare function createTableRowColumnOperationsImpl(deps: TableRowColumnOperationsDeps): {
|
|
7
7
|
insertSelectedTableRow: (current: EditorState, direction: -1 | 1) => EditorState;
|
|
8
|
+
appendTableRowForTab: (current: EditorState) => EditorState;
|
|
8
9
|
deleteSelectedTableRow: (current: EditorState) => EditorState;
|
|
9
10
|
insertSelectedTableColumn: (current: EditorState, direction: -1 | 1) => EditorState;
|
|
10
11
|
deleteSelectedTableColumn: (current: EditorState) => EditorState;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import { EditorDocument, EditorPosition, EditorParagraphNode, EditorTableCellNode, EditorTableNode, EditorTableRowNode } from '../../core/model.js';
|
|
1
|
+
import { EditorSelection, EditorDocument, EditorPosition, EditorParagraphNode, EditorTableCellNode, EditorTableNode, EditorTableRowNode } from '../../core/model.js';
|
|
2
2
|
export declare const getRowVisualWidth: (row: EditorTableRowNode) => number;
|
|
3
3
|
export declare const getTableVisualWidth: (table: EditorTableNode) => number;
|
|
4
4
|
export declare const findCellAtVisualColumn: (row: EditorTableRowNode, visualColumn: number) => EditorTableCellNode | null;
|
|
5
5
|
export declare const findFirstNavigableParagraphInTable: (table: EditorTableNode) => EditorParagraphNode | null;
|
|
6
|
+
export type TableTabTarget = {
|
|
7
|
+
kind: "outside" | "blocked" | "beforeFirst" | "afterLast";
|
|
8
|
+
} | {
|
|
9
|
+
kind: "adjacent";
|
|
10
|
+
selection: EditorSelection;
|
|
11
|
+
};
|
|
12
|
+
export declare const resolveTableTabTarget: (document: EditorDocument, paragraphId: string, delta: -1 | 1) => TableTabTarget;
|
|
13
|
+
/** Position-only projection retained for callers that do not select cell text. */
|
|
6
14
|
export declare const resolveAdjacentTableCellPosition: (document: EditorDocument, paragraphId: string, delta: -1 | 1) => EditorPosition | null;
|
|
@@ -29,6 +29,7 @@ declare function createEditorTableOperationsImpl(deps: EditorTableOperationsDeps
|
|
|
29
29
|
splitSelectedTableCell: (current: EditorState) => EditorState;
|
|
30
30
|
splitSelectedTable: (current: EditorState) => EditorState;
|
|
31
31
|
insertSelectedTableRow: (current: EditorState, direction: -1 | 1) => EditorState;
|
|
32
|
+
appendTableRowForTab: (current: EditorState) => EditorState;
|
|
32
33
|
deleteSelectedTableRow: (current: EditorState) => EditorState;
|
|
33
34
|
insertSelectedTableColumn: (current: EditorState, direction: -1 | 1) => EditorState;
|
|
34
35
|
deleteSelectedTableColumn: (current: EditorState) => EditorState;
|
|
@@ -38,6 +39,7 @@ declare function createEditorTableOperationsImpl(deps: EditorTableOperationsDeps
|
|
|
38
39
|
findFirstNavigableParagraphInTable: (table: import('../../core/model.js').EditorTableNode) => import('../../core/model.js').EditorParagraphNode | null;
|
|
39
40
|
updateBlocksInCurrentSection: (current: EditorState, blocks: import('../../core/model.js').EditorBlockNode[], zone?: import('../../core/model.js').EditorEditingZone) => EditorState;
|
|
40
41
|
resolveAdjacentTableCellPosition: (document: import('../../core/model.js').EditorDocument, paragraphId: string, delta: -1 | 1) => import('../../core/model.js').EditorPosition | null;
|
|
42
|
+
resolveTableTabTarget: (document: import('../../core/model.js').EditorDocument, paragraphId: string, delta: -1 | 1) => import('./tableOpsSelectionNavigation.js').TableTabTarget;
|
|
41
43
|
applyTableAwareParagraphEdit: (current: EditorState, edit: (tempState: EditorState) => EditorState) => EditorState;
|
|
42
44
|
withExpandedTableCellSelection: (current: EditorState) => EditorState;
|
|
43
45
|
applySelectionAwareTextCommand: (command: (current: EditorState) => EditorState) => void;
|
|
@@ -6,3 +6,6 @@ export declare function setWelcomeSeen(): void;
|
|
|
6
6
|
export declare function getPreciseFontPreference(): boolean;
|
|
7
7
|
/** @param on - Whether precise font rendering should be enabled. */
|
|
8
8
|
export declare function setPreciseFontPreference(on: boolean): void;
|
|
9
|
+
/** Word-style first-line indentation is enabled by default, independently of the document. */
|
|
10
|
+
export declare function getAutoTabIndentPreference(): boolean;
|
|
11
|
+
export declare function setAutoTabIndentPreference(enabled: boolean): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
export declare const DEFAULT_TAB_INTERVAL_PT = 36;
|
|
3
|
+
export declare function tabIntervalPx(state: EditorState): number;
|
|
4
|
+
/**
|
|
5
|
+
* Relative keyboard indentation for a whole/selected paragraph or list item.
|
|
6
|
+
* Paragraph indents are CSS px; document tab interval is pt. Each paragraph
|
|
7
|
+
* keeps its own effective starting indent, and list levels saturate at 0–8.
|
|
8
|
+
* Automatic first-line indentation is a separate policy.
|
|
9
|
+
*/
|
|
10
|
+
export declare function stepTabParagraphIndent(state: EditorState, direction: -1 | 1): EditorState;
|
|
11
|
+
/** AutoFormat at a nonempty paragraph's first line, or its inverse. */
|
|
12
|
+
export declare function stepFirstLineIndent(state: EditorState, direction: -1 | 1): EditorState;
|