mudlet-map-editor 0.1.0 → 0.2.1

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.
@@ -0,0 +1,7 @@
1
+ interface Props {
2
+ value: string;
3
+ options: string[];
4
+ onChange: (family: string) => void;
5
+ }
6
+ export declare function FontPicker({ value, options, onChange }: Props): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -1,5 +1,6 @@
1
1
  import type { SceneHandle } from '../editor/scene';
2
2
  import type { MudletMap } from '../mapIO';
3
+ import type { RoomPanelSection } from '../editor/plugin';
3
4
  interface RoomPanelProps {
4
5
  selection: {
5
6
  kind: 'room';
@@ -10,6 +11,7 @@ interface RoomPanelProps {
10
11
  sceneRef: {
11
12
  current: SceneHandle | null;
12
13
  };
14
+ pluginSections?: RoomPanelSection[];
13
15
  }
14
- export declare function RoomPanel({ selection, room, map, sceneRef }: RoomPanelProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function RoomPanel({ selection, room, map, sceneRef, pluginSections }: RoomPanelProps): import("react/jsx-runtime").JSX.Element;
15
17
  export {};
@@ -1,10 +1,11 @@
1
1
  import type { SceneHandle } from '../editor/scene';
2
- import type { SidebarTab } from '../editor/plugin';
2
+ import type { RoomPanelSection, SidebarTab } from '../editor/plugin';
3
3
  interface SidePanelProps {
4
4
  sceneRef: {
5
5
  current: SceneHandle | null;
6
6
  };
7
7
  extraTabs?: SidebarTab[];
8
+ pluginRoomSections?: RoomPanelSection[];
8
9
  }
9
- export declare function SidePanel({ sceneRef, extraTabs }: SidePanelProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function SidePanel({ sceneRef, extraTabs, pluginRoomSections }: SidePanelProps): import("react/jsx-runtime").JSX.Element;
10
11
  export {};
@@ -1,4 +1,4 @@
1
- import type { PendingCustomLine } from '../../editor/types';
1
+ import { PendingCustomLine } from '../../editor/types';
2
2
  import type { SceneHandle } from '../../editor/scene';
3
3
  import type { MudletMap } from '../../mapIO';
4
4
  export declare function CustomLineDrawPanel({ pending, sceneRef }: {
@@ -12,6 +12,7 @@ export declare function CustomLineSelectPanel({ selection, map, sceneRef }: {
12
12
  kind: 'customLine';
13
13
  roomId: number;
14
14
  exitName: string;
15
+ pointIndex?: number;
15
16
  };
16
17
  map: MudletMap;
17
18
  sceneRef: {
@@ -5,7 +5,7 @@ export declare function nextAreaId(map: MudletMap): number;
5
5
  export declare function nextRoomId(map: MudletMap): number;
6
6
  export declare function createDefaultRoom(id: number, areaId: number, x: number, y: number, z: number): MudletRoom;
7
7
  export declare function inferDirection(sx: number, sy: number, tx: number, ty: number): Direction;
8
- export declare function getExit(room: MudletRoom, dir: Direction): number;
8
+ export declare function getExit(room: MudletRoom, dir: string): number;
9
9
  export declare function setExit(room: MudletRoom, dir: Direction, value: number): void;
10
10
  /** Returns all incoming cardinal-exit references to `targetId` from any room in the map. */
11
11
  export declare function findNeighborsPointingAt(map: MudletMap, targetId: number): Array<{
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { MudletMap } from '../mapIO';
2
+ import type { MudletMap, MudletRoom } from '../mapIO';
3
3
  import type { SwatchSet } from './types';
4
4
  import type { SceneHandle } from './scene';
5
5
  export interface SidebarTab {
@@ -9,6 +9,18 @@ export interface SidebarTab {
9
9
  current: SceneHandle | null;
10
10
  }): ReactNode;
11
11
  }
12
+ export interface RoomSectionProps {
13
+ roomId: number;
14
+ room: NonNullable<MudletRoom>;
15
+ map: MudletMap;
16
+ sceneRef: {
17
+ current: SceneHandle | null;
18
+ };
19
+ }
20
+ export interface RoomPanelSection {
21
+ id: string;
22
+ render(props: RoomSectionProps): ReactNode;
23
+ }
12
24
  export interface EditorPlugin {
13
25
  onAppReady?(): Promise<void>;
14
26
  onMapOpened?(map: MudletMap): void;
@@ -17,4 +29,6 @@ export interface EditorPlugin {
17
29
  renderOverlay?(): ReactNode;
18
30
  sidebarTabs?(): SidebarTab[];
19
31
  swatchSets?(): SwatchSet[];
32
+ /** Contribute additional sections rendered at the bottom of the room selection panel. */
33
+ roomPanelSections?(): RoomPanelSection[];
20
34
  }
@@ -42,6 +42,7 @@ export type Direction = 'north' | 'northeast' | 'east' | 'southeast' | 'south' |
42
42
  export declare const CARDINAL_DIRECTIONS: Direction[];
43
43
  export declare const OPPOSITE: Record<Direction, Direction>;
44
44
  export declare const DIR_SHORT: Record<Direction, string>;
45
+ export declare const DIR_LONG: Record<string, Direction>;
45
46
  /** 1-based direction index used by Mudlet's stubs/exitLocks arrays. */
46
47
  export declare const DIR_INDEX: Record<Direction, number>;
47
48
  /** Inverse of DIR_SHORT — short-form cardinal key → full Direction name. */
@@ -1,5 +1,8 @@
1
+ import './styles.css';
1
2
  export { default as App } from './App';
2
- export type { EditorPlugin, SidebarTab } from './editor/plugin';
3
+ export type { EditorPlugin, SidebarTab, RoomPanelSection, RoomSectionProps } from './editor/plugin';
3
4
  export type { SwatchSet, Swatch } from './editor/types';
4
5
  export { loadUrlIntoStore } from './editor/loadFile';
5
6
  export { getMapBytes } from './editor/mapBytes';
7
+ export { pushCommand } from './editor/commands';
8
+ export { store, useEditorState } from './editor/store';