@mudlet/mudlet-web 0.3.0 → 0.4.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 (111) hide show
  1. package/LICENSE +338 -338
  2. package/README.md +158 -150
  3. package/dist-lib/assets/qt-resources/index.d.ts +16 -0
  4. package/dist-lib/branding.d.ts +1 -1
  5. package/dist-lib/hooks/useMudSession.d.ts +1 -1
  6. package/dist-lib/hooks/useOutput.d.ts +3 -1
  7. package/dist-lib/import/defaultPackages.d.ts +35 -2
  8. package/dist-lib/import/defaults/generic_mapper/generic_mapper.mpackage +0 -0
  9. package/dist-lib/import/defaults/gui-drop/gui-drop.mpackage +0 -0
  10. package/dist-lib/import/defaults/{run-lua-code.mpackage → mudlet-base-ui/mudlet-base-ui.mpackage} +0 -0
  11. package/dist-lib/import/defaults/mudlet-mapper.xml +13023 -13023
  12. package/dist-lib/import/defaults/run-lua-code/run-lua-code.mpackage +0 -0
  13. package/dist-lib/import/packageExport.d.ts +71 -0
  14. package/dist-lib/import/packageInstaller.d.ts +4 -1
  15. package/dist-lib/index.js +45910 -39931
  16. package/dist-lib/logging/SessionLogger.d.ts +66 -1
  17. package/dist-lib/map/MapStore.d.ts +32 -4
  18. package/dist-lib/map/mapImageExport.d.ts +1 -1
  19. package/dist-lib/map/mapZoom.d.ts +71 -0
  20. package/dist-lib/mud/ItemIdSequence.d.ts +23 -0
  21. package/dist-lib/mud/MudSession.d.ts +113 -11
  22. package/dist-lib/mud/PatternEngine.d.ts +6 -1
  23. package/dist-lib/mud/commandSplit.d.ts +16 -0
  24. package/dist-lib/mud/connection/LineAssembler.d.ts +56 -0
  25. package/dist-lib/mud/connection/MudClient.d.ts +136 -19
  26. package/dist-lib/mud/connection/TelnetNegotiator.d.ts +39 -0
  27. package/dist-lib/mud/connection/telnetByteTags.d.ts +35 -0
  28. package/dist-lib/mud/events.d.ts +86 -4
  29. package/dist-lib/mud/games/bundledGames.d.ts +29 -0
  30. package/dist-lib/mud/games/gameIcons.d.ts +5 -0
  31. package/dist-lib/mud/keybindings/KeyEngine.d.ts +9 -2
  32. package/dist-lib/mud/keybindings/browserReservedKeys.d.ts +5 -1
  33. package/dist-lib/mud/keybindings/keyEventTarget.d.ts +17 -0
  34. package/dist-lib/mud/keybindings/qtKeys.d.ts +2 -0
  35. package/dist-lib/mud/protocol/charLoginFlow.d.ts +68 -0
  36. package/dist-lib/mud/protocol/charset.d.ts +27 -5
  37. package/dist-lib/mud/protocol/constants.d.ts +1 -0
  38. package/dist-lib/mud/protocol/gmcp.d.ts +19 -3
  39. package/dist-lib/mud/protocol/index.d.ts +1 -1
  40. package/dist-lib/mud/protocol/msspTls.d.ts +54 -0
  41. package/dist-lib/mud/protocol/mxp.d.ts +28 -5
  42. package/dist-lib/mud/protocol/tlsCodes.d.ts +4 -0
  43. package/dist-lib/mud/replay/ReplayPlayer.d.ts +17 -0
  44. package/dist-lib/mud/text/Console.d.ts +64 -0
  45. package/dist-lib/mud/text/FormatState.d.ts +66 -3
  46. package/dist-lib/mud/text/hyperlinkVisibility.d.ts +35 -0
  47. package/dist-lib/mud/text/osc8Docs.d.ts +23 -0
  48. package/dist-lib/mud/text/serverWrap.d.ts +191 -0
  49. package/dist-lib/mud/timers/TimerEngine.d.ts +43 -12
  50. package/dist-lib/mud/triggers/TriggerEngine.d.ts +112 -3
  51. package/dist-lib/scripting/EngineHost.d.ts +56 -3
  52. package/dist-lib/scripting/IScriptingRuntime.d.ts +22 -0
  53. package/dist-lib/scripting/MxpFrameManager.d.ts +118 -0
  54. package/dist-lib/scripting/ScriptingAPI.d.ts +331 -54
  55. package/dist-lib/scripting/ScriptingEngine.d.ts +181 -24
  56. package/dist-lib/scripting/http/HttpService.d.ts +51 -1
  57. package/dist-lib/scripting/lua/LuaRuntime.d.ts +159 -2
  58. package/dist-lib/scripting/lua/bindings/map.d.ts +0 -12
  59. package/dist-lib/scripting/lua/utf8Patterns.d.ts +59 -0
  60. package/dist-lib/storage/index.d.ts +1 -1
  61. package/dist-lib/storage/persistentStorage.d.ts +10 -0
  62. package/dist-lib/storage/schema.d.ts +166 -4
  63. package/dist-lib/styles.css +1 -1
  64. package/dist-lib/ui/BundledGameGrid.d.ts +21 -0
  65. package/dist-lib/ui/CharLoginModal.d.ts +5 -1
  66. package/dist-lib/ui/CommandBar.d.ts +7 -1
  67. package/dist-lib/ui/ConnectionGrid.d.ts +4 -1
  68. package/dist-lib/ui/FileBrowserModal.d.ts +1 -0
  69. package/dist-lib/ui/FilePickerModal.d.ts +3 -3
  70. package/dist-lib/ui/HelpModal.d.ts +11 -0
  71. package/dist-lib/ui/LogBrowserModal.d.ts +4 -1
  72. package/dist-lib/ui/PlayerMarkerPreview.d.ts +20 -0
  73. package/dist-lib/ui/SettingsModal.d.ts +5 -1
  74. package/dist-lib/ui/TlsAlertBanner.d.ts +18 -0
  75. package/dist-lib/ui/TlsCertificateBox.d.ts +20 -0
  76. package/dist-lib/ui/TlsUpgradeModal.d.ts +16 -0
  77. package/dist-lib/ui/Toolbar.d.ts +2 -1
  78. package/dist-lib/ui/VfsPickerModal.d.ts +26 -0
  79. package/dist-lib/ui/components/FileSourceButton.d.ts +47 -0
  80. package/dist-lib/ui/components/index.d.ts +1 -0
  81. package/dist-lib/ui/components/useModalFocus.d.ts +6 -0
  82. package/dist-lib/ui/helpTopics.d.ts +19 -0
  83. package/dist-lib/ui/labels/LabelManager.d.ts +32 -0
  84. package/dist-lib/ui/labels/labelLinks.d.ts +52 -0
  85. package/dist-lib/ui/layout/ScriptWindow.d.ts +11 -2
  86. package/dist-lib/ui/markdown.d.ts +10 -1
  87. package/dist-lib/ui/output/OutputArea.d.ts +11 -1
  88. package/dist-lib/ui/output/OutputContextMenu.d.ts +3 -1
  89. package/dist-lib/ui/output/OutputRenderer.d.ts +7 -1
  90. package/dist-lib/ui/output/OutputSearchBar.d.ts +25 -0
  91. package/dist-lib/ui/output/StickyOutputPanel.d.ts +5 -1
  92. package/dist-lib/ui/output/linkNavigation.d.ts +22 -0
  93. package/dist-lib/ui/output/outputSearch.d.ts +130 -0
  94. package/dist-lib/ui/search/matcher.d.ts +15 -0
  95. package/dist-lib/ui/search/useDebounced.d.ts +3 -0
  96. package/dist-lib/ui/tts/TtsManager.d.ts +3 -0
  97. package/dist-lib/ui/useCommandHistory.d.ts +4 -2
  98. package/dist-lib/ui/useOpenProfiles.d.ts +26 -0
  99. package/dist-lib/ui/video/VideoManager.d.ts +17 -0
  100. package/dist-lib/ui/windows/WindowManager.d.ts +149 -2
  101. package/dist-lib/ui/windows/panels/MapPanel.d.ts +4 -1
  102. package/dist-lib/ui/windows/panels/PackageExportModal.d.ts +18 -0
  103. package/dist-lib/ui/windows/panels/TextPanel.d.ts +3 -1
  104. package/dist-lib/ui/windows/types.d.ts +35 -0
  105. package/dist-lib/utils/describeThrown.d.ts +22 -0
  106. package/dist-lib/utils/fontLoader.d.ts +5 -0
  107. package/dist-lib/vfs-sw.js +131 -131
  108. package/dist-lib/vite.js +22 -0
  109. package/package.json +97 -93
  110. package/dist-lib/scripting/lua/mudlet-lua/generic-mapper/generic_mapper.mpackage +0 -0
  111. package/dist-lib/ui/windows/panels/VfsModulePickerModal.d.ts +0 -8
