@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.
Files changed (242) hide show
  1. package/LICENSE +338 -0
  2. package/README.md +150 -0
  3. package/dist-lib/App.d.ts +1 -0
  4. package/dist-lib/MudletWebApp.d.ts +11 -0
  5. package/dist-lib/ProfileSession.d.ts +15 -0
  6. package/dist-lib/assets/mapParser.worker-t-3rd1zR.js +9 -0
  7. package/dist-lib/branding.d.ts +213 -0
  8. package/dist-lib/core/EventBus.d.ts +29 -0
  9. package/dist-lib/db/sqliteClient.d.ts +25 -0
  10. package/dist-lib/hooks/useEngines.d.ts +12 -0
  11. package/dist-lib/hooks/useMudSession.d.ts +10 -0
  12. package/dist-lib/hooks/useOutput.d.ts +17 -0
  13. package/dist-lib/hooks/useViewportMode.d.ts +14 -0
  14. package/dist-lib/import/applyMudletProfile.d.ts +57 -0
  15. package/dist-lib/import/collectProfileExport.d.ts +16 -0
  16. package/dist-lib/import/defaultPackages.d.ts +81 -0
  17. package/dist-lib/import/defaults/mudlet-mapper.xml +13023 -0
  18. package/dist-lib/import/defaults/run-lua-code.mpackage +0 -0
  19. package/dist-lib/import/mudletHost.d.ts +67 -0
  20. package/dist-lib/import/mudletLink.d.ts +34 -0
  21. package/dist-lib/import/mudletProfileExport.d.ts +49 -0
  22. package/dist-lib/import/mudletProfileImport.d.ts +71 -0
  23. package/dist-lib/import/mudletVariables.d.ts +49 -0
  24. package/dist-lib/import/mudletWriteback.d.ts +12 -0
  25. package/dist-lib/import/mudletXmlExport.d.ts +16 -0
  26. package/dist-lib/import/mudletXmlImport.d.ts +21 -0
  27. package/dist-lib/import/packageInstaller.d.ts +72 -0
  28. package/dist-lib/import/packageRepository.d.ts +54 -0
  29. package/dist-lib/import/remotePackageInstall.d.ts +52 -0
  30. package/dist-lib/index.d.ts +30 -0
  31. package/dist-lib/index.js +42307 -0
  32. package/dist-lib/logging/SessionLogger.d.ts +41 -0
  33. package/dist-lib/main.d.ts +2 -0
  34. package/dist-lib/map/MapSelectionOverlay.d.ts +15 -0
  35. package/dist-lib/map/MapStore.d.ts +1067 -0
  36. package/dist-lib/map/MudixMapReader.d.ts +90 -0
  37. package/dist-lib/map/MudletHighlightOverlay.d.ts +18 -0
  38. package/dist-lib/map/mapImageExport.d.ts +26 -0
  39. package/dist-lib/map/mapParser.worker.d.ts +1 -0
  40. package/dist-lib/map/mapParserClient.d.ts +35 -0
  41. package/dist-lib/map/pathfinding.d.ts +52 -0
  42. package/dist-lib/map/xmlMapImport.d.ts +28 -0
  43. package/dist-lib/mud/MudSession.d.ts +236 -0
  44. package/dist-lib/mud/PatternEngine.d.ts +28 -0
  45. package/dist-lib/mud/aliases/AliasEngine.d.ts +15 -0
  46. package/dist-lib/mud/connection/LineAssembler.d.ts +84 -0
  47. package/dist-lib/mud/connection/MudClient.d.ts +268 -0
  48. package/dist-lib/mud/connection/PingTracker.d.ts +28 -0
  49. package/dist-lib/mud/connection/TelnetNegotiator.d.ts +188 -0
  50. package/dist-lib/mud/connection/telnetDebug.d.ts +54 -0
  51. package/dist-lib/mud/events.d.ts +160 -0
  52. package/dist-lib/mud/keybindings/KeyEngine.d.ts +36 -0
  53. package/dist-lib/mud/keybindings/browserReservedKeys.d.ts +45 -0
  54. package/dist-lib/mud/keybindings/qtKeys.d.ts +33 -0
  55. package/dist-lib/mud/protocol/charset.d.ts +105 -0
  56. package/dist-lib/mud/protocol/constants.d.ts +116 -0
  57. package/dist-lib/mud/protocol/echo.d.ts +63 -0
  58. package/dist-lib/mud/protocol/gmcp.d.ts +28 -0
  59. package/dist-lib/mud/protocol/index.d.ts +11 -0
  60. package/dist-lib/mud/protocol/mccp.d.ts +18 -0
  61. package/dist-lib/mud/protocol/mnes.d.ts +83 -0
  62. package/dist-lib/mud/protocol/msdp.d.ts +19 -0
  63. package/dist-lib/mud/protocol/msp.d.ts +47 -0
  64. package/dist-lib/mud/protocol/mssp.d.ts +25 -0
  65. package/dist-lib/mud/protocol/mxp.d.ts +188 -0
  66. package/dist-lib/mud/protocol/naws.d.ts +7 -0
  67. package/dist-lib/mud/replay/ReplayPlayer.d.ts +31 -0
  68. package/dist-lib/mud/replay/ReplayRecorder.d.ts +18 -0
  69. package/dist-lib/mud/replay/replayFormat.d.ts +49 -0
  70. package/dist-lib/mud/text/Console.d.ts +183 -0
  71. package/dist-lib/mud/text/FormatState.d.ts +256 -0
  72. package/dist-lib/mud/text/ansiEscapes.d.ts +88 -0
  73. package/dist-lib/mud/text/cellRender.d.ts +21 -0
  74. package/dist-lib/mud/text/colorParsers.d.ts +54 -0
  75. package/dist-lib/mud/text/colors.d.ts +31 -0
  76. package/dist-lib/mud/text/controlCharacterMode.d.ts +13 -0
  77. package/dist-lib/mud/text/controlChars.d.ts +31 -0
  78. package/dist-lib/mud/text/hyperlinkConfig.d.ts +164 -0
  79. package/dist-lib/mud/text/hyperlinkVisibility.d.ts +37 -0
  80. package/dist-lib/mud/text/oscLinkManager.d.ts +35 -0
  81. package/dist-lib/mud/text/wcwidth.d.ts +44 -0
  82. package/dist-lib/mud/text/xterm256.d.ts +2 -0
  83. package/dist-lib/mud/timers/TimerEngine.d.ts +61 -0
  84. package/dist-lib/mud/triggers/ChunkProcessor.d.ts +11 -0
  85. package/dist-lib/mud/triggers/TriggerEngine.d.ts +188 -0
  86. package/dist-lib/mud/triggers/pcre/Pcre2.d.ts +26 -0
  87. package/dist-lib/scripting/EngineHost.d.ts +152 -0
  88. package/dist-lib/scripting/GlobalEventChannel.d.ts +36 -0
  89. package/dist-lib/scripting/IScriptingRuntime.d.ts +95 -0
  90. package/dist-lib/scripting/MapOpenNotifier.d.ts +19 -0
  91. package/dist-lib/scripting/ScriptingAPI.d.ts +1691 -0
  92. package/dist-lib/scripting/ScriptingEngine.d.ts +806 -0
  93. package/dist-lib/scripting/StopwatchManager.d.ts +94 -0
  94. package/dist-lib/scripting/heldModifiers.d.ts +3 -0
  95. package/dist-lib/scripting/http/HttpService.d.ts +23 -0
  96. package/dist-lib/scripting/lua/LuaRuntime.d.ts +190 -0
  97. package/dist-lib/scripting/lua/bindings/automation.d.ts +10 -0
  98. package/dist-lib/scripting/lua/bindings/commandLine.d.ts +11 -0
  99. package/dist-lib/scripting/lua/bindings/context.d.ts +87 -0
  100. package/dist-lib/scripting/lua/bindings/cursor.d.ts +10 -0
  101. package/dist-lib/scripting/lua/bindings/diagnostics.d.ts +9 -0
  102. package/dist-lib/scripting/lua/bindings/map.d.ts +14 -0
  103. package/dist-lib/scripting/lua/bindings/media.d.ts +24 -0
  104. package/dist-lib/scripting/lua/bindings/output.d.ts +10 -0
  105. package/dist-lib/scripting/lua/bindings/packages.d.ts +10 -0
  106. package/dist-lib/scripting/lua/bindings/session.d.ts +16 -0
  107. package/dist-lib/scripting/lua/bindings/textEdit.d.ts +9 -0
  108. package/dist-lib/scripting/lua/bindings/userWindows.d.ts +11 -0
  109. package/dist-lib/scripting/lua/bindings/window.d.ts +10 -0
  110. package/dist-lib/scripting/lua/imageSize.d.ts +4 -0
  111. package/dist-lib/scripting/lua/luaCompletions.d.ts +9 -0
  112. package/dist-lib/scripting/lua/mudlet-lua/generic-mapper/generic_mapper.mpackage +0 -0
  113. package/dist-lib/scripting/lua/rex.d.ts +3 -0
  114. package/dist-lib/scripting/lua/sqlRowEncoder.d.ts +1 -0
  115. package/dist-lib/scripting/lua/yajl.d.ts +11 -0
  116. package/dist-lib/scripting/profilesPresence.d.ts +50 -0
  117. package/dist-lib/scripting/vfs/ProfileVFS.d.ts +62 -0
  118. package/dist-lib/scripting/vfs/cssRewrite.d.ts +21 -0
  119. package/dist-lib/scripting/vfs/folderHandleStore.d.ts +16 -0
  120. package/dist-lib/scripting/vfs/folderSync.d.ts +59 -0
  121. package/dist-lib/scripting/vfs/htmlRewrite.d.ts +26 -0
  122. package/dist-lib/scripting/vfs/vfsBridge.d.ts +16 -0
  123. package/dist-lib/services/cloudflare.d.ts +54 -0
  124. package/dist-lib/storage/appStore.d.ts +132 -0
  125. package/dist-lib/storage/crossTabSync.d.ts +3 -0
  126. package/dist-lib/storage/debouncedStorage.d.ts +18 -0
  127. package/dist-lib/storage/hooks.d.ts +17 -0
  128. package/dist-lib/storage/index.d.ts +4 -0
  129. package/dist-lib/storage/logExport.d.ts +32 -0
  130. package/dist-lib/storage/logStorage.d.ts +45 -0
  131. package/dist-lib/storage/mapStorage.d.ts +2 -0
  132. package/dist-lib/storage/profileVfsData.d.ts +47 -0
  133. package/dist-lib/storage/schema.d.ts +638 -0
  134. package/dist-lib/styles.css +2 -0
  135. package/dist-lib/ui/AboutModal.d.ts +8 -0
  136. package/dist-lib/ui/BrandLoginFields.d.ts +25 -0
  137. package/dist-lib/ui/BrandLoginScreen.d.ts +11 -0
  138. package/dist-lib/ui/CharLoginModal.d.ts +32 -0
  139. package/dist-lib/ui/CmdLineMenuRegistry.d.ts +27 -0
  140. package/dist-lib/ui/CodeEditorPreview.d.ts +19 -0
  141. package/dist-lib/ui/CommandBar.d.ts +17 -0
  142. package/dist-lib/ui/ConnectionFormModal.d.ts +13 -0
  143. package/dist-lib/ui/ConnectionGrid.d.ts +18 -0
  144. package/dist-lib/ui/ConnectionScreen.d.ts +14 -0
  145. package/dist-lib/ui/FileBrowserModal.d.ts +20 -0
  146. package/dist-lib/ui/FilePickerModal.d.ts +21 -0
  147. package/dist-lib/ui/FolderPermissionScreen.d.ts +16 -0
  148. package/dist-lib/ui/JsonPreview.d.ts +15 -0
  149. package/dist-lib/ui/LogBrowserModal.d.ts +7 -0
  150. package/dist-lib/ui/MapEditorModal.d.ts +9 -0
  151. package/dist-lib/ui/MarkdownPreview.d.ts +15 -0
  152. package/dist-lib/ui/MergeConflictModal.d.ts +17 -0
  153. package/dist-lib/ui/ModuleResolveModal.d.ts +22 -0
  154. package/dist-lib/ui/MouseEventRegistry.d.ts +31 -0
  155. package/dist-lib/ui/ProfileBusyScreen.d.ts +12 -0
  156. package/dist-lib/ui/ProfileExportModal.d.ts +7 -0
  157. package/dist-lib/ui/ProxyInfoModal.d.ts +6 -0
  158. package/dist-lib/ui/ProxyWhyModal.d.ts +6 -0
  159. package/dist-lib/ui/ProxyWizardModal.d.ts +6 -0
  160. package/dist-lib/ui/QuickOpenPalette.d.ts +8 -0
  161. package/dist-lib/ui/ResizableModal.d.ts +17 -0
  162. package/dist-lib/ui/ScriptingDocsModal.d.ts +12 -0
  163. package/dist-lib/ui/SettingsModal.d.ts +9 -0
  164. package/dist-lib/ui/Toolbar.d.ts +29 -0
  165. package/dist-lib/ui/bufferWords.d.ts +38 -0
  166. package/dist-lib/ui/buttons/ButtonsBar.d.ts +21 -0
  167. package/dist-lib/ui/cmdline/CommandLineManager.d.ts +97 -0
  168. package/dist-lib/ui/cmdline/CommandLineOverlay.d.ts +8 -0
  169. package/dist-lib/ui/codemirror/theme.d.ts +5 -0
  170. package/dist-lib/ui/commandHistory.d.ts +31 -0
  171. package/dist-lib/ui/components/Button.d.ts +9 -0
  172. package/dist-lib/ui/components/ConfirmDialog.d.ts +29 -0
  173. package/dist-lib/ui/components/ContextMenu.d.ts +9 -0
  174. package/dist-lib/ui/components/FontPicker.d.ts +9 -0
  175. package/dist-lib/ui/components/FormField.d.ts +16 -0
  176. package/dist-lib/ui/components/HelpTip.d.ts +7 -0
  177. package/dist-lib/ui/components/Input.d.ts +6 -0
  178. package/dist-lib/ui/components/Toggle.d.ts +10 -0
  179. package/dist-lib/ui/components/index.d.ts +9 -0
  180. package/dist-lib/ui/components/useModalFocus.d.ts +18 -0
  181. package/dist-lib/ui/labels/LabelManager.d.ts +220 -0
  182. package/dist-lib/ui/labels/LabelOverlay.d.ts +9 -0
  183. package/dist-lib/ui/labels/backgroundImageSize.d.ts +10 -0
  184. package/dist-lib/ui/labels/cursorShapes.d.ts +6 -0
  185. package/dist-lib/ui/labels/gifMovie.d.ts +100 -0
  186. package/dist-lib/ui/labels/qtCss.d.ts +57 -0
  187. package/dist-lib/ui/layout/ContentLayout.d.ts +19 -0
  188. package/dist-lib/ui/layout/DockArea.d.ts +14 -0
  189. package/dist-lib/ui/layout/DockedPanel.d.ts +13 -0
  190. package/dist-lib/ui/layout/FloatingWindowLayer.d.ts +10 -0
  191. package/dist-lib/ui/layout/MobileLayout.d.ts +22 -0
  192. package/dist-lib/ui/layout/PopoutWindow.d.ts +35 -0
  193. package/dist-lib/ui/layout/ScriptWindow.d.ts +29 -0
  194. package/dist-lib/ui/layout/SplitGroupPanel.d.ts +17 -0
  195. package/dist-lib/ui/layout/TabGroupPanel.d.ts +12 -0
  196. package/dist-lib/ui/layout/WindowContextMenu.d.ts +11 -0
  197. package/dist-lib/ui/layout/dockDetect.d.ts +26 -0
  198. package/dist-lib/ui/layout/overlayLayerOrder.d.ts +71 -0
  199. package/dist-lib/ui/markdown.d.ts +1 -0
  200. package/dist-lib/ui/output/CaretReviewPanel.d.ts +22 -0
  201. package/dist-lib/ui/output/OutputArea.d.ts +9 -0
  202. package/dist-lib/ui/output/OutputContextMenu.d.ts +23 -0
  203. package/dist-lib/ui/output/OutputRenderer.d.ts +64 -0
  204. package/dist-lib/ui/output/ScreenReaderLog.d.ts +23 -0
  205. package/dist-lib/ui/output/StickyOutputPanel.d.ts +28 -0
  206. package/dist-lib/ui/output/backgroundImageStyle.d.ts +17 -0
  207. package/dist-lib/ui/output/caretMode.d.ts +40 -0
  208. package/dist-lib/ui/output/linkNavigation.d.ts +29 -0
  209. package/dist-lib/ui/output/osc8Menu.d.ts +16 -0
  210. package/dist-lib/ui/output/outputCopy.d.ts +15 -0
  211. package/dist-lib/ui/preventPinchZoom.d.ts +1 -0
  212. package/dist-lib/ui/scrollbox/ScrollBoxManager.d.ts +62 -0
  213. package/dist-lib/ui/scrollbox/ScrollBoxOverlay.d.ts +25 -0
  214. package/dist-lib/ui/sound/SoundManager.d.ts +149 -0
  215. package/dist-lib/ui/sound/closedCaption.d.ts +37 -0
  216. package/dist-lib/ui/textedit/TextEditManager.d.ts +56 -0
  217. package/dist-lib/ui/tts/TtsManager.d.ts +68 -0
  218. package/dist-lib/ui/useBrandLogin.d.ts +19 -0
  219. package/dist-lib/ui/useCommandHistory.d.ts +7 -0
  220. package/dist-lib/ui/video/VideoManager.d.ts +56 -0
  221. package/dist-lib/ui/windows/ScriptEditorModal.d.ts +13 -0
  222. package/dist-lib/ui/windows/WindowManager.d.ts +694 -0
  223. package/dist-lib/ui/windows/panels/HtmlPanel.d.ts +27 -0
  224. package/dist-lib/ui/windows/panels/LuaEditor.d.ts +14 -0
  225. package/dist-lib/ui/windows/panels/MapPanel.d.ts +8 -0
  226. package/dist-lib/ui/windows/panels/PackageRepositoryModal.d.ts +18 -0
  227. package/dist-lib/ui/windows/panels/ScriptEditorPanel.d.ts +24 -0
  228. package/dist-lib/ui/windows/panels/ScriptSearch.d.ts +12 -0
  229. package/dist-lib/ui/windows/panels/TextPanel.d.ts +35 -0
  230. package/dist-lib/ui/windows/panels/VariablesView.d.ts +21 -0
  231. package/dist-lib/ui/windows/panels/VfsModulePickerModal.d.ts +8 -0
  232. package/dist-lib/ui/windows/panels/WindowCmdLine.d.ts +23 -0
  233. package/dist-lib/ui/windows/types.d.ts +145 -0
  234. package/dist-lib/utils/documentTitle.d.ts +33 -0
  235. package/dist-lib/utils/fontLoader.d.ts +52 -0
  236. package/dist-lib/utils/profileLock.d.ts +26 -0
  237. package/dist-lib/utils/sessionCredentials.d.ts +16 -0
  238. package/dist-lib/version.d.ts +39 -0
  239. package/dist-lib/vfs-sw.js +131 -0
  240. package/dist-lib/vite.d.ts +2 -0
  241. package/dist-lib/vite.js +154 -0
  242. package/package.json +93 -0
