mudlet-map-renderer 0.43.0-konva → 1.1.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.
Files changed (39) hide show
  1. package/README.md +520 -522
  2. package/dist/AreaMapRenderer.d.ts +2 -2
  3. package/dist/ExitRenderer.d.ts +5 -5
  4. package/dist/MapGraph.d.ts +2 -2
  5. package/dist/MapReader-mU_4JWv_.js +224 -0
  6. package/dist/MapReader-mU_4JWv_.js.map +1 -0
  7. package/dist/MapState.d.ts +15 -9
  8. package/dist/PathData.d.ts +2 -2
  9. package/dist/PathFinder.d.ts +2 -2
  10. package/dist/ScenePipeline.d.ts +19 -6
  11. package/dist/binary/BinaryMapReader.d.ts +36 -0
  12. package/dist/binary/index.d.ts +2 -0
  13. package/dist/binary.mjs +34 -0
  14. package/dist/binary.mjs.map +1 -0
  15. package/dist/index.d.ts +13 -3
  16. package/dist/index.mjs +1086 -1147
  17. package/dist/index.mjs.map +1 -1
  18. package/dist/lens/ExplorationLens.d.ts +29 -0
  19. package/dist/lens/RoomLens.d.ts +47 -0
  20. package/dist/lens/composeLenses.d.ts +31 -0
  21. package/dist/lens/index.d.ts +5 -0
  22. package/dist/overlay/LiveEffect.d.ts +33 -0
  23. package/dist/overlay/SceneOverlay.d.ts +18 -89
  24. package/dist/reader/Area.d.ts +40 -4
  25. package/dist/reader/Exit.d.ts +4 -1
  26. package/dist/reader/MapReader.d.ts +23 -17
  27. package/dist/reader/Plane.d.ts +19 -1
  28. package/dist/rendering/KonvaRenderBackend.d.ts +4 -8
  29. package/dist/rendering/MapRenderer.d.ts +31 -7
  30. package/dist/rendering/SceneManager.d.ts +7 -6
  31. package/dist/scene/InnerExitStyle.d.ts +2 -2
  32. package/dist/scene/OverlayStyle.d.ts +8 -4
  33. package/dist/scene/RoomStyle.d.ts +2 -2
  34. package/dist/scene/elements/ExitLayout.d.ts +2 -2
  35. package/dist/scene/elements/RoomLayout.d.ts +2 -2
  36. package/dist/types/Settings.d.ts +44 -0
  37. package/dist/utils/color.d.ts +9 -1
  38. package/package.json +17 -1
  39. package/dist/reader/ExplorationArea.d.ts +0 -32
@@ -1,4 +1,4 @@
1
- import { default as MapReader } from './reader/MapReader';
1
+ import { IMapReader } from './reader/MapReader';
2
2
  import { PlanarDirection } from './directions';
