@mudlet/mudlet-web 0.4.1 → 0.4.3

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 (31) hide show
  1. package/dist-lib/hooks/useOutput.d.ts +1 -2
  2. package/dist-lib/hooks/useViewportMode.d.ts +26 -1
  3. package/dist-lib/import/defaultPackages.d.ts +9 -5
  4. package/dist-lib/import/defaults/mpkg/mpkg.mpackage +0 -0
  5. package/dist-lib/index.js +8914 -8515
  6. package/dist-lib/map/xmlMapImport.d.ts +29 -0
  7. package/dist-lib/mud/MudSession.d.ts +1 -0
  8. package/dist-lib/mud/connection/MudClient.d.ts +6 -1
  9. package/dist-lib/mud/connection/PingTracker.d.ts +13 -0
  10. package/dist-lib/mud/connection/TelnetNegotiator.d.ts +6 -0
  11. package/dist-lib/mud/protocol/byteString.d.ts +33 -0
  12. package/dist-lib/mud/protocol/gmcp.d.ts +12 -7
  13. package/dist-lib/mud/protocol/index.d.ts +2 -1
  14. package/dist-lib/mud/protocol/mnes.d.ts +38 -9
  15. package/dist-lib/mud/text/hyperlinkConfig.d.ts +4 -0
  16. package/dist-lib/scripting/ScriptingAPI.d.ts +4 -0
  17. package/dist-lib/scripting/lua/bindings/commandLine.d.ts +1 -1
  18. package/dist-lib/scripting/lua/bindings/output.d.ts +1 -1
  19. package/dist-lib/storage/schema.d.ts +21 -0
  20. package/dist-lib/styles.css +1 -1
  21. package/dist-lib/ui/labels/LabelManager.d.ts +8 -0
  22. package/dist-lib/ui/labels/qtCss.d.ts +1 -0
  23. package/dist-lib/ui/layout/ContentLayout.d.ts +23 -0
  24. package/dist-lib/ui/layout/MobileLayout.d.ts +5 -1
  25. package/dist-lib/ui/output/OutputRenderer.d.ts +1 -3
  26. package/dist-lib/ui/scrollbox/ScrollBoxOverlay.d.ts +12 -2
  27. package/dist-lib/ui/sound/SoundManager.d.ts +16 -4
  28. package/dist-lib/ui/video/VideoManager.d.ts +6 -1
  29. package/dist-lib/ui/windows/WindowManager.d.ts +28 -0
  30. package/dist-lib/utils/githubRawUrl.d.ts +1 -0
  31. package/package.json +2 -2
@@ -2,7 +2,6 @@ import { type OutputRendererControls, type MessageSource } from '../ui/output/Ou
2
2
  export declare const DEFAULT_STICKY_LINES = 50;
3
3
  export interface UseStickyOutputOptions {
4
4
  stickyLines?: number;
5
- maxElements?: number;
6
5
  splitViewThreshold?: number;
7
6
  showTimestamps?: boolean;
8
7
  /** See OutputHandlerOptions.followTail. Omit for a normal scrollback. */
@@ -16,4 +15,4 @@ export interface UseStickyOutputResult {
16
15
  scrollToBottom: () => void;
17
16
  controls: OutputRendererControls | null;
18
17
  }
19
- export declare function useStickyOutput(source: MessageSource | null, { stickyLines, maxElements, splitViewThreshold, showTimestamps, followTail, }?: UseStickyOutputOptions): UseStickyOutputResult;
18
+ export declare function useStickyOutput(source: MessageSource | null, { stickyLines, splitViewThreshold, showTimestamps, followTail, }?: UseStickyOutputOptions): UseStickyOutputResult;
@@ -1,3 +1,4 @@
1
+ import type { ReactNode } from 'react';
1
2
  /**
2
3
  * Responsive breakpoints (px). Kept in sync with the `--bp-*` tokens and the
3
4
  * `@media` blocks in App.css — change them in both places.
@@ -8,7 +9,31 @@
8
9
  export declare const MOBILE_MAX_WIDTH = 600;
9
10
  export declare const TABLET_MAX_WIDTH = 900;
10
11
  export type ViewportMode = 'mobile' | 'tablet' | 'desktop';
11
- /** Current responsive mode, re-rendering the caller when it changes. */
12
+ /** Current responsive mode, re-rendering the caller when it changes. Reads the
13
+ * nearest measured container, and the window when there is not one. */
12
14
  export declare function useViewportMode(): ViewportMode;
13
15
  /** Convenience: true on phone-sized viewports (the single-column layout branch). */
14
16
  export declare function useIsMobile(): boolean;
17
+ /**
18
+ * The same breakpoints, measured against an element instead of the window.
19
+ *
20
+ * The window is the wrong ruler when the client is not the whole page. Mudlet
21
+ * Web is embedded in a ~560px frame on mudlet.org, and `window.innerWidth`
22
+ * inside that frame is 560 — so the client concluded it was on a phone and
23
+ * switched to the single-column layout, putting its panels behind a tab strip
24
+ * on a 2560px screen. What decides the layout is how much room the client has,
25
+ * which is what its own root element knows.
26
+ *
27
+ * Thresholds are unchanged: a full-window client on a real phone still measures
28
+ * a phone-sized root and still gets the phone layout.
29
+ */
30
+ export declare function useElementViewportMode(element: HTMLElement | null): ViewportMode;
31
+ /**
32
+ * Publishes the mode measured from `element` to everything below it. Consumers
33
+ * that are not under a provider — the connection screen, tests — keep reading
34
+ * the window, so this is additive.
35
+ */
36
+ export declare function ViewportModeProvider({ element, children }: {
37
+ element: HTMLElement | null;
38
+ children: ReactNode;
39
+ }): import("react").FunctionComponentElement<import("react").ProviderProps<ViewportMode | null>>;
@@ -37,11 +37,15 @@ export declare const ALL_DEFAULTS: DefaultPackage[];
37
37
  * map view and only a mapper calls it, so a profile with no mapper never follows
38
38
  * the player — and two mappers would both fire on the same movement.
39
39
  *
40
- * The starter UI is the one conditional pick: Mudlet skips it for players who
41
- * aren't new (`experiencedMudletPlayer()` — any profile folder older than six
42
- * months) because "veterans will have their own layouts already", and for games
43
- * whose own loader installs a full interface. mudix has no profile-age signal to
44
- * mirror the first, so `createdAt` stands in for it — see {@link isNewProfile}.
40
+ * The starter UI is the one host-conditional pick: Mudlet skips it for players
41
+ * who aren't new (`experiencedMudletPlayer()` — any profile folder older than
42
+ * six months) because "veterans will have their own layouts already", and for
43
+ * games whose own loader installs a full interface. mudix has no profile-age
44
+ * signal to mirror the first, so `createdAt` stands in for it — see
45
+ * {@link isNewProfile}.
46
+ *
47
+ * mpkg is the one *build*-conditional pick, and for the reason Mudlet has:
48
+ * see {@link TEST_BUILD}.
45
49
  */
46
50
  export declare function stockDefaults(host?: string, conn?: {
47
51
  createdAt?: string;