oasis-editor 0.0.305 → 0.0.306
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-BWGkN_E7.js +1 -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 +1 -0
- package/dist/defaultToolbar-BeFXUFvZ.js +1 -0
- package/dist/i18n/locales/en.d.ts +1 -0
- package/dist/i18n/locales/pt-BR.d.ts +1 -0
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +1 -1
- package/dist/plugins/internal/essentialsCapabilities.d.ts +1 -0
- package/dist/ui/app/createEditorCommandRuntime.d.ts +4 -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/components/QuickAccess/ChromeStrip.d.ts +2 -0
- package/dist/ui/components/QuickAccess/QuickAccessToolbar.d.ts +3 -1
- package/package.json +1 -1
- package/dist/OasisEditorApp-DfWYejRx.js +0 -1
- package/dist/defaultToolbar-BavHLbMy.js +0 -1
|
@@ -218,6 +218,7 @@ export interface EssentialsDocumentCapability {
|
|
|
218
218
|
openSymbolDialog: () => void;
|
|
219
219
|
openEquationDialog: () => void;
|
|
220
220
|
openCommandSearch: () => void;
|
|
221
|
+
repeatLastAction: () => void;
|
|
221
222
|
/** True when the active selection sits inside a table. */
|
|
222
223
|
hasActiveTable: () => boolean;
|
|
223
224
|
/** Opens the Table Properties dialog for the active table/cell. */
|
|
@@ -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: {
|
|
@@ -161,7 +164,7 @@ declare function createEditorCommandRuntimeImpl(deps: EditorCommandRuntimeDeps):
|
|
|
161
164
|
}) => boolean;
|
|
162
165
|
};
|
|
163
166
|
runtimeReady: import('solid-js').Accessor<boolean>;
|
|
164
|
-
runtimeEditor: import('solid-js').Accessor<
|
|
167
|
+
runtimeEditor: import('solid-js').Accessor<Editor>;
|
|
165
168
|
commandStateOf: (commandRef: import('../../index.js').CommandRef) => {
|
|
166
169
|
isEnabled: boolean;
|
|
167
170
|
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"];
|
|
@@ -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
|