3
3
  type AreaConnection = {
4
4
  fromAreaId: number;
@@ -71,7 +71,7 @@ export declare class AreaMapRenderer {
71
71
  private backgroundImage?;
72
72
  private backgroundConfig?;
73
73
  private dotsMode;
74
- constructor(container: HTMLDivElement, mapReader: MapReader, settings?: AreaMapSettings);
74
+ constructor(container: HTMLDivElement, mapReader: IMapReader, settings?: AreaMapSettings);
75
75
  private initResize;
76
76
  private initScaling;
77
77
  setZoom(zoom: number): boolean;
@@ -1,5 +1,5 @@
1
- import { default as Exit } from './reader/Exit';
2
- import { default as MapReader } from './reader/MapReader';
1
+ import { default as IExit } from './reader/Exit';
2
+ import { IMapReader } from './reader/MapReader';
3
3
  import { Settings } from './types/Settings';
4
4
  export type ExitDrawLine = {
5
5
  points: number[];
@@ -52,14 +52,14 @@ export type ExitDrawData = {
52
52
  export default class ExitRenderer {
53
53
  private mapReader;
54
54
  private readonly settings;
55
- constructor(mapReader: MapReader, settings: Settings);
55
+ constructor(mapReader: IMapReader, settings: Settings);
56
56
  /**
57
57
  * Get the edge point of a room based on its shape.
58
58
  * The inset accounts for the inner border so exit lines reach the visible room edge.
59
59
  */
60
60
  private getRoomEdgePoint;
61
- renderData(exit: Exit, zIndex: number): ExitDrawData | undefined;
62
- renderDataWithColor(exit: Exit, color: string, zIndex: number): ExitDrawData | undefined;
61
+ renderData(exit: IExit, zIndex: number): ExitDrawData | undefined;
62
+ renderDataWithColor(exit: IExit, color: string, zIndex: number): ExitDrawData | undefined;
63
63
  private renderTwoWayExitData;
64
64
  private renderOneWayExitData;
65
65
  /**
@@ -1,4 +1,4 @@
1
- import { default as MapReader } from './reader/MapReader';
1
+ import { IMapReader } from './reader/MapReader';
2
2
  export interface Edge {
3
3
  id: number;
4
4
  weight: number;
@@ -17,7 +17,7 @@ export interface GraphData {
17
17
  export declare class MapGraph {
18
18
  private readonly mapReader;
19
19
  private readonly data;
20
- constructor(mapReader: MapReader);
20
+ constructor(mapReader: IMapReader);
21
21
  getAdj(): Map<number, Edge[]>;
22
22
  getGraphDefinition(): Record<string, Record<string, number>>;
23
23
  getMaxEdgeDistance(): number;
@@ -0,0 +1,224 @@
1
+ //#region src/reader/Plane.ts
2
+ var e = class {
3
+ constructor(e, t) {
4
+ this.rooms = [], this.labels = [], this.rooms = e, this.labels = t, this.bounds = this.createBounds();
5
+ }
6
+ getRooms() {
7
+ return this.rooms;
8
+ }
9
+ getLabels() {
10
+ return this.labels;
11
+ }
12
+ getBounds() {
13
+ return this.bounds;
14
+ }
15
+ createBounds() {
16
+ let e = this.rooms.reduce((e, t) => ({
17
+ minX: Math.min(e.minX, t.x),
18
+ maxX: Math.max(e.maxX, t.x),
19
+ minY: Math.min(e.minY, t.y),
20
+ maxY: Math.max(e.maxY, t.y)
21
+ }), {
22
+ minX: Infinity,
23
+ maxX: -Infinity,
24
+ minY: Infinity,
25
+ maxY: -Infinity
26
+ });
27
+ for (let t of this.labels) {
28
+ let n = t.X, r = -t.Y;
29
+ e.minX = Math.min(e.minX, n), e.maxX = Math.max(e.maxX, n + t.Width), e.minY = Math.min(e.minY, r), e.maxY = Math.max(e.maxY, r + t.Height);
30
+ }
31
+ return e;
32
+ }
33
+ }, t = class t {
34
+ constructor(e) {
35
+ this.planes = {}, this.exits = /* @__PURE__ */ new Map(), this.version = 0, this.area = e, this.planes = this.createPlanes(), this.createExits();
36
+ }
37
+ getAreaName() {
38
+ return this.area.areaName;
39
+ }
40
+ getAreaId() {
41
+ return parseInt(this.area.areaId);
42
+ }
43
+ getVersion() {
44
+ return this.version;
45
+ }
46
+ markDirty() {
47
+ this.version++;
48
+ }
49
+ getPlane(e) {
50
+ return this.planes[e];
51
+ }
52
+ getPlanes() {
53
+ return Object.values(this.planes);
54
+ }
55
+ getZLevels() {
56
+ return Object.keys(this.planes).map(Number).sort((e, t) => e - t);
57
+ }
58
+ getRooms() {
59
+ return this.area.rooms;
60
+ }
61
+ getFullBounds() {
62
+ return this.getPlanes().reduce((e, t) => {
63
+ let n = t.getBounds();
64
+ return {
65
+ minX: Math.min(e.minX, n.minX),
66
+ maxX: Math.max(e.maxX, n.maxX),
67
+ minY: Math.min(e.minY, n.minY),
68
+ maxY: Math.max(e.maxY, n.maxY)
69
+ };
70
+ }, {
71
+ minX: Infinity,
72
+ maxX: -Infinity,
73
+ minY: Infinity,
74
+ maxY: -Infinity
75
+ });
76
+ }
77
+ getLinkExits(e) {
78
+ return Array.from(this.exits.values()).filter((t) => t.zIndex.includes(e));
79
+ }
80
+ createPlanes() {
81
+ let t = this.area.rooms.reduce((e, t) => (e[t.z] || (e[t.z] = []), e[t.z].push(t), e), {});
82
+ return Object.entries(t).reduce((t, [n, r]) => (t[+n] = new e(r, this.area.labels.filter((e) => e.Z === +n)), t), {});
83
+ }
84
+ static {
85
+ this.oppositeDir = {
86
+ north: "south",
87
+ south: "north",
88
+ east: "west",
89
+ west: "east",
90
+ northeast: "southwest",
91
+ southwest: "northeast",
92
+ northwest: "southeast",
93
+ southeast: "northwest",
94
+ up: "down",
95
+ down: "up",
96
+ in: "out",
97
+ out: "in"
98
+ };
99
+ }
100
+ createExits() {
101
+ let e = /* @__PURE__ */ new Map();
102
+ this.area.rooms.forEach((t) => {
103
+ Object.entries(t.exits).forEach(([n, r]) => {
104
+ if (t.id === r) return;
105
+ let i = `${Math.min(t.id, r)}-${Math.max(t.id, r)}`;
106
+ e.has(i) || e.set(i, []), e.get(i).push({
107
+ origin: t.id,
108
+ target: r,
109
+ z: t.z,
110
+ dir: n
111
+ });
112
+ });
113
+ });
114
+ for (let [n, r] of e) {
115
+ let [e, i] = n.split("-"), a = parseInt(e), o = parseInt(i), s = r.filter((e) => e.origin === a), c = r.filter((e) => e.origin === o), l = /* @__PURE__ */ new Set();
116
+ for (let e of s) {
117
+ let r = -1;
118
+ for (let n = 0; n < c.length; n++) if (!l.has(n) && c[n].dir === t.oppositeDir[e.dir]) {
119
+ r = n;
120
+ break;
121
+ }
122
+ if (r !== -1) {
123
+ l.add(r);
124
+ let t = c[r];
125
+ this.exits.set(`${n}-${e.dir}`, {
126
+ a,
127
+ b: o,
128
+ aDir: e.dir,
129
+ bDir: t.dir,
130
+ zIndex: [e.z, t.z]
131
+ });
132
+ } else this.exits.set(`${n}-a:${e.dir}`, {
133
+ a,
134
+ b: o,
135
+ aDir: e.dir,
136
+ zIndex: [e.z]
137
+ });
138
+ }
139
+ for (let e = 0; e < c.length; e++) if (!l.has(e)) {
140
+ let t = c[e];
141
+ this.exits.set(`${n}-b:${t.dir}`, {
142
+ a,
143
+ b: o,
144
+ bDir: t.dir,
145
+ zIndex: [t.z]
146
+ });
147
+ }
148
+ }
149
+ }
150
+ }, n = {
151
+ rgb: [
152
+ 114,
153
+ 1,
154
+ 0
155
+ ],
156
+ rgbValue: "rgb(114, 1, 0)",
157
+ symbolColor: [
158
+ 225,
159
+ 225,
160
+ 225
161
+ ],
162
+ symbolColorValue: "rgb(225,225,225)"
163
+ };
164
+ function r(e) {
165
+ let t = e[0] / 255, n = e[1] / 255, r = e[2] / 255;
166
+ return (Math.max(t, n, r) + Math.min(t, n, r)) / 2;
167
+ }
168
+ var i = class {
169
+ constructor(e, n) {
170
+ this.rooms = {}, this.areas = {}, this.colors = {}, e.forEach((e) => {
171
+ let n = {
172
+ ...e,
173
+ rooms: e.rooms.map((e) => ({
174
+ ...e,
175
+ y: -e.y
176
+ }))
177
+ };
178
+ n.rooms.forEach((e) => {
179
+ this.rooms[e.id] = e;
180
+ });
181
+ let r = parseInt(e.areaId);
182
+ this.areas[r] = new t(n);
183
+ }), this.colors = n.reduce((e, t) => ({
184
+ ...e,
185
+ [t.envId]: {
186
+ rgb: t.colors,
187
+ rgbValue: `rgb(${t.colors.join(",")})`,
188
+ symbolColor: r(t.colors) > .41 ? [
189
+ 25,
190
+ 25,
191
+ 25
192
+ ] : [
193
+ 225,
194
+ 255,
195
+ 255
196
+ ],
197
+ symbolColorValue: r(t.colors) > .41 ? "rgb(25,25,25)" : "rgb(225,255,255)"
198
+ }
199
+ }), {});
200
+ }
201
+ getArea(e) {
202
+ return this.areas[e];
203
+ }
204
+ getAreas() {
205
+ return Object.values(this.areas);
206
+ }
207
+ getRooms() {
208
+ return Object.values(this.rooms);
209
+ }
210
+ getRoom(e) {
211
+ return this.rooms[e];
212
+ }
213
+ getColorValue(e) {
214
+ return this.colors[e]?.rgbValue ?? n.rgbValue;
215
+ }
216
+ getSymbolColor(e, t) {
217
+ let r = this.colors[e]?.symbolColor ?? n.symbolColor, i = Math.min(Math.max(t ?? 1, 0), 1), a = r.join(",");
218
+ return i == 1 ? `rgba(${a})` : `rgba(${a}, ${i})`;
219
+ }
220
+ };
221
+ //#endregion
222
+ export { t as n, e as r, i as t };
223
+
224
+ //# sourceMappingURL=MapReader-mU_4JWv_.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapReader-mU_4JWv_.js","names":[],"sources":["../src/reader/Plane.ts","../src/reader/Area.ts","../src/reader/MapReader.ts"],"sourcesContent":["/**\n * Public, renderer-facing surface of a z-level slice of an area.\n *\n * The renderer (and other library consumers) only depend on this interface;\n * the concrete {@link Plane} class is one implementation of it. Downstream\n * apps that want to drive the renderer from their own data model can hand it\n * any `IPlane`-shaped object (typically returned from an {@link IArea}).\n */\nexport interface IPlane {\n getRooms(): MapData.Room[];\n getLabels(): MapData.Label[];\n getBounds(): { minX: number; maxX: number; minY: number; maxY: number };\n}\n\nexport default class Plane implements IPlane {\n\n private readonly bounds: { minX: number, maxX: number, minY: number, maxY: number }\n private readonly rooms: MapData.Room[] = [];\n private readonly labels: MapData.Label[] = [];\n\n constructor(rooms: MapData.Room[], labels: MapData.Label[]) {\n this.rooms = rooms;\n this.labels = labels;\n this.bounds = this.createBounds();\n }\n\n getRooms() {\n return this.rooms;\n }\n\n getLabels() {\n return this.labels;\n }\n\n getBounds() {\n return this.bounds;\n }\n\n private createBounds() {\n const b = this.rooms.reduce(\n (acc, r) => ({\n minX: Math.min(acc.minX, r.x),\n maxX: Math.max(acc.maxX, r.x),\n minY: Math.min(acc.minY, r.y),\n maxY: Math.max(acc.maxY, r.y),\n }),\n {\n minX: Number.POSITIVE_INFINITY,\n maxX: Number.NEGATIVE_INFINITY,\n minY: Number.POSITIVE_INFINITY,\n maxY: Number.NEGATIVE_INFINITY,\n }\n );\n for (const label of this.labels) {\n const lx = label.X;\n const ly = -label.Y;\n b.minX = Math.min(b.minX, lx);\n b.maxX = Math.max(b.maxX, lx + label.Width);\n b.minY = Math.min(b.minY, ly);\n b.maxY = Math.max(b.maxY, ly + label.Height);\n }\n return b;\n }\n\n}\n","import Plane, {IPlane} from \"./Plane\";\n\nimport IExit from \"./Exit\";\n\n/**\n * Public, renderer-facing surface of an area. The renderer never inspects\n * private state of {@link Area}; it talks to this interface only. Custom data\n * models (e.g. an app that owns its own room store) can satisfy `IArea` and\n * hand the result to {@link MapRenderer} without subclassing.\n *\n * Mutability lives on the concrete implementation: {@link Area.markDirty} is\n * `protected`, kept off the public interface. Consumers signal \"redraw me\" by\n * bumping {@link getVersion}; the renderer reads the version to decide\n * whether to rebuild.\n */\nexport interface IArea {\n getAreaName(): string;\n getAreaId(): number;\n /**\n * Monotonically increasing version. The renderer compares the value it\n * cached on the last build against the current value to decide whether\n * the area needs a rebuild.\n */\n getVersion(): number;\n getPlane(zIndex: number): IPlane;\n getPlanes(): IPlane[];\n getZLevels(): number[];\n getRooms(): MapData.Room[];\n getFullBounds(): { minX: number; maxX: number; minY: number; maxY: number };\n /**\n * Inter-room exits drawn on the given z-level. Each exit is bidirectional\n * with optional one-way fallback; see {@link IExit}.\n */\n getLinkExits(zIndex: number): IExit[];\n}\n\nexport default class Area implements IArea {\n\n private readonly planes: Record<number, Plane> = {};\n private readonly area: MapData.Area;\n private readonly exits: Map<string, IExit> = new Map();\n private version = 0;\n\n constructor(area: MapData.Area) {\n this.area = area;\n this.planes = this.createPlanes();\n this.createExits();\n }\n\n getAreaName() {\n return this.area.areaName\n }\n\n getAreaId() {\n return parseInt(this.area.areaId)\n }\n\n getVersion() {\n return this.version;\n }\n\n protected markDirty() {\n this.version++;\n }\n\n getPlane(zIndex: number) {\n return this.planes[zIndex];\n }\n\n getPlanes() {\n return Object.values(this.planes);\n }\n\n getZLevels(): number[] {\n return Object.keys(this.planes).map(Number).sort((a, b) => a - b);\n }\n\n getRooms() {\n return this.area.rooms\n }\n\n getFullBounds(): { minX: number; maxX: number; minY: number; maxY: number } {\n return this.getPlanes().reduce(\n (acc, plane) => {\n const b = plane.getBounds();\n return {\n minX: Math.min(acc.minX, b.minX),\n maxX: Math.max(acc.maxX, b.maxX),\n minY: Math.min(acc.minY, b.minY),\n maxY: Math.max(acc.maxY, b.maxY),\n };\n },\n { minX: Infinity, maxX: -Infinity, minY: Infinity, maxY: -Infinity }\n );\n }\n\n getLinkExits(zIndex: number) {\n return Array.from(this.exits.values()).filter(e => e.zIndex.includes(zIndex));\n }\n\n private createPlanes() {\n const grouped = this.area.rooms.reduce<Record<number, MapData.Room[]>>((acc, room) => {\n if (!acc[room.z]) {\n acc[room.z] = [];\n }\n // @ts-ignore\n acc[room.z].push(room);\n return acc;\n }, {});\n return Object.entries(grouped).reduce(\n (acc, [z, rooms]) => {\n acc[+z] = new Plane(rooms, this.area.labels.filter(label => label.Z === +z));\n return acc;\n },\n {} as Record<number, Plane>\n );\n }\n\n private static readonly oppositeDir: Partial<Record<MapData.direction, MapData.direction>> = {\n \"north\": \"south\", \"south\": \"north\",\n \"east\": \"west\", \"west\": \"east\",\n \"northeast\": \"southwest\", \"southwest\": \"northeast\",\n \"northwest\": \"southeast\", \"southeast\": \"northwest\",\n \"up\": \"down\", \"down\": \"up\",\n \"in\": \"out\", \"out\": \"in\",\n };\n\n private createExits() {\n type HalfExit = { origin: number, target: number, z: number, dir: MapData.direction };\n const halfExitsByPair = new Map<string, HalfExit[]>();\n\n this.area.rooms.forEach(room => {\n Object.entries(room.exits).forEach(([direction, targetRoomId]) => {\n if (room.id === targetRoomId) return;\n const a = Math.min(room.id, targetRoomId);\n const b = Math.max(room.id, targetRoomId);\n const key = `${a}-${b}`;\n if (!halfExitsByPair.has(key)) halfExitsByPair.set(key, []);\n halfExitsByPair.get(key)!.push({\n origin: room.id, target: targetRoomId, z: room.z, dir: direction as MapData.direction\n });\n });\n });\n\n for (const [pairKey, halves] of halfExitsByPair) {\n const [aStr, bStr] = pairKey.split('-');\n const a = parseInt(aStr), b = parseInt(bStr);\n\n const aSide = halves.filter(h => h.origin === a);\n const bSide = halves.filter(h => h.origin === b);\n\n const usedB = new Set<number>();\n\n for (const aHalf of aSide) {\n let bestIdx = -1;\n for (let i = 0; i < bSide.length; i++) {\n if (usedB.has(i)) continue;\n if (bSide[i].dir === Area.oppositeDir[aHalf.dir]) {\n bestIdx = i;\n break;\n }\n }\n\n if (bestIdx !== -1) {\n usedB.add(bestIdx);\n const bHalf = bSide[bestIdx];\n this.exits.set(`${pairKey}-${aHalf.dir}`, {\n a, b, aDir: aHalf.dir, bDir: bHalf.dir, zIndex: [aHalf.z, bHalf.z]\n });\n } else {\n this.exits.set(`${pairKey}-a:${aHalf.dir}`, {\n a, b, aDir: aHalf.dir, zIndex: [aHalf.z]\n });\n }\n }\n\n for (let i = 0; i < bSide.length; i++) {\n if (!usedB.has(i)) {\n const bHalf = bSide[i];\n this.exits.set(`${pairKey}-b:${bHalf.dir}`, {\n a, b, bDir: bHalf.dir, zIndex: [bHalf.z]\n });\n }\n }\n }\n }\n\n}","import Area, {IArea} from \"./Area\";\n\n/**\n * Public, renderer-facing surface for map data. Everything the renderer\n * (and other library consumers) call on `MapReader` is on this interface —\n * private state and internal helpers are not.\n *\n * Downstream apps with their own room/area store can implement `IMapReader`\n * directly (no need to subclass {@link MapReader}) and hand the result to\n * {@link MapRenderer}. Visibility filtering (exploration, scope overlays,\n * etc.) lives on the renderer's lens — it is intentionally not on this\n * interface.\n */\nexport interface IMapReader {\n getArea(areaId: number): IArea;\n getAreas(): IArea[];\n getRooms(): MapData.Room[];\n getRoom(roomId: number): MapData.Room;\n /** Returns the env's `rgb(r,g,b)` string, or a default colour if the env id is unknown. */\n getColorValue(envId: number): string;\n /** Returns a contrasting symbol colour for the env, optionally with the given alpha. */\n getSymbolColor(envId: number, opacity?: number): string;\n}\n\ninterface Color {\n rgb: number[];\n rgbValue: string;\n symbolColor: number[];\n symbolColorValue: string,\n}\n\nconst defaultColor: Color = {\n rgb: [114, 1, 0],\n rgbValue: 'rgb(114, 1, 0)',\n symbolColor: [225, 225, 225],\n symbolColorValue: 'rgb(225,225,225)'\n}\n\nfunction calculateLuminance(rgb: number[]) {\n const rn = rgb[0] / 255;\n const gn = rgb[1] / 255;\n const bn = rgb[2] / 255;\n\n const max = Math.max(rn, gn, bn);\n const min = Math.min(rn, gn, bn);\n\n return (max + min) / 2;\n}\n\nexport default class MapReader implements IMapReader {\n\n private rooms: Record<number, MapData.Room> = {};\n private areas: Record<number, Area> = {};\n private colors: Record<number, Color> = {};\n\n constructor(map: MapData.Map, envs: MapData.Env[]) {\n map.forEach(area => {\n const clonedArea: MapData.Area = {\n ...area,\n rooms: area.rooms.map(room => ({ ...room, y: -room.y })),\n };\n clonedArea.rooms.forEach(room => {\n this.rooms[room.id] = room;\n });\n const areaId = parseInt(area.areaId);\n this.areas[areaId] = new Area(clonedArea);\n })\n this.colors = envs.reduce((acc, c) => ({\n ...acc,\n [c.envId]: {\n rgb: c.colors,\n rgbValue: `rgb(${c.colors.join(',')})`,\n symbolColor: calculateLuminance(c.colors) > 0.41 ? [25, 25, 25] : [225, 255, 255],\n symbolColorValue: calculateLuminance(c.colors) > 0.41 ? 'rgb(25,25,25)' : 'rgb(225,255,255)'\n }\n }), {});\n }\n\n getArea(areaId: number) {\n return this.areas[areaId];\n }\n\n getAreas() {\n return Object.values(this.areas);\n }\n\n getRooms() {\n return Object.values(this.rooms);\n }\n\n getRoom(roomId: number) {\n return this.rooms[roomId];\n }\n\n getColorValue(envId: number): string {\n return this.colors[envId]?.rgbValue ?? defaultColor.rgbValue;\n }\n\n getSymbolColor(envId: number, opacity?: number): string {\n const color = this.colors[envId]?.symbolColor ?? defaultColor.symbolColor;\n const normalizedOpacity = Math.min(Math.max(opacity ?? 1, 0), 1);\n const value = color.join(',');\n if (normalizedOpacity != 1) {\n return `rgba(${value}, ${normalizedOpacity})`;\n }\n return `rgba(${value})`;\n }\n\n}\n"],"mappings":";AAcA,IAAqB,IAArB,MAA6C;CAMzC,YAAY,GAAuB,GAAyB;AAGxD,eANqC,EAAE,gBACA,EAAE,EAGzC,KAAK,QAAQ,GACb,KAAK,SAAS,GACd,KAAK,SAAS,KAAK,cAAc;;CAGrC,WAAW;AACP,SAAO,KAAK;;CAGhB,YAAY;AACR,SAAO,KAAK;;CAGhB,YAAY;AACR,SAAO,KAAK;;CAGhB,eAAuB;EACnB,IAAM,IAAI,KAAK,MAAM,QAChB,GAAK,OAAO;GACT,MAAM,KAAK,IAAI,EAAI,MAAM,EAAE,EAAE;GAC7B,MAAM,KAAK,IAAI,EAAI,MAAM,EAAE,EAAE;GAC7B,MAAM,KAAK,IAAI,EAAI,MAAM,EAAE,EAAE;GAC7B,MAAM,KAAK,IAAI,EAAI,MAAM,EAAE,EAAE;GAChC,GACD;GACI,MAAM;GACN,MAAM;GACN,MAAM;GACN,MAAM;GACT,CACJ;AACD,OAAK,IAAM,KAAS,KAAK,QAAQ;GAC7B,IAAM,IAAK,EAAM,GACX,IAAK,CAAC,EAAM;AAIlB,GAHA,EAAE,OAAO,KAAK,IAAI,EAAE,MAAM,EAAG,EAC7B,EAAE,OAAO,KAAK,IAAI,EAAE,MAAM,IAAK,EAAM,MAAM,EAC3C,EAAE,OAAO,KAAK,IAAI,EAAE,MAAM,EAAG,EAC7B,EAAE,OAAO,KAAK,IAAI,EAAE,MAAM,IAAK,EAAM,OAAO;;AAEh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AAQ,MAAQ;AAC7B,SAAK,MAAM,EAAK,MAAM;KACxB;GACF,IAAM,IAAS,SAAS,EAAK,OAAO;AACpC,QAAK,MAAM,KAAU,IAAI,EAAK,EAAW;IAC3C,EACF,KAAK,SAAS,EAAK,QAAQ,GAAK,OAAO;GACnC,GAAG;IACF,EAAE,QAAQ;IACP,KAAK,EAAE;IACP,UAAU,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,aAAa,EAAmB,EAAE,OAAO,GAAG,MAAO;KAAC;KAAI;KAAI;KAAG,GAAG;KAAC;KAAK;KAAK;KAAI;IACjF,kBAAkB,EAAmB,EAAE,OAAO,GAAG,MAAO,kBAAkB;IAC7E;GACJ,GAAG,EAAE,CAAC;;CAGX,QAAQ,GAAgB;AACpB,SAAO,KAAK,MAAM;;CAGtB,WAAW;AACP,SAAO,OAAO,OAAO,KAAK,MAAM;;CAGpC,WAAW;AACP,SAAO,OAAO,OAAO,KAAK,MAAM;;CAGpC,QAAQ,GAAgB;AACpB,SAAO,KAAK,MAAM;;CAGtB,cAAc,GAAuB;AACjC,SAAO,KAAK,OAAO,IAAQ,YAAY,EAAa;;CAGxD,eAAe,GAAe,GAA0B;EACpD,IAAM,IAAQ,KAAK,OAAO,IAAQ,eAAe,EAAa,aACxD,IAAoB,KAAK,IAAI,KAAK,IAAI,KAAW,GAAG,EAAE,EAAE,EAAE,EAC1D,IAAQ,EAAM,KAAK,IAAI;AAI7B,SAHI,KAAqB,IAGlB,QAAQ,EAAM,KAFV,QAAQ,EAAM,IAAI,EAAkB"}
@@ -1,9 +1,10 @@
1
- import { default as MapReader } from './reader/MapReader';
2
- import { default as Area } from './reader/Area';
3
- import { default as Plane } from './reader/Plane';
1
+ import { IMapReader } from './reader/MapReader';
2
+ import { IArea } from './reader/Area';
3
+ import { IPlane } from './reader/Plane';
4
4
  import { Settings } from './types/Settings';
5
5
  import { SvgOverlays } from './SvgTypes';
6
6
  import { TypedEventEmitter } from './TypedEventEmitter';
7
+ import { RoomLens } from './lens/RoomLens';
7
8
  export type HighlightEntry = {
8
9
  color: string;
9
10
  area: number;
@@ -15,7 +16,7 @@ export type PathEntry = {
15
16
  };
16
17
  export type MapStateEventMap = {
17
18
  area: {
18
- area: Area;
19
+ area: IArea;
19
20
  zIndex: number;
20
21
  };
21
22
  position: {
@@ -33,6 +34,9 @@ export type MapStateEventMap = {
33
34
  };
34
35
  path: undefined;
35
36
  clear: undefined;
37
+ lens: {
38
+ lens: RoomLens;
39
+ };
36
40
  };
37
41
  /**
38
42
  * Pure data + events layer for map state.
@@ -42,18 +46,20 @@ export type MapStateEventMap = {
42
46
  * Rendering backends subscribe to events and sync their visual state.
43
47
  */
44
48
  export declare class MapState {
45
- readonly mapReader: MapReader;
49
+ readonly mapReader: IMapReader;
46
50
  readonly settings: Settings;
47
51
  readonly events: TypedEventEmitter<MapStateEventMap>;
48
52
  currentArea?: number;
49
- currentAreaInstance?: Area;
53
+ currentAreaInstance?: IArea;
50
54
  currentZIndex?: number;
51
55
  currentAreaVersion?: number;
52
56
  positionRoomId?: number;
53
57
  centerRoomId?: number;
54
58
  highlights: Map<number, HighlightEntry>;
55
59
  paths: PathEntry[];
56
- constructor(mapReader: MapReader, settings: Settings);
60
+ lens: RoomLens;
61
+ constructor(mapReader: IMapReader, settings: Settings);
62
+ setLens(lens: RoomLens): void;
57
63
  /**
58
64
  * Set the displayed area and z-level.
59
65
  * Returns true if the area/z actually changed (or area version bumped).
@@ -86,7 +92,7 @@ export declare class MapState {
86
92
  /**
87
93
  * Get the effective plane bounds (respects uniformLevelSize setting).
88
94
  */
89
- getEffectiveBounds(area: Area, plane: Plane): {
95
+ getEffectiveBounds(area: IArea, plane: IPlane): {
90
96
  minX: number;
91
97
  maxX: number;
92
98
  minY: number;
@@ -95,7 +101,7 @@ export declare class MapState {
95
101
  /**
96
102
  * Compute export bounds for a given area/plane, optionally centered on a room.
97
103
  */
98
- computeExportBounds(area: Area, plane: Plane, roomId: number | undefined, padding: number): {
104
+ computeExportBounds(area: IArea, plane: IPlane, roomId: number | undefined, padding: number): {
99
105
  x: number;
100
106
  y: number;
101
107
  w: number;
@@ -1,4 +1,4 @@
1
- import { default as MapReader } from './reader/MapReader';
1
+ import { IMapReader } from './reader/MapReader';
2
2
  import { Settings } from './types/Settings';
3
3
  export interface PathSegment {
4
4
  points: number[];
@@ -15,4 +15,4 @@ export interface PathResult {
15
15
  innerMarkers: PathInnerMarker[];
16
16
  customLines: PathCustomLine[];
17
17
  }
18
- export declare function computePathData(mapReader: MapReader, settings: Settings, locations: number[], currentArea: number, currentZIndex: number): PathResult;
18
+ export declare function computePathData(mapReader: IMapReader, settings: Settings, locations: number[], currentArea: number, currentZIndex: number): PathResult;
@@ -1,11 +1,11 @@
1
- import { default as MapReader } from './reader/MapReader';
1
+ import { IMapReader } from './reader/MapReader';
2
2
  export type PathFindingAlgorithm = 'dijkstra' | 'astar';
3
3
  export default class PathFinder {
4
4
  private readonly mapGraph;
5
5
  private readonly dijkstraGraph;
6
6
  private _algorithm;
7
7
  private readonly cache;
8
- constructor(mapReader: MapReader, algorithm?: PathFindingAlgorithm);
8
+ constructor(mapReader: IMapReader, algorithm?: PathFindingAlgorithm);
9
9
  get algorithm(): PathFindingAlgorithm;
10
10
  setAlgorithm(algorithm: PathFindingAlgorithm): void;
11
11
  findPath(from: number, to: number): number[] | null;
@@ -1,9 +1,10 @@
1
- import { default as MapReader } from './reader/MapReader';
2
- import { default as Area } from './reader/Area';
3
- import { default as Plane } from './reader/Plane';
1
+ import { IMapReader } from './reader/MapReader';
2
+ import { IArea } from './reader/Area';
3
+ import { IPlane } from './reader/Plane';
4
4
  import { Settings } from './types/Settings';
5
5
  import { default as ExitRenderer, ExitDrawData } from './ExitRenderer';
6
6
  import { GroupShape, Shape } from './scene/Shape';
7
+ import { RoomLens } from './lens/RoomLens';
7
8
  type Bounds = {
8
9
  x: number;
9
10
  y: number;
@@ -185,14 +186,17 @@ export declare class ScenePipeline {
185
186
  private specialExitShapeRefs;
186
187
  private stubShapeRefs;
187
188
  private areaExitLabelShapeRefs;
188
- constructor(mapReader: MapReader, settings: Settings);
189
+ constructor(mapReader: IMapReader, settings: Settings);
189
190
  /**
190
191
  * Build the full scene for an area/plane.
191
192
  * Clears layers, renders grid → labels → exits → rooms → area name.
192
193
  * Returns data for culling and interaction (room nodes, exit data, hit zones).
194
+ *
195
+ * The `lens` filters which rooms paint and how partially-visible exits are
196
+ * treated. Pass {@link ALL_VISIBLE} (or omit) for an unfiltered build.
193
197
  */
194
- buildScene(area: Area, plane: Plane, zIndex: number): SceneBuildResult;
195
- getEffectiveBounds(area: Area, plane: Plane): {
198
+ buildScene(area: IArea, plane: IPlane, zIndex: number, lens?: RoomLens): SceneBuildResult;
199
+ getEffectiveBounds(area: IArea, plane: IPlane): {
196
200
  minX: number;
197
201
  maxX: number;
198
202
  minY: number;
@@ -200,6 +204,15 @@ export declare class ScenePipeline {
200
204
  };
201
205
  private renderRooms;
202
206
  private renderLinkExits;
207
+ /**
208
+ * Build a stub anchored at the visible endpoint of an exit, pointing
209
+ * toward the hidden one. Returns undefined when the exit can't be drawn
210
+ * as a stub (no planar direction on the visible side, both sides hidden,
211
+ * or both sides visible — the last is a caller bug).
212
+ */
213
+ private buildLensStub;
214
+ private emitLensStub;
215
+ private getRoomEdgePoint;
203
216
  /**
204
217
  * Build the world-space shape tree for one inter-room exit. Used by the
205
218
  * live renderer's current-room overlay path to recolour a single exit
@@ -0,0 +1,36 @@
1
+ import { MudletMap, readMapFromBuffer } from 'mudlet-map-binary-reader';
2
+ import { IMapReader } from '../reader/MapReader';
3
+ import { IArea } from '../reader/Area';
4
+ /**
5
+ * {@link IMapReader} implementation backed by a parsed Mudlet binary map.
6
+ *
7
+ * Convenience wrapper around the existing {@link MapReader} that converts a
8
+ * {@link MudletMap} (the in-memory binary model from
9
+ * `mudlet-map-binary-reader`) into the renderer's `{mapData, colors}` shape
10
+ * via `readerExport()`, then forwards every `IMapReader` call to the wrapped
11
+ * reader.
12
+ *
13
+ * Useful for downstream apps (the upstream Mudix client is one) that already
14
+ * own binary `.dat` bytes and want a single object they can hand to
15
+ * {@link MapRenderer} without staging a separate JSON export step.
16
+ *
17
+ * `mudlet-map-binary-reader` is a `peerDependency`; consumers who do not use
18
+ * binary maps never pay the bundle cost.
19
+ */
20
+ export default class BinaryMapReader implements IMapReader {
21
+ private readonly reader;
22
+ /** Build directly from a parsed {@link MudletMap}. */
23
+ constructor(model: MudletMap);
24
+ /**
25
+ * Parse the given binary map buffer and construct a reader from it.
26
+ * In Node, pass `fs.readFileSync(path)`; in the browser, construct a
27
+ * `Buffer` from an `ArrayBuffer` (e.g. via the `buffer` polyfill).
28
+ */
29
+ static fromBuffer(buf: Parameters<typeof readMapFromBuffer>[0]): BinaryMapReader;
30
+ getArea(areaId: number): IArea;
31
+ getAreas(): IArea[];
32
+ getRooms(): MapData.Room[];
33
+ getRoom(roomId: number): MapData.Room;
34
+ getColorValue(envId: number): string;
35
+ getSymbolColor(envId: number, opacity?: number): string;
36
+ }
@@ -0,0 +1,2 @@
1
+ export { default as BinaryMapReader } from './BinaryMapReader';
2
+ export type { MudletMap, MudletArea, MudletRoom, MudletColor, MudletLabel } from 'mudlet-map-binary-reader';
@@ -0,0 +1,34 @@
1
+ import { t as e } from "./MapReader-mU_4JWv_.js";
2
+ import { readMapFromBuffer as t, readerExport as n } from "mudlet-map-binary-reader";
3
+ //#region src/binary/BinaryMapReader.ts
4
+ var r = class r {
5
+ constructor(t) {
6
+ let { mapData: r, colors: i } = n(t);
7
+ this.reader = new e(r, i);
8
+ }
9
+ static fromBuffer(e) {
10
+ return new r(t(e));
11
+ }
12
+ getArea(e) {
13
+ return this.reader.getArea(e);
14
+ }
15
+ getAreas() {
16
+ return this.reader.getAreas();
17
+ }
18
+ getRooms() {
19
+ return this.reader.getRooms();
20
+ }
21
+ getRoom(e) {
22
+ return this.reader.getRoom(e);
23
+ }
24
+ getColorValue(e) {
25
+ return this.reader.getColorValue(e);
26
+ }
27
+ getSymbolColor(e, t) {
28
+ return this.reader.getSymbolColor(e, t);
29
+ }
30
+ };
31
+ //#endregion
32
+ export { r as BinaryMapReader };
33
+
34
+ //# sourceMappingURL=binary.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binary.mjs","names":[],"sources":["../src/binary/BinaryMapReader.ts"],"sourcesContent":["import {\n type MudletMap,\n readerExport,\n readMapFromBuffer,\n} from \"mudlet-map-binary-reader\";\nimport MapReader, {type IMapReader} from \"../reader/MapReader\";\nimport type {IArea} from \"../reader/Area\";\n\n/**\n * {@link IMapReader} implementation backed by a parsed Mudlet binary map.\n *\n * Convenience wrapper around the existing {@link MapReader} that converts a\n * {@link MudletMap} (the in-memory binary model from\n * `mudlet-map-binary-reader`) into the renderer's `{mapData, colors}` shape\n * via `readerExport()`, then forwards every `IMapReader` call to the wrapped\n * reader.\n *\n * Useful for downstream apps (the upstream Mudix client is one) that already\n * own binary `.dat` bytes and want a single object they can hand to\n * {@link MapRenderer} without staging a separate JSON export step.\n *\n * `mudlet-map-binary-reader` is a `peerDependency`; consumers who do not use\n * binary maps never pay the bundle cost.\n */\nexport default class BinaryMapReader implements IMapReader {\n private readonly reader: MapReader;\n\n /** Build directly from a parsed {@link MudletMap}. */\n constructor(model: MudletMap) {\n const {mapData, colors} = readerExport(model);\n // RendererRoom (binary-reader output) and MapData.Room (renderer\n // input) overlap structurally — RendererRoom is missing only\n // `areaId`, which the renderer never reads from rooms (only from\n // the area). Cast through `unknown` to bridge the nominal gap.\n this.reader = new MapReader(mapData as unknown as MapData.Map, colors);\n }\n\n /**\n * Parse the given binary map buffer and construct a reader from it.\n * In Node, pass `fs.readFileSync(path)`; in the browser, construct a\n * `Buffer` from an `ArrayBuffer` (e.g. via the `buffer` polyfill).\n */\n static fromBuffer(buf: Parameters<typeof readMapFromBuffer>[0]): BinaryMapReader {\n return new BinaryMapReader(readMapFromBuffer(buf));\n }\n\n // --- IMapReader forwarding ---\n\n getArea(areaId: number): IArea {\n return this.reader.getArea(areaId);\n }\n\n getAreas(): IArea[] {\n return this.reader.getAreas();\n }\n\n getRooms(): MapData.Room[] {\n return this.reader.getRooms();\n }\n\n getRoom(roomId: number): MapData.Room {\n return this.reader.getRoom(roomId);\n }\n\n getColorValue(envId: number): string {\n return this.reader.getColorValue(envId);\n }\n\n getSymbolColor(envId: number, opacity?: number): string {\n return this.reader.getSymbolColor(envId, opacity);\n }\n}\n"],"mappings":";;;AAwBA,IAAqB,IAArB,MAAqB,EAAsC;CAIvD,YAAY,GAAkB;EAC1B,IAAM,EAAC,YAAS,cAAU,EAAa,EAAM;AAK7C,OAAK,SAAS,IAAI,EAAU,GAAmC,EAAO;;CAQ1E,OAAO,WAAW,GAA+D;AAC7E,SAAO,IAAI,EAAgB,EAAkB,EAAI,CAAC;;CAKtD,QAAQ,GAAuB;AAC3B,SAAO,KAAK,OAAO,QAAQ,EAAO;;CAGtC,WAAoB;AAChB,SAAO,KAAK,OAAO,UAAU;;CAGjC,WAA2B;AACvB,SAAO,KAAK,OAAO,UAAU;;CAGjC,QAAQ,GAA8B;AAClC,SAAO,KAAK,OAAO,QAAQ,EAAO;;CAGtC,cAAc,GAAuB;AACjC,SAAO,KAAK,OAAO,cAAc,EAAM;;CAG3C,eAAe,GAAe,GAA0B;AACpD,SAAO,KAAK,OAAO,eAAe,GAAO,EAAQ"}
package/dist/index.d.ts CHANGED
@@ -7,7 +7,6 @@ export type { DrawnExitEntry, DrawnSpecialExitEntry, DrawnStubEntry } from './Sc
7
7
  export type { ExitDrawData, ExitDrawLine, ExitDrawArrow, ExitDrawDoor } from './ExitRenderer';
8
8
  export { MapState } from './MapState';
9
9
  export type { MapStateEventMap, HighlightEntry, PathEntry } from './MapState';
10
- export { KonvaRenderBackend } from './rendering/KonvaRenderBackend';
11
10
  export { Camera } from './camera/Camera';
12
11
  export type { CameraEventMap } from './camera/Camera';
13
12
  export { HitTester } from './hit/HitTester';
@@ -34,15 +33,26 @@ export type { PngExportOptions } from './export/PngExporter';
34
33
  export { CanvasExporter, PngBytesExporter } from './export/CanvasExporter';
35
34
  export type { CanvasExportOptions, PngBytesExportOptions } from './export/CanvasExporter';
36
35
  export { canvasToBytes } from './export/canvasToBytes';
37
- export type { SceneOverlay, SceneOverlayContext, CanvasDrawState } from './overlay/SceneOverlay';
36
+ export type { SceneOverlay, SceneOverlayContext } from './overlay/SceneOverlay';
37
+ export type { LiveEffect, CoordinateTransform } from './overlay/LiveEffect';
38
38
  export { AmbientLightOverlay } from './overlay/AmbientLightOverlay';
39
39
  export type { AmbientLightOptions } from './overlay/AmbientLightOverlay';
40
40
  export { default as MapReader } from './reader/MapReader';
41
+ export type { IMapReader } from './reader/MapReader';
41
42
  export { default as PathFinder } from './PathFinder';
42
43
  export type { PathFindingAlgorithm } from './PathFinder';
43
44
  export { MapGraph } from './MapGraph';
44
45
  export type { Edge, GraphData } from './MapGraph';
45
- export { default as ExplorationArea } from './reader/ExplorationArea';
46
+ export { default as Area } from './reader/Area';
47
+ export type { IArea } from './reader/Area';
48
+ export { default as Plane } from './reader/Plane';
49
+ export type { IPlane } from './reader/Plane';
50
+ export type { IExit, Kind as ExitKind } from './reader/Exit';
51
+ export type { RoomLens, ExitTreatment } from './lens/RoomLens';
52
+ export { ALL_VISIBLE, defaultExitTreatment } from './lens/RoomLens';
53
+ export { composeLenses } from './lens/composeLenses';
54
+ export type { ComposeOptions, ExitConflictStrategy } from './lens/composeLenses';
55
+ export { ExplorationLens } from './lens/ExplorationLens';
46
56
  export { AreaMapRenderer, createAreaMapSettings } from './AreaMapRenderer';
47
57
  export type { AreaMapSettings } from './AreaMapRenderer';
48
58
  export type { AreaDomainInfo, DomainFilter } from './AreaMapRenderer';