@@ -0,0 +1,118 @@
1
+ /**
2
+ * MXP `<FRAME>` window layout — a port of Mudlet 4.21's `TMxpFrameManager`
3
+ * (src/TMxpFrameManager.cpp).
4
+ *
5
+ * MXP lets a server carve the client window into named sub-windows and then
6
+ * redirect text into them with `<DEST>`. Mudlet lays those out itself rather
7
+ * than handing them to the OS window manager: internal frames are tiled against
8
+ * the edges of the main console, each one shrinking the console's usable area
9
+ * by adding to a set of "MXP borders", and frames declared inside an open
10
+ * `<DEST>` nest inside that destination frame instead. `TITLE` gives a frame a
11
+ * tab header, and `DOCK`+`ALIGN=CLIENT` (a CMUD extension, not MXP 1.0) adds a
12
+ * frame as another tab of an existing one.
13
+ *
14
+ * This class owns the same bookkeeping — the frame records, the accumulated
15
+ * borders, the parent/child hierarchy and the tab groups — and drives the UI
16
+ * through {@link MxpFrameHost} so the geometry is testable without a DOM.
17
+ * mudix maps a frame's console onto a mini-console (an overlay panel with
18
+ * script-controlled geometry); the tab strip is window chrome rendered by
19
+ * ScriptWindow, and child frames nest by portalling into the parent panel's
20
+ * viewport, so their coordinates are parent-relative.
21
+ */
22
+ import type { MxpTabPage } from '../ui/windows/types';
23
+ /** Height in px of a frame's tab strip. Must match `.mxp-frame-tabs` in ScriptWindow.css. */
24
+ export declare const MXP_TAB_BAR_HEIGHT = 24;
25
+ /** Pixel insets carved out of the main console by edge-aligned frames. */
26
+ export interface MxpBorders {
27
+ top: number;
28
+ right: number;
29
+ bottom: number;
30
+ left: number;
31
+ }
32
+ /** Rectangle, in main-viewport coordinates, that top-level frames tile inside. */
33
+ export interface MxpArea {
34
+ x: number;
35
+ y: number;
36
+ width: number;
37
+ height: number;
38
+ }
39
+ /** Everything the layout needs from the app. Implemented by ScriptingAPI. */
40
+ export interface MxpFrameHost {
41
+ /** The region top-level frames may tile in: the main window minus whatever
42
+ * `setBorder*` has reserved. A GUI package that docks itself to an edge
43
+ * (Geyser's `Adjustable.Container{attached=…}`) reserves its strip that
44
+ * way, and a server laying out frames must not tile over it. MXP's own
45
+ * borders are excluded — the manager tracks those itself. */
46
+ consoleArea(): MxpArea;
47
+ /** Character cell `[width, height]` in px for the main output font, backing `Nc` sizes. */
48
+ charCellSize(): [number, number];
49
+ /** Create (or reposition) a frame's console. `parent` nests it inside that
50
+ * frame's viewport, making x/y parent-relative. */
51
+ placeFrameConsole(name: string, x: number, y: number, width: number, height: number, parent?: string): void;
52
+ /** Open an `EXTERNAL` frame as a free-floating window with its own titlebar. */
53
+ openExternalFrame(name: string, title: string, width: number, height: number): void;
54
+ destroyFrameConsole(name: string): void;
55
+ showFrameConsole(name: string): void;
56
+ raiseFrameConsole(name: string): void;
57
+ setFrameScrolling(name: string, enabled: boolean): void;
58
+ /** Install/replace a frame's tab strip. An empty `pages` list removes it. */
59
+ setFrameTabs(name: string, pages: MxpTabPage[], active: string): void;
60
+ /** Publish the accumulated borders so the main console shrinks around the frames. */
61
+ setMxpBorders(borders: MxpBorders): void;
62
+ }
63
+ export declare class MxpFrameManager {
64
+ private readonly host;
65
+ private readonly frames;
66
+ private borders;
67
+ constructor(host: MxpFrameHost);
68
+ /**
69
+ * `<FRAME name …>`. `dest` is the `<DEST>` frame open at the time the tag
70
+ * was parsed, which nests this frame inside it. Returns false when the tag
71
+ * could not be honoured (bad name, frame budget exhausted) — Mudlet renders
72
+ * the raw tag text in that case.
73
+ */
74
+ createFrame(name: string, attrs: Record<string, string>, dest?: string): boolean;
75
+ /** `ACTION=close`. Closing an unknown frame succeeds — it is already closed,
76
+ * and reporting failure would leak the raw tag into the output. */
77
+ closeFrame(name: string): boolean;
78
+ /** `ACTION=focus` — raise an existing frame. False when there is none. */
79
+ focusFrame(name: string): boolean;
80
+ /** `ACTION=open` on a frame that already exists: show and raise, no re-layout. */
81
+ showFrame(name: string): boolean;
82
+ /** MXP frames do not survive a reconnect — Mudlet's `resetAllFrames`. */
83
+ resetAllFrames(): void;
84
+ has(name: string): boolean;
85
+ frameNames(): string[];
86
+ /** Current MXP borders. Exposed for tests and for the initial UI read. */
87
+ getBorders(): MxpBorders;
88
+ /**
89
+ * The common case: a frame tiled against an edge of the main console, or —
90
+ * when declared inside an open `<DEST>` — stacked inside that frame.
91
+ */
92
+ private layoutInternalFrame;
93
+ /** `EXTERNAL` — a window of its own. The browser has no OS child windows,
94
+ * so this becomes a free-floating panel with a real titlebar. */
95
+ private layoutExternalFrame;
96
+ /** `DOCK=other ALIGN=CLIENT` — join `other`'s tab strip as another page. */
97
+ private layoutTabFrame;
98
+ /** Usable area inside a frame, i.e. its rect minus its own tab strip. */
99
+ private contentSize;
100
+ /** Push a frame's strip to the UI. `active` switches the visible page;
101
+ * omitting it keeps whichever page is showing, so a tab arriving or closing
102
+ * never yanks the reader off the one they were watching. */
103
+ private publishTabs;
104
+ /** Bring `name` to the front of whichever tab strip holds it, if any. */
105
+ private selectTabFor;
106
+ /**
107
+ * `WIDTH`/`HEIGHT`/`LEFT`/`TOP` accept `40c` (character cells), `25%` of the
108
+ * container, or `350px`/`350` (pixels). Anything unparseable is 0, matching
109
+ * Mudlet — the caller's minimums then take over.
110
+ */
111
+ private calcSize;
112
+ /**
113
+ * Rebuild the borders from the frames that are left. Called after a close so
114
+ * the main console reclaims the space; surviving frames keep the geometry
115
+ * they were given (Mudlet does not re-tile them either).
116
+ */
117
+ private recalculateBorders;
118
+ }