oasis-editor 0.0.304 → 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/app/controllers/EditorKeyboardDeps.d.ts +1 -0
- package/dist/core/commands/CommandRegistry.d.ts +6 -0
- package/dist/core/commands/builtinCommands.d.ts +1 -1
- package/dist/core/commands/commandSearch.d.ts +35 -0
- package/dist/core/commands/publicCommandTypes.d.ts +2 -0
- package/dist/defaultToolbar-BeFXUFvZ.js +1 -0
- package/dist/i18n/locales/en.d.ts +9 -0
- package/dist/i18n/locales/pt-BR.d.ts +9 -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 +2 -0
- package/dist/ui/app/commandSearchEntries.d.ts +10 -0
- package/dist/ui/app/createEditorCommandRuntime.d.ts +9 -1
- package/dist/ui/app/createEditorKeyboardBinding.d.ts +4 -0
- package/dist/ui/app/createQuickAccess.d.ts +17 -0
- 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 +3 -0
- package/dist/ui/app/quickAccessCatalog.d.ts +9 -0
- package/dist/ui/app/useEditorRuntimeBootstrap.d.ts +2 -0
- package/dist/ui/components/CommandSearch/CommandSearchDialog.d.ts +17 -0
- package/dist/ui/components/QuickAccess/ChromeStrip.d.ts +18 -0
- package/dist/ui/components/QuickAccess/QuickAccessToolbar.d.ts +18 -0
- package/package.json +1 -1
- package/dist/OasisEditorApp-DdMfyjk2.js +0 -1
- package/dist/defaultToolbar-xm7peA2q.js +0 -1
|
@@ -217,6 +217,8 @@ export interface EssentialsDocumentCapability {
|
|
|
217
217
|
insertShape: (preset: string) => void;
|
|
218
218
|
openSymbolDialog: () => void;
|
|
219
219
|
openEquationDialog: () => void;
|
|
220
|
+
openCommandSearch: () => void;
|
|
221
|
+
repeatLastAction: () => void;
|
|
220
222
|
/** True when the active selection sits inside a table. */
|
|
221
223
|
hasActiveTable: () => boolean;
|
|
222
224
|
/** Opens the Table Properties dialog for the active table/cell. */
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ToolbarItem } from '../components/Toolbar/schema/items.js';
|
|
2
|
+
import { MenuItem } from '../components/Menubar/menuRegistry.js';
|
|
3
|
+
import { TranslateFn } from '../../i18n/index.js';
|
|
4
|
+
import { CommandSearchEntry } from '../../core/commands/commandSearch.js';
|
|
5
|
+
/**
|
|
6
|
+
* Derive the searchable command surface from the same registries the UI
|
|
7
|
+
* renders from, so palette results can never drift from what the app shows.
|
|
8
|
+
* Ribbon wins over the menubar when both describe the same command.
|
|
9
|
+
*/
|
|
10
|
+
export declare function buildCommandSearchEntries(toolbarItems: ToolbarItem[], menuItems: MenuItem[], t: TranslateFn): CommandSearchEntry[];
|
|
@@ -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';
|
|
@@ -81,6 +82,13 @@ export interface EditorCommandRuntimeDeps {
|
|
|
81
82
|
isOutlineVisible: () => boolean;
|
|
82
83
|
toggleRevisionsPanel: () => void;
|
|
83
84
|
revisionsPanelVisible: () => boolean;
|
|
85
|
+
commandSearch: {
|
|
86
|
+
isOpen: () => boolean;
|
|
87
|
+
setIsOpen: (open: boolean) => void;
|
|
88
|
+
};
|
|
89
|
+
setCommandSearchOpen: (open: boolean) => void;
|
|
90
|
+
/** Extra tap invoked after every command bus execution (QAT refresh). */
|
|
91
|
+
onExecutedTap?: () => void;
|
|
84
92
|
getUiState: () => OasisEditorUiState;
|
|
85
93
|
updateUiState: (patch: OasisEditorUiState) => OasisEditorUiState;
|
|
86
94
|
zoom: {
|
|
@@ -156,7 +164,7 @@ declare function createEditorCommandRuntimeImpl(deps: EditorCommandRuntimeDeps):
|
|
|
156
164
|
}) => boolean;
|
|
157
165
|
};
|
|
158
166
|
runtimeReady: import('solid-js').Accessor<boolean>;
|
|
159
|
-
runtimeEditor: import('solid-js').Accessor<
|
|
167
|
+
runtimeEditor: import('solid-js').Accessor<Editor>;
|
|
160
168
|
commandStateOf: (commandRef: import('../../index.js').CommandRef) => {
|
|
161
169
|
isEnabled: boolean;
|
|
162
170
|
isActive: boolean;
|
|
@@ -33,6 +33,10 @@ export interface EditorKeyboardBindingDeps {
|
|
|
33
33
|
isOpen: () => boolean;
|
|
34
34
|
setIsOpen: (open: boolean) => void;
|
|
35
35
|
};
|
|
36
|
+
commandSearch: {
|
|
37
|
+
isOpen: () => boolean;
|
|
38
|
+
setIsOpen: (open: boolean) => void;
|
|
39
|
+
};
|
|
36
40
|
runtimeEditor: RuntimeEditorAccessor;
|
|
37
41
|
}
|
|
38
42
|
/**
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface QuickAccessCatalogEntry {
|
|
2
|
+
/** Built-in command name dispatched through the command bus. */
|
|
3
|
+
command: string;
|
|
4
|
+
/** Lucide icon name used on the strip and in the customize menu. */
|
|
5
|
+
icon: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Quick Access Toolbar state: which of the curated commands is visible on the
|
|
9
|
+
* strip. Persisted to localStorage (`oasis-quick-access-v1`) so the layout
|
|
10
|
+
* survives reloads; unknown commands from a newer version are dropped.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createQuickAccess(catalog: readonly QuickAccessCatalogEntry[]): {
|
|
13
|
+
catalog: readonly QuickAccessCatalogEntry[];
|
|
14
|
+
visible: () => string[];
|
|
15
|
+
isShown: (command: string) => boolean;
|
|
16
|
+
toggle: (command: string) => void;
|
|
17
|
+
};
|
|
@@ -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;
|
|
@@ -38,6 +38,9 @@ export interface CreateEditorEssentialsPluginOptions {
|
|
|
38
38
|
saveDocument: () => void;
|
|
39
39
|
openSymbolDialog: () => void;
|
|
40
40
|
openEquationDialog: () => void;
|
|
41
|
+
openCommandSearch: () => void;
|
|
42
|
+
repeatLastAction: () => void;
|
|
43
|
+
canRepeatLastAction: () => boolean;
|
|
41
44
|
/** Opens the Table Properties dialog for the active table/cell. */
|
|
42
45
|
openTablePropertiesDialog: (activeTab?: "table" | "cell") => void;
|
|
43
46
|
/** Opens the Font dialog. */
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { QuickAccessCatalogEntry } from './createQuickAccess.js';
|
|
2
|
+
import { TranslationKey } from '../../i18n/index.js';
|
|
3
|
+
export interface QuickAccessCatalogItem extends QuickAccessCatalogEntry {
|
|
4
|
+
labelKey: TranslationKey;
|
|
5
|
+
/** Optional shortcut hint shown in the customize menu. */
|
|
6
|
+
shortcut?: string;
|
|
7
|
+
}
|
|
8
|
+
/** Curated command surface for the strip; translation handled at render. */
|
|
9
|
+
export declare const QUICK_ACCESS_CATALOG: readonly QuickAccessCatalogItem[];
|
|
@@ -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"];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { CommandSearchEntry, CommandSearchHit } from '../../../core/commands/commandSearch.js';
|
|
3
|
+
export interface CommandSearchDialogProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
/** Localized entries built from the live registries at open time. */
|
|
6
|
+
entries: CommandSearchEntry[];
|
|
7
|
+
/** Enabled check evaluated against the live command bus. */
|
|
8
|
+
isEnabled: (command: string, payload?: unknown) => boolean;
|
|
9
|
+
onExecute: (entry: CommandSearchHit) => void;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Command search ("Tell Me"): a small top-anchored palette over every
|
|
14
|
+
* executable surface (Ribbon + menubar), fuzzy-matched as you type. Enter
|
|
15
|
+
* runs the active row; disabled rows are announced but cannot be run.
|
|
16
|
+
*/
|
|
17
|
+
export declare function CommandSearchDialog(props: CommandSearchDialogProps): JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Accessor, JSX } from 'solid-js';
|
|
2
|
+
import { QuickAccessCatalogItem } from '../../app/quickAccessCatalog.js';
|
|
3
|
+
export interface ChromeStripProps {
|
|
4
|
+
catalog: readonly QuickAccessCatalogItem[];
|
|
5
|
+
visible: Accessor<string[]>;
|
|
6
|
+
onToggle: (command: string) => void;
|
|
7
|
+
onExecute: (command: string) => void;
|
|
8
|
+
canExecute: (command: string) => boolean;
|
|
9
|
+
/** Bumps on every command bus execution; forces the strip to re-read state. */
|
|
10
|
+
tick: () => number;
|
|
11
|
+
onOpenCommandSearch: () => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The slim chrome strip above the ribbon: Quick Access Toolbar on the left,
|
|
15
|
+
* the Tell Me command-search launcher on the right. Rendered for both the
|
|
16
|
+
* bare and the composed document shell.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ChromeStrip(props: ChromeStripProps): JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Accessor, JSX } from 'solid-js';
|
|
2
|
+
import { QuickAccessCatalogItem } from '../../app/quickAccessCatalog.js';
|
|
3
|
+
export interface QuickAccessToolbarProps {
|
|
4
|
+
catalog: readonly QuickAccessCatalogItem[];
|
|
5
|
+
visible: Accessor<string[]>;
|
|
6
|
+
onToggle: (command: string) => void;
|
|
7
|
+
onExecute: (command: string) => void;
|
|
8
|
+
/** Enabled check; re-evaluated on every bus tap and editor commit. */
|
|
9
|
+
canExecute: (command: string) => boolean;
|
|
10
|
+
/** Bumps after every command bus execution. */
|
|
11
|
+
tick: () => number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Word-style Quick Access Toolbar: a slim, always-available strip above the
|
|
15
|
+
* ribbon. Visible commands are user-picked and persisted in localStorage via
|
|
16
|
+
* `createQuickAccess`; the trailing chevron opens the customize menu.
|
|
17
|
+
*/
|
|
18
|
+
export declare function QuickAccessToolbar(props: QuickAccessToolbarProps): JSX.Element;
|