@mudlet/mudlet-web 0.3.0
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/LICENSE +338 -0
- package/README.md +150 -0
- package/dist-lib/App.d.ts +1 -0
- package/dist-lib/MudletWebApp.d.ts +11 -0
- package/dist-lib/ProfileSession.d.ts +15 -0
- package/dist-lib/assets/mapParser.worker-t-3rd1zR.js +9 -0
- package/dist-lib/branding.d.ts +213 -0
- package/dist-lib/core/EventBus.d.ts +29 -0
- package/dist-lib/db/sqliteClient.d.ts +25 -0
- package/dist-lib/hooks/useEngines.d.ts +12 -0
- package/dist-lib/hooks/useMudSession.d.ts +10 -0
- package/dist-lib/hooks/useOutput.d.ts +17 -0
- package/dist-lib/hooks/useViewportMode.d.ts +14 -0
- package/dist-lib/import/applyMudletProfile.d.ts +57 -0
- package/dist-lib/import/collectProfileExport.d.ts +16 -0
- package/dist-lib/import/defaultPackages.d.ts +81 -0
- package/dist-lib/import/defaults/mudlet-mapper.xml +13023 -0
- package/dist-lib/import/defaults/run-lua-code.mpackage +0 -0
- package/dist-lib/import/mudletHost.d.ts +67 -0
- package/dist-lib/import/mudletLink.d.ts +34 -0
- package/dist-lib/import/mudletProfileExport.d.ts +49 -0
- package/dist-lib/import/mudletProfileImport.d.ts +71 -0
- package/dist-lib/import/mudletVariables.d.ts +49 -0
- package/dist-lib/import/mudletWriteback.d.ts +12 -0
- package/dist-lib/import/mudletXmlExport.d.ts +16 -0
- package/dist-lib/import/mudletXmlImport.d.ts +21 -0
- package/dist-lib/import/packageInstaller.d.ts +72 -0
- package/dist-lib/import/packageRepository.d.ts +54 -0
- package/dist-lib/import/remotePackageInstall.d.ts +52 -0
- package/dist-lib/index.d.ts +30 -0
- package/dist-lib/index.js +42307 -0
- package/dist-lib/logging/SessionLogger.d.ts +41 -0
- package/dist-lib/main.d.ts +2 -0
- package/dist-lib/map/MapSelectionOverlay.d.ts +15 -0
- package/dist-lib/map/MapStore.d.ts +1067 -0
- package/dist-lib/map/MudixMapReader.d.ts +90 -0
- package/dist-lib/map/MudletHighlightOverlay.d.ts +18 -0
- package/dist-lib/map/mapImageExport.d.ts +26 -0
- package/dist-lib/map/mapParser.worker.d.ts +1 -0
- package/dist-lib/map/mapParserClient.d.ts +35 -0
- package/dist-lib/map/pathfinding.d.ts +52 -0
- package/dist-lib/map/xmlMapImport.d.ts +28 -0
- package/dist-lib/mud/MudSession.d.ts +236 -0
- package/dist-lib/mud/PatternEngine.d.ts +28 -0
- package/dist-lib/mud/aliases/AliasEngine.d.ts +15 -0
- package/dist-lib/mud/connection/LineAssembler.d.ts +84 -0
- package/dist-lib/mud/connection/MudClient.d.ts +268 -0
- package/dist-lib/mud/connection/PingTracker.d.ts +28 -0
- package/dist-lib/mud/connection/TelnetNegotiator.d.ts +188 -0
- package/dist-lib/mud/connection/telnetDebug.d.ts +54 -0
- package/dist-lib/mud/events.d.ts +160 -0
- package/dist-lib/mud/keybindings/KeyEngine.d.ts +36 -0
- package/dist-lib/mud/keybindings/browserReservedKeys.d.ts +45 -0
- package/dist-lib/mud/keybindings/qtKeys.d.ts +33 -0
- package/dist-lib/mud/protocol/charset.d.ts +105 -0
- package/dist-lib/mud/protocol/constants.d.ts +116 -0
- package/dist-lib/mud/protocol/echo.d.ts +63 -0
- package/dist-lib/mud/protocol/gmcp.d.ts +28 -0
- package/dist-lib/mud/protocol/index.d.ts +11 -0
- package/dist-lib/mud/protocol/mccp.d.ts +18 -0
- package/dist-lib/mud/protocol/mnes.d.ts +83 -0
- package/dist-lib/mud/protocol/msdp.d.ts +19 -0
- package/dist-lib/mud/protocol/msp.d.ts +47 -0
- package/dist-lib/mud/protocol/mssp.d.ts +25 -0
- package/dist-lib/mud/protocol/mxp.d.ts +188 -0
- package/dist-lib/mud/protocol/naws.d.ts +7 -0
- package/dist-lib/mud/replay/ReplayPlayer.d.ts +31 -0
- package/dist-lib/mud/replay/ReplayRecorder.d.ts +18 -0
- package/dist-lib/mud/replay/replayFormat.d.ts +49 -0
- package/dist-lib/mud/text/Console.d.ts +183 -0
- package/dist-lib/mud/text/FormatState.d.ts +256 -0
- package/dist-lib/mud/text/ansiEscapes.d.ts +88 -0
- package/dist-lib/mud/text/cellRender.d.ts +21 -0
- package/dist-lib/mud/text/colorParsers.d.ts +54 -0
- package/dist-lib/mud/text/colors.d.ts +31 -0
- package/dist-lib/mud/text/controlCharacterMode.d.ts +13 -0
- package/dist-lib/mud/text/controlChars.d.ts +31 -0
- package/dist-lib/mud/text/hyperlinkConfig.d.ts +164 -0
- package/dist-lib/mud/text/hyperlinkVisibility.d.ts +37 -0
- package/dist-lib/mud/text/oscLinkManager.d.ts +35 -0
- package/dist-lib/mud/text/wcwidth.d.ts +44 -0
- package/dist-lib/mud/text/xterm256.d.ts +2 -0
- package/dist-lib/mud/timers/TimerEngine.d.ts +61 -0
- package/dist-lib/mud/triggers/ChunkProcessor.d.ts +11 -0
- package/dist-lib/mud/triggers/TriggerEngine.d.ts +188 -0
- package/dist-lib/mud/triggers/pcre/Pcre2.d.ts +26 -0
- package/dist-lib/scripting/EngineHost.d.ts +152 -0
- package/dist-lib/scripting/GlobalEventChannel.d.ts +36 -0
- package/dist-lib/scripting/IScriptingRuntime.d.ts +95 -0
- package/dist-lib/scripting/MapOpenNotifier.d.ts +19 -0
- package/dist-lib/scripting/ScriptingAPI.d.ts +1691 -0
- package/dist-lib/scripting/ScriptingEngine.d.ts +806 -0
- package/dist-lib/scripting/StopwatchManager.d.ts +94 -0
- package/dist-lib/scripting/heldModifiers.d.ts +3 -0
- package/dist-lib/scripting/http/HttpService.d.ts +23 -0
- package/dist-lib/scripting/lua/LuaRuntime.d.ts +190 -0
- package/dist-lib/scripting/lua/bindings/automation.d.ts +10 -0
- package/dist-lib/scripting/lua/bindings/commandLine.d.ts +11 -0
- package/dist-lib/scripting/lua/bindings/context.d.ts +87 -0
- package/dist-lib/scripting/lua/bindings/cursor.d.ts +10 -0
- package/dist-lib/scripting/lua/bindings/diagnostics.d.ts +9 -0
- package/dist-lib/scripting/lua/bindings/map.d.ts +14 -0
- package/dist-lib/scripting/lua/bindings/media.d.ts +24 -0
- package/dist-lib/scripting/lua/bindings/output.d.ts +10 -0
- package/dist-lib/scripting/lua/bindings/packages.d.ts +10 -0
- package/dist-lib/scripting/lua/bindings/session.d.ts +16 -0
- package/dist-lib/scripting/lua/bindings/textEdit.d.ts +9 -0
- package/dist-lib/scripting/lua/bindings/userWindows.d.ts +11 -0
- package/dist-lib/scripting/lua/bindings/window.d.ts +10 -0
- package/dist-lib/scripting/lua/imageSize.d.ts +4 -0
- package/dist-lib/scripting/lua/luaCompletions.d.ts +9 -0
- package/dist-lib/scripting/lua/mudlet-lua/generic-mapper/generic_mapper.mpackage +0 -0
- package/dist-lib/scripting/lua/rex.d.ts +3 -0
- package/dist-lib/scripting/lua/sqlRowEncoder.d.ts +1 -0
- package/dist-lib/scripting/lua/yajl.d.ts +11 -0
- package/dist-lib/scripting/profilesPresence.d.ts +50 -0
- package/dist-lib/scripting/vfs/ProfileVFS.d.ts +62 -0
- package/dist-lib/scripting/vfs/cssRewrite.d.ts +21 -0
- package/dist-lib/scripting/vfs/folderHandleStore.d.ts +16 -0
- package/dist-lib/scripting/vfs/folderSync.d.ts +59 -0
- package/dist-lib/scripting/vfs/htmlRewrite.d.ts +26 -0
- package/dist-lib/scripting/vfs/vfsBridge.d.ts +16 -0
- package/dist-lib/services/cloudflare.d.ts +54 -0
- package/dist-lib/storage/appStore.d.ts +132 -0
- package/dist-lib/storage/crossTabSync.d.ts +3 -0
- package/dist-lib/storage/debouncedStorage.d.ts +18 -0
- package/dist-lib/storage/hooks.d.ts +17 -0
- package/dist-lib/storage/index.d.ts +4 -0
- package/dist-lib/storage/logExport.d.ts +32 -0
- package/dist-lib/storage/logStorage.d.ts +45 -0
- package/dist-lib/storage/mapStorage.d.ts +2 -0
- package/dist-lib/storage/profileVfsData.d.ts +47 -0
- package/dist-lib/storage/schema.d.ts +638 -0
- package/dist-lib/styles.css +2 -0
- package/dist-lib/ui/AboutModal.d.ts +8 -0
- package/dist-lib/ui/BrandLoginFields.d.ts +25 -0
- package/dist-lib/ui/BrandLoginScreen.d.ts +11 -0
- package/dist-lib/ui/CharLoginModal.d.ts +32 -0
- package/dist-lib/ui/CmdLineMenuRegistry.d.ts +27 -0
- package/dist-lib/ui/CodeEditorPreview.d.ts +19 -0
- package/dist-lib/ui/CommandBar.d.ts +17 -0
- package/dist-lib/ui/ConnectionFormModal.d.ts +13 -0
- package/dist-lib/ui/ConnectionGrid.d.ts +18 -0
- package/dist-lib/ui/ConnectionScreen.d.ts +14 -0
- package/dist-lib/ui/FileBrowserModal.d.ts +20 -0
- package/dist-lib/ui/FilePickerModal.d.ts +21 -0
- package/dist-lib/ui/FolderPermissionScreen.d.ts +16 -0
- package/dist-lib/ui/JsonPreview.d.ts +15 -0
- package/dist-lib/ui/LogBrowserModal.d.ts +7 -0
- package/dist-lib/ui/MapEditorModal.d.ts +9 -0
- package/dist-lib/ui/MarkdownPreview.d.ts +15 -0
- package/dist-lib/ui/MergeConflictModal.d.ts +17 -0
- package/dist-lib/ui/ModuleResolveModal.d.ts +22 -0
- package/dist-lib/ui/MouseEventRegistry.d.ts +31 -0
- package/dist-lib/ui/ProfileBusyScreen.d.ts +12 -0
- package/dist-lib/ui/ProfileExportModal.d.ts +7 -0
- package/dist-lib/ui/ProxyInfoModal.d.ts +6 -0
- package/dist-lib/ui/ProxyWhyModal.d.ts +6 -0
- package/dist-lib/ui/ProxyWizardModal.d.ts +6 -0
- package/dist-lib/ui/QuickOpenPalette.d.ts +8 -0
- package/dist-lib/ui/ResizableModal.d.ts +17 -0
- package/dist-lib/ui/ScriptingDocsModal.d.ts +12 -0
- package/dist-lib/ui/SettingsModal.d.ts +9 -0
- package/dist-lib/ui/Toolbar.d.ts +29 -0
- package/dist-lib/ui/bufferWords.d.ts +38 -0
- package/dist-lib/ui/buttons/ButtonsBar.d.ts +21 -0
- package/dist-lib/ui/cmdline/CommandLineManager.d.ts +97 -0
- package/dist-lib/ui/cmdline/CommandLineOverlay.d.ts +8 -0
- package/dist-lib/ui/codemirror/theme.d.ts +5 -0
- package/dist-lib/ui/commandHistory.d.ts +31 -0
- package/dist-lib/ui/components/Button.d.ts +9 -0
- package/dist-lib/ui/components/ConfirmDialog.d.ts +29 -0
- package/dist-lib/ui/components/ContextMenu.d.ts +9 -0
- package/dist-lib/ui/components/FontPicker.d.ts +9 -0
- package/dist-lib/ui/components/FormField.d.ts +16 -0
- package/dist-lib/ui/components/HelpTip.d.ts +7 -0
- package/dist-lib/ui/components/Input.d.ts +6 -0
- package/dist-lib/ui/components/Toggle.d.ts +10 -0
- package/dist-lib/ui/components/index.d.ts +9 -0
- package/dist-lib/ui/components/useModalFocus.d.ts +18 -0
- package/dist-lib/ui/labels/LabelManager.d.ts +220 -0
- package/dist-lib/ui/labels/LabelOverlay.d.ts +9 -0
- package/dist-lib/ui/labels/backgroundImageSize.d.ts +10 -0
- package/dist-lib/ui/labels/cursorShapes.d.ts +6 -0
- package/dist-lib/ui/labels/gifMovie.d.ts +100 -0
- package/dist-lib/ui/labels/qtCss.d.ts +57 -0
- package/dist-lib/ui/layout/ContentLayout.d.ts +19 -0
- package/dist-lib/ui/layout/DockArea.d.ts +14 -0
- package/dist-lib/ui/layout/DockedPanel.d.ts +13 -0
- package/dist-lib/ui/layout/FloatingWindowLayer.d.ts +10 -0
- package/dist-lib/ui/layout/MobileLayout.d.ts +22 -0
- package/dist-lib/ui/layout/PopoutWindow.d.ts +35 -0
- package/dist-lib/ui/layout/ScriptWindow.d.ts +29 -0
- package/dist-lib/ui/layout/SplitGroupPanel.d.ts +17 -0
- package/dist-lib/ui/layout/TabGroupPanel.d.ts +12 -0
- package/dist-lib/ui/layout/WindowContextMenu.d.ts +11 -0
- package/dist-lib/ui/layout/dockDetect.d.ts +26 -0
- package/dist-lib/ui/layout/overlayLayerOrder.d.ts +71 -0
- package/dist-lib/ui/markdown.d.ts +1 -0
- package/dist-lib/ui/output/CaretReviewPanel.d.ts +22 -0
- package/dist-lib/ui/output/OutputArea.d.ts +9 -0
- package/dist-lib/ui/output/OutputContextMenu.d.ts +23 -0
- package/dist-lib/ui/output/OutputRenderer.d.ts +64 -0
- package/dist-lib/ui/output/ScreenReaderLog.d.ts +23 -0
- package/dist-lib/ui/output/StickyOutputPanel.d.ts +28 -0
- package/dist-lib/ui/output/backgroundImageStyle.d.ts +17 -0
- package/dist-lib/ui/output/caretMode.d.ts +40 -0
- package/dist-lib/ui/output/linkNavigation.d.ts +29 -0
- package/dist-lib/ui/output/osc8Menu.d.ts +16 -0
- package/dist-lib/ui/output/outputCopy.d.ts +15 -0
- package/dist-lib/ui/preventPinchZoom.d.ts +1 -0
- package/dist-lib/ui/scrollbox/ScrollBoxManager.d.ts +62 -0
- package/dist-lib/ui/scrollbox/ScrollBoxOverlay.d.ts +25 -0
- package/dist-lib/ui/sound/SoundManager.d.ts +149 -0
- package/dist-lib/ui/sound/closedCaption.d.ts +37 -0
- package/dist-lib/ui/textedit/TextEditManager.d.ts +56 -0
- package/dist-lib/ui/tts/TtsManager.d.ts +68 -0
- package/dist-lib/ui/useBrandLogin.d.ts +19 -0
- package/dist-lib/ui/useCommandHistory.d.ts +7 -0
- package/dist-lib/ui/video/VideoManager.d.ts +56 -0
- package/dist-lib/ui/windows/ScriptEditorModal.d.ts +13 -0
- package/dist-lib/ui/windows/WindowManager.d.ts +694 -0
- package/dist-lib/ui/windows/panels/HtmlPanel.d.ts +27 -0
- package/dist-lib/ui/windows/panels/LuaEditor.d.ts +14 -0
- package/dist-lib/ui/windows/panels/MapPanel.d.ts +8 -0
- package/dist-lib/ui/windows/panels/PackageRepositoryModal.d.ts +18 -0
- package/dist-lib/ui/windows/panels/ScriptEditorPanel.d.ts +24 -0
- package/dist-lib/ui/windows/panels/ScriptSearch.d.ts +12 -0
- package/dist-lib/ui/windows/panels/TextPanel.d.ts +35 -0
- package/dist-lib/ui/windows/panels/VariablesView.d.ts +21 -0
- package/dist-lib/ui/windows/panels/VfsModulePickerModal.d.ts +8 -0
- package/dist-lib/ui/windows/panels/WindowCmdLine.d.ts +23 -0
- package/dist-lib/ui/windows/types.d.ts +145 -0
- package/dist-lib/utils/documentTitle.d.ts +33 -0
- package/dist-lib/utils/fontLoader.d.ts +52 -0
- package/dist-lib/utils/profileLock.d.ts +26 -0
- package/dist-lib/utils/sessionCredentials.d.ts +16 -0
- package/dist-lib/version.d.ts +39 -0
- package/dist-lib/vfs-sw.js +131 -0
- package/dist-lib/vite.d.ts +2 -0
- package/dist-lib/vite.js +154 -0
- package/package.json +93 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export declare function cssTextToStyle(css: string): React.CSSProperties;
|
|
3
|
+
export interface QtMargin {
|
|
4
|
+
top: number;
|
|
5
|
+
right: number;
|
|
6
|
+
bottom: number;
|
|
7
|
+
left: number;
|
|
8
|
+
}
|
|
9
|
+
export interface CssParts {
|
|
10
|
+
inline: React.CSSProperties;
|
|
11
|
+
scoped: Array<{
|
|
12
|
+
pseudo: string;
|
|
13
|
+
declarations: string;
|
|
14
|
+
}>;
|
|
15
|
+
margin?: QtMargin;
|
|
16
|
+
}
|
|
17
|
+
export declare function cssTextToParts(css: string): CssParts;
|
|
18
|
+
export declare function userWindowQssToScopedCss(qss: string, scope: string): string;
|
|
19
|
+
export declare function cmdLineQssToScopedCss(qss: string, scope: string): string;
|
|
20
|
+
/** Qt objectNames (from Mudlet's `.ui` files) that mudix mirrors onto a DOM node
|
|
21
|
+
* via `data-qt-object`, so package stylesheets addressing them keep working.
|
|
22
|
+
* Reference these instead of writing the raw string at the render site. */
|
|
23
|
+
export declare const QT_OBJECT_NAMES: {
|
|
24
|
+
/** dlgMapper's collapsible control bar — area picker, z-level buttons,
|
|
25
|
+
* options menu (`mapper.ui`: `widget_panel`). */
|
|
26
|
+
readonly mapperPanel: "widget_panel";
|
|
27
|
+
/** The arrow that shows/hides that bar (`mapper.ui`: `toolButton_togglePanel`). */
|
|
28
|
+
readonly mapperPanelToggle: "toolButton_togglePanel";
|
|
29
|
+
/** Area selector (`mapper.ui`: `comboBox_showArea`). */
|
|
30
|
+
readonly mapperAreaSelector: "comboBox_showArea";
|
|
31
|
+
/** Z-level up / down buttons (`mapper.ui`: `toolButton_shiftZup/down`). */
|
|
32
|
+
readonly mapperShiftZup: "toolButton_shiftZup";
|
|
33
|
+
readonly mapperShiftZdown: "toolButton_shiftZdown";
|
|
34
|
+
/** The mapper's hamburger / options button (`mapper.ui`: `toolButton_mapperMenu`). */
|
|
35
|
+
readonly mapperMenu: "toolButton_mapperMenu";
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Rewrite the Qt selectors in an app/profile-level stylesheet — objectName forms
|
|
39
|
+
* (`QWidget#widget_panel`) and mapped widget types (`QDockWidget::title`) — onto
|
|
40
|
+
* the DOM they correspond to in mudix. Returns the input unchanged when it holds
|
|
41
|
+
* no Qt selector at all, which is the common case for CSS written against
|
|
42
|
+
* mudix's own `.mudix-*` classes.
|
|
43
|
+
*
|
|
44
|
+
* A rule whose selector we rewrote also gets its *declarations* translated
|
|
45
|
+
* (`qtDeclarationsToCss`): that body was written for Qt, so it may carry
|
|
46
|
+
* `QLinearGradient(…)`, Qt's 0–255 `rgba()` alpha, or unitless lengths. Rules we
|
|
47
|
+
* left alone keep their declarations verbatim. Comments are stripped up front —
|
|
48
|
+
* they're inert, and an unbalanced brace or stray `#` inside one would otherwise
|
|
49
|
+
* confuse the scan.
|
|
50
|
+
*/
|
|
51
|
+
export declare function rewriteQtSelectors(qss: string): string;
|
|
52
|
+
export declare function cssEscape(s: string): string;
|
|
53
|
+
export declare function patchStyleSheetBackgroundColor(styleSheet: string, r: number, g: number, b: number, a: number): string;
|
|
54
|
+
export declare function qtDeclarationsToCss(css: string, important?: boolean): string;
|
|
55
|
+
export declare function qtAlignmentToFlex(val: string): Record<string, string>;
|
|
56
|
+
export declare function extractQtAlignment(css: string): string | undefined;
|
|
57
|
+
export declare function extractQtScaledContents(css: string): boolean | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { MudSession } from '../../mud/MudSession';
|
|
2
|
+
import type { WindowManager } from '../windows/WindowManager';
|
|
3
|
+
import type { ScriptingEngine } from '../../scripting/ScriptingEngine';
|
|
4
|
+
import type { ProfileVFS } from '../../scripting/vfs/ProfileVFS';
|
|
5
|
+
import './ScriptWindow.css';
|
|
6
|
+
interface ContentLayoutProps {
|
|
7
|
+
session: MudSession;
|
|
8
|
+
manager: WindowManager;
|
|
9
|
+
connectionId: string;
|
|
10
|
+
stickyLines?: number;
|
|
11
|
+
commandInputRef?: React.RefObject<HTMLInputElement | HTMLTextAreaElement | null>;
|
|
12
|
+
commandBar?: React.ReactNode;
|
|
13
|
+
contextMenuHandlerRef?: React.RefObject<((e: React.MouseEvent) => void) | null>;
|
|
14
|
+
/** Live ref so button clicks reach the engine even though the ref is set after initial render. */
|
|
15
|
+
scriptingEngineRef?: React.RefObject<ScriptingEngine | null>;
|
|
16
|
+
vfs?: ProfileVFS | null;
|
|
17
|
+
}
|
|
18
|
+
export declare function ContentLayout({ session, manager, connectionId, stickyLines, commandInputRef, commandBar, contextMenuHandlerRef, scriptingEngineRef, vfs, }: ContentLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DockSide, DragState, ScriptWindowRenderData } from '../windows/types';
|
|
2
|
+
import type { WindowManager } from '../windows/WindowManager';
|
|
3
|
+
interface DockAreaProps {
|
|
4
|
+
side: DockSide;
|
|
5
|
+
windows: ScriptWindowRenderData[];
|
|
6
|
+
extent: number;
|
|
7
|
+
dragState: DragState | null;
|
|
8
|
+
manager: WindowManager;
|
|
9
|
+
onSetExtent: (side: DockSide, n: number) => void;
|
|
10
|
+
onDragStateChange: (ds: DragState | null) => void;
|
|
11
|
+
onTitlebarContextMenu: (e: React.MouseEvent) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function DockArea({ side, windows, extent, dragState, manager, onSetExtent, onDragStateChange, onTitlebarContextMenu }: DockAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DragState } from '../windows/types';
|
|
2
|
+
import type { WindowManager } from '../windows/WindowManager';
|
|
3
|
+
interface DockedPanelProps {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
kind: 'text' | 'html' | 'map';
|
|
7
|
+
manager: WindowManager;
|
|
8
|
+
onHide: () => void;
|
|
9
|
+
onDragStateChange: (ds: DragState | null) => void;
|
|
10
|
+
onTitlebarContextMenu: (e: React.MouseEvent) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function DockedPanel({ id, title, manager, onHide, onDragStateChange, onTitlebarContextMenu }: DockedPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DragState, ScriptWindowRenderData } from '../windows/types';
|
|
2
|
+
import type { WindowManager } from '../windows/WindowManager';
|
|
3
|
+
interface FloatingWindowLayerProps {
|
|
4
|
+
windows: ScriptWindowRenderData[];
|
|
5
|
+
manager: WindowManager;
|
|
6
|
+
onDragStateChange: (ds: DragState | null) => void;
|
|
7
|
+
onTitlebarContextMenu: (e: React.MouseEvent) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function FloatingWindowLayer({ windows, manager, onDragStateChange, onTitlebarContextMenu }: FloatingWindowLayerProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { MudSession } from '../../mud/MudSession';
|
|
2
|
+
import type { ScriptWindowRenderData } from '../windows/types';
|
|
3
|
+
import type { WindowManager } from '../windows/WindowManager';
|
|
4
|
+
interface MobileLayoutProps {
|
|
5
|
+
session: MudSession;
|
|
6
|
+
manager: WindowManager;
|
|
7
|
+
/** Already filtered to non-popped-out windows by ContentLayout. */
|
|
8
|
+
windows: ScriptWindowRenderData[];
|
|
9
|
+
stickyLines?: number;
|
|
10
|
+
commandInputRef?: React.RefObject<HTMLInputElement | HTMLTextAreaElement | null>;
|
|
11
|
+
commandBar?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Phone layout: a single column showing one view at a time — the main MUD
|
|
15
|
+
* output or one script panel — flipped via a bottom switcher bar. The desktop
|
|
16
|
+
* dock/float chrome (drag, splitters, floating frames) is bypassed entirely;
|
|
17
|
+
* panel *content* is reused untouched by re-parenting the same stable
|
|
18
|
+
* portal-target divs WindowManager already maintains (same trick as the
|
|
19
|
+
* desktop TabGroupPanel), so panels stay live in the background.
|
|
20
|
+
*/
|
|
21
|
+
export declare function MobileLayout({ session, manager, windows, stickyLines, commandInputRef, commandBar }: MobileLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { WindowManager } from '../windows/WindowManager';
|
|
2
|
+
interface PopoutWindowProps {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
manager: WindowManager;
|
|
8
|
+
/** Called when the popout should be re-docked into the main window — either
|
|
9
|
+
* because the user closed the child window, or the browser blocked it. */
|
|
10
|
+
onClosed: () => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Detaches a panel into a separate browser window.
|
|
14
|
+
*
|
|
15
|
+
* The whole window system is built on a single persistent portal-target div per
|
|
16
|
+
* panel (WindowManager.getOrCreatePortalTarget) that physically moves between
|
|
17
|
+
* dock slots and floating frames while the React component rendered into it
|
|
18
|
+
* never unmounts. A popout is just one more place to move that div: into a
|
|
19
|
+
* `window.open()` child document. Because the component stays mounted in the
|
|
20
|
+
* main React tree, scrollback, buffered writes, and the live renderer/viewport
|
|
21
|
+
* registrations all survive the move.
|
|
22
|
+
*
|
|
23
|
+
* Cross-window events: React 19 attaches its event delegation to the root
|
|
24
|
+
* container passed to createRoot — which lives in the main window — so synthetic
|
|
25
|
+
* events never reach panel content sitting in another window. We fix this by
|
|
26
|
+
* mounting a throwaway React root on the child window's body and appending the
|
|
27
|
+
* portal target as a descendant (the same appendChild-into-a-ref'd-div pattern
|
|
28
|
+
* DockedPanel/ScriptWindow use). The throwaway root registers React's listeners
|
|
29
|
+
* on the child document; when a native event fires there, React resolves the
|
|
30
|
+
* target node's fiber (the `__reactFiber$` key matches because both roots share
|
|
31
|
+
* the one React bundle) and dispatches synthetic events up the *main* tree, so
|
|
32
|
+
* the panel's existing onChange/onKeyDown/onClick handlers fire normally.
|
|
33
|
+
*/
|
|
34
|
+
export declare function PopoutWindow({ id, title, width, height, manager, onClosed }: PopoutWindowProps): null;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { DockSide, DragState } from '../windows/types';
|
|
2
|
+
import type { WindowManager } from '../windows/WindowManager';
|
|
3
|
+
interface ScriptWindowProps {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
kind: 'text' | 'html' | 'map';
|
|
7
|
+
visible: boolean;
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
zIndex: number;
|
|
13
|
+
manager: WindowManager;
|
|
14
|
+
/** Miniconsoles render bare: no titlebar, no border, no drag, no resize.
|
|
15
|
+
* Position and size are script-controlled. */
|
|
16
|
+
isMiniConsole?: boolean;
|
|
17
|
+
/** When true, dragging the titlebar still moves the window but never
|
|
18
|
+
* enters a dock zone — mirrors Mudlet's openUserWindow(..., autoDock=false). */
|
|
19
|
+
lockFloating?: boolean;
|
|
20
|
+
onFocus: () => void;
|
|
21
|
+
onMoved: (x: number, y: number) => void;
|
|
22
|
+
onResized: (w: number, h: number) => void;
|
|
23
|
+
onDock: (side: DockSide, slotIndex: number, stackTargetId?: string, splitTargetId?: string, splitBefore?: boolean) => void;
|
|
24
|
+
onDragStateChange: (ds: DragState | null) => void;
|
|
25
|
+
onTitlebarContextMenu: (e: React.MouseEvent) => void;
|
|
26
|
+
onHide: () => void;
|
|
27
|
+
}
|
|
28
|
+
export declare function ScriptWindow({ id, title, visible, x, y, width, height, zIndex, manager, isMiniConsole, lockFloating, onFocus, onMoved, onResized, onDock, onDragStateChange, onTitlebarContextMenu, onHide, }: ScriptWindowProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DockSide, DragState, ScriptWindowRenderData } from '../windows/types';
|
|
2
|
+
import type { WindowManager } from '../windows/WindowManager';
|
|
3
|
+
interface SplitGroupPanelProps {
|
|
4
|
+
side: DockSide;
|
|
5
|
+
panels: ScriptWindowRenderData[];
|
|
6
|
+
splitGroupId: string;
|
|
7
|
+
manager: WindowManager;
|
|
8
|
+
onDragStateChange: (ds: DragState | null) => void;
|
|
9
|
+
onTitlebarContextMenu: (e: React.MouseEvent) => void;
|
|
10
|
+
/** Panel ID hovered for a tab-stack drop — highlights only that sub-panel. */
|
|
11
|
+
stackTargetId?: string;
|
|
12
|
+
/** Panel ID targeted for a within-split insert — shows ghost between members. */
|
|
13
|
+
splitTargetId?: string;
|
|
14
|
+
splitBefore?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function SplitGroupPanel({ side, panels, manager, onDragStateChange, onTitlebarContextMenu, stackTargetId, splitTargetId, splitBefore }: SplitGroupPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DockSide, DragState, ScriptWindowRenderData } from '../windows/types';
|
|
2
|
+
import type { WindowManager } from '../windows/WindowManager';
|
|
3
|
+
interface TabGroupPanelProps {
|
|
4
|
+
side: DockSide;
|
|
5
|
+
panels: ScriptWindowRenderData[];
|
|
6
|
+
activeId: string;
|
|
7
|
+
manager: WindowManager;
|
|
8
|
+
onDragStateChange: (ds: DragState | null) => void;
|
|
9
|
+
onTitlebarContextMenu: (e: React.MouseEvent) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function TabGroupPanel({ side, panels, activeId, manager, onDragStateChange, onTitlebarContextMenu }: TabGroupPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ScriptWindowRenderData } from '../windows/types';
|
|
2
|
+
import type { WindowManager } from '../windows/WindowManager';
|
|
3
|
+
interface WindowContextMenuProps {
|
|
4
|
+
windows: ScriptWindowRenderData[];
|
|
5
|
+
manager: WindowManager;
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function WindowContextMenu({ windows, manager, x, y, onClose }: WindowContextMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { DockSide } from '../windows/types';
|
|
2
|
+
/**
|
|
3
|
+
* 5-zone drop detection per slot.
|
|
4
|
+
*
|
|
5
|
+
* For a horizontal dock area (top/bottom):
|
|
6
|
+
* ┌────────────────────────────────┐
|
|
7
|
+
* │ SPLIT ABOVE 25% │
|
|
8
|
+
* ├────┬──────────────────────┬────┤
|
|
9
|
+
* │bef │ tab stack │aft │ (middle 50% cross-axis)
|
|
10
|
+
* │20% │ center 60% │20% │
|
|
11
|
+
* ├────┴──────────────────────┴────┤
|
|
12
|
+
* │ SPLIT BELOW 25% │
|
|
13
|
+
* └────────────────────────────────┘
|
|
14
|
+
*
|
|
15
|
+
* Ghost-slot hysteresis: when the cursor is inside the ghost slot that appears
|
|
16
|
+
* on a before/after drop, we merge the ghost + adjacent real panel into one
|
|
17
|
+
* bounding box for zone detection. This keeps the center/split zones reachable
|
|
18
|
+
* without having to drag all the way across the ghost to reach the shifted panel.
|
|
19
|
+
*/
|
|
20
|
+
export declare function detectDock(mx: number, my: number): {
|
|
21
|
+
side: DockSide | null;
|
|
22
|
+
slotIndex: number;
|
|
23
|
+
stackTargetId?: string;
|
|
24
|
+
splitTargetId?: string;
|
|
25
|
+
splitBefore?: boolean;
|
|
26
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flat per-viewport z-order for every kind of overlay content: nested windows /
|
|
3
|
+
* mini-consoles (including the embedded mapper), labels, overlay command lines,
|
|
4
|
+
* and scroll boxes. This is the mudix analogue of Mudlet's Qt widget stack.
|
|
5
|
+
*
|
|
6
|
+
* ## Why flat (and not a container tree)
|
|
7
|
+
*
|
|
8
|
+
* In real Mudlet, `raiseWindow`/`lowerWindow` operate on ONE flat stack per
|
|
9
|
+
* console/userwindow. Geyser containers (Adjustable.Container, VBox/HBox, a
|
|
10
|
+
* flyout menu, a gauge's labels) are pure Lua geometry helpers — they never
|
|
11
|
+
* reparent the real QWidgets, which all stay siblings of the console. So
|
|
12
|
+
* `raise` brings a widget to the front of EVERY widget in that window, and
|
|
13
|
+
* z-order is simply most-recently-raised-wins, flat, per real viewport.
|
|
14
|
+
* (An earlier version of this file modelled Geyser containers as a real tree
|
|
15
|
+
* and ranked by a pre-order walk; that diverged from Mudlet — it buried a
|
|
16
|
+
* freshly-raised widget beneath its container's stale position — and is why
|
|
17
|
+
* an opened config menu rendered *under* a sibling mapper. Flat is correct.)
|
|
18
|
+
*
|
|
19
|
+
* Correct z-order alone is not enough: every overlay leaf must also render into
|
|
20
|
+
* the SAME CSS stacking context for these ranks to take visual effect. mudix
|
|
21
|
+
* ensures that by rendering all four overlay kinds under one wrapper per
|
|
22
|
+
* viewport (`.main-overlay-root` for main; the panel viewport for a userwindow)
|
|
23
|
+
* whose descendants' inline z-indices all compete directly. See
|
|
24
|
+
* FloatingWindowLayer / OutputArea — the nested-window layer is portaled into
|
|
25
|
+
* that same wrapper, NOT a separate sibling, precisely so a window's z and a
|
|
26
|
+
* label's z compare in one context.
|
|
27
|
+
*
|
|
28
|
+
* ## Bounded ranks
|
|
29
|
+
*
|
|
30
|
+
* `getZ` returns a small ordinal (0..N-1 among the widgets under one viewport),
|
|
31
|
+
* NOT the raw monotonic `order`. The `order` keys grow unboundedly over a
|
|
32
|
+
* session (every raise/lower, including the ones Geyser fires on each reflow,
|
|
33
|
+
* bumps one), and feeding that straight into a CSS z-index risks it eventually
|
|
34
|
+
* exceeding fixed "always on top" bands elsewhere (e.g. the map's right-click
|
|
35
|
+
* menu at z:1000 — which regressed exactly this way once). Ranking into a range
|
|
36
|
+
* bounded by the live widget count keeps the output far below any such band.
|
|
37
|
+
*/
|
|
38
|
+
export type OverlayLayerKind = 'windows' | 'labels' | 'cmdlines' | 'scrollboxes';
|
|
39
|
+
type Listener = () => void;
|
|
40
|
+
export declare class OverlayLayerOrder {
|
|
41
|
+
private seq;
|
|
42
|
+
private negSeq;
|
|
43
|
+
private widgets;
|
|
44
|
+
private listeners;
|
|
45
|
+
/** Viewports whose widgets' `rank` fields are stale and must be re-sorted
|
|
46
|
+
* on the next getZ(). Only the viewport actually mutated is marked, so a
|
|
47
|
+
* reflow storm under one window never re-sorts the others, and a drag —
|
|
48
|
+
* which re-renders via move()'s notify() but never mutates this registry —
|
|
49
|
+
* leaves every parent clean, so getZ() is a plain field read per widget. */
|
|
50
|
+
private dirty;
|
|
51
|
+
private static widgetKey;
|
|
52
|
+
private upsert;
|
|
53
|
+
/** A widget was created / reparented / raised under `parentId` — bring it
|
|
54
|
+
* to the front of that viewport's flat stack. */
|
|
55
|
+
touch(parentId: string, kind: OverlayLayerKind, id: string): void;
|
|
56
|
+
/** A widget was lowered under `parentId` (lowerWindow / lowerLabel) — drop
|
|
57
|
+
* it below every other widget in that viewport's stack. */
|
|
58
|
+
sink(parentId: string, kind: OverlayLayerKind, id: string): void;
|
|
59
|
+
/** Stop tracking a destroyed widget, so a later widget re-using the same
|
|
60
|
+
* id starts fresh and dead entries don't accumulate. */
|
|
61
|
+
forget(parentId: string, kind: OverlayLayerKind, id: string): void;
|
|
62
|
+
private emit;
|
|
63
|
+
/** Front-to-back rank (0 = back) for one widget under `parentId`, ranked
|
|
64
|
+
* among every widget of any kind in that viewport by most-recent raise.
|
|
65
|
+
* Re-sorts the viewport's widgets only when it's dirty; otherwise this is
|
|
66
|
+
* a couple of Map lookups plus a field read. */
|
|
67
|
+
getZ(parentId: string, kind: OverlayLayerKind, id: string): number;
|
|
68
|
+
/** Re-render trigger for a viewport's overlay wrapper components. */
|
|
69
|
+
subscribe(parentId: string, cb: Listener): () => void;
|
|
70
|
+
}
|
|
71
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function renderMarkdown(src: string): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { MudSession } from '../../mud/MudSession';
|
|
3
|
+
/**
|
|
4
|
+
* Caret mode / reading cursor (Mudlet's caret mode, web-native).
|
|
5
|
+
*
|
|
6
|
+
* When the user's configured `caretShortcut` is pressed, a focusable review
|
|
7
|
+
* panel mirrors the main output's rendered lines (text + working links) and
|
|
8
|
+
* takes focus, so a screen reader can navigate the scrollback by char/word/line
|
|
9
|
+
* with its own virtual cursor — and reach links — without the live output's
|
|
10
|
+
* additions-only ARIA region getting in the way. Escape, the close button, or
|
|
11
|
+
* the toggle key again exits and returns focus to the command line.
|
|
12
|
+
*
|
|
13
|
+
* The mirror is kept live by a MutationObserver on the main output: appends and
|
|
14
|
+
* evictions are reflected as they happen, so the panel never goes stale while
|
|
15
|
+
* open. We clone the already-rendered DOM (rather than re-deriving from the
|
|
16
|
+
* Console model) because the DOM is the faithful "what's on screen" source —
|
|
17
|
+
* blank lines and inline command echoes included.
|
|
18
|
+
*/
|
|
19
|
+
export declare function CaretReviewPanel({ session, commandInputRef, }: {
|
|
20
|
+
session: MudSession;
|
|
21
|
+
commandInputRef?: React.RefObject<HTMLInputElement | HTMLTextAreaElement | null>;
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { MudSession } from '../../mud/MudSession';
|
|
3
|
+
interface OutputAreaProps {
|
|
4
|
+
session: MudSession;
|
|
5
|
+
stickyLines?: number;
|
|
6
|
+
commandInputRef?: React.RefObject<HTMLInputElement | HTMLTextAreaElement | null>;
|
|
7
|
+
}
|
|
8
|
+
export declare function OutputArea({ session, stickyLines, commandInputRef }: OutputAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface OutputMenuExtraItem {
|
|
2
|
+
label: string;
|
|
3
|
+
tooltip?: string;
|
|
4
|
+
onClick: () => void;
|
|
5
|
+
}
|
|
6
|
+
interface OutputContextMenuProps {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
/** Whether the selection touches this window (gates the copy actions). */
|
|
10
|
+
hasSelection: boolean;
|
|
11
|
+
onSelectAll: () => void;
|
|
12
|
+
onCopy: () => void;
|
|
13
|
+
onCopyHtml: () => void;
|
|
14
|
+
onCopyImage: () => void;
|
|
15
|
+
/** Timestamp toggle — only the main console passes these. */
|
|
16
|
+
showTimestamps?: boolean;
|
|
17
|
+
onToggleTimestamps?: () => void;
|
|
18
|
+
/** Script-provided entries (Mudlet addMouseEvent). */
|
|
19
|
+
extraItems?: OutputMenuExtraItem[];
|
|
20
|
+
onClose: () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function OutputContextMenu({ x, y, hasSelection, onSelectAll, onCopy, onCopyHtml, onCopyImage, showTimestamps, onToggleTimestamps, extraItems, onClose, }: OutputContextMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { AnsiAwareBuffer } from "../../mud/text/FormatState";
|
|
2
|
+
export declare const elementBuffers: WeakMap<Element, AnsiAwareBuffer>;
|
|
3
|
+
type MessageListener = (message?: string | AnsiAwareBuffer, type?: string, timestamp?: number, isPrompt?: boolean) => void;
|
|
4
|
+
export type MessageSource = {
|
|
5
|
+
on(event: 'message', listener: MessageListener): () => void;
|
|
6
|
+
on(event: 'script.deleteline', listener: () => void): () => void;
|
|
7
|
+
on(event: 'script.clearwindow', listener: () => void): () => void;
|
|
8
|
+
on(event: 'script.movecursorup', listener: () => void): () => void;
|
|
9
|
+
on(event: 'script.movecursordown', listener: () => void): () => void;
|
|
10
|
+
};
|
|
11
|
+
export type CursorOps = {
|
|
12
|
+
/** Plain text of the line at the current cursor position. */
|
|
13
|
+
getLine: () => string;
|
|
14
|
+
/** AnsiAwareBuffer of the line at the current cursor position, for in-place coloring. */
|
|
15
|
+
getBuffer: () => AnsiAwareBuffer | null;
|
|
16
|
+
/** Remove the line at the current cursor position. */
|
|
17
|
+
deleteLine: () => void;
|
|
18
|
+
/** Move the cursor one line toward older output. */
|
|
19
|
+
moveUp: () => void;
|
|
20
|
+
/** Move the cursor one line toward newer output. */
|
|
21
|
+
moveDown: () => void;
|
|
22
|
+
/** Move the cursor to an absolute line number (1 = oldest, getLineCount() = newest). */
|
|
23
|
+
moveTo: (line: number) => void;
|
|
24
|
+
/** 1-indexed line number of the cursor from the top of the buffer. */
|
|
25
|
+
getLineNumber: () => number;
|
|
26
|
+
/** Total number of lines currently in the output buffer. */
|
|
27
|
+
getLineCount: () => number;
|
|
28
|
+
/** Plain text of lines [from..to] (1-indexed, inclusive) as a JS string array. */
|
|
29
|
+
getLines: (from: number, to: number) => string[];
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Creates cursor ops for a plain line container (text/miniconsole windows).
|
|
33
|
+
* The container holds `div` line elements appended via appendChild — no sentinel.
|
|
34
|
+
* Returns the ops plus an `onLineAppended` callback that must be called each
|
|
35
|
+
* time a new line element is added, so the cursor resets to the latest line.
|
|
36
|
+
*/
|
|
37
|
+
export declare function createWindowCursorOps(container: HTMLElement): {
|
|
38
|
+
ops: CursorOps;
|
|
39
|
+
onLineAppended: (el: Element) => void;
|
|
40
|
+
};
|
|
41
|
+
type OutputHandlerOptions = {
|
|
42
|
+
outputWrapper: HTMLElement;
|
|
43
|
+
sentinel: HTMLElement;
|
|
44
|
+
stickyArea: HTMLElement;
|
|
45
|
+
isSplitView: () => boolean;
|
|
46
|
+
stickyLines: number;
|
|
47
|
+
maxElements?: number | (() => number);
|
|
48
|
+
trimSlack?: number;
|
|
49
|
+
suppressSplitView?: (durationMs: number) => void;
|
|
50
|
+
/** Called once the cursor ops are ready; wire them to ScriptingAPI/session. */
|
|
51
|
+
onCursorReady?: (ops: CursorOps) => void;
|
|
52
|
+
};
|
|
53
|
+
export type OutputRendererControls = {
|
|
54
|
+
teardown: () => void;
|
|
55
|
+
areTimestampsVisible: () => boolean;
|
|
56
|
+
setTimestampVisibility: (visible: boolean) => void;
|
|
57
|
+
toggleTimestampVisibility: () => void;
|
|
58
|
+
populateStickyArea: () => void;
|
|
59
|
+
clearStickyArea: () => void;
|
|
60
|
+
push: (message: string | AnsiAwareBuffer, type?: string, timestamp?: number) => void;
|
|
61
|
+
clear: () => void;
|
|
62
|
+
};
|
|
63
|
+
export declare function setupOutputRenderer(source: MessageSource | null, { outputWrapper, sentinel, stickyArea, isSplitView, stickyLines, maxElements, trimSlack, suppressSplitView, onCursorReady, }: OutputHandlerOptions): OutputRendererControls;
|
|
64
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { MudSession } from '../../mud/MudSession';
|
|
2
|
+
import { AnsiAwareBuffer } from '../../mud/text/FormatState';
|
|
3
|
+
export declare const MAX_LINES = 60;
|
|
4
|
+
/**
|
|
5
|
+
* The plain text a `message` line should announce, or null when it must be
|
|
6
|
+
* skipped: interim `script-partial` cecho output (superseded by the finalized
|
|
7
|
+
* line), missing text, or blank/whitespace-only lines (no speech, only churn).
|
|
8
|
+
* Raw strings carry ANSI, so they route through an {@link AnsiAwareBuffer} for
|
|
9
|
+
* the plain text; an `AnsiAwareBuffer` payload already exposes `.text`. Pure.
|
|
10
|
+
*/
|
|
11
|
+
export declare function screenReaderPlainText(text?: string | AnsiAwareBuffer, type?: string): string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Append a batch of lines to the live `region` as ONE node (a wrapper div with
|
|
14
|
+
* a child per line) so the screen reader announces the whole burst once — the
|
|
15
|
+
* way Mudlet coalesces a buffer update into a single announcement — instead of
|
|
16
|
+
* once per line. Per-line child divs keep the line boundaries in the a11y tree.
|
|
17
|
+
* Then cap the region to `maxLines` batches. Returns true when a batch was
|
|
18
|
+
* appended. Exported for testing.
|
|
19
|
+
*/
|
|
20
|
+
export declare function flushScreenReaderLines(region: HTMLElement, lines: string[], maxLines?: number): boolean;
|
|
21
|
+
export declare function ScreenReaderLog({ session }: {
|
|
22
|
+
session: MudSession;
|
|
23
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type OutputMenuExtraItem } from './OutputContextMenu';
|
|
3
|
+
interface StickyOutputPanelProps {
|
|
4
|
+
outputRef: React.RefObject<HTMLDivElement | null>;
|
|
5
|
+
sentinelRef: React.RefObject<HTMLDivElement | null>;
|
|
6
|
+
stickyAreaRef: React.RefObject<HTMLDivElement | null>;
|
|
7
|
+
isSplitView: boolean;
|
|
8
|
+
scrollToBottom: () => void;
|
|
9
|
+
background?: string;
|
|
10
|
+
/** Extra CSS layered on top of `background` — used to add background-image
|
|
11
|
+
* / border-image properties from Mudlet setBackgroundImage. */
|
|
12
|
+
backgroundExtra?: React.CSSProperties;
|
|
13
|
+
foreground?: string;
|
|
14
|
+
showTimestamps?: boolean;
|
|
15
|
+
onToggleTimestamps?: () => void;
|
|
16
|
+
/** Script-provided right-click entries (Mudlet addMouseEvent), evaluated
|
|
17
|
+
* lazily when the menu opens since the registry can change. */
|
|
18
|
+
getMenuExtraItems?: () => OutputMenuExtraItem[];
|
|
19
|
+
commandInputRef?: React.RefObject<HTMLInputElement | HTMLTextAreaElement | null>;
|
|
20
|
+
className?: string;
|
|
21
|
+
fontSize?: number;
|
|
22
|
+
fontFamily?: string;
|
|
23
|
+
wrapAt?: number;
|
|
24
|
+
wrapIndent?: number;
|
|
25
|
+
wrapHangingIndent?: number;
|
|
26
|
+
}
|
|
27
|
+
export declare function StickyOutputPanel({ outputRef, sentinelRef, stickyAreaRef, isSplitView, scrollToBottom, background, backgroundExtra, foreground, showTimestamps, onToggleTimestamps, getMenuExtraItems, commandInputRef, className, fontSize, fontFamily, wrapAt, wrapIndent, wrapHangingIndent, }: StickyOutputPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export interface BackgroundImageSpec {
|
|
3
|
+
/** Resolved image URL (for modes 1-3) or raw CSS stylesheet (mode 4). */
|
|
4
|
+
url: string;
|
|
5
|
+
/** Mudlet BgImageMode: 1=border (stretched via border-image), 2=center,
|
|
6
|
+
* 3=tile, 4=raw stylesheet (url field is the stylesheet body). */
|
|
7
|
+
mode: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Translates a Mudlet background-image spec into inline React CSS, mirroring
|
|
11
|
+
* the QSS produced by TConsole::setConsoleBackgroundImage in Mudlet's C++ so
|
|
12
|
+
* imported scripts look the same. Mode 4 takes the user-authored stylesheet
|
|
13
|
+
* body and parses its declarations through the same path setLabelStyleSheet
|
|
14
|
+
* uses, so multi-property CSS strings (with their own `url(...)` refs) layer
|
|
15
|
+
* cleanly. Returns null for unsupported modes — the caller leaves the element
|
|
16
|
+
* style untouched. */
|
|
17
|
+
export declare function backgroundImageStyle(spec: BackgroundImageSpec | undefined): React.CSSProperties | null;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Caret mode / reading cursor — keyboard-navigable review of the scrollback for
|
|
3
|
+
* screen-reader users (Mudlet's caret mode, ported web-natively).
|
|
4
|
+
*
|
|
5
|
+
* Rather than reimplement Mudlet's painted caret + boundary-finding over a
|
|
6
|
+
* custom-drawn widget, we mirror the already-rendered output DOM into a
|
|
7
|
+
* focusable review surface and let the browser + assistive tech provide real
|
|
8
|
+
* char/word/line navigation and announcements for free (the `CaretReviewPanel`
|
|
9
|
+
* component). This module holds the surface-independent, DOM-level helpers so
|
|
10
|
+
* they're unit-testable without React.
|
|
11
|
+
*/
|
|
12
|
+
/** The toggle key the `caretShortcut` config selects. `none` disables the
|
|
13
|
+
* feature; the rest mirror Mudlet's Host::CaretShortcut enum. */
|
|
14
|
+
export type CaretShortcut = 'none' | 'tab' | 'ctrltab' | 'f6';
|
|
15
|
+
/** True when `e` is the configured caret-mode toggle. Bare Tab / Ctrl+Tab / F6
|
|
16
|
+
* each require no *other* modifiers so they don't fire on Shift+Tab, Alt+F6,
|
|
17
|
+
* etc. `none` (or any unknown value) never matches. Pure — reads only `key`
|
|
18
|
+
* and the modifier flags. */
|
|
19
|
+
export declare function matchCaretToggle(e: KeyboardEvent, shortcut: CaretShortcut): boolean;
|
|
20
|
+
/** The rendered line elements under the main output wrapper, in order. Each
|
|
21
|
+
* logical line is one `div.output-msg`; the height:0 sticky sentinel and any
|
|
22
|
+
* other children are skipped (mirrors WindowManager.lineElements). */
|
|
23
|
+
export declare function outputLineElements(outputEl: HTMLElement): HTMLElement[];
|
|
24
|
+
/**
|
|
25
|
+
* Clone one rendered output line for the review surface and revive its links.
|
|
26
|
+
*
|
|
27
|
+
* `cloneNode(true)` copies the text and inline colour styles faithfully but NOT
|
|
28
|
+
* the per-element click/contextmenu listeners (they're attached imperatively in
|
|
29
|
+
* FormatState, closing over the link descriptor). So for each clickable run we
|
|
30
|
+
* re-dispatch the clone's click/context-menu to the *original* element — which
|
|
31
|
+
* still owns the real send/prompt/url/spoiler action — and tag it `role="link"`
|
|
32
|
+
* so assistive tech announces and reaches it. Original and clone share document
|
|
33
|
+
* order within the line, so pairing by index is stable.
|
|
34
|
+
*/
|
|
35
|
+
export declare function cloneOutputLine(orig: HTMLElement): HTMLElement;
|
|
36
|
+
/** Whether a scroll container is within `threshold` px of its bottom — used to
|
|
37
|
+
* decide if the review surface should follow new output to the end (Mudlet's
|
|
38
|
+
* "auto-scroll only when the caret is already at the end") or hold position so
|
|
39
|
+
* the user can keep reading where they are. */
|
|
40
|
+
export declare function isNearBottom(el: HTMLElement, threshold?: number): boolean;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keyboard navigation and activation for output hyperlinks — OSC 8, MXP, and
|
|
3
|
+
* scripted links alike (Mudlet's Ctrl+] / Ctrl+[ plus Enter/Space activation).
|
|
4
|
+
*
|
|
5
|
+
* Ctrl+] focuses the next clickable link in the output, Ctrl+[ the previous,
|
|
6
|
+
* wrapping at the ends. With nothing focused, Ctrl+] starts at the first link
|
|
7
|
+
* and Ctrl+[ at the last. Links are made focusable (`tabIndex = -1`) by the
|
|
8
|
+
* renderer, so they take focus programmatically without joining the Tab order.
|
|
9
|
+
*
|
|
10
|
+
* With a link focused: Enter/Space activates it (same as a left-click — fires
|
|
11
|
+
* the send/prompt/url action, reveals a spoiler, toggles selection, arms
|
|
12
|
+
* visibility); the Menu key or Shift+F10 opens its context menu. Mirrors
|
|
13
|
+
* Mudlet's TTextEdit key handling.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* One representative element per logical link under `root`, in document order.
|
|
17
|
+
* A multicolour link is rendered as several spans (one per colour run) sharing
|
|
18
|
+
* a `data-link-group` key — only the first run of each group is a navigation
|
|
19
|
+
* stop, so Ctrl+]/Ctrl+[ moves link-to-link, not run-to-run. Concealed (hidden)
|
|
20
|
+
* links are skipped.
|
|
21
|
+
*/
|
|
22
|
+
export declare function navigableLinks(root: ParentNode): HTMLElement[];
|
|
23
|
+
/** Move focus to the link `dir` steps from the currently-focused one (wrapping).
|
|
24
|
+
* Returns the newly-focused link, or null when there are no links. */
|
|
25
|
+
export declare function focusAdjacentLink(root: ParentNode, dir: 1 | -1): HTMLElement | null;
|
|
26
|
+
/** Handle a keydown for link navigation/activation. Returns true when it acted. */
|
|
27
|
+
export declare function handleLinkNavKeydown(e: KeyboardEvent, root: ParentNode): boolean;
|
|
28
|
+
/** Install the link navigation/activation key listener for `root`. Returns a remover. */
|
|
29
|
+
export declare function installLinkNavigation(root: ParentNode): () => void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Right-click context menu for OSC 8 hyperlinks (Mudlet's `config.menu`).
|
|
3
|
+
*
|
|
4
|
+
* Pure DOM — no scripting/session dependencies — so the renderer can build and
|
|
5
|
+
* show it and tests can exercise it without the full engine. `run` executes a
|
|
6
|
+
* selected item's action URI (the caller maps it to send/prompt/openUrl).
|
|
7
|
+
*/
|
|
8
|
+
import type { MenuItem, LinkTitle } from "../../mud/text/hyperlinkConfig";
|
|
9
|
+
/**
|
|
10
|
+
* Open the link's context menu at the event position. `menu` entries are either
|
|
11
|
+
* separators (`{ separator: true }`) or `{ label, action }` pairs; `title`, when
|
|
12
|
+
* present, is shown as an (optionally styled) header. Selecting an item runs its
|
|
13
|
+
* action via `run` and closes the menu. Any open menu is replaced; clicking
|
|
14
|
+
* outside dismisses it.
|
|
15
|
+
*/
|
|
16
|
+
export declare function openOsc8Menu(ev: MouseEvent, menu: MenuItem[], title: LinkTitle | undefined, run: (uri: string) => void): void;
|