mudlet-map-editor 0.1.0 → 0.2.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/dist-lib/components/FontPicker.d.ts +7 -0
- package/dist-lib/components/RoomPanel.d.ts +3 -1
- package/dist-lib/components/SidePanel.d.ts +3 -2
- package/dist-lib/editor/plugin.d.ts +15 -1
- package/dist-lib/index.d.ts +4 -1
- package/dist-lib/index.js +989 -885
- package/dist-lib/main.d.ts +1 -1
- package/dist-lib/styles.css +2 -3476
- package/package.json +2 -2
|
@@ -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,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
|
}
|
package/dist-lib/index.d.ts
CHANGED
|
@@ -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';
|