@@ -0,0 +1,15 @@
1
+ /** True when the current selection touches any line inside `container`. */
2
+ export declare function hasSelectionIn(container: HTMLElement): boolean;
3
+ /** Select every line in the container (Range over its contents). */
4
+ export declare function selectAll(container: HTMLElement): void;
5
+ /** Copy the native selection text verbatim (character-precise). */
6
+ export declare function copySelectionText(): Promise<void>;
7
+ /**
8
+ * Copy the selected lines as a complete, self-contained HTML document. The full
9
+ * document source goes on the clipboard as both `text/html` (so rich targets
10
+ * paste it rendered) and `text/plain` (so plain targets paste the HTML markup
11
+ * itself), with a `writeText` fallback for browsers without ClipboardItem.
12
+ */
13
+ export declare function copySelectionAsHtml(container: HTMLElement): Promise<void>;
14
+ /** Copy the selected lines to the clipboard as a PNG image. */
15
+ export declare function copySelectionAsImage(container: HTMLElement): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare function installPinchZoomGuard(): void;
@@ -0,0 +1,62 @@
1
+ import { OverlayLayerOrder } from '../layout/overlayLayerOrder';
2
+ export interface ScrollBoxCreateOptions {
3
+ /** Parent window id ('main' for the main viewport, or a userwindow / another
4
+ * scroll box name for nesting). */
5
+ parent?: string;
6
+ x: number;
7
+ y: number;
8
+ width: number;
9
+ height: number;
10
+ }
11
+ export interface ScrollBoxState {
12
+ name: string;
13
+ parent: string;
14
+ x: number;
15
+ y: number;
16
+ width: number;
17
+ height: number;
18
+ visible: boolean;
19
+ /** Raw Qt-style CSS string from a future setScrollBoxStyleSheet — stored for
20
+ * parity; Geyser.ScrollBox:setStyleSheet is itself unimplemented upstream. */
21
+ styleSheet?: string;
22
+ }
23
+ type Listener = (scrollBoxes: ScrollBoxState[]) => void;
24
+ /**
25
+ * Registry for overlay scroll-box widgets (Mudlet createScrollBox). A scroll box
26
+ * is an absolutely-positioned, scrollable container on top of a parent viewport
27
+ * that other overlay widgets (labels, command lines, nested scroll boxes) can be
28
+ * created *inside* by passing the box's name as their parent — mirroring
29
+ * Mudlet's Geyser.ScrollBox, which treats the box as its own "window".
30
+ *
31
+ * Shares the per-parent subscriber shape of {@link CommandLineManager} /
32
+ * {@link LabelManager}; the React {@link ScrollBoxOverlay} renders each box and
33
+ * mounts the child overlays scoped to the box's name within its scroll area.
34
+ */
35
+ export declare class ScrollBoxManager {
36
+ readonly overlayZ: OverlayLayerOrder;
37
+ private readonly boxes;
38
+ private readonly listeners;
39
+ constructor(overlayZ?: OverlayLayerOrder);
40
+ /** Mudlet createScrollBox([parent,] name, x, y, w, h) — false when a scroll
41
+ * box with that name already exists. */
42
+ create(name: string, opts: ScrollBoxCreateOptions): boolean;
43
+ has(name: string): boolean;
44
+ get(name: string): ScrollBoxState | undefined;
45
+ destroy(name: string): boolean;
46
+ move(name: string, x: number, y: number): boolean;
47
+ resize(name: string, width: number, height: number): boolean;
48
+ /** Mudlet setWindow — reparent a scroll box into another window's
49
+ * overlay. Both the old and the new parent's overlays re-render.
50
+ * Cycle prevention is the caller's job (ScriptingAPI.setWindow). */
51
+ setParent(name: string, parent: string): boolean;
52
+ show(name: string): boolean;
53
+ hide(name: string): boolean;
54
+ raise(name: string): boolean;
55
+ lower(name: string): boolean;
56
+ setStyleSheet(name: string, css: string): boolean;
57
+ list(parent: string): ScrollBoxState[];
58
+ subscribe(parent: string, fn: Listener): () => void;
59
+ clearAll(): void;
60
+ private notify;
61
+ }
62
+ export {};
@@ -0,0 +1,25 @@
1
+ import type { ScrollBoxManager } from './ScrollBoxManager';
2
+ import type { LabelManager } from '../labels/LabelManager';
3
+ import type { CommandLineManager } from '../cmdline/CommandLineManager';
4
+ import './ScrollBoxOverlay.css';
5
+ interface ScrollBoxOverlayProps {
6
+ manager: ScrollBoxManager;
7
+ labels: LabelManager;
8
+ cmdLines: CommandLineManager;
9
+ /** Viewport whose scroll boxes this overlay renders ('main', a userwindow
10
+ * id, or — when nested — another scroll box's name). */
11
+ parent: string;
12
+ }
13
+ /**
14
+ * Renders the {@link ScrollBoxManager}'s boxes for a given parent viewport as
15
+ * absolutely-positioned scrollable containers. Each box hosts the child overlays
16
+ * (labels, command lines, and nested scroll boxes) scoped to the box's own name,
17
+ * so widgets created with `parent = boxName` render inside it.
18
+ *
19
+ * Scrolling: the children are absolutely positioned and don't expand their
20
+ * containers on their own, so each box wraps them in a content div sized to the
21
+ * extent of its children (the furthest child edge). When that extent exceeds the
22
+ * box, the box's `overflow:auto` produces real scrollbars.
23
+ */
24
+ export declare function ScrollBoxOverlay({ manager, labels, cmdLines, parent }: ScrollBoxOverlayProps): import("react/jsx-runtime").JSX.Element | null;
25
+ export {};
@@ -0,0 +1,149 @@
1
+ import type { MediaCaptionInfo } from './closedCaption';
2
+ type LoaderFn = (path: string) => Promise<ArrayBuffer | null>;
3
+ /** Which mute gate a playback belongs to. `api` = triggered by a Lua script
4
+ * (playSoundFile / playMusicFile); `game` = triggered by the server (MSP, and
5
+ * GMCP media). Mirrors Mudlet's muteMediaAPI / muteMediaGame split, where API
6
+ * media maps to MediaProtocolAPI and game media to MSP/GMCP. */
7
+ export type MediaOrigin = 'api' | 'game';
8
+ export interface PlaySoundOptions {
9
+ name: string;
10
+ /** 0..100 — Mudlet scale. Default 50. */
11
+ volume?: number;
12
+ /** Fade-in duration in milliseconds. */
13
+ fadein?: number;
14
+ /** Fade-out duration in milliseconds (on natural end or stop). */
15
+ fadeout?: number;
16
+ /** Start offset within the buffer, in milliseconds. */
17
+ start?: number;
18
+ /** Loop count. 1 = play once (default). -1 = infinite. N>1 = N total plays. */
19
+ loops?: number;
20
+ /** Dedupe key — calling again with same key replaces the previous one. */
21
+ key?: string;
22
+ /** Group tag — stopMusic({tag=...}) and stopSounds() filter on this. */
23
+ tag?: string;
24
+ /** Which mute gate governs this playback. Default 'api'. */
25
+ origin?: MediaOrigin;
26
+ /** Optional closed-caption text (Mudlet's media `caption`). Shown verbatim
27
+ * when closed captions are on; absent → a caption is synthesized from the
28
+ * kind + filename. */
29
+ caption?: string;
30
+ }
31
+ export interface PlayMusicOptions extends PlaySoundOptions {
32
+ /** If true and a music track with the same name+key is already playing, do nothing. */
33
+ continue?: boolean;
34
+ }
35
+ export interface StopMusicOptions {
36
+ name?: string;
37
+ key?: string;
38
+ tag?: string;
39
+ /** Fade-out duration in milliseconds. Overrides the source's own fadeout. */
40
+ fadeout?: number;
41
+ }
42
+ export declare class SoundManager {
43
+ private nextId;
44
+ private active;
45
+ private loader;
46
+ /** 0..1, applied as an extra multiplier on every source's gain. */
47
+ private masterVolume;
48
+ /**
49
+ * Persistent per-origin mute gates — Mudlet's muteMediaAPI / muteMediaGame.
50
+ * A muted origin's sources keep playing (their position advances) but their
51
+ * gain is pinned to 0, and new sources of that origin start silent; nothing
52
+ * is stopped, so unmuting restores audibility mid-track. This mirrors Mudlet
53
+ * toggling QAudioOutput::setMuted on the live players by protocol rather than
54
+ * tearing them down.
55
+ */
56
+ private muted;
57
+ /**
58
+ * Raised when a tracked source ends — whether it played out naturally or
59
+ * was stopped. ScriptingEngine wires this to raise Mudlet's
60
+ * `sysMediaFinished(name, path)`. `stopAll()` nulls each source's onended
61
+ * before stopping, so engine teardown never fires it.
62
+ */
63
+ onMediaFinished?: (name: string, path: string) => void;
64
+ /**
65
+ * Raised when a tracked source starts ('plays') or ends ('stops'), so the
66
+ * engine can print a closed caption (Mudlet's enableClosedCaption). Fires
67
+ * regardless of the caption setting — the consumer decides whether to show
68
+ * it. Not fired by `stopAll()` (teardown nulls each onended first).
69
+ */
70
+ onMediaCaption?: (info: MediaCaptionInfo) => void;
71
+ setLoader(fn: LoaderFn | null): void;
72
+ setMasterVolume(value: number): void;
73
+ /**
74
+ * Mudlet `muteMediaAPI` / `muteMediaGame`. Sets the persistent mute gate for
75
+ * a playback origin. While muted, that origin's currently-playing sources are
76
+ * silenced in place (gain → 0, position keeps advancing) and any new ones
77
+ * start silent — but nothing is stopped, so unmuting restores audibility
78
+ * mid-track. `api` gates script playback (playSoundFile/playMusicFile);
79
+ * `game` gates server-driven media (MSP / GMCP).
80
+ */
81
+ setOriginMuted(origin: MediaOrigin, muted: boolean): void;
82
+ isOriginMuted(origin: MediaOrigin): boolean;
83
+ /** Output gain for a source: its own volume scaled by the master volume,
84
+ * pinned to 0 while its origin is muted. */
85
+ private effectiveGain;
86
+ playSound(opts: PlaySoundOptions): Promise<number>;
87
+ playMusic(opts: PlayMusicOptions): Promise<number>;
88
+ stopSounds(): void;
89
+ /**
90
+ * Mudlet `pauseSounds([channel])`. Web Audio source nodes can be
91
+ * scheduled to start but not paused once playing — they're transient by
92
+ * design, with no equivalent of QMediaPlayer::pause(). We approximate
93
+ * Mudlet's contract by stopping the matching sources outright (so the
94
+ * mute happens immediately) and let the player retrigger them with
95
+ * `playSoundFile` to resume. The optional `channel` filters by the
96
+ * source's `tag` (matches Mudlet's "channel" semantics: a Tag string
97
+ * passed to playSoundFile). Music sources are untouched — they have a
98
+ * separate `stopMusic` codepath.
99
+ */
100
+ pauseSounds(channel?: string): void;
101
+ /**
102
+ * Mudlet `pauseMusic([settings])`. Web Audio source nodes can't truly
103
+ * pause once started (same constraint as {@link pauseSounds}), so this is
104
+ * an immediate fade-out + stop of the matching music sources — re-trigger
105
+ * `playMusicFile` to "resume". The optional `channel`/tag filters which
106
+ * music tracks are affected; sound effects are untouched.
107
+ */
108
+ pauseMusic(channel?: string): void;
109
+ stopMusic(opts?: StopMusicOptions): void;
110
+ /**
111
+ * Mudlet getPlayingSounds / getPlayingMusic. Returns the currently-playing
112
+ * sources of the requested `kind` (default 'sound' — music is reported
113
+ * separately by getPlayingMusic) optionally filtered by name/key/tag.
114
+ * Volume is reported on Mudlet's 0..100 scale.
115
+ */
116
+ getPlaying(filter?: {
117
+ name?: string;
118
+ key?: string;
119
+ tag?: string;
120
+ }, kind?: 'sound' | 'music'): Array<{
121
+ name: string;
122
+ key?: string;
123
+ tag?: string;
124
+ volume: number;
125
+ }>;
126
+ /**
127
+ * Mudlet loadSoundFile. Preloads (decodes + caches) a sound so the first
128
+ * playSoundFile has no decode latency. Fire-and-forget: warms `decodeCache`
129
+ * via the same path playSound uses, so a later play of the same name hits
130
+ * the cache. Returns false when no AudioContext is available yet.
131
+ */
132
+ preload(name: string): boolean;
133
+ /**
134
+ * Mudlet `purgeMediaCache()` — drop every decoded-audio buffer so the next
135
+ * play of any file re-fetches and re-decodes it. Active playback is
136
+ * untouched (the cache only fronts the decode step). Always returns true.
137
+ */
138
+ purgeCache(): boolean;
139
+ /** Stop everything this manager owns. Call on engine teardown. */
140
+ stopAll(): void;
141
+ destroy(): void;
142
+ private play;
143
+ private fadeAndStop;
144
+ private isMusicPlaying;
145
+ private stopMusicMatching;
146
+ private updateMediaSessionState;
147
+ private firstActiveMusicName;
148
+ }
149
+ export {};
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Closed captions for media (Mudlet's `enableClosedCaption`). When enabled,
3
+ * each sound / music / video that starts or stops prints a short text line into
4
+ * the main output so deaf / hard-of-hearing players know audio fired — and, via
5
+ * the normal output path, screen-reader users hear it announced.
6
+ *
7
+ * Faithful to Mudlet `TMedia::printClosedCaption` (TMedia.cpp:2084-2110):
8
+ * captions cover audio + video ONLY — there is no image media type, so images
9
+ * are never captioned. This module holds the pure formatter; the SoundManager /
10
+ * VideoManager raise the lifecycle events and ScriptingEngine prints the line.
11
+ */
12
+ /** Media families Mudlet captions. Notably no `image` — images never flow
13
+ * through the media player and so are never captioned. */
14
+ export type MediaKind = 'sound' | 'music' | 'video';
15
+ /** The player-lifecycle verb shown in the caption. Mudlet also has pauses/fades,
16
+ * but mudix's Web Audio model collapses those into a stop, so we expose the two
17
+ * transitions that map cleanly. */
18
+ export type CaptionAction = 'plays' | 'stops';
19
+ export interface MediaCaptionInfo {
20
+ kind: MediaKind;
21
+ /** The path or name handed to the player; the trailing segment is shown. */
22
+ name: string;
23
+ /** Media key, when one was supplied. */
24
+ key?: string;
25
+ /** Explicit caption from the media packet / Lua `caption` arg, if any. */
26
+ caption?: string;
27
+ action: CaptionAction;
28
+ }
29
+ /**
30
+ * Format one caption line, mirroring Mudlet's text exactly:
31
+ * - with an explicit caption: `[<caption> <action>]`
32
+ * - else, with a key: `[<kind> <key> "<file>" <action>]`
33
+ * - else: `[<kind> "<file>" <action>]`
34
+ * `<file>` is the trailing path segment of `name` (Mudlet shows the bare
35
+ * filename, not the resolved path).
36
+ */
37
+ export declare function formatClosedCaption(info: MediaCaptionInfo): string;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Registry for Mudlet `createTextEdit` widgets — a multi-line text editor pane.
3
+ *
4
+ * This is the data model behind the `*TextEdit*` Lua API (text content, the
5
+ * editor properties scripts set, and geometry/visibility). The on-screen
6
+ * QPlainTextEdit-equivalent rendering is not wired yet; scripts can create
7
+ * editors and round-trip their text/properties, which is what the Mudlet API
8
+ * surface (and the busted TextEdit spec) exercises.
9
+ */
10
+ export interface TextEditState {
11
+ parent: string;
12
+ x: number;
13
+ y: number;
14
+ width: number;
15
+ height: number;
16
+ text: string;
17
+ readOnly: boolean;
18
+ placeholder: string;
19
+ styleSheet: string;
20
+ font: string;
21
+ fontSize: number;
22
+ tabMovesFocus: boolean;
23
+ visible: boolean;
24
+ }
25
+ export declare class TextEditManager {
26
+ private edits;
27
+ has(name: string): boolean;
28
+ /** Read-only handle on a text edit's stored state, for the geometry and
29
+ * visibility getters (getWindowGeometry, windowVisible). */
30
+ get(name: string): Readonly<TextEditState> | undefined;
31
+ /** Create (or replace) a text edit. Returns true (Mudlet always succeeds). */
32
+ create(name: string, opts: {
33
+ parent: string;
34
+ x: number;
35
+ y: number;
36
+ width: number;
37
+ height: number;
38
+ }): boolean;
39
+ destroy(name: string): boolean;
40
+ /** Returns the editor's text, or null when no editor of that name exists. */
41
+ getText(name: string): string | null;
42
+ setText(name: string, text: string): boolean;
43
+ clear(name: string): boolean;
44
+ setReadOnly(name: string, value: boolean): boolean;
45
+ setPlaceholder(name: string, text: string): boolean;
46
+ setStyleSheet(name: string, css: string): boolean;
47
+ setFont(name: string, font: string): boolean;
48
+ setFontSize(name: string, size: number): boolean;
49
+ setTabMovesFocus(name: string, value: boolean): boolean;
50
+ show(name: string): boolean;
51
+ hide(name: string): boolean;
52
+ move(name: string, x: number, y: number): boolean;
53
+ /** Mudlet setWindow — reparent a text edit into another window. */
54
+ setParent(name: string, parent: string): boolean;
55
+ resize(name: string, width: number, height: number): boolean;
56
+ }
@@ -0,0 +1,68 @@
1
+ export type TtsState = 'ttsSpeechReady' | 'ttsSpeechStarted' | 'ttsSpeechPaused' | 'ttsSpeechError' | 'ttsUnknownState';
2
+ type EmitFn = (event: string, args: unknown[]) => void;
3
+ export declare class TtsManager {
4
+ private readonly emit;
5
+ private readonly synth;
6
+ private pending;
7
+ private current;
8
+ private state;
9
+ private rate;
10
+ private pitch;
11
+ private volume;
12
+ private voiceName;
13
+ private gen;
14
+ private destroyed;
15
+ private readonly onVoicesChanged;
16
+ constructor(emit: EmitFn);
17
+ /** Mudlet ttsSpeak — speak `text` immediately, interrupting anything in
18
+ * progress. The queue is untouched and resumes once `text` finishes. */
19
+ speak(text: string): void;
20
+ /** Mudlet ttsQueue — append `text` to the queue (or insert at 1-based
21
+ * `index`). Starts playback if nothing is currently speaking. */
22
+ queue(text: string, index?: number): void;
23
+ /** Mudlet ttsSkip — stop the current utterance and move on to the next
24
+ * queued one (if any). */
25
+ skip(): void;
26
+ /** Mudlet ttsPause — pause the current utterance. */
27
+ pause(): void;
28
+ /** Mudlet ttsResume — resume a paused utterance. */
29
+ resume(): void;
30
+ /** Mudlet ttsClearQueue — drop the whole pending queue, or just the item at
31
+ * 1-based `index`. Returns false when `index` is out of bounds (the
32
+ * currently-speaking utterance is never in the queue and is unaffected). */
33
+ clearQueue(index?: number): boolean;
34
+ /** Mudlet ttsGetQueue — the pending texts (1-based index returns one item,
35
+ * or false if out of bounds; no index returns the whole list). */
36
+ getQueue(): string[];
37
+ getQueue(index: number): string | false;
38
+ /** Mudlet ttsGetState — one of the tts* state strings. */
39
+ getState(): TtsState;
40
+ /** Mudlet ttsGetCurrentLine — the text being spoken, or null when idle
41
+ * (Ready) / errored. The Lua wrapper maps null to (nil, reason). */
42
+ getCurrentLine(): string | null;
43
+ /** Mudlet ttsGetVoices — the available voice names. */
44
+ getVoices(): string[];
45
+ /** Mudlet ttsGetCurrentVoice — the selected voice name, falling back to the
46
+ * engine's first available voice when none was set. */
47
+ getCurrentVoice(): string;
48
+ getRate(): number;
49
+ getPitch(): number;
50
+ getVolume(): number;
51
+ /** Mudlet ttsSetRate — clamps to -1..1, stores it, raises ttsRateChanged. */
52
+ setRate(rate: number): void;
53
+ /** Mudlet ttsSetPitch — clamps to -1..1, stores it, raises ttsPitchChanged. */
54
+ setPitch(pitch: number): void;
55
+ /** Mudlet ttsSetVolume — clamps to 0..1, stores it, raises ttsVolumeChanged. */
56
+ setVolume(volume: number): void;
57
+ /** Mudlet ttsSetVoiceByName — selects a voice by name. Returns false when no
58
+ * voice matches; otherwise stores it and raises ttsVoiceChanged. */
59
+ setVoiceByName(name: string): boolean;
60
+ /** Mudlet ttsSetVoiceByIndex — selects a voice by 1-based index. Returns
61
+ * false when out of bounds. */
62
+ setVoiceByIndex(index: number): boolean;
63
+ destroy(): void;
64
+ private advance;
65
+ private beginUtterance;
66
+ private setState;
67
+ }
68
+ export {};
@@ -0,0 +1,19 @@
1
+ import type { LandingProps } from '../branding';
2
+ export interface UseBrandLoginResult {
3
+ account: string;
4
+ setAccount: (value: string) => void;
5
+ password: string;
6
+ setPassword: (value: string) => void;
7
+ /** Find-or-create the profile, stash credentials in memory, and open it.
8
+ * `connect` dials immediately; false opens offline. */
9
+ enter: (connect: boolean) => void;
10
+ }
11
+ /**
12
+ * Shared login-form state for custom branded landings. Handles the
13
+ * find-or-create-profile + in-memory-credential-stash + open sequence common
14
+ * to every branded login screen, and prefills from the last credentials
15
+ * entered this page (e.g. after backing out of a profile) — nothing is ever
16
+ * read from or written to storage. Bring your own markup; for a ready-made
17
+ * form see `BrandLoginFields`.
18
+ */
19
+ export declare function useBrandLogin({ openProfile, ensureBrandProfile }: Pick<LandingProps, 'openProfile' | 'ensureBrandProfile'>): UseBrandLoginResult;
@@ -0,0 +1,7 @@
1
+ /** Reactive MRU command history wrapper around localStorage. History is scoped
2
+ * to `connectionId` so each profile keeps its own. `saveSize` caps how many
3
+ * entries are persisted (Mudlet's `commandLineHistorySaveSize`). */
4
+ export declare function useCommandHistory(connectionId: string | null, saveSize?: number): {
5
+ history: string[];
6
+ add: (item: string) => void;
7
+ };
@@ -0,0 +1,56 @@
1
+ import type { MediaCaptionInfo } from '../sound/closedCaption';
2
+ type LoaderFn = (path: string) => Promise<ArrayBuffer | null>;
3
+ export interface PlayVideoOptions {
4
+ name: string;
5
+ /** 0..100 — Mudlet scale. Default 50. */
6
+ volume?: number;
7
+ /** Loop count. 1 = play once (default). -1 = infinite. */
8
+ loops?: number;
9
+ /** CSS units; default fills the viewport. */
10
+ width?: string;
11
+ height?: string;
12
+ /** Optional closed-caption text (Mudlet's media `caption`). */
13
+ caption?: string;
14
+ }
15
+ export declare class VideoManager {
16
+ private loader;
17
+ /** Returns the DOM element that videos should be attached to. Set by
18
+ * WindowManager.observeMain so videos drop onto the main viewport. */
19
+ private getMount;
20
+ private active;
21
+ /** Buffers fetched ahead of play via loadVideoFile, keyed by VFS path. */
22
+ private prefetched;
23
+ /** Fires when a video ends naturally or is stopped — mirrors Mudlet's
24
+ * sysMediaFinished. */
25
+ onEnded: ((name: string, path: string) => void) | null;
26
+ /** Raised when a video starts ('plays') or finishes ('stops') so the engine
27
+ * can print a closed caption (Mudlet's enableClosedCaption). */
28
+ onMediaCaption: ((info: MediaCaptionInfo) => void) | null;
29
+ setLoader(fn: LoaderFn | null): void;
30
+ setMountPoint(fn: (() => HTMLElement | null) | null): void;
31
+ /**
32
+ * Mudlet `loadVideoFile`. Preloads (fetches + caches) a VFS-backed video so
33
+ * the first playVideoFile has no fetch latency. http(s)/data/blob URLs need
34
+ * no preloading (the element fetches them directly) and report success.
35
+ * Returns false when no loader is wired or the fetch fails.
36
+ */
37
+ preload(path: string): Promise<boolean>;
38
+ play(path: string, opts: PlayVideoOptions): Promise<boolean>;
39
+ pauseAll(): void;
40
+ /**
41
+ * Mudlet `getPlayingVideos([settings])` / `getPausedVideos([settings])`.
42
+ * Lists the videos currently in the requested play state, optionally
43
+ * filtered by name. Volume is reported on Mudlet's 0..100 scale.
44
+ */
45
+ getByState(wantPaused: boolean, filter?: {
46
+ name?: string;
47
+ }): Array<{
48
+ name: string;
49
+ path: string;
50
+ volume: number;
51
+ }>;
52
+ stopAll(): void;
53
+ private stopByName;
54
+ destroy(): void;
55
+ }
56
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { MudSession } from '../../mud/MudSession';
2
+ import type { ProfileVFS } from '../../scripting/vfs/ProfileVFS';
3
+ import type { ScriptingEngine } from '../../scripting/ScriptingEngine';
4
+ interface Props {
5
+ connectionId: string;
6
+ session: MudSession;
7
+ vfs: ProfileVFS | null;
8
+ scriptingEngineRef?: React.RefObject<ScriptingEngine | null>;
9
+ onClose: () => void;
10
+ onOpenVfsFile?: (path: string, line?: number) => void;
11
+ }
12
+ export declare function ScriptEditorModal({ connectionId, session, vfs, scriptingEngineRef, onClose, onOpenVfsFile }: Props): import("react/jsx-runtime").JSX.Element;
13
+ export {};