oasis-editor 0.0.201 → 0.0.203

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.
@@ -29,10 +29,26 @@ export interface EssentialsFormattingCapability {
29
29
  hasTableOfContents: () => boolean;
30
30
  /** True when the current selection intersects revisions this command can resolve. */
31
31
  hasRevisionsInSelection: () => boolean;
32
+ hasNavigableRevisions: () => boolean;
33
+ hasNavigableComments: () => boolean;
34
+ navigateRevisionNext: () => boolean;
35
+ navigateRevisionPrevious: () => boolean;
36
+ navigateCommentNext: () => boolean;
37
+ navigateCommentPrevious: () => boolean;
38
+ hasSelectedComment: () => boolean;
39
+ isSelectedCommentResolved: () => boolean;
40
+ resolveSelectedComment: () => boolean;
41
+ reopenSelectedComment: () => boolean;
42
+ deleteSelectedComment: () => boolean;
32
43
  insertText: (text: string, fontFamily?: string | null) => boolean;
33
44
  insertEquation: (expression: EditorMathExpression) => boolean;
34
45
  updateEquation: (runId: string, expression: EditorMathExpression) => boolean;
35
46
  pastePlainText: () => boolean;
47
+ formatPainterOnce: () => boolean;
48
+ formatPainterContinuous: () => boolean;
49
+ cancelFormatPainter: () => boolean;
50
+ formatPainterMode: () => "once" | "continuous" | null;
51
+ canCaptureFormatPainter: () => boolean;
36
52
  bold: () => boolean;
37
53
  italic: () => boolean;
38
54
  underline: () => boolean;
@@ -104,6 +104,10 @@ export interface OasisEditorEditorInputHandlers {
104
104
  onKeyDown: (event: KeyboardEvent & {
105
105
  currentTarget: HTMLTextAreaElement;
106
106
  }) => void;
107
+ /** Applied after keyboard selection is finalized, not while Shift is held. */
108
+ onKeyUp?: (event: KeyboardEvent & {
109
+ currentTarget: HTMLTextAreaElement;
110
+ }) => void;
107
111
  onPaste: (event: ClipboardEvent & {
108
112
  currentTarget: HTMLTextAreaElement;
109
113
  }) => void;
@@ -72,6 +72,7 @@ export interface EditorViewInputInput {
72
72
  handleCut: OasisEditorEditorInputHandlers["onCut"];
73
73
  handlePaste: OasisEditorEditorInputHandlers["onPaste"];
74
74
  handleKeyDown: OasisEditorEditorInputHandlers["onKeyDown"];
75
+ handleKeyUp?: OasisEditorEditorInputHandlers["onKeyUp"];
75
76
  }
76
77
  /**
77
78
  * Inputs needed to assemble the editor's view-prop bundles, grouped by the
@@ -0,0 +1,25 @@
1
+ import { EditorState } from '../../core/model.js';
2
+ export type FormatPainterMode = "once" | "continuous" | null;
3
+ export interface EditorFormatPainterDeps {
4
+ state: () => EditorState;
5
+ isReadOnly: () => boolean;
6
+ applyTransactionalState: (transform: (state: EditorState) => EditorState) => void;
7
+ applyTableAwareParagraphEdit: (state: EditorState, transform: (state: EditorState) => EditorState) => EditorState;
8
+ clearPreferredColumn: () => void;
9
+ resetTransactionGrouping: () => void;
10
+ focusInput: () => void;
11
+ }
12
+ /**
13
+ * Instance-local UI state. Source formatting is captured when armed.
14
+ * Pointer selection is committed only after pointerup (never during drag),
15
+ * and keyboard selection only on keyup.
16
+ */
17
+ export declare function createEditorFormatPainter(deps: EditorFormatPainterDeps): {
18
+ mode: import('solid-js').Accessor<FormatPainterMode>;
19
+ canCapture: () => boolean;
20
+ armOnce: () => boolean;
21
+ armContinuous: () => boolean;
22
+ cancel: () => void;
23
+ applyToSelection: (origin: "pointer" | "keyboard") => boolean;
24
+ };
25
+ export type EditorFormatPainter = ReturnType<typeof createEditorFormatPainter>;
@@ -146,6 +146,14 @@ declare function createEditorInteractionRuntimeImpl(deps: EditorInteractionRunti
146
146
  applyToolbarValueStyleCommand: <K extends "link" | "styleId" | "underlineStyle" | "textEffect" | "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language">(key: K, value: import('../../core/model.js').EditorTextStyle[K] | null) => void;
147
147
  applyToolbarBooleanStyleCommand: (key: import('../toolbarStyleState.js').BooleanStyleKey) => void;
148
148
  };
149
+ formatPainter: {
150
+ mode: import('solid-js').Accessor<import('./createEditorFormatPainter.js').FormatPainterMode>;
151
+ canCapture: () => boolean;
152
+ armOnce: () => boolean;
153
+ armContinuous: () => boolean;
154
+ cancel: () => void;
155
+ applyToSelection: (origin: "pointer" | "keyboard") => boolean;
156
+ };
149
157
  onEditorPointerDown: (event: PointerEvent) => void;
150
158
  tableResize: import('../../app/controllers/useEditorTableResize.js').TableResizeOps;
151
159
  tableCornerResize: import('../../app/controllers/useEditorTableCornerResize.js').TableCornerResizeOps;
@@ -4,6 +4,7 @@ import { SelectedImageRun } from '../../../core/commands/image.js';
4
4
  import { createEditorCommandsController } from '../../../app/controllers/EditorCommandsController.js';
5
5
  import { createEditorHistoryActions } from '../../../app/controllers/useEditorHistoryActions.js';
6
6
  import { createEditorStyleController } from '../../../app/controllers/useEditorStyle.js';
7
+ import { EditorFormatPainter } from '../createEditorFormatPainter.js';
7
8
  import { createEditorTableOperations } from '../../../app/controllers/useEditorTableOperations.js';
8
9
  import { EssentialsDesignCapability } from '../../../plugins/internal/essentialsCapabilities.js';
9
10
  export interface CreateEditorEssentialsPluginOptions {
@@ -22,6 +23,7 @@ export interface CreateEditorEssentialsPluginOptions {
22
23
  };
23
24
  historyActions: ReturnType<typeof createEditorHistoryActions>;
24
25
  styleController: ReturnType<typeof createEditorStyleController>;
26
+ formatPainter: EditorFormatPainter;
25
27
  tableOps: ReturnType<typeof createEditorTableOperations>;
26
28
  docIO: {
27
29
  handleExportDocx: () => Promise<Blob>;
@@ -12,6 +12,7 @@ import { createEditorRevisionController } from '../../app/controllers/useEditorR
12
12
  import { createEditorTableOperations } from '../../app/controllers/useEditorTableOperations.js';
13
13
  import { createEditorImageOperations } from '../../app/controllers/useEditorImageOperations.js';
14
14
  import { createEditorStyleController } from '../../app/controllers/useEditorStyle.js';
15
+ import { EditorFormatPainter } from './createEditorFormatPainter.js';
15
16
  type TableDragParams = Parameters<typeof createEditorTableDrag>[0];
16
17
  type TextDragParams = Parameters<typeof createEditorTextDrag>[0];
17
18
  type NavigationParams = Parameters<typeof createEditorNavigation>[0];
@@ -47,6 +48,7 @@ export interface EditorInteractionWiringContext {
47
48
  tableOps: ReturnType<typeof createEditorTableOperations>;
48
49
  imageOps: ReturnType<typeof createEditorImageOperations>;
49
50
  styleController: ReturnType<typeof createEditorStyleController>;
51
+ formatPainter: EditorFormatPainter;
50
52
  getForcePlainTextPaste: () => boolean;
51
53
  setForcePlainTextPaste: (value: boolean) => void;
52
54
  insertImageFromFile: ClipboardParams["insertImageFromFile"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oasis-editor",
3
- "version": "0.0.201",
3
+ "version": "0.0.203",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {