mudlet-map-editor 0.10.2 → 0.12.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/panels/MapPanel.d.ts +3 -37
- package/dist-lib/editor/store.d.ts +5 -0
- package/dist-lib/editor/tools.d.ts +1 -1
- package/dist-lib/editor/warningAcks.d.ts +8 -0
- package/dist-lib/editor/warnings.d.ts +44 -0
- package/dist-lib/index.js +2393 -4994
- package/dist-lib/styles.css +1 -1
- package/package.json +7 -14
|
@@ -1,44 +1,10 @@
|
|
|
1
1
|
import type { SceneHandle } from '../../editor/scene';
|
|
2
|
-
import type
|
|
2
|
+
import { type MapWarning, warningKey } from '../../editor/warnings';
|
|
3
|
+
export type { MapWarning };
|
|
4
|
+
export { warningKey };
|
|
3
5
|
interface MapPanelProps {
|
|
4
6
|
sceneRef: {
|
|
5
7
|
current: SceneHandle | null;
|
|
6
8
|
};
|
|
7
9
|
}
|
|
8
|
-
type MapWarning = {
|
|
9
|
-
kind: 'zeroSizeLabel';
|
|
10
|
-
labelId: number;
|
|
11
|
-
areaId: number;
|
|
12
|
-
areaName: string;
|
|
13
|
-
z: number;
|
|
14
|
-
text: string;
|
|
15
|
-
x: number;
|
|
16
|
-
y: number;
|
|
17
|
-
} | {
|
|
18
|
-
kind: 'selfLinkRoom';
|
|
19
|
-
roomId: number;
|
|
20
|
-
dirs: string[];
|
|
21
|
-
} | {
|
|
22
|
-
kind: 'orphanRoom';
|
|
23
|
-
roomId: number;
|
|
24
|
-
areaName: string;
|
|
25
|
-
} | {
|
|
26
|
-
kind: 'danglingExit';
|
|
27
|
-
roomId: number;
|
|
28
|
-
dir: string;
|
|
29
|
-
targetId: number;
|
|
30
|
-
areaName: string;
|
|
31
|
-
} | {
|
|
32
|
-
kind: 'duplicateCoord';
|
|
33
|
-
roomIds: number[];
|
|
34
|
-
areaId: number;
|
|
35
|
-
areaName: string;
|
|
36
|
-
x: number;
|
|
37
|
-
y: number;
|
|
38
|
-
z: number;
|
|
39
|
-
};
|
|
40
|
-
export declare function collectWarnings(sceneRef: {
|
|
41
|
-
current: SceneHandle | null;
|
|
42
|
-
}, map: MudletMap): MapWarning[];
|
|
43
10
|
export declare function MapPanel({ sceneRef }: MapPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
-
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { MudletMap, MudletRoom } from '../mapIO';
|
|
2
2
|
import type { Command, HitItem, HoverTarget, LoadedMap, Pending, Selection, SwatchSet, ToolId } from './types';
|
|
3
|
+
import type { MapWarning } from './warnings';
|
|
3
4
|
export type RoomClipboard = {
|
|
4
5
|
/** Rooms captured at copy time; origId preserved for internal-exit remap. */
|
|
5
6
|
rooms: Array<{
|
|
@@ -89,6 +90,9 @@ export interface EditorState {
|
|
|
89
90
|
swatchPaletteOpen: boolean;
|
|
90
91
|
sessionId: string | null;
|
|
91
92
|
spreadShrink: SpreadShrinkState | null;
|
|
93
|
+
warningAckVersion: number;
|
|
94
|
+
/** Cached map warnings; recomputed in App after each command lands. */
|
|
95
|
+
warnings: MapWarning[];
|
|
92
96
|
}
|
|
93
97
|
export type ContextMenuState = {
|
|
94
98
|
kind: 'customLinePoint';
|
|
@@ -123,6 +127,7 @@ declare class Store {
|
|
|
123
127
|
subscribe: (listener: Listener) => (() => void);
|
|
124
128
|
bumpData: () => void;
|
|
125
129
|
bumpStructure: () => void;
|
|
130
|
+
bumpAckVersion: () => void;
|
|
126
131
|
}
|
|
127
132
|
export declare const store: Store;
|
|
128
133
|
export declare function useEditorState<T>(selector: (s: EditorState) => T): T;
|
|
@@ -42,7 +42,7 @@ export declare const customLineTool: Tool;
|
|
|
42
42
|
* when no raw write happened yet (restores / removes based on previousSnapshot).
|
|
43
43
|
*/
|
|
44
44
|
export declare function restorePendingCustomLine(pending: import('./types').PendingCustomLine, scene: SceneHandle): void;
|
|
45
|
-
export declare function finishCustomLine(pending: import('./types').PendingCustomLine,
|
|
45
|
+
export declare function finishCustomLine(pending: import('./types').PendingCustomLine, _ctx?: ToolContext): void;
|
|
46
46
|
export declare const addLabelTool: Tool;
|
|
47
47
|
export declare function getActiveSwatch(s: import('./store').EditorState): import('./types').Swatch | null;
|
|
48
48
|
export declare const paintTool: Tool;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MudletMap } from '../mapIO';
|
|
2
|
+
/**
|
|
3
|
+
* Fingerprint based on sorted area IDs. Stable across filename changes;
|
|
4
|
+
* invalidates when areas are added or removed.
|
|
5
|
+
*/
|
|
6
|
+
export declare function mapAckKey(map: MudletMap): string;
|
|
7
|
+
export declare function loadAcks(mapKey: string): Set<string>;
|
|
8
|
+
export declare function saveAcks(mapKey: string, acks: Set<string>): void;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { SceneHandle } from './scene';
|
|
2
|
+
import type { MudletMap } from '../mapIO';
|
|
3
|
+
export type MapWarning = {
|
|
4
|
+
kind: 'zeroSizeLabel';
|
|
5
|
+
labelId: number;
|
|
6
|
+
areaId: number;
|
|
7
|
+
areaName: string;
|
|
8
|
+
z: number;
|
|
9
|
+
text: string;
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
} | {
|
|
13
|
+
kind: 'selfLinkRoom';
|
|
14
|
+
roomId: number;
|
|
15
|
+
dirs: string[];
|
|
16
|
+
} | {
|
|
17
|
+
kind: 'orphanRoom';
|
|
18
|
+
roomId: number;
|
|
19
|
+
areaName: string;
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'danglingExit';
|
|
22
|
+
roomId: number;
|
|
23
|
+
dir: string;
|
|
24
|
+
targetId: number;
|
|
25
|
+
areaName: string;
|
|
26
|
+
} | {
|
|
27
|
+
kind: 'duplicateCoord';
|
|
28
|
+
roomIds: number[];
|
|
29
|
+
areaId: number;
|
|
30
|
+
areaName: string;
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
z: number;
|
|
34
|
+
} | {
|
|
35
|
+
kind: 'coordMismatch';
|
|
36
|
+
roomId: number;
|
|
37
|
+
dir: string;
|
|
38
|
+
targetId: number;
|
|
39
|
+
areaName: string;
|
|
40
|
+
};
|
|
41
|
+
export declare function warningKey(w: MapWarning): string;
|
|
42
|
+
export declare function collectWarnings(sceneRef: {
|
|
43
|
+
current: SceneHandle | null;
|
|
44
|
+
}, map: MudletMap): MapWarning[];
|