oasis-editor 0.0.305 → 0.0.307
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-DXN7f-Ev.js +1 -0
- package/dist/app/controllers/EditorCommandsController.d.ts +2 -0
- package/dist/core/commands/CommandRegistry.d.ts +6 -0
- package/dist/core/commands/builtinCommands.d.ts +1 -1
- package/dist/core/commands/publicCommandTypes.d.ts +4 -0
- package/dist/core/commands/reviewMarkup.d.ts +83 -0
- package/dist/core/model/editorState.d.ts +14 -0
- package/dist/defaultToolbar-DV-_VUzb.js +1 -0
- package/dist/i18n/locales/en.d.ts +6 -0
- package/dist/i18n/locales/pt-BR.d.ts +6 -0
- package/dist/oasis-editor.css +1 -1
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +1 -1
- package/dist/plugins/internal/essentialsCapabilities.d.ts +6 -0
- package/dist/ui/app/createAppCommandsController.d.ts +2 -0
- package/dist/ui/app/createEditorCommandRuntime.d.ts +5 -1
- package/dist/ui/app/createRepeatTracking.d.ts +19 -0
- package/dist/ui/app/createRuntimeCommandHost.d.ts +2 -0
- package/dist/ui/app/essentials/types.d.ts +2 -0
- package/dist/ui/app/useEditorRuntimeBootstrap.d.ts +2 -0
- package/dist/ui/canvas/CanvasRevisionGeometry.d.ts +4 -2
- package/dist/ui/components/QuickAccess/ChromeStrip.d.ts +2 -0
- package/dist/ui/components/QuickAccess/QuickAccessToolbar.d.ts +3 -1
- package/dist/ui/components/Toolbar/ShowMarkupButton.d.ts +12 -0
- package/package.json +1 -1
- package/dist/OasisEditorApp-DfWYejRx.js +0 -1
- package/dist/defaultToolbar-BavHLbMy.js +0 -1
|
@@ -6,6 +6,7 @@ import { ImageBorderPatch } from '../../core/commands/image.js';
|
|
|
6
6
|
import { TextCaseMode } from '../../core/commands/text.js';
|
|
7
7
|
import { SpecialCharacterKind } from '../../core/commands/specialChar.js';
|
|
8
8
|
import { ReplaceAllPayload } from '../../core/commands/publicCommandTypes.js';
|
|
9
|
+
import { MarkupOptionsSnapshot, ShowMarkupPayload } from '../../core/commands/reviewMarkup.js';
|
|
9
10
|
import { ToolbarStyleState } from '../../ui/toolbarStyleState.js';
|
|
10
11
|
import { OasisBuiltinCommand } from '../../core/commands/builtinCommands.js';
|
|
11
12
|
import { TableBorderPreset, TableCellAlignment, TableCellAlignmentState, TableCellMargins, TableRowHeight } from '../../core/commands/table.js';
|
|
@@ -124,6 +125,10 @@ export interface EssentialsFormattingCapability {
|
|
|
124
125
|
areRevisionsPanelVisible: () => boolean;
|
|
125
126
|
reviewDisplayMode: () => string;
|
|
126
127
|
setReviewDisplayMode: (mode: string) => boolean;
|
|
128
|
+
/** Reactive Show Markup menu snapshot (view flags + reviewer list). */
|
|
129
|
+
showMarkupOptions: () => MarkupOptionsSnapshot;
|
|
130
|
+
/** Apply one Show Markup category/reviewer action. */
|
|
131
|
+
applyShowMarkup: (payload: ShowMarkupPayload) => boolean;
|
|
127
132
|
/** Reactive document view/state flags for Ribbon toggle feedback. */
|
|
128
133
|
isTrackChangesEnabled: () => boolean;
|
|
129
134
|
areRevisionMarkupVisible: () => boolean;
|
|
@@ -218,6 +223,7 @@ export interface EssentialsDocumentCapability {
|
|
|
218
223
|
openSymbolDialog: () => void;
|
|
219
224
|
openEquationDialog: () => void;
|
|
220
225
|
openCommandSearch: () => void;
|
|
226
|
+
repeatLastAction: () => void;
|
|
221
227
|
/** True when the active selection sits inside a table. */
|
|
222
228
|
hasActiveTable: () => boolean;
|
|
223
229
|
/** Opens the Table Properties dialog for the active table/cell. */
|
|
@@ -69,6 +69,7 @@ declare function createAppCommandsControllerImpl(deps: AppCommandsControllerDeps
|
|
|
69
69
|
applyToggleTrackChangesCommand: () => void;
|
|
70
70
|
applyToggleRevisionMarkupCommand: () => void;
|
|
71
71
|
applySetReviewDisplayModeCommand: (mode: import('../../core/model.js').EditorState["reviewDisplayMode"]) => void;
|
|
72
|
+
applyShowMarkupCommand: (payload: import('../../core/commands/reviewMarkup').ShowMarkupPayload) => void;
|
|
72
73
|
applyToggleShowMarginsCommand: () => void;
|
|
73
74
|
applyToggleShowParagraphMarksCommand: () => void;
|
|
74
75
|
applyAcceptRevisionsCommand: () => void;
|
|
@@ -125,6 +126,7 @@ declare function createAppCommandsControllerImpl(deps: AppCommandsControllerDeps
|
|
|
125
126
|
applyToggleTrackChangesCommand: () => void;
|
|
126
127
|
applyToggleRevisionMarkupCommand: () => void;
|
|
127
128
|
applySetReviewDisplayModeCommand: (mode: import('../../core/model.js').EditorState["reviewDisplayMode"]) => void;
|
|
129
|
+
applyShowMarkupCommand: (payload: import('../../core/commands/reviewMarkup').ShowMarkupPayload) => void;
|
|
128
130
|
applyToggleShowMarginsCommand: () => void;
|
|
129
131
|
applyToggleShowParagraphMarksCommand: () => void;
|
|
130
132
|
applyAcceptRevisionsCommand: () => void;
|
|
@@ -4,6 +4,7 @@ import { EditorState } from '../../core/model.js';
|
|
|
4
4
|
import { EditorLogger } from '../../utils/logger.js';
|
|
5
5
|
import { OasisEditorClientController, OasisEditorUiState } from '../../app/client/OasisEditorClient.js';
|
|
6
6
|
import { TranslateFn } from '../../i18n/index.js';
|
|
7
|
+
import { Editor } from '../../core/Editor.js';
|
|
7
8
|
import { createEditorDocumentRuntime } from './createEditorDocumentRuntime.js';
|
|
8
9
|
import { createEditorInteractionRuntime } from './createEditorInteractionRuntime.js';
|
|
9
10
|
import { EditorCommentComposer } from './createEditorCommentComposer.js';
|
|
@@ -86,6 +87,8 @@ export interface EditorCommandRuntimeDeps {
|
|
|
86
87
|
setIsOpen: (open: boolean) => void;
|
|
87
88
|
};
|
|
88
89
|
setCommandSearchOpen: (open: boolean) => void;
|
|
90
|
+
/** Extra tap invoked after every command bus execution (QAT refresh). */
|
|
91
|
+
onExecutedTap?: () => void;
|
|
89
92
|
getUiState: () => OasisEditorUiState;
|
|
90
93
|
updateUiState: (patch: OasisEditorUiState) => OasisEditorUiState;
|
|
91
94
|
zoom: {
|
|
@@ -125,6 +128,7 @@ declare function createEditorCommandRuntimeImpl(deps: EditorCommandRuntimeDeps):
|
|
|
125
128
|
applyToggleTrackChangesCommand: () => void;
|
|
126
129
|
applyToggleRevisionMarkupCommand: () => void;
|
|
127
130
|
applySetReviewDisplayModeCommand: (mode: import('../../core/model.js').EditorState["reviewDisplayMode"]) => void;
|
|
131
|
+
applyShowMarkupCommand: (payload: import('../../core/commands/reviewMarkup.js').ShowMarkupPayload) => void;
|
|
128
132
|
applyToggleShowMarginsCommand: () => void;
|
|
129
133
|
applyToggleShowParagraphMarksCommand: () => void;
|
|
130
134
|
applyAcceptRevisionsCommand: () => void;
|
|
@@ -161,7 +165,7 @@ declare function createEditorCommandRuntimeImpl(deps: EditorCommandRuntimeDeps):
|
|
|
161
165
|
}) => boolean;
|
|
162
166
|
};
|
|
163
167
|
runtimeReady: import('solid-js').Accessor<boolean>;
|
|
164
|
-
runtimeEditor: import('solid-js').Accessor<
|
|
168
|
+
runtimeEditor: import('solid-js').Accessor<Editor>;
|
|
165
169
|
commandStateOf: (commandRef: import('../../index.js').CommandRef) => {
|
|
166
170
|
isEnabled: boolean;
|
|
167
171
|
isActive: boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repeat-last-command tracking (Word's F4 / Quick Access Repeat). Records the
|
|
3
|
+
* last command executed through the command bus, excluding pure navigation,
|
|
4
|
+
* chrome and history commands, and re-executes it — payload included — on
|
|
5
|
+
* demand. Kept framework-free of command-registry internals: the registry
|
|
6
|
+
* only reports executions via its `onExecuted` hook.
|
|
7
|
+
*/
|
|
8
|
+
export interface RepeatTracking {
|
|
9
|
+
/** Last recordable command, or null when nothing repeatable happened. */
|
|
10
|
+
lastCommand: () => string | null;
|
|
11
|
+
/** Record a bus execution; called from the registry's onExecuted hook. */
|
|
12
|
+
record: (command: string, payload?: unknown) => void;
|
|
13
|
+
/** Whether the last command can be re-executed right now. */
|
|
14
|
+
canExecute: () => boolean;
|
|
15
|
+
/** Re-execute the last command (no-op when there is nothing to repeat). */
|
|
16
|
+
execute: () => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function isRepeatableCommand(command: string): boolean;
|
|
19
|
+
export declare function createRepeatTracking(executeCommand: (command: string, payload?: unknown) => unknown, canExecuteCommand: (command: string, payload?: unknown) => boolean): RepeatTracking;
|
|
@@ -7,6 +7,8 @@ import { ToolbarHost } from '../components/Toolbar/state/createToolbarApi.js';
|
|
|
7
7
|
import { EditorLogger } from '../../utils/logger.js';
|
|
8
8
|
interface CreateRuntimeCommandHostOptions {
|
|
9
9
|
initialDocument: EditorDocument;
|
|
10
|
+
/** Optional tap: called after each command executes through the bus. */
|
|
11
|
+
onExecuted?: (command: string, payload?: unknown) => void;
|
|
10
12
|
runtimePlugins: OasisPlugin[];
|
|
11
13
|
focusEditor: () => void;
|
|
12
14
|
logger: EditorLogger;
|
|
@@ -39,6 +39,8 @@ export interface CreateEditorEssentialsPluginOptions {
|
|
|
39
39
|
openSymbolDialog: () => void;
|
|
40
40
|
openEquationDialog: () => void;
|
|
41
41
|
openCommandSearch: () => void;
|
|
42
|
+
repeatLastAction: () => void;
|
|
43
|
+
canRepeatLastAction: () => boolean;
|
|
42
44
|
/** Opens the Table Properties dialog for the active table/cell. */
|
|
43
45
|
openTablePropertiesDialog: (activeTab?: "table" | "cell") => void;
|
|
44
46
|
/** Opens the Font dialog. */
|
|
@@ -12,6 +12,8 @@ type RuntimeCommandHost = ReturnType<typeof createRuntimeCommandHost>;
|
|
|
12
12
|
* root only feeds the already-built controllers in and consumes the host facade.
|
|
13
13
|
*/
|
|
14
14
|
export interface EditorRuntimeBootstrapContext {
|
|
15
|
+
/** Optional bus tap forwarded to the runtime command host. */
|
|
16
|
+
onExecuted?: (command: string, payload?: unknown) => void;
|
|
15
17
|
essentials: EssentialsPluginDeps;
|
|
16
18
|
externalPlugins: RuntimePluginsConfig["externalPlugins"];
|
|
17
19
|
t: RuntimePluginsConfig["t"];
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { EditorState } from '../../core/model.js';
|
|
1
2
|
import { RevisionMarkupBox } from '../editorUiTypes.js';
|
|
2
3
|
import { CanvasLayoutSnapshot } from './CanvasLayoutSnapshot.js';
|
|
3
4
|
/**
|
|
4
5
|
* Project insert/delete revision ranges into highlight rectangles, reusing the
|
|
5
6
|
* canvas layout snapshot's per-line slot positions (the same machinery the
|
|
6
7
|
* comment highlights and the selection geometry use). One box per covered line;
|
|
7
|
-
* property/formatting and merge/grid revisions are not painted.
|
|
8
|
+
* property/formatting and merge/grid revisions are not painted. Show Markup
|
|
9
|
+
* filters come from the live editor state, not from the document.
|
|
8
10
|
*/
|
|
9
|
-
export declare function computeRevisionMarkup(snapshot: CanvasLayoutSnapshot): RevisionMarkupBox[];
|
|
11
|
+
export declare function computeRevisionMarkup(snapshot: CanvasLayoutSnapshot, state: EditorState): RevisionMarkupBox[];
|
|
10
12
|
export type { RevisionMarkupBox };
|
|
@@ -6,6 +6,8 @@ export interface ChromeStripProps {
|
|
|
6
6
|
onToggle: (command: string) => void;
|
|
7
7
|
onExecute: (command: string) => void;
|
|
8
8
|
canExecute: (command: string) => boolean;
|
|
9
|
+
/** Bumps on every command bus execution; forces the strip to re-read state. */
|
|
10
|
+
tick: () => number;
|
|
9
11
|
onOpenCommandSearch: () => void;
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
@@ -5,8 +5,10 @@ export interface QuickAccessToolbarProps {
|
|
|
5
5
|
visible: Accessor<string[]>;
|
|
6
6
|
onToggle: (command: string) => void;
|
|
7
7
|
onExecute: (command: string) => void;
|
|
8
|
-
/**
|
|
8
|
+
/** Enabled check; re-evaluated on every bus tap and editor commit. */
|
|
9
9
|
canExecute: (command: string) => boolean;
|
|
10
|
+
/** Bumps after every command bus execution. */
|
|
11
|
+
tick: () => number;
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
12
14
|
* Word-style Quick Access Toolbar: a slim, always-available strip above the
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { ToolbarActionApi } from './schema/items.js';
|
|
3
|
+
export interface ShowMarkupButtonProps {
|
|
4
|
+
api: ToolbarActionApi;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Show Markup gallery (Review > Tracking). Word filters the *display* of
|
|
8
|
+
* tracked changes per category and per reviewer without editing the revision
|
|
9
|
+
* data; the menu reads a reactive snapshot from the command bus and dispatches
|
|
10
|
+
* one `applyShowMarkup` action per checkbox.
|
|
11
|
+
*/
|
|
12
|
+
export declare function ShowMarkupButton(props: ShowMarkupButtonProps): JSX.Element;
|