@mudlet/mudlet-web 0.4.5 → 1.0.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/README.md +1 -1
- package/dist-lib/analytics.d.ts +27 -0
- package/dist-lib/assets/fonts/Vera.woff2 +0 -0
- package/dist-lib/assets/fonts/VeraBI.woff2 +0 -0
- package/dist-lib/assets/fonts/VeraBd.woff2 +0 -0
- package/dist-lib/assets/fonts/VeraIt.woff2 +0 -0
- package/dist-lib/assets/mapParser.worker-DrVZ3wg_.js +9 -0
- package/dist-lib/backupImport-wt8r7JXI.js +233 -0
- package/dist-lib/branding.d.ts +111 -13
- package/dist-lib/db/sqliteClient.d.ts +195 -7
- package/dist-lib/hooks/useAutoReconnect.d.ts +61 -0
- package/dist-lib/hooks/useDocumentFullscreen.d.ts +23 -0
- package/dist-lib/hooks/useKeyboardShortcuts.d.ts +37 -0
- package/dist-lib/hooks/useRecordLastPlayed.d.ts +10 -0
- package/dist-lib/import/applyMudletProfile.d.ts +35 -9
- package/dist-lib/import/backupImport.d.ts +118 -0
- package/dist-lib/import/collectProfileExport.d.ts +33 -2
- package/dist-lib/import/defaultPackages.d.ts +57 -14
- package/dist-lib/import/defaults/CF-loader/CF-loader.mpackage +0 -0
- package/dist-lib/import/defaults/MedBootstrap/MedBootstrap.mpackage +0 -0
- package/dist-lib/import/defaults/deleteOldProfiles/deleteOldProfiles.mpackage +0 -0
- package/dist-lib/import/defaults/echo/echo.mpackage +0 -0
- package/dist-lib/import/defaults/enable-accessibility/enable-accessibility.mpackage +0 -0
- package/dist-lib/import/defaults/generic_mapper/generic_mapper.mpackage +0 -0
- package/dist-lib/import/defaults/gui-drop/gui-drop.mpackage +0 -0
- package/dist-lib/import/defaults/icesus-loader/icesus-loader.mpackage +0 -0
- package/dist-lib/import/defaults/mg-loader/mg-loader.mpackage +0 -0
- package/dist-lib/import/defaults/mudlet-base-ui/mudlet-base-ui.mpackage +0 -0
- package/dist-lib/import/defaults/mudlet-mapper.xml +1215 -389
- package/dist-lib/import/mudletControlChars.d.ts +14 -0
- package/dist-lib/import/mudletHost.d.ts +73 -10
- package/dist-lib/import/mudletLink.d.ts +53 -2
- package/dist-lib/import/mudletProfileExport.d.ts +38 -5
- package/dist-lib/import/mudletProfileImport.d.ts +110 -12
- package/dist-lib/import/mudletVariables.d.ts +4 -3
- package/dist-lib/import/mudletWriteback.d.ts +15 -1
- package/dist-lib/import/mudletXmlImport.d.ts +46 -0
- package/dist-lib/import/packageFonts.d.ts +33 -0
- package/dist-lib/import/packageInstaller.d.ts +111 -7
- package/dist-lib/import/qtProfileData.d.ts +10 -0
- package/dist-lib/import/remotePackageInstall.d.ts +23 -7
- package/dist-lib/import/zipEntries.d.ts +45 -0
- package/dist-lib/index.d.ts +7 -3
- package/dist-lib/index.js +50660 -29735
- package/dist-lib/logging/SessionLogger.d.ts +75 -15
- package/dist-lib/map/MapSelectionOverlay.d.ts +2 -2
- package/dist-lib/map/MapStore.d.ts +432 -59
- package/dist-lib/map/MudletHighlightOverlay.d.ts +2 -2
- package/dist-lib/map/{MudixMapReader.d.ts → MudletMapReader.d.ts} +2 -2
- package/dist-lib/map/areaGraph.d.ts +120 -0
- package/dist-lib/map/environmentKit.d.ts +36 -0
- package/dist-lib/map/labelPixmap.d.ts +90 -0
- package/dist-lib/map/mapImageExport.d.ts +36 -2
- package/dist-lib/map/mapStyle.d.ts +11 -0
- package/dist-lib/map/mapVersion.d.ts +66 -0
- package/dist-lib/map/pathfinding.d.ts +2 -2
- package/dist-lib/mud/CharLoginController.d.ts +230 -0
- package/dist-lib/mud/ItemIdSequence.d.ts +1 -1
- package/dist-lib/mud/MudSession.d.ts +279 -22
- package/dist-lib/mud/PatternEngine.d.ts +153 -14
- package/dist-lib/mud/aliases/AliasEngine.d.ts +55 -9
- package/dist-lib/mud/autoLogin.d.ts +59 -0
- package/dist-lib/mud/commandSplit.d.ts +9 -0
- package/dist-lib/mud/connection/LineAssembler.d.ts +38 -11
- package/dist-lib/mud/connection/MudClient.d.ts +291 -53
- package/dist-lib/mud/connection/SubnegotiationRepair.d.ts +24 -0
- package/dist-lib/mud/connection/TelnetNegotiator.d.ts +208 -68
- package/dist-lib/mud/connection/telnetDebug.d.ts +8 -8
- package/dist-lib/mud/events.d.ts +102 -23
- package/dist-lib/mud/games/bundledGames.d.ts +12 -7
- package/dist-lib/mud/games/gameLinks.d.ts +40 -0
- package/dist-lib/mud/games/icons/3Kingdoms.png +0 -0
- package/dist-lib/mud/games/icons/3Scapes.png +0 -0
- package/dist-lib/mud/games/icons/achaea.png +0 -0
- package/dist-lib/mud/games/icons/aetolia.png +0 -0
- package/dist-lib/mud/games/icons/banner_astaria.png +0 -0
- package/dist-lib/mud/games/icons/banner_darkmists.png +0 -0
- package/dist-lib/mud/games/icons/banner_dreamland.png +0 -0
- package/dist-lib/mud/games/icons/banner_petria.jpg +0 -0
- package/dist-lib/mud/games/icons/banner_ropmud.png +0 -0
- package/dist-lib/mud/games/icons/blackmud.png +0 -0
- package/dist-lib/mud/games/icons/carrionfields.png +0 -0
- package/dist-lib/mud/games/icons/dragonfire_icon.png +0 -0
- package/dist-lib/mud/games/icons/fed2-logo.png +0 -0
- package/dist-lib/mud/games/icons/icesus_480x120.png +0 -0
- package/dist-lib/mud/games/icons/imperian.png +0 -0
- package/dist-lib/mud/games/icons/infinity_480x120.png +0 -0
- package/dist-lib/mud/games/icons/lusternia.png +0 -0
- package/dist-lib/mud/games/icons/morgengrauen_480x120.png +0 -0
- package/dist-lib/mud/games/icons/mudlet-tutorial.png +0 -0
- package/dist-lib/mud/games/icons/phoenixmud_480x120.png +0 -0
- package/dist-lib/mud/games/icons/starmourn.png +0 -0
- package/dist-lib/mud/games/icons/voidmud_icon.png +0 -0
- package/dist-lib/mud/games/icons/wotmudicon.png +0 -0
- package/dist-lib/mud/games/websiteLinks.d.ts +21 -0
- package/dist-lib/mud/keybindings/KeyEngine.d.ts +110 -4
- package/dist-lib/mud/keybindings/browserReservedKeys.d.ts +2 -2
- package/dist-lib/mud/keybindings/keyEventTarget.d.ts +61 -0
- package/dist-lib/mud/keybindings/qtKeys.d.ts +91 -12
- package/dist-lib/mud/protocol/atcp.d.ts +19 -0
- package/dist-lib/mud/protocol/byteString.d.ts +24 -0
- package/dist-lib/mud/protocol/charLoginFlow.d.ts +243 -16
- package/dist-lib/mud/protocol/charset.d.ts +111 -46
- package/dist-lib/mud/protocol/codePages.d.ts +10 -0
- package/dist-lib/mud/protocol/constants.d.ts +17 -10
- package/dist-lib/mud/protocol/echo.d.ts +23 -27
- package/dist-lib/mud/protocol/gmcp.d.ts +36 -6
- package/dist-lib/mud/protocol/index.d.ts +3 -2
- package/dist-lib/mud/protocol/luaLiteral.d.ts +12 -0
- package/dist-lib/mud/protocol/mccp.d.ts +83 -1
- package/dist-lib/mud/protocol/mnes.d.ts +41 -58
- package/dist-lib/mud/protocol/msdp.d.ts +11 -4
- package/dist-lib/mud/protocol/msp.d.ts +3 -2
- package/dist-lib/mud/protocol/mssp.d.ts +9 -4
- package/dist-lib/mud/protocol/multiByte.d.ts +51 -0
- package/dist-lib/mud/protocol/multiByteEncode.d.ts +42 -0
- package/dist-lib/mud/protocol/mxp.d.ts +193 -14
- package/dist-lib/mud/protocol/oauthClientFlow.d.ts +128 -0
- package/dist-lib/mud/protocol/qtCodePages.generated.d.ts +1 -0
- package/dist-lib/mud/protocol/tlsCodes.d.ts +40 -3
- package/dist-lib/mud/replay/ReplayPlayer.d.ts +16 -1
- package/dist-lib/mud/replay/replayFormat.d.ts +29 -2
- package/dist-lib/mud/text/Console.d.ts +255 -49
- package/dist-lib/mud/text/FormatState.d.ts +137 -14
- package/dist-lib/mud/text/ansiEscapes.d.ts +32 -16
- package/dist-lib/mud/text/colorParsers.d.ts +14 -2
- package/dist-lib/mud/text/colorSpaceId.d.ts +2 -0
- package/dist-lib/mud/text/colors.d.ts +17 -10
- package/dist-lib/mud/text/controlCharacterMode.d.ts +1 -1
- package/dist-lib/mud/text/hyperlinkVisibility.d.ts +1 -1
- package/dist-lib/mud/text/lineBreak.d.ts +5 -0
- package/dist-lib/mud/text/serverWrap.d.ts +2 -2
- package/dist-lib/mud/text/textAnalyzer.d.ts +79 -0
- package/dist-lib/mud/text/unicodeRuns.d.ts +11 -0
- package/dist-lib/mud/text/unicodeTables.generated.d.ts +3 -0
- package/dist-lib/mud/text/wcwidth.d.ts +27 -22
- package/dist-lib/mud/timers/TimerEngine.d.ts +163 -11
- package/dist-lib/mud/timers/workerClock.d.ts +67 -0
- package/dist-lib/mud/triggers/TriggerEngine.d.ts +449 -47
- package/dist-lib/mud/triggers/legacyColorPatterns.d.ts +58 -0
- package/dist-lib/mud/triggers/pcre/Pcre2.d.ts +83 -1
- package/dist-lib/oauth-callback.html +94 -0
- package/dist-lib/pcre2Wasm.d.ts +54 -0
- package/dist-lib/pcre2Wasm.js +241 -0
- package/dist-lib/scripting/EngineHost.d.ts +54 -21
- package/dist-lib/scripting/IScriptingRuntime.d.ts +103 -27
- package/dist-lib/scripting/MxpFrameManager.d.ts +10 -1
- package/dist-lib/scripting/ScriptingAPI.d.ts +1039 -213
- package/dist-lib/scripting/ScriptingEngine.d.ts +753 -103
- package/dist-lib/scripting/StopwatchManager.d.ts +97 -36
- package/dist-lib/scripting/http/HttpService.d.ts +9 -1
- package/dist-lib/scripting/http/userUrl.d.ts +41 -0
- package/dist-lib/scripting/lua/LuaRuntime.d.ts +352 -77
- package/dist-lib/scripting/lua/argContracts.d.ts +71 -0
- package/dist-lib/scripting/lua/bindings/automation.d.ts +1 -1
- package/dist-lib/scripting/lua/bindings/commands.d.ts +13 -0
- package/dist-lib/scripting/lua/bindings/context.d.ts +20 -2
- package/dist-lib/scripting/lua/bindings/diagnostics.d.ts +1 -1
- package/dist-lib/scripting/lua/bindings/map.d.ts +1 -1
- package/dist-lib/scripting/lua/bindings/media.d.ts +2 -2
- package/dist-lib/scripting/lua/bindings/output.d.ts +1 -1
- package/dist-lib/scripting/lua/bindings/session.d.ts +2 -2
- package/dist-lib/scripting/lua/bindings/textEdit.d.ts +1 -1
- package/dist-lib/scripting/lua/bindings/userWindows.d.ts +1 -1
- package/dist-lib/scripting/lua/byteArmor.d.ts +36 -0
- package/dist-lib/scripting/lua/imageSize.d.ts +7 -0
- package/dist-lib/scripting/lua/rex.d.ts +4 -2
- package/dist-lib/scripting/lua/sqlRowEncoder.d.ts +6 -1
- package/dist-lib/scripting/lua/utf8CaseMap.d.ts +1 -0
- package/dist-lib/scripting/lua/utf8Patterns.d.ts +21 -1
- package/dist-lib/scripting/lua/wellFormedStrings.d.ts +40 -0
- package/dist-lib/scripting/lua/yajl.d.ts +43 -5
- package/dist-lib/scripting/profilesPresence.d.ts +20 -2
- package/dist-lib/scripting/vfs/ProfileVFS.d.ts +164 -10
- package/dist-lib/scripting/vfs/fsErrors.d.ts +28 -0
- package/dist-lib/scripting/vfs/idbCommit.d.ts +20 -0
- package/dist-lib/storage/appStore.d.ts +24 -9
- package/dist-lib/storage/hooks.d.ts +5 -1
- package/dist-lib/storage/index.d.ts +2 -2
- package/dist-lib/storage/mapStorage.d.ts +2 -0
- package/dist-lib/storage/persistentStorage.d.ts +3 -1
- package/dist-lib/storage/profileStorage.d.ts +15 -0
- package/dist-lib/storage/profileVfsData.d.ts +3 -3
- package/dist-lib/storage/schema.d.ts +521 -44
- package/dist-lib/storage/storageMigration.d.ts +82 -0
- package/dist-lib/storage-g5V1b-c1.js +2039 -0
- package/dist-lib/styles.css +1 -1
- package/dist-lib/ui/AboutModal.d.ts +1 -1
- package/dist-lib/ui/BrandLoginFields.d.ts +1 -1
- package/dist-lib/ui/BrowserSignInModal.d.ts +23 -0
- package/dist-lib/ui/CharLoginModal.d.ts +24 -15
- package/dist-lib/ui/CmdLineMenuRegistry.d.ts +14 -5
- package/dist-lib/ui/CommandBar.d.ts +8 -8
- package/dist-lib/ui/ConnectionFormModal.d.ts +25 -1
- package/dist-lib/ui/ConnectionScreen.d.ts +9 -1
- package/dist-lib/ui/GameLinkPrompt.d.ts +28 -0
- package/dist-lib/ui/HelpModal.d.ts +5 -1
- package/dist-lib/ui/MapSymbolUsageModal.d.ts +32 -0
- package/dist-lib/ui/MouseEventRegistry.d.ts +31 -4
- package/dist-lib/ui/NotepadModal.d.ts +22 -0
- package/dist-lib/ui/ResizableModal.d.ts +16 -1
- package/dist-lib/ui/SettingsModal.d.ts +10 -1
- package/dist-lib/ui/TlsAlertBanner.d.ts +3 -1
- package/dist-lib/ui/Toolbar.d.ts +22 -1
- package/dist-lib/ui/VaultManageButton.d.ts +20 -0
- package/dist-lib/ui/VaultModal.d.ts +5 -0
- package/dist-lib/ui/VaultUnlockPrompt.d.ts +15 -0
- package/dist-lib/ui/buttons/ButtonsBar.d.ts +3 -1
- package/dist-lib/ui/buttons/inactiveButtons.d.ts +25 -0
- package/dist-lib/ui/cmdline/CommandLineManager.d.ts +19 -0
- package/dist-lib/ui/cmdline/plainText.d.ts +16 -0
- package/dist-lib/ui/cmdline/subCommandLine.d.ts +78 -0
- package/dist-lib/ui/cmdline/useCmdLineSelection.d.ts +26 -0
- package/dist-lib/ui/cmdline/useSubCommandLineKeys.d.ts +33 -0
- package/dist-lib/ui/codemirror/lineParagraphMarks.d.ts +19 -0
- package/dist-lib/ui/codemirror/luaHover.d.ts +7 -0
- package/dist-lib/ui/codemirror/options.d.ts +33 -0
- package/dist-lib/ui/codemirror/theme.d.ts +29 -5
- package/dist-lib/ui/commands/addonCommands.d.ts +134 -0
- package/dist-lib/ui/commands/appShortcuts.d.ts +86 -0
- package/dist-lib/ui/commands/hostCommands.d.ts +88 -0
- package/dist-lib/ui/commands/keyMatch.d.ts +20 -0
- package/dist-lib/ui/commands/keySequence.d.ts +57 -0
- package/dist-lib/ui/components/ContextMenu.d.ts +21 -1
- package/dist-lib/ui/components/FontPicker.d.ts +5 -1
- package/dist-lib/ui/components/useModalFocus.d.ts +13 -1
- package/dist-lib/ui/helpTopics.d.ts +15 -0
- package/dist-lib/ui/labels/LabelManager.d.ts +172 -9
- package/dist-lib/ui/labels/LabelOverlay.d.ts +19 -0
- package/dist-lib/ui/labels/backgroundImageSize.d.ts +19 -0
- package/dist-lib/ui/labels/labelModel.d.ts +64 -0
- package/dist-lib/ui/labels/qColor.d.ts +13 -0
- package/dist-lib/ui/labels/qtCss.d.ts +12 -4
- package/dist-lib/ui/landmarks.d.ts +9 -0
- package/dist-lib/ui/launcher/ActionMenu.d.ts +19 -0
- package/dist-lib/ui/launcher/GameDetails.d.ts +21 -0
- package/dist-lib/ui/launcher/GameSection.d.ts +18 -0
- package/dist-lib/ui/launcher/LauncherSearch.d.ts +23 -0
- package/dist-lib/ui/launcher/ProfileArt.d.ts +20 -0
- package/dist-lib/ui/launcher/ProfileSection.d.ts +43 -0
- package/dist-lib/ui/launcher/launcherModel.d.ts +72 -0
- package/dist-lib/ui/layout/overlayLayerOrder.d.ts +2 -2
- package/dist-lib/ui/menu/MenuBar.d.ts +31 -0
- package/dist-lib/ui/menu/SplitButton.d.ts +39 -0
- package/dist-lib/ui/menu/anchoredPopup.d.ts +74 -0
- package/dist-lib/ui/menu/appMenus.d.ts +65 -0
- package/dist-lib/ui/menu/menuModel.d.ts +88 -0
- package/dist-lib/ui/menu/toolbarModel.d.ts +56 -0
- package/dist-lib/ui/notepad.d.ts +76 -0
- package/dist-lib/ui/openSignInPage.d.ts +14 -0
- package/dist-lib/ui/output/OutputContextMenu.d.ts +14 -1
- package/dist-lib/ui/output/OutputRenderer.d.ts +5 -0
- package/dist-lib/ui/output/OutputSearchBar.d.ts +5 -1
- package/dist-lib/ui/output/StickyOutputPanel.d.ts +17 -3
- package/dist-lib/ui/output/TextAnalyzerModal.d.ts +25 -0
- package/dist-lib/ui/output/caretMode.d.ts +3 -2
- package/dist-lib/ui/output/clearSplit.d.ts +11 -0
- package/dist-lib/ui/output/outputCopy.d.ts +41 -2
- package/dist-lib/ui/output/outputRows.d.ts +43 -0
- package/dist-lib/ui/output/selectionGesture.d.ts +35 -0
- package/dist-lib/ui/output/wordSelection.d.ts +33 -0
- package/dist-lib/ui/search/matcher.d.ts +14 -4
- package/dist-lib/ui/settings/SettingsShell.d.ts +91 -0
- package/dist-lib/ui/settings/ShortcutEditor.d.ts +13 -0
- package/dist-lib/ui/sound/SoundManager.d.ts +210 -44
- package/dist-lib/ui/sound/closedCaption.d.ts +4 -1
- package/dist-lib/ui/sound/mediaDirection.d.ts +35 -0
- package/dist-lib/ui/tabCompletion.d.ts +53 -0
- package/dist-lib/ui/textedit/TextEditManager.d.ts +11 -2
- package/dist-lib/ui/useOpenProfiles.d.ts +1 -1
- package/dist-lib/ui/useVaultSaver.d.ts +26 -0
- package/dist-lib/ui/video/VideoManager.d.ts +7 -0
- package/dist-lib/ui/windows/WindowManager.d.ts +452 -37
- package/dist-lib/ui/windows/panels/ScriptEditorPanel.d.ts +14 -0
- package/dist-lib/ui/windows/panels/ScriptSearch.d.ts +6 -1
- package/dist-lib/ui/windows/panels/TextPanel.d.ts +4 -1
- package/dist-lib/ui/windows/panels/VariablesView.d.ts +37 -7
- package/dist-lib/ui/windows/panels/WindowCmdLine.d.ts +4 -2
- package/dist-lib/ui/windows/panels/aliasLoop.d.ts +24 -0
- package/dist-lib/ui/windows/panels/editorClipboard.d.ts +45 -0
- package/dist-lib/ui/windows/panels/editorUndo.d.ts +79 -0
- package/dist-lib/ui/windows/panels/mapAreaChange.d.ts +10 -0
- package/dist-lib/utils/appShellCache.d.ts +25 -0
- package/dist-lib/utils/fontFamilyName.d.ts +13 -0
- package/dist-lib/utils/fontLoader.d.ts +31 -0
- package/dist-lib/utils/formatBytes.d.ts +4 -0
- package/dist-lib/utils/mustBeOneOf.d.ts +9 -0
- package/dist-lib/utils/profileLock.d.ts +1 -1
- package/dist-lib/utils/storedCredentials.d.ts +31 -0
- package/dist-lib/utils/systemTheme.d.ts +24 -0
- package/dist-lib/utils/timeZone.d.ts +10 -0
- package/dist-lib/vault/CredentialVault.d.ts +197 -0
- package/dist-lib/vault/deviceUnlock.d.ts +47 -0
- package/dist-lib/vault/passkeyPrf.d.ts +56 -0
- package/dist-lib/vault/useVault.d.ts +8 -0
- package/dist-lib/vault/vaultAccess.d.ts +80 -0
- package/dist-lib/vault/vaultCrypto.d.ts +56 -0
- package/dist-lib/vault/vaultHelpTopic.d.ts +9 -0
- package/dist-lib/vault/vaultRecord.d.ts +92 -0
- package/dist-lib/vfs-sw.js +220 -11
- package/dist-lib/vite.d.ts +1 -1
- package/dist-lib/vite.js +66 -43
- package/package.json +22 -14
- package/dist-lib/assets/mapParser.worker-t-3rd1zR.js +0 -9
- package/dist-lib/mud/connection/PingTracker.d.ts +0 -41
- package/dist-lib/ui/BundledGameGrid.d.ts +0 -21
- package/dist-lib/ui/ConnectionGrid.d.ts +0 -21
- package/dist-lib/ui/bufferWords.d.ts +0 -38
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { TriggerPatternType } from '../../../storage/schema';
|
|
2
3
|
import type { MudSession } from '../../../mud/MudSession';
|
|
3
4
|
import type { ProfileVFS } from '../../../scripting/vfs/ProfileVFS';
|
|
4
5
|
import type { ScriptingEngine } from '../../../scripting/ScriptingEngine';
|
|
5
6
|
import './ScriptEditorPanel.css';
|
|
6
7
|
type Category = 'scripts' | 'aliases' | 'triggers' | 'timers' | 'keys' | 'buttons' | 'packages' | 'errors' | 'variables';
|
|
7
8
|
type EditCategory = Exclude<Category, 'errors' | 'packages' | 'variables'>;
|
|
9
|
+
/** The `text` a pattern row should carry after its type changes.
|
|
10
|
+
*
|
|
11
|
+
* `colorTrigger` stores `"fg,bg"` and `lineSpacer` stores a line count, so
|
|
12
|
+
* neither can inherit a regex left over from the previous type — and a regex
|
|
13
|
+
* must not inherit `"-1,-1"` or `"2"` either. Mudlet gets this for free by
|
|
14
|
+
* giving each type its own widget (`dlgTriggerEditor.cpp:7196-7239`); here one
|
|
15
|
+
* `text` field is shared, so it is reset explicitly whenever the type crosses
|
|
16
|
+
* into or out of one of the two structured kinds. */
|
|
17
|
+
export declare function retypePatternText(text: string, from: TriggerPatternType, to: TriggerPatternType): string;
|
|
8
18
|
interface ScriptEditorPanelProps {
|
|
9
19
|
connectionId: string;
|
|
10
20
|
session: MudSession;
|
|
@@ -19,6 +29,10 @@ export interface ScriptEditorPanelHandle {
|
|
|
19
29
|
/** Switch to the item's category, expand its ancestors, select it, and —
|
|
20
30
|
* when a line is given — move the editor cursor there. */
|
|
21
31
|
navigateToItem: (category: EditCategory, id: string, line?: number) => void;
|
|
32
|
+
/** Show the Variables tab with its filter set to the named top-level global.
|
|
33
|
+
* Desktop selects the row in its variables tree; filtering is the same job
|
|
34
|
+
* in a view that has no persistent selection. */
|
|
35
|
+
navigateToVariable: (name: string) => void;
|
|
22
36
|
}
|
|
23
37
|
export declare const ScriptEditorPanel: React.ForwardRefExoticComponent<ScriptEditorPanelProps & React.RefAttributes<ScriptEditorPanelHandle>>;
|
|
24
38
|
export {};
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ScriptingEngine } from '../../../scripting/ScriptingEngine';
|
|
1
3
|
import './ScriptSearch.css';
|
|
2
4
|
export type EditCategory = 'scripts' | 'aliases' | 'triggers' | 'timers' | 'keys' | 'buttons';
|
|
3
5
|
interface ScriptSearchProps {
|
|
4
6
|
connectionId: string;
|
|
7
|
+
scriptingEngineRef?: React.RefObject<ScriptingEngine | null>;
|
|
5
8
|
/** Navigate the editor to a matched item (and optionally a code line). */
|
|
6
9
|
onNavigate: (category: EditCategory, id: string, line?: number) => void;
|
|
10
|
+
/** Show the Variables tab filtered to the named top-level global. */
|
|
11
|
+
onNavigateVariable?: (name: string) => void;
|
|
7
12
|
}
|
|
8
13
|
/** Global search for the Scripts editor — lives in the modal title bar and
|
|
9
14
|
* drops a VS Code-style results overlay (rendered through a portal so it
|
|
10
15
|
* escapes the modal's `overflow: hidden`). */
|
|
11
|
-
export declare function ScriptSearch({ connectionId, onNavigate }: ScriptSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function ScriptSearch({ connectionId, scriptingEngineRef, onNavigate, onNavigateVariable }: ScriptSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
12
17
|
export {};
|
|
@@ -2,6 +2,7 @@ import type { WindowManager } from '../WindowManager';
|
|
|
2
2
|
import type { LabelManager } from '../../labels/LabelManager';
|
|
3
3
|
import type { CommandLineManager } from '../../cmdline/CommandLineManager';
|
|
4
4
|
import type { ScrollBoxManager } from '../../scrollbox/ScrollBoxManager';
|
|
5
|
+
import { type MouseEventRegistry } from '../../MouseEventRegistry';
|
|
5
6
|
interface TextPanelProps {
|
|
6
7
|
id: string;
|
|
7
8
|
/** Human-readable window title (defaults to the id), used as the accessible
|
|
@@ -11,6 +12,8 @@ interface TextPanelProps {
|
|
|
11
12
|
labels?: LabelManager;
|
|
12
13
|
cmdLines?: CommandLineManager;
|
|
13
14
|
scrollBoxes?: ScrollBoxManager;
|
|
15
|
+
/** addMouseEvent entries, which desktop puts in every console's menu. */
|
|
16
|
+
mouseEvents?: MouseEventRegistry;
|
|
14
17
|
fontSize?: number;
|
|
15
18
|
fontFamily?: string;
|
|
16
19
|
/** Rendered row height in px (MXP frames). See WindowManager.setLineHeight. */
|
|
@@ -33,5 +36,5 @@ interface TextPanelProps {
|
|
|
33
36
|
cmdLineValue?: string;
|
|
34
37
|
cmdLineValueSeq?: number;
|
|
35
38
|
}
|
|
36
|
-
export declare function TextPanel({ id, title, manager, labels, cmdLines, scrollBoxes, fontSize, fontFamily, lineHeight, wrapAt, wrapIndent, wrapHangingIndent, backgroundColor, backgroundImage, cmdLineEnabled, cmdLineStyleSheet, cmdLineValue, cmdLineValueSeq }: TextPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export declare function TextPanel({ id, title, manager, labels, cmdLines, scrollBoxes, mouseEvents, fontSize, fontFamily, lineHeight, wrapAt, wrapIndent, wrapHangingIndent, backgroundColor, backgroundImage, cmdLineEnabled, cmdLineStyleSheet, cmdLineValue, cmdLineValueSeq }: TextPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
37
40
|
export {};
|
|
@@ -2,20 +2,50 @@ import type { ScriptingEngine } from '../../../scripting/ScriptingEngine';
|
|
|
2
2
|
interface VariablesViewProps {
|
|
3
3
|
connectionId: string;
|
|
4
4
|
scriptingEngineRef?: React.RefObject<ScriptingEngine | null>;
|
|
5
|
+
/** A search result asking for this top-level global to be brought into view.
|
|
6
|
+
* `revision` makes a repeat jump to the same name re-apply the filter. */
|
|
7
|
+
focus?: {
|
|
8
|
+
name: string;
|
|
9
|
+
revision: number;
|
|
10
|
+
} | null;
|
|
11
|
+
/** Called once `focus` has been applied. The request lives in the parent,
|
|
12
|
+
* which outlives this view — without clearing it, leaving the tab and
|
|
13
|
+
* coming back would silently re-type the old name into the filter. */
|
|
14
|
+
onFocusConsumed?: () => void;
|
|
5
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Re-point every hidden path that lived at `from` (or underneath it) at `to`,
|
|
18
|
+
* for a rename. Returns null when nothing referred to the old path, so the
|
|
19
|
+
* caller can skip a no-op store write.
|
|
20
|
+
*
|
|
21
|
+
* A descendant is spelled `from` followed by `.` or `[`, which are the only two
|
|
22
|
+
* separators {@link pathKey} emits — so `myTable` never captures `myTableTwo`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function renameHiddenPaths(hidden: readonly string[], from: string, to: string): string[] | null;
|
|
25
|
+
/** Drop every hidden path at `at` or underneath it, for a delete. Returns null
|
|
26
|
+
* when none matched, so the caller can skip a no-op store write. */
|
|
27
|
+
export declare function dropHiddenPaths(hidden: readonly string[], at: string): string[] | null;
|
|
6
28
|
/**
|
|
7
29
|
* Mudlet's Variables view: the live `_G` tree with a checkbox per top-level
|
|
8
30
|
* entry that toggles whether it persists across sessions (the profile's
|
|
9
|
-
* save-list / Mudlet `<VariablePackage>`)
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
31
|
+
* save-list / Mudlet `<VariablePackage>`), and the create/rename/retype/edit/
|
|
32
|
+
* hide/delete controls desktop puts in `vars_main_area.ui` — name
|
|
33
|
+
* (`lineEdit_var_name:73`), key type (`comboBox_variable_key_type:105`), hidden
|
|
34
|
+
* (`checkBox_variable_hidden:142`), value type
|
|
35
|
+
* (`comboBox_variable_value_type:165`), plus `dlgTriggerEditor::addVar`
|
|
36
|
+
* (:5211). Edits go straight into the running `_G`, so a script sees them
|
|
37
|
+
* immediately.
|
|
38
|
+
*
|
|
39
|
+
* Built-in globals — the default Lua + Mudlet API namespace present at runtime
|
|
40
|
+
* boot — are hidden by default (toggle to show), so only your own variables
|
|
41
|
+
* appear. Tables expand to browse their contents (fetched eagerly, so expansion
|
|
42
|
+
* is instant). Functions/userdata are shown but neither flaggable nor editable.
|
|
43
|
+
* Save flagging is top-level granularity (checking a table persists all of it);
|
|
44
|
+
* per-key flagging is a follow-up.
|
|
15
45
|
*
|
|
16
46
|
* Enumerating `_G` runs synchronously on the Lua/main thread, so we defer it a
|
|
17
47
|
* tick behind a loader: the spinner paints first, then the walk runs, keeping
|
|
18
48
|
* opening the tab responsive even for a large namespace.
|
|
19
49
|
*/
|
|
20
|
-
export declare function VariablesView({ connectionId, scriptingEngineRef }: VariablesViewProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export declare function VariablesView({ connectionId, scriptingEngineRef, focus, onFocusConsumed }: VariablesViewProps): import("react/jsx-runtime").JSX.Element;
|
|
21
51
|
export {};
|
|
@@ -16,8 +16,10 @@ interface WindowCmdLineProps {
|
|
|
16
16
|
* with WindowManager so getCmdLine([name]) can read the live text.
|
|
17
17
|
*
|
|
18
18
|
* Enter dispatches to the bound Lua callback (setCmdLineAction). When no
|
|
19
|
-
* callback is bound,
|
|
20
|
-
*
|
|
19
|
+
* callback is bound, the text is sent to the game as typed input, the way
|
|
20
|
+
* Mudlet's TCommandLine::enterCommand falls back to Host::send. History, Tab
|
|
21
|
+
* completion, Shift+Enter, Escape and what Enter leaves behind follow desktop's
|
|
22
|
+
* TCommandLine (see useSubCommandLineKeys).
|
|
21
23
|
*/
|
|
22
24
|
export declare function WindowCmdLine({ id, manager, styleSheet, seedValue, seedSeq }: WindowCmdLineProps): import("react/jsx-runtime").JSX.Element;
|
|
23
25
|
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Edit-time detection of the alias that feeds itself: a pattern that matches
|
|
3
|
+
* its own substitution, so sending the command re-triggers the alias.
|
|
4
|
+
*
|
|
5
|
+
* Desktop refuses the save outright — `if (aliasSubstitutionLoops(regex,
|
|
6
|
+
* substitution)) { showAliasLoopWarning(...); return; }`
|
|
7
|
+
* (dlgTriggerEditor.cpp:6174-6178, :15054, :15090), implemented at :6269 as an
|
|
8
|
+
* unanchored match of the pattern against the substitution.
|
|
9
|
+
*
|
|
10
|
+
* Here it only warns. Mudlet Web already stops the damage at runtime — send()
|
|
11
|
+
* refuses past `MAX_SEND_DEPTH` with a message naming the alias — and that
|
|
12
|
+
* guard catches indirect loops (A → B → A) this one cannot see. Refusing the
|
|
13
|
+
* save on top of it would block the direct case while still letting the
|
|
14
|
+
* indirect one through, so the warning is what the runtime guard is missing:
|
|
15
|
+
* feedback before the 25 junk lines rather than after them.
|
|
16
|
+
*
|
|
17
|
+
* The match runs through JS `RegExp`, not PCRE — near enough for a warning, and
|
|
18
|
+
* a pattern that does not compile here produces none, mirroring desktop's
|
|
19
|
+
* `if (!rx.isValid()) return false`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function aliasSubstitutionLoops(pattern: string, substitution: string): boolean;
|
|
22
|
+
/** The warning shown beside a looping alias, worded as desktop words it
|
|
23
|
+
* (`showAliasLoopWarning`, dlgTriggerEditor.cpp:6364-6369) minus the refusal. */
|
|
24
|
+
export declare function aliasLoopWarning(name: string): string;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copy / paste / duplicate for editor items.
|
|
3
|
+
*
|
|
4
|
+
* Mudlet round-trips the item and its subtree through XML — `slot_copyXml`
|
|
5
|
+
* (dlgTriggerEditor.cpp:11777) exports it to `mpHost->mpEditorDialog`'s
|
|
6
|
+
* clipboard buffer and `slot_pasteXml` (:11913) imports it back, which is why
|
|
7
|
+
* the paste mints fresh ids there too. Mudlet Web's nodes are plain objects, so the
|
|
8
|
+
* same job is a structured clone with remapped ids; the clipboard is an
|
|
9
|
+
* in-memory snapshot rather than XML text, which keeps it exact (no lossy
|
|
10
|
+
* element set) at the cost of not surviving a page reload — Mudlet's doesn't
|
|
11
|
+
* outlive its editor either.
|
|
12
|
+
*/
|
|
13
|
+
import type { EditorItemCategory, EditorItemNode } from './editorUndo';
|
|
14
|
+
export interface EditorClipboard {
|
|
15
|
+
category: EditorItemCategory;
|
|
16
|
+
/** The copied item followed by its descendants, in tree order. */
|
|
17
|
+
nodes: EditorItemNode[];
|
|
18
|
+
/** What the context menu says it will paste, e.g. `trigger "qa-sub"`. */
|
|
19
|
+
label: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The item plus every descendant, root first and the rest in `items` order.
|
|
23
|
+
*
|
|
24
|
+
* Root-first matters because {@link cloneSubtree} and the paste placement both
|
|
25
|
+
* treat the first element as the item the user picked. Every producer happens
|
|
26
|
+
* to keep parents ahead of children today, but the walk below explicitly does
|
|
27
|
+
* not rely on that — so neither does this.
|
|
28
|
+
*/
|
|
29
|
+
export declare function collectSubtree<T extends {
|
|
30
|
+
id: string;
|
|
31
|
+
parentId: string | null;
|
|
32
|
+
}>(items: readonly T[], rootId: string): T[];
|
|
33
|
+
/**
|
|
34
|
+
* Copy `nodes` (a subtree, root first) under `newParentId` with fresh ids.
|
|
35
|
+
*
|
|
36
|
+
* `packageName` is dropped: uninstalling a package removes every item carrying
|
|
37
|
+
* its name, so a copy that kept the tag would be deleted along with the
|
|
38
|
+
* original the next time that package went away — and the package's own
|
|
39
|
+
* manifest never listed the copy in the first place.
|
|
40
|
+
*
|
|
41
|
+
* `existingNames` are the names already in use among the new siblings; a
|
|
42
|
+
* collision gets a " (copy)" suffix so the paste is visible in the tree rather
|
|
43
|
+
* than looking like nothing happened.
|
|
44
|
+
*/
|
|
45
|
+
export declare function cloneSubtree<T extends EditorItemNode>(nodes: readonly T[], newParentId: string | null, existingNames: ReadonlySet<string>, newId?: () => string): T[];
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The script editor's item-level undo stack.
|
|
3
|
+
*
|
|
4
|
+
* Mudlet's editor deletes immediately and never asks; what makes that safe is
|
|
5
|
+
* that every delete path builds an `EditorDeleteItemCommand` and pushes it onto
|
|
6
|
+
* the editor's own `EditorUndoStack` (dlgTriggerEditor.cpp:3714 for triggers,
|
|
7
|
+
* and the same at :3089 aliases, :3237 buttons, :3441 scripts, :3575 keys,
|
|
8
|
+
* :3848 timers), reachable from Ctrl+Z. This is that stack, minus the parts
|
|
9
|
+
* Mudlet only needs because of how it stores items:
|
|
10
|
+
*
|
|
11
|
+
* * Mudlet snapshots each deleted item to XML and re-imports it on undo, which
|
|
12
|
+
* mints fresh ids — hence the id remapping, the `remapItemID` plumbing and
|
|
13
|
+
* the child-id fix-up loops all over `EditorDeleteItemCommand::undo()`.
|
|
14
|
+
* Mudlet Web's nodes are plain objects with stable string ids, so the very same
|
|
15
|
+
* objects go back and none of that is needed.
|
|
16
|
+
* * Mudlet restores parents before children (a topological sort) because a
|
|
17
|
+
* child needs a live parent pointer. Here the tree is a flat array plus
|
|
18
|
+
* `parentId`, so restoring the whole subtree at its recorded indices
|
|
19
|
+
* reproduces it in one step, in any order.
|
|
20
|
+
*/
|
|
21
|
+
import type { AliasNode, ButtonNode, KeyNode, ScriptNode, TimerNode, TriggerNode } from '../../../storage/schema';
|
|
22
|
+
import type { RestoredNode } from '../../../storage/appStore';
|
|
23
|
+
/** The six editor views that hold deletable items. Mirrors Mudlet's
|
|
24
|
+
* EditorViewType minus the varUnit view, which has no delete command. */
|
|
25
|
+
export type EditorItemCategory = 'scripts' | 'aliases' | 'triggers' | 'timers' | 'keys' | 'buttons';
|
|
26
|
+
export type EditorItemNode = ScriptNode | AliasNode | TriggerNode | TimerNode | KeyNode | ButtonNode;
|
|
27
|
+
/** Mudlet caps the editor stack at 50 commands (`setUndoLimit(50)`,
|
|
28
|
+
* dlgTriggerEditor.cpp:457). */
|
|
29
|
+
export declare const EDITOR_UNDO_LIMIT = 50;
|
|
30
|
+
/**
|
|
31
|
+
* One reversible edit to the item tree.
|
|
32
|
+
*
|
|
33
|
+
* `delete` and `insert` are the same record read in opposite directions: both
|
|
34
|
+
* hold every node involved plus the index it occupied, so undoing one is
|
|
35
|
+
* redoing the other. Mudlet only ever pushes deletions here, but a paste that
|
|
36
|
+
* cannot be undone makes Ctrl+Z do something unrelated to what the user just
|
|
37
|
+
* did — so pastes and duplicates go on the same stack.
|
|
38
|
+
*/
|
|
39
|
+
export interface EditorItemCommand {
|
|
40
|
+
kind: 'delete' | 'insert';
|
|
41
|
+
category: EditorItemCategory;
|
|
42
|
+
/** Every node the command covers — the item and its whole subtree — each
|
|
43
|
+
* with the index it occupied in the category's flat list. */
|
|
44
|
+
entries: ReadonlyArray<RestoredNode<EditorItemNode>>;
|
|
45
|
+
/** Undo-menu wording, e.g. `delete trigger "qa-sub"`. Mirrors
|
|
46
|
+
* `EditorDeleteItemCommand::generateText`. */
|
|
47
|
+
label: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The item plus every descendant, paired with the index each occupies in
|
|
51
|
+
* `items` — exactly the set the store's `removeX` actions drop (they take the
|
|
52
|
+
* same `id` + `getDescendantIds` closure), so the capture and the removal can
|
|
53
|
+
* never disagree.
|
|
54
|
+
*
|
|
55
|
+
* Mudlet's `captureTriggerAndChildren` lambda (dlgTriggerEditor.cpp:3616) does
|
|
56
|
+
* the same walk, recording `positionInParent` because its tree is real
|
|
57
|
+
* parent/child widgets. Here sibling order lives in the flat array, so the flat
|
|
58
|
+
* index is the position worth keeping.
|
|
59
|
+
*/
|
|
60
|
+
export declare function captureDeletion<T extends {
|
|
61
|
+
id: string;
|
|
62
|
+
parentId: string | null;
|
|
63
|
+
}>(items: readonly T[], id: string): RestoredNode<T>[];
|
|
64
|
+
/** `delete trigger "qa-sub"` / `delete 4 triggers`, following
|
|
65
|
+
* `EditorDeleteItemCommand::generateText` — including its choice to count the
|
|
66
|
+
* captured descendants, not just the item the user picked. */
|
|
67
|
+
export declare function describeDeletion(category: EditorItemCategory, entries: ReadonlyArray<{
|
|
68
|
+
node: {
|
|
69
|
+
name: string;
|
|
70
|
+
};
|
|
71
|
+
}>): string;
|
|
72
|
+
/** The same wording for the other direction — `paste trigger "qa-sub"`. */
|
|
73
|
+
export declare function describeInsertion(category: EditorItemCategory, entries: ReadonlyArray<{
|
|
74
|
+
node: {
|
|
75
|
+
name: string;
|
|
76
|
+
};
|
|
77
|
+
}>): string;
|
|
78
|
+
/** Push onto a stack held at Mudlet's 50-command limit, dropping the oldest. */
|
|
79
|
+
export declare function pushBounded<T>(stack: readonly T[], command: T): T[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `sysMapAreaChanged(newAreaID, prevAreaID)` a centerview raises, or null
|
|
3
|
+
* when it raises none.
|
|
4
|
+
*
|
|
5
|
+
* Moving into another area raises it, as does the first centerview since the
|
|
6
|
+
* map widget opened (or its map was replaced) even when the room lies in the
|
|
7
|
+
* area already on show: that area is only the view restored from last time,
|
|
8
|
+
* and desktop reports the first centerview with -2 as the previous area.
|
|
9
|
+
*/
|
|
10
|
+
export declare function centerviewAreaChange(first: boolean, prevArea: number | null, areaId: number): [number, number] | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether this build wants its shell cached at all.
|
|
3
|
+
*
|
|
4
|
+
* Only a built app does. A dev server has no content-hashed assets to cache
|
|
5
|
+
* anyway, and the caching it *could* do — the icons, the manifest, the WASM the
|
|
6
|
+
* plugin serves at the root — is pure cost there: a second copy written on every
|
|
7
|
+
* boot, and a hot-reload hazard for the one file that isn't content-addressed.
|
|
8
|
+
* It is measurable cost, too. The busted corpus boots the whole app 41 times in
|
|
9
|
+
* parallel contexts, and on a four-core CI runner the extra work per boot was
|
|
10
|
+
* enough to push readiness past its 90s timeout.
|
|
11
|
+
*
|
|
12
|
+
* Read at the two edges rather than inside the functions below, so the worker's
|
|
13
|
+
* registration URL and the page's decision to speak to it can't disagree.
|
|
14
|
+
*/
|
|
15
|
+
export declare const appShellCacheEnabled: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Hand the active worker this build's resource list, once the page has settled.
|
|
18
|
+
* Safe to call when there is no worker, no support, or nothing loaded — it is a
|
|
19
|
+
* best-effort optimisation of a cache the worker also fills on its own.
|
|
20
|
+
*/
|
|
21
|
+
export declare function primeAppShellCache(): Promise<void>;
|
|
22
|
+
/** How long after load to let stragglers arrive before taking the snapshot.
|
|
23
|
+
* A flat wait rather than an idle callback: the browser counts as idle while a
|
|
24
|
+
* WASM download is still in flight, which is exactly the case this is for. */
|
|
25
|
+
export declare const SETTLE_MS = 5000;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The family name a font file declares, or null when the bytes are not a font
|
|
3
|
+
* this can read.
|
|
4
|
+
*
|
|
5
|
+
* Null is a normal answer, not an error: a package may ship a font in a format
|
|
6
|
+
* with no sfnt wrapper, and the caller's job is then to say so rather than to
|
|
7
|
+
* register the file under a name nothing would ask for.
|
|
8
|
+
*/
|
|
9
|
+
export declare function fontFamilyName(bytes: Uint8Array): string | null;
|
|
10
|
+
/** File extensions desktop's `Host::installPackageFonts` picks up
|
|
11
|
+
* (Host.cpp:3513). */
|
|
12
|
+
export declare const FONT_EXTENSIONS: readonly [".otf", ".ttf", ".ttc", ".otc"];
|
|
13
|
+
export declare function isFontPath(path: string): boolean;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { ProfileVFS } from '../scripting/vfs/ProfileVFS';
|
|
2
2
|
import type { OutputFontSource } from '../storage';
|
|
3
|
+
/** Cache-key component for anything that memoises a font measurement. */
|
|
4
|
+
export declare function getFontGeneration(): number;
|
|
5
|
+
/** Note that a family became usable — see `getFontGeneration`. */
|
|
6
|
+
export declare function bumpFontGeneration(): void;
|
|
3
7
|
/** Synchronous detection. May false-negative on a system font whose face the
|
|
4
8
|
* browser hasn't materialized yet — use {@link ensureFontAvailable} when an
|
|
5
9
|
* await is acceptable. */
|
|
@@ -53,5 +57,32 @@ export declare function primeLocalFontsCache(): Promise<void>;
|
|
|
53
57
|
* forms ("Family Name") are unwrapped to plain names. */
|
|
54
58
|
export declare function getRegisteredFontFamilies(): string[];
|
|
55
59
|
export declare function loadFontFromUrl(family: string, url: string): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Register a font file from the profile VFS under `family`.
|
|
62
|
+
*
|
|
63
|
+
* The face goes into `document.fonts` before this returns — synchronously —
|
|
64
|
+
* and the returned promise settles once the browser has parsed it. That order
|
|
65
|
+
* is what lets a package use its own font in the events its install raises
|
|
66
|
+
* straight after (#438): `getAvailableFonts()` reads `document.fonts`, and
|
|
67
|
+
* desktop's font database has the family the moment `loadFont` returns, so a
|
|
68
|
+
* `setFont` in sysInstallPackage or sysLoadEvent must find it. Text already
|
|
69
|
+
* asking for the family re-renders in it once the face has loaded, as with any
|
|
70
|
+
* web font. A file that will not load is taken out again and the promise
|
|
71
|
+
* rejects.
|
|
72
|
+
*/
|
|
56
73
|
export declare function loadFontFromVfs(family: string, path: string, vfs: ProfileVFS): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Make a font source drawable, without saying where it is to be drawn.
|
|
76
|
+
*
|
|
77
|
+
* A `system` source is whatever the machine already has, so there is nothing to
|
|
78
|
+
* do; the other two have to be fetched or read out of the profile before the
|
|
79
|
+
* family name means anything. Both underlying loaders are idempotent, so calling
|
|
80
|
+
* this again for a font already registered costs nothing — which is what lets it
|
|
81
|
+
* sit in an effect keyed on the setting.
|
|
82
|
+
*
|
|
83
|
+
* Separate from {@link applyOutputFont} because the map's room-symbol font needs
|
|
84
|
+
* the registration half and not the CSS-variable half: it is handed to a canvas
|
|
85
|
+
* by the renderer, not inherited through the document.
|
|
86
|
+
*/
|
|
87
|
+
export declare function registerFontSource(font: OutputFontSource | undefined, vfs: ProfileVFS | null): Promise<void>;
|
|
57
88
|
export declare function applyOutputFont(font: OutputFontSource | undefined, vfs: ProfileVFS | null): Promise<void>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The refusal Mudlet gives a value outside a fixed set of words, in the one
|
|
3
|
+
* wording its API settled on: `<what> must be "a", "b" or "c", got "x"` — no
|
|
4
|
+
* function-name prefix, double quotes, no comma before the "or".
|
|
5
|
+
*
|
|
6
|
+
* The Lua twin is `__mudlet_must_be_one_of` in `src/scripting/lua/Bridge.lua`;
|
|
7
|
+
* keep the two in step.
|
|
8
|
+
*/
|
|
9
|
+
export declare function mustBeOneOf(what: string, values: readonly string[], got: unknown): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Shared prefix for every per-profile Web Lock name. */
|
|
2
|
-
export declare const PROFILE_LOCK_PREFIX = "
|
|
2
|
+
export declare const PROFILE_LOCK_PREFIX = "mudlet:profile:";
|
|
3
3
|
/** Web Lock name for a profile. */
|
|
4
4
|
export declare const profileLockName: (connectionId: string) => string;
|
|
5
5
|
/** Inverse of {@link profileLockName}: the connectionId encoded in a lock name,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where auto-login credentials come from, in priority order — one place so the
|
|
3
|
+
* GMCP `Char.Login` path and the text-login state machine can never disagree
|
|
4
|
+
* about which password they are about to send.
|
|
5
|
+
*
|
|
6
|
+
* 1. **In-memory** (`sessionCredentials`) — a branded build's login form. Those
|
|
7
|
+
* builds never persist anything, so this is the only source they have.
|
|
8
|
+
* 2. **The credential vault**, when one is installed and unlocked.
|
|
9
|
+
* 3. **`charLoginPassword` on the connection record** — the pre-vault plaintext
|
|
10
|
+
* field. Never written any more (see issue #25) and no longer offered in the
|
|
11
|
+
* UI, but still read so that an existing saved login keeps working until the
|
|
12
|
+
* user sets a vault up, at which point it is migrated and deleted
|
|
13
|
+
* (`useVaultSaver`).
|
|
14
|
+
*
|
|
15
|
+
* The account name is not a secret and stays on the connection record either
|
|
16
|
+
* way: prefilling it is also what lets a browser password manager pick the one
|
|
17
|
+
* matching password instead of offering every profile's.
|
|
18
|
+
*/
|
|
19
|
+
export interface StoredLogin {
|
|
20
|
+
account: string;
|
|
21
|
+
password: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function readStoredLogin(connectionId: string): StoredLogin;
|
|
24
|
+
/**
|
|
25
|
+
* Drop vault entries for profiles that no longer exist.
|
|
26
|
+
*
|
|
27
|
+
* Deleting a profile can't rewrite the vault when it is locked — there is no
|
|
28
|
+
* key to re-encrypt the remaining secrets with — so `forgetConnection` leaves
|
|
29
|
+
* the entry behind and the sweep happens here instead, on the next unlock.
|
|
30
|
+
*/
|
|
31
|
+
export declare function pruneVaultEntries(): void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Theme } from '../storage/schema';
|
|
2
|
+
/** The stored value meaning "whatever the OS is set to". Never reaches
|
|
3
|
+
* `data-theme`; {@link resolveTheme} turns it into a real palette first. */
|
|
4
|
+
export declare const SYSTEM_THEME = "system";
|
|
5
|
+
/** Whether the OS is asking for a dark UI right now. Defaults to dark when
|
|
6
|
+
* nothing can be asked, which is this app's own default. */
|
|
7
|
+
export declare function prefersDark(): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* The concrete palette to render: `theme` itself, unless it is the system
|
|
10
|
+
* sentinel. Safe to call with any stored value, including one from a brand.
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolveTheme(theme: Theme | undefined): Theme;
|
|
13
|
+
/** `isLightTheme` through {@link resolveTheme}, for callers holding a stored
|
|
14
|
+
* value rather than a resolved one (the editor's syntax palette). */
|
|
15
|
+
export declare function isLightResolvedTheme(theme: Theme | undefined): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Call `onChange` whenever the OS preference flips, so a theme left on "System
|
|
18
|
+
* setting" repaints without a reload. Returns an unsubscribe.
|
|
19
|
+
*
|
|
20
|
+
* Subscribed unconditionally rather than only while `system` is selected: the
|
|
21
|
+
* listener is one boolean check, and gating it on the current value would mean
|
|
22
|
+
* re-subscribing every time the theme changes for no saving worth having.
|
|
23
|
+
*/
|
|
24
|
+
export declare function onSystemThemeChange(onChange: () => void): () => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Short zone name in effect at `date` ("UTC", "EST", "CET") — what glibc's
|
|
2
|
+
* `%Z` and Qt's `t` format token print. A zone tzdata gives no letters gets
|
|
3
|
+
* its numeric abbreviation ("+03", "+0545"); a time before the zone adopted
|
|
4
|
+
* standard time is its local mean time, "LMT". `timeZone` is an IANA id; the
|
|
5
|
+
* local zone when omitted. */
|
|
6
|
+
export declare function timeZoneAbbreviation(date: Date, timeZone?: string): string;
|
|
7
|
+
export declare function timeZoneLongName(date: Date): string;
|
|
8
|
+
/** The local zone's offset from UTC at `date` as "+hhmm", or "+hh:mm" with
|
|
9
|
+
* `colon` — Qt's `tt` and `ttt`. */
|
|
10
|
+
export declare function timeZoneOffset(date: Date, colon?: boolean): string;
|