@industry-theme/repository-composition-panels 0.2.57 → 0.2.58
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/{BufferResource-DEjDe1s8.js → BufferResource-CwFhjYqu.js} +2 -2
- package/dist/{BufferResource-DEjDe1s8.js.map → BufferResource-CwFhjYqu.js.map} +1 -1
- package/dist/{CanvasRenderer-D2eDumWy.js → CanvasRenderer-D_uyJXq7.js} +3 -3
- package/dist/{CanvasRenderer-D2eDumWy.js.map → CanvasRenderer-D_uyJXq7.js.map} +1 -1
- package/dist/{Filter-BSpiVWUN.js → Filter-BL3R0vO2.js} +2 -2
- package/dist/{Filter-BSpiVWUN.js.map → Filter-BL3R0vO2.js.map} +1 -1
- package/dist/{RenderTargetSystem-3-YKfxPi.js → RenderTargetSystem-CUdkCVfb.js} +3 -3
- package/dist/{RenderTargetSystem-3-YKfxPi.js.map → RenderTargetSystem-CUdkCVfb.js.map} +1 -1
- package/dist/{WebGLRenderer-BKhoAof0.js → WebGLRenderer-CxHdzexZ.js} +4 -4
- package/dist/{WebGLRenderer-BKhoAof0.js.map → WebGLRenderer-CxHdzexZ.js.map} +1 -1
- package/dist/{WebGPURenderer-BMMCBjut.js → WebGPURenderer-XZ3X-iy6.js} +4 -4
- package/dist/{WebGPURenderer-BMMCBjut.js.map → WebGPURenderer-XZ3X-iy6.js.map} +1 -1
- package/dist/{browserAll-BaiHieOj.js → browserAll-7cTZp3vq.js} +3 -3
- package/dist/{browserAll-BaiHieOj.js.map → browserAll-7cTZp3vq.js.map} +1 -1
- package/dist/{index-72-eqzyq.js → index-Cd5eYs9k.js} +215 -111
- package/dist/{index-72-eqzyq.js.map → index-Cd5eYs9k.js.map} +1 -1
- package/dist/{init-CZ5jJ8OJ.js → init-D_6tdjww.js} +3 -3
- package/dist/{init-CZ5jJ8OJ.js.map → init-D_6tdjww.js.map} +1 -1
- package/dist/panels/CollectionMapPanel.d.ts.map +1 -1
- package/dist/panels/GitProjectsMapPanel.d.ts.map +1 -1
- package/dist/panels/overworld-map/OverworldMapPanel.d.ts.map +1 -1
- package/dist/panels/overworld-map/genericMapper.d.ts.map +1 -1
- package/dist/panels/overworld-map/spriteGenerator.d.ts +4 -0
- package/dist/panels/overworld-map/spriteGenerator.d.ts.map +1 -1
- package/dist/panels/overworld-map/types.d.ts +4 -0
- package/dist/panels/overworld-map/types.d.ts.map +1 -1
- package/dist/panels.bundle.js +1 -1
- package/dist/webworkerAll-CNZapS1-.js +3 -0
- package/dist/webworkerAll-CNZapS1-.js.map +1 -0
- package/package.json +1 -1
- package/dist/webworkerAll-Ccu7Tp4h.js +0 -3
- package/dist/webworkerAll-Ccu7Tp4h.js.map +0 -1
|
@@ -60179,7 +60179,7 @@ const browserExt = {
|
|
|
60179
60179
|
},
|
|
60180
60180
|
test: () => true,
|
|
60181
60181
|
load: async () => {
|
|
60182
|
-
await import("./browserAll-
|
|
60182
|
+
await import("./browserAll-7cTZp3vq.js");
|
|
60183
60183
|
}
|
|
60184
60184
|
};
|
|
60185
60185
|
const webworkerExt = {
|
|
@@ -60190,7 +60190,7 @@ const webworkerExt = {
|
|
|
60190
60190
|
},
|
|
60191
60191
|
test: () => typeof self !== "undefined" && self.WorkerGlobalScope !== void 0,
|
|
60192
60192
|
load: async () => {
|
|
60193
|
-
await import("./webworkerAll-
|
|
60193
|
+
await import("./webworkerAll-CNZapS1-.js");
|
|
60194
60194
|
}
|
|
60195
60195
|
};
|
|
60196
60196
|
class ObservablePoint {
|
|
@@ -72433,19 +72433,19 @@ async function autoDetectRenderer(options) {
|
|
|
72433
72433
|
for (let i2 = 0; i2 < preferredOrder.length; i2++) {
|
|
72434
72434
|
const rendererType = preferredOrder[i2];
|
|
72435
72435
|
if (rendererType === "webgpu" && await isWebGPUSupported()) {
|
|
72436
|
-
const { WebGPURenderer } = await import("./WebGPURenderer-
|
|
72436
|
+
const { WebGPURenderer } = await import("./WebGPURenderer-XZ3X-iy6.js");
|
|
72437
72437
|
RendererClass = WebGPURenderer;
|
|
72438
72438
|
finalOptions = { ...options, ...options.webgpu };
|
|
72439
72439
|
break;
|
|
72440
72440
|
} else if (rendererType === "webgl" && isWebGLSupported(
|
|
72441
72441
|
options.failIfMajorPerformanceCaveat ?? AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat
|
|
72442
72442
|
)) {
|
|
72443
|
-
const { WebGLRenderer } = await import("./WebGLRenderer-
|
|
72443
|
+
const { WebGLRenderer } = await import("./WebGLRenderer-CxHdzexZ.js");
|
|
72444
72444
|
RendererClass = WebGLRenderer;
|
|
72445
72445
|
finalOptions = { ...options, ...options.webgl };
|
|
72446
72446
|
break;
|
|
72447
72447
|
} else if (rendererType === "canvas") {
|
|
72448
|
-
const { CanvasRenderer } = await import("./CanvasRenderer-
|
|
72448
|
+
const { CanvasRenderer } = await import("./CanvasRenderer-D_uyJXq7.js");
|
|
72449
72449
|
RendererClass = CanvasRenderer;
|
|
72450
72450
|
finalOptions = { ...options, ...options.canvasOptions };
|
|
72451
72451
|
break;
|
|
@@ -84393,7 +84393,7 @@ function layoutNodes(nodes) {
|
|
|
84393
84393
|
});
|
|
84394
84394
|
return positions;
|
|
84395
84395
|
}
|
|
84396
|
-
function generateTerrain(width, height, nodes, paths) {
|
|
84396
|
+
function generateTerrain(width, height, nodes, paths, regionBoundaries = []) {
|
|
84397
84397
|
const tiles = [];
|
|
84398
84398
|
for (let y2 = 0; y2 < height; y2++) {
|
|
84399
84399
|
for (let x2 = 0; x2 < width; x2++) {
|
|
@@ -84406,6 +84406,21 @@ function generateTerrain(width, height, nodes, paths) {
|
|
|
84406
84406
|
});
|
|
84407
84407
|
}
|
|
84408
84408
|
}
|
|
84409
|
+
for (const boundaryX of regionBoundaries) {
|
|
84410
|
+
const bridgeStartX = boundaryX - 1;
|
|
84411
|
+
const bridgeEndX = boundaryX + 1;
|
|
84412
|
+
for (let y2 = 0; y2 < height; y2++) {
|
|
84413
|
+
for (let x2 = bridgeStartX; x2 <= bridgeEndX; x2++) {
|
|
84414
|
+
if (x2 >= 0 && x2 < width) {
|
|
84415
|
+
const tileIndex = y2 * width + x2;
|
|
84416
|
+
if (tileIndex >= 0 && tileIndex < tiles.length) {
|
|
84417
|
+
tiles[tileIndex].type = "water";
|
|
84418
|
+
tiles[tileIndex].biome = "water";
|
|
84419
|
+
}
|
|
84420
|
+
}
|
|
84421
|
+
}
|
|
84422
|
+
}
|
|
84423
|
+
}
|
|
84409
84424
|
for (const path2 of paths) {
|
|
84410
84425
|
for (const point of path2.points) {
|
|
84411
84426
|
const x2 = Math.round(point.gridX);
|
|
@@ -84520,10 +84535,15 @@ function nodesToOverworldMap(nodes, options = {}) {
|
|
|
84520
84535
|
minY = Math.min(minY, node.gridY);
|
|
84521
84536
|
maxY = Math.max(maxY, node.gridY + node.size);
|
|
84522
84537
|
});
|
|
84523
|
-
const
|
|
84524
|
-
const
|
|
84525
|
-
const
|
|
84526
|
-
const
|
|
84538
|
+
const calculatedWidth = Math.ceil(maxX - minX) + mapPadding * 2;
|
|
84539
|
+
const calculatedHeight = Math.ceil(maxY - minY) + mapPadding * 2;
|
|
84540
|
+
const squareSize = Math.ceil(Math.max(calculatedWidth, calculatedHeight));
|
|
84541
|
+
const mapWidth = squareSize;
|
|
84542
|
+
const mapHeight = squareSize;
|
|
84543
|
+
const extraHorizontalSpace = Math.floor((squareSize - calculatedWidth) / 2);
|
|
84544
|
+
const extraVerticalSpace = Math.floor((squareSize - calculatedHeight) / 2);
|
|
84545
|
+
const offsetX = mapPadding + extraHorizontalSpace - minX;
|
|
84546
|
+
const offsetY = mapPadding + extraVerticalSpace - minY;
|
|
84527
84547
|
locationNodes.forEach((node) => {
|
|
84528
84548
|
node.gridX += offsetX;
|
|
84529
84549
|
node.gridY += offsetY;
|
|
@@ -84608,23 +84628,27 @@ function nodesToUnifiedOverworldMap(nodes, options = {}) {
|
|
|
84608
84628
|
};
|
|
84609
84629
|
}
|
|
84610
84630
|
const REGION_SPACING = 5;
|
|
84631
|
+
const regionMaps = nodeGroups.map((group) => nodesToOverworldMap(group, options));
|
|
84632
|
+
const maxRegionSize = Math.max(...regionMaps.map((rm) => Math.max(rm.width, rm.height)));
|
|
84633
|
+
const REGION_SIZE = Math.ceil(maxRegionSize);
|
|
84611
84634
|
const allNodes = [];
|
|
84612
84635
|
const allPaths = [];
|
|
84613
84636
|
const regions = [];
|
|
84637
|
+
const regionBoundaries = [];
|
|
84614
84638
|
let currentX = 0;
|
|
84615
|
-
|
|
84616
|
-
|
|
84617
|
-
const
|
|
84639
|
+
regionMaps.forEach((regionMap, index2) => {
|
|
84640
|
+
const xOffset = currentX + Math.floor((REGION_SIZE - regionMap.width) / 2);
|
|
84641
|
+
const yOffset = Math.floor((REGION_SIZE - regionMap.height) / 2);
|
|
84618
84642
|
const offsetNodes = regionMap.nodes.map((node) => ({
|
|
84619
84643
|
...node,
|
|
84620
|
-
gridX: node.gridX +
|
|
84621
|
-
gridY: node.gridY
|
|
84644
|
+
gridX: node.gridX + xOffset,
|
|
84645
|
+
gridY: node.gridY + yOffset
|
|
84622
84646
|
}));
|
|
84623
84647
|
const offsetPaths = regionMap.paths.map((path2) => ({
|
|
84624
84648
|
...path2,
|
|
84625
84649
|
points: path2.points.map((point) => ({
|
|
84626
|
-
gridX: point.gridX +
|
|
84627
|
-
gridY: point.gridY
|
|
84650
|
+
gridX: point.gridX + xOffset,
|
|
84651
|
+
gridY: point.gridY + yOffset
|
|
84628
84652
|
}))
|
|
84629
84653
|
}));
|
|
84630
84654
|
allNodes.push(...offsetNodes);
|
|
@@ -84636,19 +84660,23 @@ function nodesToUnifiedOverworldMap(nodes, options = {}) {
|
|
|
84636
84660
|
bounds: {
|
|
84637
84661
|
x: currentX,
|
|
84638
84662
|
y: 0,
|
|
84639
|
-
width:
|
|
84640
|
-
height:
|
|
84663
|
+
width: REGION_SIZE,
|
|
84664
|
+
height: REGION_SIZE
|
|
84641
84665
|
},
|
|
84642
|
-
centerX: currentX +
|
|
84643
|
-
centerY:
|
|
84666
|
+
centerX: currentX + REGION_SIZE / 2,
|
|
84667
|
+
centerY: REGION_SIZE / 2,
|
|
84644
84668
|
nodeIds: offsetNodes.map((n2) => n2.id)
|
|
84645
84669
|
});
|
|
84646
|
-
|
|
84647
|
-
|
|
84670
|
+
currentX += REGION_SIZE;
|
|
84671
|
+
if (index2 < nodeGroups.length - 1) {
|
|
84672
|
+
const bridgeCenterX = currentX + Math.floor(REGION_SPACING / 2);
|
|
84673
|
+
regionBoundaries.push(bridgeCenterX);
|
|
84674
|
+
}
|
|
84675
|
+
currentX += REGION_SPACING;
|
|
84648
84676
|
});
|
|
84649
84677
|
const totalWidth = currentX - REGION_SPACING;
|
|
84650
|
-
const totalHeight =
|
|
84651
|
-
const tiles = generateTerrain(totalWidth, totalHeight, allNodes, allPaths);
|
|
84678
|
+
const totalHeight = REGION_SIZE;
|
|
84679
|
+
const tiles = generateTerrain(totalWidth, totalHeight, allNodes, allPaths, regionBoundaries);
|
|
84652
84680
|
return {
|
|
84653
84681
|
width: totalWidth,
|
|
84654
84682
|
height: totalHeight,
|
|
@@ -84883,6 +84911,33 @@ function generatePathTile() {
|
|
|
84883
84911
|
ctx.fillRect(ISO_TILE_WIDTH / 2 - 12, ISO_TILE_HEIGHT / 2 + 4, 6, 3);
|
|
84884
84912
|
return canvas;
|
|
84885
84913
|
}
|
|
84914
|
+
function generateBridgeTile() {
|
|
84915
|
+
const canvas = createCanvas(ISO_TILE_WIDTH, ISO_TILE_HEIGHT);
|
|
84916
|
+
const ctx = canvas.getContext("2d");
|
|
84917
|
+
ctx.fillStyle = "#92400e";
|
|
84918
|
+
ctx.beginPath();
|
|
84919
|
+
ctx.moveTo(ISO_TILE_WIDTH / 2, 0);
|
|
84920
|
+
ctx.lineTo(ISO_TILE_WIDTH, ISO_TILE_HEIGHT / 2);
|
|
84921
|
+
ctx.lineTo(ISO_TILE_WIDTH / 2, ISO_TILE_HEIGHT);
|
|
84922
|
+
ctx.lineTo(0, ISO_TILE_HEIGHT / 2);
|
|
84923
|
+
ctx.closePath();
|
|
84924
|
+
ctx.fill();
|
|
84925
|
+
ctx.strokeStyle = "#78350f";
|
|
84926
|
+
ctx.lineWidth = 2;
|
|
84927
|
+
const plankY = [ISO_TILE_HEIGHT * 0.25, ISO_TILE_HEIGHT * 0.5, ISO_TILE_HEIGHT * 0.75];
|
|
84928
|
+
for (const y2 of plankY) {
|
|
84929
|
+
const widthAtY = y2 <= ISO_TILE_HEIGHT / 2 ? y2 / (ISO_TILE_HEIGHT / 2) * (ISO_TILE_WIDTH / 2) : (ISO_TILE_HEIGHT - y2) / (ISO_TILE_HEIGHT / 2) * (ISO_TILE_WIDTH / 2);
|
|
84930
|
+
ctx.beginPath();
|
|
84931
|
+
ctx.moveTo(ISO_TILE_WIDTH / 2 - widthAtY, y2);
|
|
84932
|
+
ctx.lineTo(ISO_TILE_WIDTH / 2 + widthAtY, y2);
|
|
84933
|
+
ctx.stroke();
|
|
84934
|
+
}
|
|
84935
|
+
ctx.fillStyle = "#a16207";
|
|
84936
|
+
ctx.fillRect(ISO_TILE_WIDTH / 2 - 3, ISO_TILE_HEIGHT / 2 - 1, 6, 2);
|
|
84937
|
+
ctx.fillRect(ISO_TILE_WIDTH / 2 + 10, ISO_TILE_HEIGHT / 2 + 3, 4, 2);
|
|
84938
|
+
ctx.fillRect(ISO_TILE_WIDTH / 2 - 14, ISO_TILE_HEIGHT / 2 + 3, 4, 2);
|
|
84939
|
+
return canvas;
|
|
84940
|
+
}
|
|
84886
84941
|
function generateLocationSprite(type2, theme, size = 2) {
|
|
84887
84942
|
const width = ISO_TILE_WIDTH * size;
|
|
84888
84943
|
const height = ISO_TILE_HEIGHT * size + 64;
|
|
@@ -85145,6 +85200,7 @@ function generateSpriteAtlas() {
|
|
|
85145
85200
|
atlas[`tile-grass-${biome}`] = generateGrassTile(biome);
|
|
85146
85201
|
}
|
|
85147
85202
|
atlas["tile-path"] = generatePathTile();
|
|
85203
|
+
atlas["tile-bridge"] = generateBridgeTile();
|
|
85148
85204
|
const locationTypes = ["castle", "fortress", "tower", "house", "pipe", "git-repo", "monorepo"];
|
|
85149
85205
|
const themes = ["grass", "desert", "water", "volcano", "ice"];
|
|
85150
85206
|
for (const type2 of locationTypes) {
|
|
@@ -85163,8 +85219,8 @@ const OverworldMapPanelContent = ({
|
|
|
85163
85219
|
packages,
|
|
85164
85220
|
includeDevDependencies = true,
|
|
85165
85221
|
includePeerDependencies = false,
|
|
85166
|
-
width
|
|
85167
|
-
height
|
|
85222
|
+
width,
|
|
85223
|
+
height,
|
|
85168
85224
|
isLoading = false
|
|
85169
85225
|
}) => {
|
|
85170
85226
|
const canvasRef = useRef(null);
|
|
@@ -85172,6 +85228,7 @@ const OverworldMapPanelContent = ({
|
|
|
85172
85228
|
const worldContainerRef = useRef(null);
|
|
85173
85229
|
const scaleRef = useRef(1);
|
|
85174
85230
|
const [isRendering, setIsRendering] = useState(true);
|
|
85231
|
+
const dimensionsRef = useRef({ width: width || 800, height: height || 600 });
|
|
85175
85232
|
const [currentRegionIndex, setCurrentRegionIndex] = useState(0);
|
|
85176
85233
|
const [isAnimating, setIsAnimating] = useState(false);
|
|
85177
85234
|
const animationRef = useRef(null);
|
|
@@ -85188,11 +85245,14 @@ const OverworldMapPanelContent = ({
|
|
|
85188
85245
|
let app;
|
|
85189
85246
|
let cleanup = false;
|
|
85190
85247
|
const initPixi = async () => {
|
|
85191
|
-
var _a;
|
|
85248
|
+
var _a, _b, _c;
|
|
85249
|
+
const containerWidth = ((_a = canvasRef.current) == null ? void 0 : _a.clientWidth) || width || 800;
|
|
85250
|
+
const containerHeight = ((_b = canvasRef.current) == null ? void 0 : _b.clientHeight) || height || 600;
|
|
85251
|
+
dimensionsRef.current = { width: containerWidth, height: containerHeight };
|
|
85192
85252
|
app = new Application();
|
|
85193
85253
|
await app.init({
|
|
85194
|
-
width,
|
|
85195
|
-
height,
|
|
85254
|
+
width: containerWidth,
|
|
85255
|
+
height: containerHeight,
|
|
85196
85256
|
backgroundColor: 8900331,
|
|
85197
85257
|
// Sky blue
|
|
85198
85258
|
antialias: false
|
|
@@ -85202,7 +85262,7 @@ const OverworldMapPanelContent = ({
|
|
|
85202
85262
|
app.destroy(true);
|
|
85203
85263
|
return;
|
|
85204
85264
|
}
|
|
85205
|
-
(
|
|
85265
|
+
(_c = canvasRef.current) == null ? void 0 : _c.appendChild(app.canvas);
|
|
85206
85266
|
appRef.current = app;
|
|
85207
85267
|
const atlas = generateSpriteAtlas();
|
|
85208
85268
|
const textures = {};
|
|
@@ -85254,6 +85314,21 @@ const OverworldMapPanelContent = ({
|
|
|
85254
85314
|
tileContainer.addChild(sprite);
|
|
85255
85315
|
}
|
|
85256
85316
|
}
|
|
85317
|
+
const bridgeContainer = new Container();
|
|
85318
|
+
worldContainer.addChild(bridgeContainer);
|
|
85319
|
+
for (const tile of mapData.tiles) {
|
|
85320
|
+
if (tile.type === "water") {
|
|
85321
|
+
const { screenX, screenY } = gridToScreen(tile.x, tile.y);
|
|
85322
|
+
const bridgeTexture = textures["tile-bridge"];
|
|
85323
|
+
if (bridgeTexture) {
|
|
85324
|
+
const bridgeSprite = new Sprite(bridgeTexture);
|
|
85325
|
+
bridgeSprite.x = screenX;
|
|
85326
|
+
bridgeSprite.y = screenY;
|
|
85327
|
+
bridgeSprite.anchor.set(0.5, 0.5);
|
|
85328
|
+
bridgeContainer.addChild(bridgeSprite);
|
|
85329
|
+
}
|
|
85330
|
+
}
|
|
85331
|
+
}
|
|
85257
85332
|
const pathContainer = new Container();
|
|
85258
85333
|
worldContainer.addChild(pathContainer);
|
|
85259
85334
|
const pathGraphics = [];
|
|
@@ -85377,10 +85452,10 @@ const OverworldMapPanelContent = ({
|
|
|
85377
85452
|
const sprite = new Sprite(texture);
|
|
85378
85453
|
const MAX_SPRITE_SIZE = 256;
|
|
85379
85454
|
if (sprite.width > MAX_SPRITE_SIZE || sprite.height > MAX_SPRITE_SIZE) {
|
|
85380
|
-
const
|
|
85381
|
-
const
|
|
85382
|
-
const
|
|
85383
|
-
sprite.scale.set(
|
|
85455
|
+
const scaleX = MAX_SPRITE_SIZE / sprite.width;
|
|
85456
|
+
const scaleY = MAX_SPRITE_SIZE / sprite.height;
|
|
85457
|
+
const scale = Math.min(scaleX, scaleY);
|
|
85458
|
+
sprite.scale.set(scale, scale);
|
|
85384
85459
|
}
|
|
85385
85460
|
sprite.x = screenX;
|
|
85386
85461
|
sprite.y = screenY;
|
|
@@ -85503,27 +85578,30 @@ const OverworldMapPanelContent = ({
|
|
|
85503
85578
|
});
|
|
85504
85579
|
}
|
|
85505
85580
|
}
|
|
85506
|
-
|
|
85507
|
-
|
|
85508
|
-
|
|
85509
|
-
const
|
|
85510
|
-
|
|
85511
|
-
|
|
85512
|
-
|
|
85513
|
-
|
|
85514
|
-
|
|
85515
|
-
|
|
85516
|
-
|
|
85517
|
-
|
|
85518
|
-
|
|
85519
|
-
|
|
85520
|
-
|
|
85521
|
-
|
|
85522
|
-
|
|
85523
|
-
|
|
85524
|
-
|
|
85525
|
-
|
|
85526
|
-
|
|
85581
|
+
const updateScale = () => {
|
|
85582
|
+
let maxRegionWidth = 0;
|
|
85583
|
+
let maxRegionHeight = 0;
|
|
85584
|
+
for (const region of mapData.regions) {
|
|
85585
|
+
const topLeft = gridToScreen(region.bounds.x, region.bounds.y);
|
|
85586
|
+
const bottomRight = gridToScreen(
|
|
85587
|
+
region.bounds.x + region.bounds.width,
|
|
85588
|
+
region.bounds.y + region.bounds.height
|
|
85589
|
+
);
|
|
85590
|
+
const regionWidth = Math.abs(bottomRight.screenX - topLeft.screenX);
|
|
85591
|
+
const regionHeight = Math.abs(bottomRight.screenY - topLeft.screenY);
|
|
85592
|
+
maxRegionWidth = Math.max(maxRegionWidth, regionWidth);
|
|
85593
|
+
maxRegionHeight = Math.max(maxRegionHeight, regionHeight);
|
|
85594
|
+
}
|
|
85595
|
+
const padding = 40;
|
|
85596
|
+
const availableWidth = dimensionsRef.current.width - padding * 2;
|
|
85597
|
+
const availableHeight = dimensionsRef.current.height - padding * 2;
|
|
85598
|
+
const scaleX = availableWidth / maxRegionWidth;
|
|
85599
|
+
const scaleY = availableHeight / maxRegionHeight;
|
|
85600
|
+
const scale = Math.min(scaleX, scaleY, 1);
|
|
85601
|
+
worldContainer.scale.set(scale, scale);
|
|
85602
|
+
scaleRef.current = scale;
|
|
85603
|
+
};
|
|
85604
|
+
updateScale();
|
|
85527
85605
|
const easeOutCubic = (t2) => {
|
|
85528
85606
|
return 1 - Math.pow(1 - t2, 3);
|
|
85529
85607
|
};
|
|
@@ -85542,9 +85620,50 @@ const OverworldMapPanelContent = ({
|
|
|
85542
85620
|
});
|
|
85543
85621
|
setIsRendering(false);
|
|
85544
85622
|
};
|
|
85545
|
-
|
|
85623
|
+
let resizeObserver = null;
|
|
85624
|
+
const initAndSetupResize = async () => {
|
|
85625
|
+
await initPixi();
|
|
85626
|
+
if (canvasRef.current && appRef.current) {
|
|
85627
|
+
resizeObserver = new ResizeObserver((entries) => {
|
|
85628
|
+
if (!appRef.current || !worldContainerRef.current) return;
|
|
85629
|
+
for (const entry of entries) {
|
|
85630
|
+
const { width: newWidth, height: newHeight } = entry.contentRect;
|
|
85631
|
+
dimensionsRef.current = { width: newWidth, height: newHeight };
|
|
85632
|
+
appRef.current.renderer.resize(newWidth, newHeight);
|
|
85633
|
+
const worldContainer = worldContainerRef.current;
|
|
85634
|
+
let maxRegionWidth = 0;
|
|
85635
|
+
let maxRegionHeight = 0;
|
|
85636
|
+
for (const region of mapData.regions) {
|
|
85637
|
+
const topLeft = gridToScreen(region.bounds.x, region.bounds.y);
|
|
85638
|
+
const bottomRight = gridToScreen(
|
|
85639
|
+
region.bounds.x + region.bounds.width,
|
|
85640
|
+
region.bounds.y + region.bounds.height
|
|
85641
|
+
);
|
|
85642
|
+
const regionWidth = Math.abs(bottomRight.screenX - topLeft.screenX);
|
|
85643
|
+
const regionHeight = Math.abs(bottomRight.screenY - topLeft.screenY);
|
|
85644
|
+
maxRegionWidth = Math.max(maxRegionWidth, regionWidth);
|
|
85645
|
+
maxRegionHeight = Math.max(maxRegionHeight, regionHeight);
|
|
85646
|
+
}
|
|
85647
|
+
const padding = 40;
|
|
85648
|
+
const availableWidth = dimensionsRef.current.width - padding * 2;
|
|
85649
|
+
const availableHeight = dimensionsRef.current.height - padding * 2;
|
|
85650
|
+
const scaleX = availableWidth / maxRegionWidth;
|
|
85651
|
+
const scaleY = availableHeight / maxRegionHeight;
|
|
85652
|
+
const scale = Math.min(scaleX, scaleY, 1);
|
|
85653
|
+
worldContainer.scale.set(scale, scale);
|
|
85654
|
+
scaleRef.current = scale;
|
|
85655
|
+
appRef.current.stage.hitArea = appRef.current.screen;
|
|
85656
|
+
}
|
|
85657
|
+
});
|
|
85658
|
+
resizeObserver.observe(canvasRef.current);
|
|
85659
|
+
}
|
|
85660
|
+
};
|
|
85661
|
+
initAndSetupResize();
|
|
85546
85662
|
return () => {
|
|
85547
85663
|
cleanup = true;
|
|
85664
|
+
if (resizeObserver) {
|
|
85665
|
+
resizeObserver.disconnect();
|
|
85666
|
+
}
|
|
85548
85667
|
if (appRef.current) {
|
|
85549
85668
|
appRef.current.destroy(true);
|
|
85550
85669
|
appRef.current = null;
|
|
@@ -85552,14 +85671,14 @@ const OverworldMapPanelContent = ({
|
|
|
85552
85671
|
worldContainerRef.current = null;
|
|
85553
85672
|
animationRef.current = null;
|
|
85554
85673
|
};
|
|
85555
|
-
}, [mapData
|
|
85674
|
+
}, [mapData]);
|
|
85556
85675
|
useEffect(() => {
|
|
85557
85676
|
if (!worldContainerRef.current || !currentRegion || isRendering) return;
|
|
85558
85677
|
const regionCenter = gridToScreen(currentRegion.centerX, currentRegion.centerY);
|
|
85559
85678
|
const worldContainer = worldContainerRef.current;
|
|
85560
85679
|
const scale = scaleRef.current;
|
|
85561
|
-
const targetX = width / 2 - regionCenter.screenX * scale;
|
|
85562
|
-
const targetY = height / 2 - regionCenter.screenY * scale;
|
|
85680
|
+
const targetX = dimensionsRef.current.width / 2 - regionCenter.screenX * scale;
|
|
85681
|
+
const targetY = dimensionsRef.current.height / 2 - regionCenter.screenY * scale;
|
|
85563
85682
|
if (!hasInitializedCamera.current) {
|
|
85564
85683
|
worldContainer.x = targetX;
|
|
85565
85684
|
worldContainer.y = targetY;
|
|
@@ -85574,14 +85693,14 @@ const OverworldMapPanelContent = ({
|
|
|
85574
85693
|
targetX,
|
|
85575
85694
|
targetY
|
|
85576
85695
|
};
|
|
85577
|
-
}, [currentRegionIndex, currentRegion,
|
|
85696
|
+
}, [currentRegionIndex, currentRegion, isRendering]);
|
|
85578
85697
|
if (packages.length === 0) {
|
|
85579
85698
|
return /* @__PURE__ */ jsx(
|
|
85580
85699
|
"div",
|
|
85581
85700
|
{
|
|
85582
85701
|
style: {
|
|
85583
|
-
width,
|
|
85584
|
-
height,
|
|
85702
|
+
width: "100%",
|
|
85703
|
+
height: "100%",
|
|
85585
85704
|
display: "flex",
|
|
85586
85705
|
alignItems: "center",
|
|
85587
85706
|
justifyContent: "center",
|
|
@@ -85592,7 +85711,7 @@ const OverworldMapPanelContent = ({
|
|
|
85592
85711
|
}
|
|
85593
85712
|
);
|
|
85594
85713
|
}
|
|
85595
|
-
return /* @__PURE__ */ jsxs("div", { style: { position: "relative" }, children: [
|
|
85714
|
+
return /* @__PURE__ */ jsxs("div", { style: { position: "relative", width: "100%", height: "100%", overflow: "hidden" }, children: [
|
|
85596
85715
|
(isLoading || isRendering) && /* @__PURE__ */ jsx(
|
|
85597
85716
|
"div",
|
|
85598
85717
|
{
|
|
@@ -85600,8 +85719,8 @@ const OverworldMapPanelContent = ({
|
|
|
85600
85719
|
position: "absolute",
|
|
85601
85720
|
top: 0,
|
|
85602
85721
|
left: 0,
|
|
85603
|
-
width,
|
|
85604
|
-
height,
|
|
85722
|
+
width: "100%",
|
|
85723
|
+
height: "100%",
|
|
85605
85724
|
display: "flex",
|
|
85606
85725
|
alignItems: "center",
|
|
85607
85726
|
justifyContent: "center",
|
|
@@ -85618,10 +85737,11 @@ const OverworldMapPanelContent = ({
|
|
|
85618
85737
|
{
|
|
85619
85738
|
ref: canvasRef,
|
|
85620
85739
|
style: {
|
|
85621
|
-
width,
|
|
85622
|
-
height,
|
|
85740
|
+
width: "100%",
|
|
85741
|
+
height: "100%",
|
|
85623
85742
|
imageRendering: "pixelated",
|
|
85624
|
-
border: "2px solid #1f2937"
|
|
85743
|
+
border: "2px solid #1f2937",
|
|
85744
|
+
boxSizing: "border-box"
|
|
85625
85745
|
}
|
|
85626
85746
|
}
|
|
85627
85747
|
),
|
|
@@ -85697,33 +85817,6 @@ const OverworldMapPanelContent = ({
|
|
|
85697
85817
|
]
|
|
85698
85818
|
}
|
|
85699
85819
|
),
|
|
85700
|
-
mapData.regions.length === 1 && /* @__PURE__ */ jsxs(
|
|
85701
|
-
"div",
|
|
85702
|
-
{
|
|
85703
|
-
style: {
|
|
85704
|
-
position: "absolute",
|
|
85705
|
-
top: 8,
|
|
85706
|
-
left: 8,
|
|
85707
|
-
padding: "8px 12px",
|
|
85708
|
-
backgroundColor: "rgba(0, 0, 0, 0.7)",
|
|
85709
|
-
color: "#ffffff",
|
|
85710
|
-
fontFamily: "monospace",
|
|
85711
|
-
fontSize: 12,
|
|
85712
|
-
borderRadius: 4,
|
|
85713
|
-
pointerEvents: "none"
|
|
85714
|
-
},
|
|
85715
|
-
children: [
|
|
85716
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
85717
|
-
"Packages: ",
|
|
85718
|
-
mapData.nodes.length
|
|
85719
|
-
] }),
|
|
85720
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
85721
|
-
"Dependencies: ",
|
|
85722
|
-
mapData.paths.length
|
|
85723
|
-
] })
|
|
85724
|
-
]
|
|
85725
|
-
}
|
|
85726
|
-
),
|
|
85727
85820
|
/* @__PURE__ */ jsx(
|
|
85728
85821
|
"div",
|
|
85729
85822
|
{
|
|
@@ -85780,8 +85873,8 @@ const OverworldMapPanel = ({ context: context2 }) => {
|
|
|
85780
85873
|
};
|
|
85781
85874
|
const GitProjectsMapPanelContent = ({
|
|
85782
85875
|
projects,
|
|
85783
|
-
width
|
|
85784
|
-
height
|
|
85876
|
+
width,
|
|
85877
|
+
height,
|
|
85785
85878
|
isLoading = false
|
|
85786
85879
|
}) => {
|
|
85787
85880
|
const packages = useMemo(() => {
|
|
@@ -85814,8 +85907,8 @@ const GitProjectsMapPanelContent = ({
|
|
|
85814
85907
|
"div",
|
|
85815
85908
|
{
|
|
85816
85909
|
style: {
|
|
85817
|
-
width,
|
|
85818
|
-
height,
|
|
85910
|
+
width: "100%",
|
|
85911
|
+
height: "100%",
|
|
85819
85912
|
display: "flex",
|
|
85820
85913
|
alignItems: "center",
|
|
85821
85914
|
justifyContent: "center",
|
|
@@ -85984,21 +86077,21 @@ const GitProjectsMapPanel = ({ context: context2 }) => {
|
|
|
85984
86077
|
}
|
|
85985
86078
|
];
|
|
85986
86079
|
}, []);
|
|
85987
|
-
return /* @__PURE__ */ jsx(
|
|
86080
|
+
return /* @__PURE__ */ jsx("div", { style: { width: "100%", height: "100%", overflow: "hidden" }, children: /* @__PURE__ */ jsx(
|
|
85988
86081
|
GitProjectsMapPanelContent,
|
|
85989
86082
|
{
|
|
85990
86083
|
projects,
|
|
85991
86084
|
isLoading: false
|
|
85992
86085
|
}
|
|
85993
|
-
);
|
|
86086
|
+
) });
|
|
85994
86087
|
};
|
|
85995
86088
|
const CollectionMapPanelContent = ({
|
|
85996
86089
|
collection,
|
|
85997
86090
|
memberships,
|
|
85998
86091
|
repositories,
|
|
85999
86092
|
dependencies = {},
|
|
86000
|
-
width
|
|
86001
|
-
height
|
|
86093
|
+
width,
|
|
86094
|
+
height,
|
|
86002
86095
|
isLoading = false,
|
|
86003
86096
|
onProjectMoved
|
|
86004
86097
|
}) => {
|
|
@@ -86008,10 +86101,21 @@ const CollectionMapPanelContent = ({
|
|
|
86008
86101
|
);
|
|
86009
86102
|
return collectionMemberships.map((membership) => {
|
|
86010
86103
|
var _a, _b, _c;
|
|
86011
|
-
const repo = repositories.find((r2) =>
|
|
86012
|
-
|
|
86104
|
+
const repo = repositories.find((r2) => {
|
|
86105
|
+
var _a2;
|
|
86106
|
+
const repoId = ((_a2 = r2.github) == null ? void 0 : _a2.id) || r2.name;
|
|
86107
|
+
return repoId === membership.repositoryId;
|
|
86108
|
+
});
|
|
86109
|
+
if (!repo) {
|
|
86110
|
+
console.warn("[CollectionMapPanel] No repo found for membership:", membership.repositoryId);
|
|
86111
|
+
console.log("[CollectionMapPanel] Sample repo IDs:", repositories.slice(0, 3).map((r2) => {
|
|
86112
|
+
var _a2;
|
|
86113
|
+
return ((_a2 = r2.github) == null ? void 0 : _a2.id) || r2.name;
|
|
86114
|
+
}));
|
|
86115
|
+
return null;
|
|
86116
|
+
}
|
|
86013
86117
|
let category;
|
|
86014
|
-
if (((_a = repo.provider) == null ? void 0 : _a.type) === "github") {
|
|
86118
|
+
if (((_a = repo.provider) == null ? void 0 : _a.type) === "github" || repo.github) {
|
|
86015
86119
|
category = "git-repo";
|
|
86016
86120
|
} else {
|
|
86017
86121
|
category = repo.theme || "git-repo";
|
|
@@ -86030,7 +86134,7 @@ const CollectionMapPanelContent = ({
|
|
|
86030
86134
|
return project;
|
|
86031
86135
|
}).filter((p2) => p2 !== null);
|
|
86032
86136
|
}, [collection.id, memberships, repositories, dependencies]);
|
|
86033
|
-
return /* @__PURE__ */ jsxs("div", { style: { position: "relative", width, height }, children: [
|
|
86137
|
+
return /* @__PURE__ */ jsxs("div", { style: { position: "relative", width: "100%", height: "100%", overflow: "hidden" }, children: [
|
|
86034
86138
|
/* @__PURE__ */ jsxs(
|
|
86035
86139
|
"div",
|
|
86036
86140
|
{
|
|
@@ -86102,7 +86206,7 @@ const CollectionMapPanel = ({ context: context2 }) => {
|
|
|
86102
86206
|
);
|
|
86103
86207
|
const dependencies = {};
|
|
86104
86208
|
const isLoading = collectionsLoading || repositoriesLoading;
|
|
86105
|
-
return /* @__PURE__ */ jsx(
|
|
86209
|
+
return /* @__PURE__ */ jsx("div", { style: { width: "100%", height: "100%", overflow: "hidden" }, children: /* @__PURE__ */ jsx(
|
|
86106
86210
|
CollectionMapPanelContent,
|
|
86107
86211
|
{
|
|
86108
86212
|
collection: selectedCollection,
|
|
@@ -86111,7 +86215,7 @@ const CollectionMapPanel = ({ context: context2 }) => {
|
|
|
86111
86215
|
dependencies,
|
|
86112
86216
|
isLoading
|
|
86113
86217
|
}
|
|
86114
|
-
);
|
|
86218
|
+
) });
|
|
86115
86219
|
};
|
|
86116
86220
|
const getCoverageColor = (percentage) => {
|
|
86117
86221
|
if (percentage >= 80) return "#22c55e";
|
|
@@ -87194,4 +87298,4 @@ export {
|
|
|
87194
87298
|
UPDATE_PRIORITY as y,
|
|
87195
87299
|
removeItems as z
|
|
87196
87300
|
};
|
|
87197
|
-
//# sourceMappingURL=index-
|
|
87301
|
+
//# sourceMappingURL=index-Cd5eYs9k.js.map
|