@industry-theme/repository-composition-panels 0.2.68 → 0.2.70
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-CMNRQWe8.js → BufferResource-ZJvC8zXz.js} +2 -2
- package/dist/{BufferResource-CMNRQWe8.js.map → BufferResource-ZJvC8zXz.js.map} +1 -1
- package/dist/{CanvasRenderer-D0D8k2oO.js → CanvasRenderer-CZNjDYf4.js} +3 -3
- package/dist/{CanvasRenderer-D0D8k2oO.js.map → CanvasRenderer-CZNjDYf4.js.map} +1 -1
- package/dist/{Filter-DIblQBqi.js → Filter-BEaERivb.js} +2 -2
- package/dist/{Filter-DIblQBqi.js.map → Filter-BEaERivb.js.map} +1 -1
- package/dist/{RenderTargetSystem-MIwqmoSy.js → RenderTargetSystem-Dk6N66rW.js} +3 -3
- package/dist/{RenderTargetSystem-MIwqmoSy.js.map → RenderTargetSystem-Dk6N66rW.js.map} +1 -1
- package/dist/{WebGLRenderer-gj84aSZI.js → WebGLRenderer-Bdwo224g.js} +4 -4
- package/dist/{WebGLRenderer-gj84aSZI.js.map → WebGLRenderer-Bdwo224g.js.map} +1 -1
- package/dist/{WebGPURenderer--CfN5TH8.js → WebGPURenderer-UZOBStZd.js} +4 -4
- package/dist/{WebGPURenderer--CfN5TH8.js.map → WebGPURenderer-UZOBStZd.js.map} +1 -1
- package/dist/{browserAll-Dgech-hG.js → browserAll-4jAVGaRC.js} +3 -3
- package/dist/{browserAll-Dgech-hG.js.map → browserAll-4jAVGaRC.js.map} +1 -1
- package/dist/{index-CH6ELGkG.js → index-BOvVt6TB.js} +275 -72
- package/dist/{index-CH6ELGkG.js.map → index-BOvVt6TB.js.map} +1 -1
- package/dist/{init-zjHse7MQ.js → init-Ds_uh0av.js} +3 -3
- package/dist/{init-zjHse7MQ.js.map → init-Ds_uh0av.js.map} +1 -1
- package/dist/panels/CollectionMapPanel.d.ts +2 -0
- package/dist/panels/CollectionMapPanel.d.ts.map +1 -1
- package/dist/panels/GitProjectsMapPanel.d.ts +10 -0
- package/dist/panels/GitProjectsMapPanel.d.ts.map +1 -1
- package/dist/panels/overworld-map/OverworldMapPanel.d.ts +2 -0
- package/dist/panels/overworld-map/OverworldMapPanel.d.ts.map +1 -1
- package/dist/panels/overworld-map/components/IsometricInteractionManager.d.ts +5 -0
- package/dist/panels/overworld-map/components/IsometricInteractionManager.d.ts.map +1 -1
- package/dist/panels/overworld-map/dataConverter.d.ts +1 -0
- package/dist/panels/overworld-map/dataConverter.d.ts.map +1 -1
- package/dist/panels/overworld-map/genericMapper.d.ts +7 -0
- package/dist/panels/overworld-map/genericMapper.d.ts.map +1 -1
- package/dist/panels.bundle.js +1 -1
- package/dist/webworkerAll-CXqtvh6U.js +3 -0
- package/dist/webworkerAll-CXqtvh6U.js.map +1 -0
- package/package.json +1 -1
- package/dist/webworkerAll-B_cz3Wvr.js +0 -3
- package/dist/webworkerAll-B_cz3Wvr.js.map +0 -1
|
@@ -104266,7 +104266,7 @@ const browserExt = {
|
|
|
104266
104266
|
},
|
|
104267
104267
|
test: () => true,
|
|
104268
104268
|
load: async () => {
|
|
104269
|
-
await import("./browserAll-
|
|
104269
|
+
await import("./browserAll-4jAVGaRC.js");
|
|
104270
104270
|
}
|
|
104271
104271
|
};
|
|
104272
104272
|
const webworkerExt = {
|
|
@@ -104277,7 +104277,7 @@ const webworkerExt = {
|
|
|
104277
104277
|
},
|
|
104278
104278
|
test: () => typeof self !== "undefined" && self.WorkerGlobalScope !== void 0,
|
|
104279
104279
|
load: async () => {
|
|
104280
|
-
await import("./webworkerAll-
|
|
104280
|
+
await import("./webworkerAll-CXqtvh6U.js");
|
|
104281
104281
|
}
|
|
104282
104282
|
};
|
|
104283
104283
|
class ObservablePoint {
|
|
@@ -116520,19 +116520,19 @@ async function autoDetectRenderer(options) {
|
|
|
116520
116520
|
for (let i2 = 0; i2 < preferredOrder.length; i2++) {
|
|
116521
116521
|
const rendererType = preferredOrder[i2];
|
|
116522
116522
|
if (rendererType === "webgpu" && await isWebGPUSupported()) {
|
|
116523
|
-
const { WebGPURenderer } = await import("./WebGPURenderer
|
|
116523
|
+
const { WebGPURenderer } = await import("./WebGPURenderer-UZOBStZd.js");
|
|
116524
116524
|
RendererClass = WebGPURenderer;
|
|
116525
116525
|
finalOptions = { ...options, ...options.webgpu };
|
|
116526
116526
|
break;
|
|
116527
116527
|
} else if (rendererType === "webgl" && isWebGLSupported(
|
|
116528
116528
|
options.failIfMajorPerformanceCaveat ?? AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat
|
|
116529
116529
|
)) {
|
|
116530
|
-
const { WebGLRenderer } = await import("./WebGLRenderer-
|
|
116530
|
+
const { WebGLRenderer } = await import("./WebGLRenderer-Bdwo224g.js");
|
|
116531
116531
|
RendererClass = WebGLRenderer;
|
|
116532
116532
|
finalOptions = { ...options, ...options.webgl };
|
|
116533
116533
|
break;
|
|
116534
116534
|
} else if (rendererType === "canvas") {
|
|
116535
|
-
const { CanvasRenderer } = await import("./CanvasRenderer-
|
|
116535
|
+
const { CanvasRenderer } = await import("./CanvasRenderer-CZNjDYf4.js");
|
|
116536
116536
|
RendererClass = CanvasRenderer;
|
|
116537
116537
|
finalOptions = { ...options, ...options.canvasOptions };
|
|
116538
116538
|
break;
|
|
@@ -130768,6 +130768,7 @@ function splitNodesIntoRegions(nodes, regionSize) {
|
|
|
130768
130768
|
return groups;
|
|
130769
130769
|
}
|
|
130770
130770
|
function nodesToUnifiedOverworldMap(nodes, options = {}) {
|
|
130771
|
+
var _a, _b;
|
|
130771
130772
|
const nodeWithSizes = nodes.map((node2) => {
|
|
130772
130773
|
const isRoot = node2.isRoot || false;
|
|
130773
130774
|
const nodeType = options.getNodeType ? options.getNodeType(node2) : determineNodeType(node2, isRoot);
|
|
@@ -130775,17 +130776,129 @@ function nodesToUnifiedOverworldMap(nodes, options = {}) {
|
|
|
130775
130776
|
return { ...node2, size };
|
|
130776
130777
|
});
|
|
130777
130778
|
const layoutNodes2 = nodeWithSizes.map((node2) => {
|
|
130778
|
-
var
|
|
130779
|
+
var _a2;
|
|
130779
130780
|
return {
|
|
130780
130781
|
id: node2.id,
|
|
130781
130782
|
size: node2.size,
|
|
130782
130783
|
// Now guaranteed to have a size
|
|
130783
130784
|
language: node2.language,
|
|
130784
|
-
lastEditedAt: (
|
|
130785
|
+
lastEditedAt: (_a2 = node2.aging) == null ? void 0 : _a2.lastEditedAt
|
|
130785
130786
|
// Pass through for age-based grouping
|
|
130786
130787
|
};
|
|
130787
130788
|
});
|
|
130788
|
-
|
|
130789
|
+
let layoutRegions;
|
|
130790
|
+
if (options.customRegions && options.customRegions.length > 0) {
|
|
130791
|
+
layoutRegions = options.customRegions.map((customRegion) => {
|
|
130792
|
+
const row2 = Math.floor(customRegion.order / 10);
|
|
130793
|
+
const col = customRegion.order % 10;
|
|
130794
|
+
return {
|
|
130795
|
+
regionId: customRegion.id,
|
|
130796
|
+
name: customRegion.name,
|
|
130797
|
+
gridPosition: { row: row2, col },
|
|
130798
|
+
bounds: {
|
|
130799
|
+
x: col * REGION_SIZE_TILES,
|
|
130800
|
+
y: row2 * REGION_SIZE_TILES,
|
|
130801
|
+
width: REGION_SIZE_TILES,
|
|
130802
|
+
height: REGION_SIZE_TILES
|
|
130803
|
+
},
|
|
130804
|
+
nodes: []
|
|
130805
|
+
// Will be filled by layout engine below
|
|
130806
|
+
};
|
|
130807
|
+
});
|
|
130808
|
+
const nodesByRegion = /* @__PURE__ */ new Map();
|
|
130809
|
+
const unassignedNodes = [];
|
|
130810
|
+
for (const layoutNode of layoutNodes2) {
|
|
130811
|
+
const genericNode = nodeWithSizes.find((n2) => n2.id === layoutNode.id);
|
|
130812
|
+
const assignedRegionId = genericNode == null ? void 0 : genericNode.regionId;
|
|
130813
|
+
if (assignedRegionId && layoutRegions.some((r2) => r2.regionId === assignedRegionId)) {
|
|
130814
|
+
if (!nodesByRegion.has(assignedRegionId)) {
|
|
130815
|
+
nodesByRegion.set(assignedRegionId, []);
|
|
130816
|
+
}
|
|
130817
|
+
nodesByRegion.get(assignedRegionId).push(layoutNode);
|
|
130818
|
+
} else {
|
|
130819
|
+
unassignedNodes.push(layoutNode);
|
|
130820
|
+
}
|
|
130821
|
+
}
|
|
130822
|
+
for (const region of layoutRegions) {
|
|
130823
|
+
const regionNodes = nodesByRegion.get(region.regionId) || [];
|
|
130824
|
+
if (regionNodes.length === 0) {
|
|
130825
|
+
region.nodes = [];
|
|
130826
|
+
continue;
|
|
130827
|
+
}
|
|
130828
|
+
const manuallyPositioned = [];
|
|
130829
|
+
const autoPositioned = [];
|
|
130830
|
+
for (const layoutNode of regionNodes) {
|
|
130831
|
+
const genericNode = nodeWithSizes.find((n2) => n2.id === layoutNode.id);
|
|
130832
|
+
if (((_a = genericNode == null ? void 0 : genericNode.layout) == null ? void 0 : _a.isManuallyPositioned) && genericNode.layout.gridX !== void 0 && genericNode.layout.gridY !== void 0) {
|
|
130833
|
+
manuallyPositioned.push(layoutNode);
|
|
130834
|
+
} else {
|
|
130835
|
+
autoPositioned.push(layoutNode);
|
|
130836
|
+
}
|
|
130837
|
+
}
|
|
130838
|
+
const placedNodes = [];
|
|
130839
|
+
for (const layoutNode of manuallyPositioned) {
|
|
130840
|
+
const genericNode = nodeWithSizes.find((n2) => n2.id === layoutNode.id);
|
|
130841
|
+
if (((_b = genericNode == null ? void 0 : genericNode.layout) == null ? void 0 : _b.gridX) !== void 0 && genericNode.layout.gridY !== void 0) {
|
|
130842
|
+
placedNodes.push({
|
|
130843
|
+
id: layoutNode.id,
|
|
130844
|
+
gridX: region.bounds.x + genericNode.layout.gridX,
|
|
130845
|
+
gridY: region.bounds.y + genericNode.layout.gridY,
|
|
130846
|
+
size: layoutNode.size,
|
|
130847
|
+
language: layoutNode.language
|
|
130848
|
+
});
|
|
130849
|
+
}
|
|
130850
|
+
}
|
|
130851
|
+
if (autoPositioned.length > 0) {
|
|
130852
|
+
const result = layoutSpritesInRegion(autoPositioned, {
|
|
130853
|
+
width: REGION_SIZE_TILES,
|
|
130854
|
+
height: REGION_SIZE_TILES
|
|
130855
|
+
}, { spacing: 0.5 });
|
|
130856
|
+
placedNodes.push(...result.placed.map((node2) => ({
|
|
130857
|
+
id: node2.id,
|
|
130858
|
+
gridX: region.bounds.x + node2.gridX,
|
|
130859
|
+
gridY: region.bounds.y + node2.gridY,
|
|
130860
|
+
size: node2.size,
|
|
130861
|
+
language: node2.language
|
|
130862
|
+
})));
|
|
130863
|
+
if (result.overflow.length > 0) {
|
|
130864
|
+
console.warn(`[nodesToUnifiedOverworldMap] ${result.overflow.length} nodes didn't fit in region ${region.name}`);
|
|
130865
|
+
}
|
|
130866
|
+
}
|
|
130867
|
+
region.nodes = placedNodes;
|
|
130868
|
+
}
|
|
130869
|
+
if (unassignedNodes.length > 0 && layoutRegions.length > 0) {
|
|
130870
|
+
const firstRegion = layoutRegions[0];
|
|
130871
|
+
const result = layoutSpritesInRegion(unassignedNodes, {
|
|
130872
|
+
width: REGION_SIZE_TILES,
|
|
130873
|
+
height: REGION_SIZE_TILES
|
|
130874
|
+
}, { spacing: 0.5 });
|
|
130875
|
+
firstRegion.nodes.push(...result.placed.map((node2) => ({
|
|
130876
|
+
id: node2.id,
|
|
130877
|
+
gridX: firstRegion.bounds.x + node2.gridX,
|
|
130878
|
+
gridY: firstRegion.bounds.y + node2.gridY,
|
|
130879
|
+
size: node2.size,
|
|
130880
|
+
language: node2.language
|
|
130881
|
+
})));
|
|
130882
|
+
}
|
|
130883
|
+
} else {
|
|
130884
|
+
const autoLayoutRegions = layoutSpritesMultiRegion(layoutNodes2, REGION_SIZE_TILES, { spacing: 0.5 });
|
|
130885
|
+
layoutRegions = autoLayoutRegions.map((region, index2) => ({
|
|
130886
|
+
regionId: region.regionId,
|
|
130887
|
+
name: region.name || `Region ${index2 + 1}`,
|
|
130888
|
+
gridPosition: region.gridPosition,
|
|
130889
|
+
bounds: region.bounds,
|
|
130890
|
+
nodes: region.nodes
|
|
130891
|
+
}));
|
|
130892
|
+
if (layoutRegions.length === 0) {
|
|
130893
|
+
layoutRegions.push({
|
|
130894
|
+
regionId: "region-0-0",
|
|
130895
|
+
name: "Main",
|
|
130896
|
+
gridPosition: { row: 0, col: 0 },
|
|
130897
|
+
bounds: { x: 0, y: 0, width: REGION_SIZE_TILES, height: REGION_SIZE_TILES },
|
|
130898
|
+
nodes: []
|
|
130899
|
+
});
|
|
130900
|
+
}
|
|
130901
|
+
}
|
|
130789
130902
|
const nodePositions = /* @__PURE__ */ new Map();
|
|
130790
130903
|
for (const region of layoutRegions) {
|
|
130791
130904
|
for (const layoutNode of region.nodes) {
|
|
@@ -130948,6 +131061,8 @@ function packageToGenericNode(pkg, packageNames, nameToId, options) {
|
|
|
130948
131061
|
const size = pkg.size;
|
|
130949
131062
|
const aging = pkg.aging;
|
|
130950
131063
|
const language2 = pkg.language;
|
|
131064
|
+
const regionId = pkg.regionId;
|
|
131065
|
+
const layout = pkg.layout;
|
|
130951
131066
|
return {
|
|
130952
131067
|
id: pkg.id,
|
|
130953
131068
|
name: pkg.packageData.name,
|
|
@@ -130962,7 +131077,11 @@ function packageToGenericNode(pkg, packageNames, nameToId, options) {
|
|
|
130962
131077
|
aging,
|
|
130963
131078
|
// Pass through aging for weathering effects
|
|
130964
131079
|
dependencies,
|
|
130965
|
-
devDependencies
|
|
131080
|
+
devDependencies,
|
|
131081
|
+
regionId,
|
|
131082
|
+
// Pass through region assignment
|
|
131083
|
+
layout
|
|
131084
|
+
// Pass through saved position data
|
|
130966
131085
|
};
|
|
130967
131086
|
}
|
|
130968
131087
|
function packagesToOverworldMap(packages, options = {}) {
|
|
@@ -130996,7 +131115,8 @@ function packagesToUnifiedOverworldMap(packages, options = {}) {
|
|
|
130996
131115
|
const map2 = nodesToUnifiedOverworldMap(genericNodes, {
|
|
130997
131116
|
includeDevDependencies: options.includeDevDependencies,
|
|
130998
131117
|
mapPadding: options.mapPadding,
|
|
130999
|
-
regionLayout: options.regionLayout
|
|
131118
|
+
regionLayout: options.regionLayout,
|
|
131119
|
+
customRegions: options.customRegions
|
|
131000
131120
|
});
|
|
131001
131121
|
return {
|
|
131002
131122
|
...map2,
|
|
@@ -131548,6 +131668,15 @@ class IsometricInteractionManager {
|
|
|
131548
131668
|
this.sprites.delete(id2);
|
|
131549
131669
|
}
|
|
131550
131670
|
}
|
|
131671
|
+
/**
|
|
131672
|
+
* Clear all sprite registrations
|
|
131673
|
+
* Used when scene is recreated but interaction manager persists
|
|
131674
|
+
*/
|
|
131675
|
+
clearSprites() {
|
|
131676
|
+
for (const id2 of Array.from(this.sprites.keys())) {
|
|
131677
|
+
this.unregisterSprite(id2);
|
|
131678
|
+
}
|
|
131679
|
+
}
|
|
131551
131680
|
/**
|
|
131552
131681
|
* Handle pointer down - start dragging
|
|
131553
131682
|
*/
|
|
@@ -131871,7 +132000,8 @@ const OverworldMapPanelContent = ({
|
|
|
131871
132000
|
customRegions = [],
|
|
131872
132001
|
onAddRegion,
|
|
131873
132002
|
onRenameRegion,
|
|
131874
|
-
onDeleteRegion
|
|
132003
|
+
onDeleteRegion,
|
|
132004
|
+
collectionKey
|
|
131875
132005
|
}) => {
|
|
131876
132006
|
const canvasRef = useRef(null);
|
|
131877
132007
|
const appRef = useRef(null);
|
|
@@ -131880,6 +132010,7 @@ const OverworldMapPanelContent = ({
|
|
|
131880
132010
|
useRef(1);
|
|
131881
132011
|
const interactionRef = useRef(null);
|
|
131882
132012
|
const pathManagerRef = useRef(null);
|
|
132013
|
+
const rendererRef = useRef(null);
|
|
131883
132014
|
const [isRendering, setIsRendering] = useState(true);
|
|
131884
132015
|
const [isResizing, setIsResizing] = useState(false);
|
|
131885
132016
|
const dimensionsRef = useRef({ width: width || 800, height: height || 600 });
|
|
@@ -131894,22 +132025,63 @@ const OverworldMapPanelContent = ({
|
|
|
131894
132025
|
const animationRef = useRef(null);
|
|
131895
132026
|
const hasInitializedCamera = useRef(false);
|
|
131896
132027
|
const skipNextAnimation = useRef(false);
|
|
132028
|
+
const previousCollectionKeyRef = useRef(null);
|
|
132029
|
+
const savedCameraPosition = useRef(null);
|
|
132030
|
+
const stableCollectionKey = useMemo(() => {
|
|
132031
|
+
if (collectionKey) return collectionKey;
|
|
132032
|
+
return packages.map((p2) => p2.id).sort().join(",");
|
|
132033
|
+
}, [collectionKey, packages]);
|
|
131897
132034
|
const mapData = useMemo(() => {
|
|
131898
132035
|
const map2 = packagesToUnifiedOverworldMap(packages, {
|
|
131899
132036
|
includeDevDependencies,
|
|
131900
132037
|
includePeerDependencies,
|
|
131901
|
-
regionLayout
|
|
132038
|
+
regionLayout,
|
|
132039
|
+
customRegions
|
|
132040
|
+
// Pass through custom regions for manual layout
|
|
131902
132041
|
});
|
|
131903
132042
|
mapDataRef.current = map2;
|
|
131904
132043
|
return map2;
|
|
131905
|
-
}, [packages, includeDevDependencies, includePeerDependencies, regionLayout]);
|
|
132044
|
+
}, [packages, includeDevDependencies, includePeerDependencies, regionLayout, customRegions]);
|
|
131906
132045
|
const currentRegion = mapData.regions[currentRegionIndex] || mapData.regions[0];
|
|
131907
132046
|
useEffect(() => {
|
|
131908
132047
|
if (!canvasRef.current) return;
|
|
132048
|
+
const isCollectionChange = previousCollectionKeyRef.current !== stableCollectionKey;
|
|
132049
|
+
const isRegionOnlyUpdate = !isCollectionChange && previousCollectionKeyRef.current !== null;
|
|
132050
|
+
previousCollectionKeyRef.current = stableCollectionKey;
|
|
132051
|
+
if (isRegionOnlyUpdate && viewportRef.current && rendererRef.current) {
|
|
132052
|
+
const renderer = rendererRef.current;
|
|
132053
|
+
const viewport = viewportRef.current;
|
|
132054
|
+
if (sceneContainersRef.current) {
|
|
132055
|
+
viewport.removeChild(sceneContainersRef.current.background);
|
|
132056
|
+
viewport.removeChild(sceneContainersRef.current.tiles);
|
|
132057
|
+
viewport.removeChild(sceneContainersRef.current.bridges);
|
|
132058
|
+
viewport.removeChild(sceneContainersRef.current.paths);
|
|
132059
|
+
viewport.removeChild(sceneContainersRef.current.nodes);
|
|
132060
|
+
}
|
|
132061
|
+
const scene = renderer.renderScene(mapData, true);
|
|
132062
|
+
viewport.addChild(scene.background);
|
|
132063
|
+
viewport.addChild(scene.tiles);
|
|
132064
|
+
viewport.addChild(scene.bridges);
|
|
132065
|
+
viewport.addChild(scene.paths);
|
|
132066
|
+
viewport.addChild(scene.nodes);
|
|
132067
|
+
scene.nodes.sortableChildren = true;
|
|
132068
|
+
sceneContainersRef.current = scene;
|
|
132069
|
+
if (renderPlaceholdersRef.current) {
|
|
132070
|
+
renderPlaceholdersRef.current();
|
|
132071
|
+
}
|
|
132072
|
+
return;
|
|
132073
|
+
}
|
|
131909
132074
|
let app;
|
|
131910
132075
|
let cleanup = false;
|
|
131911
132076
|
const initPixi = async () => {
|
|
131912
132077
|
var _a, _b, _c;
|
|
132078
|
+
if (viewportRef.current && hasInitializedCamera.current) {
|
|
132079
|
+
savedCameraPosition.current = {
|
|
132080
|
+
x: viewportRef.current.center.x,
|
|
132081
|
+
y: viewportRef.current.center.y,
|
|
132082
|
+
scale: viewportRef.current.scale.x
|
|
132083
|
+
};
|
|
132084
|
+
}
|
|
131913
132085
|
const containerWidth = ((_a = canvasRef.current) == null ? void 0 : _a.clientWidth) || width || 800;
|
|
131914
132086
|
const containerHeight = ((_b = canvasRef.current) == null ? void 0 : _b.clientHeight) || height || 600;
|
|
131915
132087
|
dimensionsRef.current = { width: containerWidth, height: containerHeight };
|
|
@@ -131967,6 +132139,7 @@ const OverworldMapPanelContent = ({
|
|
|
131967
132139
|
gridColor: 3355443,
|
|
131968
132140
|
regionColor: 16737792
|
|
131969
132141
|
});
|
|
132142
|
+
rendererRef.current = renderer;
|
|
131970
132143
|
const scene = renderer.renderScene(mapData, true);
|
|
131971
132144
|
viewport.addChild(scene.background);
|
|
131972
132145
|
viewport.addChild(scene.tiles);
|
|
@@ -132007,13 +132180,11 @@ const OverworldMapPanelContent = ({
|
|
|
132007
132180
|
},
|
|
132008
132181
|
{
|
|
132009
132182
|
onDragStart: (nodeId) => {
|
|
132010
|
-
console.log("Drag start:", nodeId);
|
|
132011
132183
|
},
|
|
132012
132184
|
onDragMove: (nodeId, gridX, gridY) => {
|
|
132013
132185
|
pathManager.updateNodePosition(nodeId, gridX, gridY);
|
|
132014
132186
|
},
|
|
132015
132187
|
onDragEnd: (nodeId, gridX, gridY) => {
|
|
132016
|
-
console.log("Drag end:", nodeId, "at", gridX, gridY);
|
|
132017
132188
|
const node2 = mapData.nodes.find((n2) => n2.id === nodeId);
|
|
132018
132189
|
if (node2) {
|
|
132019
132190
|
node2.gridX = gridX;
|
|
@@ -132028,12 +132199,16 @@ const OverworldMapPanelContent = ({
|
|
|
132028
132199
|
}
|
|
132029
132200
|
interactionRef.current = interaction;
|
|
132030
132201
|
pathManagerRef.current = pathManager;
|
|
132031
|
-
if (
|
|
132202
|
+
if (savedCameraPosition.current) {
|
|
132203
|
+
viewport.moveCenter(savedCameraPosition.current.x, savedCameraPosition.current.y);
|
|
132204
|
+
viewport.setZoom(savedCameraPosition.current.scale);
|
|
132205
|
+
} else if (mapData.regions.length > 0 && !hasInitializedCamera.current) {
|
|
132032
132206
|
const firstRegion = mapData.regions[0];
|
|
132033
132207
|
viewport.moveCenter(
|
|
132034
132208
|
gridToScreen(firstRegion.centerX, firstRegion.centerY).screenX,
|
|
132035
132209
|
gridToScreen(firstRegion.centerX, firstRegion.centerY).screenY
|
|
132036
132210
|
);
|
|
132211
|
+
hasInitializedCamera.current = true;
|
|
132037
132212
|
}
|
|
132038
132213
|
const findAdjacentEmptyPositions = (regions) => {
|
|
132039
132214
|
var _a2;
|
|
@@ -132252,12 +132427,49 @@ const OverworldMapPanelContent = ({
|
|
|
132252
132427
|
viewportRef.current = null;
|
|
132253
132428
|
worldContainerRef.current = null;
|
|
132254
132429
|
animationRef.current = null;
|
|
132430
|
+
rendererRef.current = null;
|
|
132255
132431
|
};
|
|
132432
|
+
}, [stableCollectionKey, width, height]);
|
|
132433
|
+
useEffect(() => {
|
|
132434
|
+
if (!viewportRef.current || !rendererRef.current || !mapData) return;
|
|
132435
|
+
const renderer = rendererRef.current;
|
|
132436
|
+
const viewport = viewportRef.current;
|
|
132437
|
+
if (sceneContainersRef.current) {
|
|
132438
|
+
viewport.removeChild(sceneContainersRef.current.background);
|
|
132439
|
+
viewport.removeChild(sceneContainersRef.current.tiles);
|
|
132440
|
+
viewport.removeChild(sceneContainersRef.current.bridges);
|
|
132441
|
+
viewport.removeChild(sceneContainersRef.current.paths);
|
|
132442
|
+
viewport.removeChild(sceneContainersRef.current.nodes);
|
|
132443
|
+
sceneContainersRef.current.background.destroy({ children: true });
|
|
132444
|
+
sceneContainersRef.current.tiles.destroy({ children: true });
|
|
132445
|
+
sceneContainersRef.current.bridges.destroy({ children: true });
|
|
132446
|
+
sceneContainersRef.current.paths.destroy({ children: true });
|
|
132447
|
+
sceneContainersRef.current.nodes.destroy({ children: true });
|
|
132448
|
+
}
|
|
132449
|
+
const scene = renderer.renderScene(mapData, true);
|
|
132450
|
+
viewport.addChild(scene.background);
|
|
132451
|
+
viewport.addChild(scene.tiles);
|
|
132452
|
+
viewport.addChild(scene.bridges);
|
|
132453
|
+
viewport.addChild(scene.paths);
|
|
132454
|
+
viewport.addChild(scene.nodes);
|
|
132455
|
+
scene.nodes.sortableChildren = true;
|
|
132456
|
+
sceneContainersRef.current = scene;
|
|
132457
|
+
if (interactionRef.current) {
|
|
132458
|
+
interactionRef.current.clearSprites();
|
|
132459
|
+
for (const [id2, instance] of scene.spriteInstances) {
|
|
132460
|
+
interactionRef.current.registerSprite(id2, instance);
|
|
132461
|
+
}
|
|
132462
|
+
}
|
|
132463
|
+
if (renderPlaceholdersRef.current) {
|
|
132464
|
+
renderPlaceholdersRef.current();
|
|
132465
|
+
}
|
|
132256
132466
|
}, [mapData]);
|
|
132257
132467
|
useEffect(() => {
|
|
132258
|
-
if (!viewportRef.current || !
|
|
132468
|
+
if (!viewportRef.current || !mapData || isRendering) return;
|
|
132469
|
+
const region = mapData.regions[currentRegionIndex] || mapData.regions[0];
|
|
132470
|
+
if (!region) return;
|
|
132259
132471
|
const viewport = viewportRef.current;
|
|
132260
|
-
const regionCenter = gridToScreen(
|
|
132472
|
+
const regionCenter = gridToScreen(region.centerX, region.centerY);
|
|
132261
132473
|
if (!hasInitializedCamera.current) {
|
|
132262
132474
|
viewport.moveCenter(regionCenter.screenX, regionCenter.screenY);
|
|
132263
132475
|
hasInitializedCamera.current = true;
|
|
@@ -132277,7 +132489,7 @@ const OverworldMapPanelContent = ({
|
|
|
132277
132489
|
targetX,
|
|
132278
132490
|
targetY
|
|
132279
132491
|
};
|
|
132280
|
-
}, [currentRegionIndex,
|
|
132492
|
+
}, [currentRegionIndex, isRendering]);
|
|
132281
132493
|
useEffect(() => {
|
|
132282
132494
|
isEditingRegionsRef.current = isEditingRegions;
|
|
132283
132495
|
if (renderPlaceholdersRef.current) {
|
|
@@ -132305,35 +132517,6 @@ const OverworldMapPanelContent = ({
|
|
|
132305
132517
|
children: "Loading map..."
|
|
132306
132518
|
}
|
|
132307
132519
|
),
|
|
132308
|
-
!isLoading && !isRendering && packages.length === 0 && /* @__PURE__ */ jsxs(
|
|
132309
|
-
"div",
|
|
132310
|
-
{
|
|
132311
|
-
style: {
|
|
132312
|
-
position: "absolute",
|
|
132313
|
-
top: "50%",
|
|
132314
|
-
left: "50%",
|
|
132315
|
-
transform: "translate(-50%, -50%)",
|
|
132316
|
-
display: "flex",
|
|
132317
|
-
flexDirection: "column",
|
|
132318
|
-
alignItems: "center",
|
|
132319
|
-
gap: "12px",
|
|
132320
|
-
padding: "24px 32px",
|
|
132321
|
-
backgroundColor: "rgba(0, 0, 0, 0.85)",
|
|
132322
|
-
color: "#ffffff",
|
|
132323
|
-
fontFamily: "monospace",
|
|
132324
|
-
borderRadius: 8,
|
|
132325
|
-
border: "2px solid #fbbf24",
|
|
132326
|
-
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.5)",
|
|
132327
|
-
zIndex: 5,
|
|
132328
|
-
pointerEvents: "none"
|
|
132329
|
-
},
|
|
132330
|
-
children: [
|
|
132331
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: "32px" }, children: "🗺️" }),
|
|
132332
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: "16px", fontWeight: "bold", color: "#fbbf24" }, children: "Empty Collection" }),
|
|
132333
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: "12px", color: "#94a3b8", textAlign: "center" }, children: "Drag repositories here to start building your map" })
|
|
132334
|
-
]
|
|
132335
|
-
}
|
|
132336
|
-
),
|
|
132337
132520
|
/* @__PURE__ */ jsx(
|
|
132338
132521
|
"div",
|
|
132339
132522
|
{
|
|
@@ -132513,7 +132696,8 @@ const GitProjectsMapPanelContent = ({
|
|
|
132513
132696
|
customRegions = [],
|
|
132514
132697
|
onAddRegion,
|
|
132515
132698
|
onRenameRegion,
|
|
132516
|
-
onDeleteRegion
|
|
132699
|
+
onDeleteRegion,
|
|
132700
|
+
collectionKey
|
|
132517
132701
|
}) => {
|
|
132518
132702
|
const packages = useMemo(() => {
|
|
132519
132703
|
return projects.map((project) => ({
|
|
@@ -132528,6 +132712,10 @@ const GitProjectsMapPanelContent = ({
|
|
|
132528
132712
|
// Pass through aging for weathering effects
|
|
132529
132713
|
language: project.language,
|
|
132530
132714
|
// Pass through language for color-based visualization
|
|
132715
|
+
regionId: project.regionId,
|
|
132716
|
+
// Pass through region assignment
|
|
132717
|
+
layout: project.layout,
|
|
132718
|
+
// Pass through saved position data
|
|
132531
132719
|
packageData: {
|
|
132532
132720
|
name: project.name,
|
|
132533
132721
|
version: "1.0.0",
|
|
@@ -132563,7 +132751,8 @@ const GitProjectsMapPanelContent = ({
|
|
|
132563
132751
|
customRegions,
|
|
132564
132752
|
onAddRegion,
|
|
132565
132753
|
onRenameRegion,
|
|
132566
|
-
onDeleteRegion
|
|
132754
|
+
onDeleteRegion,
|
|
132755
|
+
collectionKey
|
|
132567
132756
|
}
|
|
132568
132757
|
);
|
|
132569
132758
|
};
|
|
@@ -132691,26 +132880,41 @@ const CollectionMapPanelContent = ({
|
|
|
132691
132880
|
const [isEditingRegions, setIsEditingRegions] = React2__default.useState(false);
|
|
132692
132881
|
React2__default.useEffect(() => {
|
|
132693
132882
|
if (customRegions.length === 0 && (regionCallbacks == null ? void 0 : regionCallbacks.onInitializeDefaultRegions)) {
|
|
132694
|
-
const defaultRegions = createDefaultAgeRegions();
|
|
132883
|
+
const defaultRegions = layoutMode === "auto" ? createDefaultAgeRegions() : [createDefaultRegion("Main")];
|
|
132695
132884
|
regionCallbacks.onInitializeDefaultRegions(collection.id, defaultRegions);
|
|
132696
132885
|
}
|
|
132697
|
-
}, [collection.id, customRegions.length, regionCallbacks]);
|
|
132886
|
+
}, [collection.id, customRegions.length, regionCallbacks, layoutMode]);
|
|
132698
132887
|
const handleRenameRegion = useCallback(async (regionId, name2) => {
|
|
132699
132888
|
if (!(regionCallbacks == null ? void 0 : regionCallbacks.onRegionUpdated)) {
|
|
132700
132889
|
console.warn("No onRegionUpdated callback provided");
|
|
132701
132890
|
return;
|
|
132702
132891
|
}
|
|
132703
132892
|
await regionCallbacks.onRegionUpdated(collection.id, regionId, { name: name2 });
|
|
132704
|
-
console.log("Renamed region:", regionId, name2);
|
|
132705
132893
|
}, [regionCallbacks, collection.id]);
|
|
132706
132894
|
const handleDeleteRegion = useCallback(async (regionId) => {
|
|
132707
132895
|
if (!(regionCallbacks == null ? void 0 : regionCallbacks.onRegionDeleted)) {
|
|
132708
132896
|
console.warn("No onRegionDeleted callback provided");
|
|
132709
132897
|
return;
|
|
132710
132898
|
}
|
|
132899
|
+
if (customRegions.length <= 1) {
|
|
132900
|
+
console.warn("Cannot delete the last region - at least one region must exist");
|
|
132901
|
+
alert("Cannot delete the last region. At least one region must exist.");
|
|
132902
|
+
return;
|
|
132903
|
+
}
|
|
132711
132904
|
await regionCallbacks.onRegionDeleted(collection.id, regionId);
|
|
132712
|
-
|
|
132713
|
-
|
|
132905
|
+
}, [regionCallbacks, collection.id, customRegions.length]);
|
|
132906
|
+
const handleProjectMoved = useCallback(async (projectId, gridX, gridY) => {
|
|
132907
|
+
if (!(regionCallbacks == null ? void 0 : regionCallbacks.onRepositoryPositionUpdated)) {
|
|
132908
|
+
console.warn("No onRepositoryPositionUpdated callback provided");
|
|
132909
|
+
return;
|
|
132910
|
+
}
|
|
132911
|
+
const layout = {
|
|
132912
|
+
gridX,
|
|
132913
|
+
gridY,
|
|
132914
|
+
isManuallyPositioned: true
|
|
132915
|
+
};
|
|
132916
|
+
await regionCallbacks.onRepositoryPositionUpdated(collection.id, projectId, layout);
|
|
132917
|
+
}, [collection.id, regionCallbacks]);
|
|
132714
132918
|
const handleProjectDrop = useCallback(async (data, event) => {
|
|
132715
132919
|
var _a2;
|
|
132716
132920
|
if (!onProjectAdded) {
|
|
@@ -132719,17 +132923,9 @@ const CollectionMapPanelContent = ({
|
|
|
132719
132923
|
}
|
|
132720
132924
|
const repositoryPath = data.primaryData;
|
|
132721
132925
|
const repositoryMetadata = data.metadata || {};
|
|
132722
|
-
console.log("Project dropped on collection map:", {
|
|
132723
|
-
path: repositoryPath,
|
|
132724
|
-
metadata: repositoryMetadata,
|
|
132725
|
-
collectionId: collection.id,
|
|
132726
|
-
sourcePanel: data.sourcePanel,
|
|
132727
|
-
layoutMode
|
|
132728
|
-
});
|
|
132729
132926
|
if (layoutMode === "manual") {
|
|
132730
132927
|
let targetRegionId;
|
|
132731
132928
|
if (customRegions.length === 0 && (regionCallbacks == null ? void 0 : regionCallbacks.onRegionCreated)) {
|
|
132732
|
-
console.log("No regions exist - creating default region");
|
|
132733
132929
|
const defaultRegion = await regionCallbacks.onRegionCreated(collection.id, {
|
|
132734
132930
|
name: "Main",
|
|
132735
132931
|
order: 0
|
|
@@ -132763,7 +132959,7 @@ const CollectionMapPanelContent = ({
|
|
|
132763
132959
|
(m2) => m2.collectionId === collection.id
|
|
132764
132960
|
);
|
|
132765
132961
|
return collectionMemberships.map((membership) => {
|
|
132766
|
-
var _a2, _b2, _c, _d, _e2;
|
|
132962
|
+
var _a2, _b2, _c, _d, _e2, _f, _g;
|
|
132767
132963
|
const repo = repositories.find((r2) => {
|
|
132768
132964
|
var _a3;
|
|
132769
132965
|
const repoId = ((_a3 = r2.github) == null ? void 0 : _a3.id) || r2.name;
|
|
@@ -132798,7 +132994,11 @@ const CollectionMapPanelContent = ({
|
|
|
132798
132994
|
aging,
|
|
132799
132995
|
// Pass aging metrics for visual weathering
|
|
132800
132996
|
dependencies: dependencies[membership.repositoryId] || [],
|
|
132801
|
-
isRoot: ((_e2 = membership.metadata) == null ? void 0 : _e2.pinned) || false
|
|
132997
|
+
isRoot: ((_e2 = membership.metadata) == null ? void 0 : _e2.pinned) || false,
|
|
132998
|
+
regionId: (_f = membership.metadata) == null ? void 0 : _f.regionId,
|
|
132999
|
+
// Preserve region assignment
|
|
133000
|
+
layout: (_g = membership.metadata) == null ? void 0 : _g.layout
|
|
133001
|
+
// Pass saved position data
|
|
132802
133002
|
};
|
|
132803
133003
|
return project;
|
|
132804
133004
|
}).filter((p2) => p2 !== null);
|
|
@@ -132886,6 +133086,8 @@ const CollectionMapPanelContent = ({
|
|
|
132886
133086
|
isLoading,
|
|
132887
133087
|
isEditingRegions,
|
|
132888
133088
|
customRegions,
|
|
133089
|
+
collectionKey: collection.id,
|
|
133090
|
+
onProjectMoved: handleProjectMoved,
|
|
132889
133091
|
onAddRegion: async (position2) => {
|
|
132890
133092
|
const order2 = position2.row * 10 + position2.col;
|
|
132891
133093
|
const name2 = `Region ${customRegions.length + 1}`;
|
|
@@ -132921,7 +133123,6 @@ const CollectionMapPanel = ({ context: context2, actions }) => {
|
|
|
132921
133123
|
}, [actions, selectedCollectionId]);
|
|
132922
133124
|
const regionCallbacks = useMemo(() => ({
|
|
132923
133125
|
onInitializeDefaultRegions: async (collectionId, regions) => {
|
|
132924
|
-
console.log("Initializing default age regions:", { collectionId, regions });
|
|
132925
133126
|
if (actions == null ? void 0 : actions.onInitializeDefaultRegions) {
|
|
132926
133127
|
await actions.onInitializeDefaultRegions(collectionId, regions);
|
|
132927
133128
|
} else {
|
|
@@ -132929,7 +133130,6 @@ const CollectionMapPanel = ({ context: context2, actions }) => {
|
|
|
132929
133130
|
}
|
|
132930
133131
|
},
|
|
132931
133132
|
onSwitchLayoutMode: async (collectionId, mode) => {
|
|
132932
|
-
console.log("Switching layout mode:", { collectionId, mode });
|
|
132933
133133
|
if (actions == null ? void 0 : actions.onSwitchLayoutMode) {
|
|
132934
133134
|
await actions.onSwitchLayoutMode(collectionId, mode);
|
|
132935
133135
|
} else {
|
|
@@ -132937,7 +133137,6 @@ const CollectionMapPanel = ({ context: context2, actions }) => {
|
|
|
132937
133137
|
}
|
|
132938
133138
|
},
|
|
132939
133139
|
onRegionCreated: async (collectionId, region) => {
|
|
132940
|
-
console.log("Region created:", { collectionId, region });
|
|
132941
133140
|
if (actions == null ? void 0 : actions.onRegionCreated) {
|
|
132942
133141
|
return await actions.onRegionCreated(collectionId, region);
|
|
132943
133142
|
} else {
|
|
@@ -132951,7 +133150,6 @@ const CollectionMapPanel = ({ context: context2, actions }) => {
|
|
|
132951
133150
|
}
|
|
132952
133151
|
},
|
|
132953
133152
|
onRegionUpdated: async (collectionId, regionId, updates) => {
|
|
132954
|
-
console.log("Region updated:", { collectionId, regionId, updates });
|
|
132955
133153
|
if (actions == null ? void 0 : actions.onRegionUpdated) {
|
|
132956
133154
|
await actions.onRegionUpdated(collectionId, regionId, updates);
|
|
132957
133155
|
} else {
|
|
@@ -132959,7 +133157,6 @@ const CollectionMapPanel = ({ context: context2, actions }) => {
|
|
|
132959
133157
|
}
|
|
132960
133158
|
},
|
|
132961
133159
|
onRegionDeleted: async (collectionId, regionId) => {
|
|
132962
|
-
console.log("Region deleted:", { collectionId, regionId });
|
|
132963
133160
|
if (actions == null ? void 0 : actions.onRegionDeleted) {
|
|
132964
133161
|
await actions.onRegionDeleted(collectionId, regionId);
|
|
132965
133162
|
} else {
|
|
@@ -132967,12 +133164,18 @@ const CollectionMapPanel = ({ context: context2, actions }) => {
|
|
|
132967
133164
|
}
|
|
132968
133165
|
},
|
|
132969
133166
|
onRepositoryAssigned: async (collectionId, repositoryId, regionId) => {
|
|
132970
|
-
console.log("Repository assigned to region:", { collectionId, repositoryId, regionId });
|
|
132971
133167
|
if (actions == null ? void 0 : actions.onRepositoryAssigned) {
|
|
132972
133168
|
await actions.onRepositoryAssigned(collectionId, repositoryId, regionId);
|
|
132973
133169
|
} else {
|
|
132974
133170
|
console.warn("Actions does not support onRepositoryAssigned - region management requires context integration");
|
|
132975
133171
|
}
|
|
133172
|
+
},
|
|
133173
|
+
onRepositoryPositionUpdated: async (collectionId, repositoryId, layout) => {
|
|
133174
|
+
if (actions == null ? void 0 : actions.onRepositoryPositionUpdated) {
|
|
133175
|
+
await actions.onRepositoryPositionUpdated(collectionId, repositoryId, layout);
|
|
133176
|
+
} else {
|
|
133177
|
+
console.warn("Actions does not support onRepositoryPositionUpdated - region management requires context integration");
|
|
133178
|
+
}
|
|
132976
133179
|
}
|
|
132977
133180
|
}), [actions]);
|
|
132978
133181
|
if (!selectedCollection) {
|
|
@@ -134054,4 +134257,4 @@ export {
|
|
|
134054
134257
|
UPDATE_PRIORITY as y,
|
|
134055
134258
|
removeItems as z
|
|
134056
134259
|
};
|
|
134057
|
-
//# sourceMappingURL=index-
|
|
134260
|
+
//# sourceMappingURL=index-BOvVt6TB.js.map
|