@industry-theme/repository-composition-panels 0.2.64 → 0.2.66
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-CSz8BlTE.js → BufferResource-BdJQbJNW.js} +2 -2
- package/dist/{BufferResource-CSz8BlTE.js.map → BufferResource-BdJQbJNW.js.map} +1 -1
- package/dist/{CanvasRenderer-CFxYLt8V.js → CanvasRenderer-CxXcVqJ_.js} +3 -3
- package/dist/{CanvasRenderer-CFxYLt8V.js.map → CanvasRenderer-CxXcVqJ_.js.map} +1 -1
- package/dist/{Filter-C-5VcMDd.js → Filter-DcWnAtyi.js} +2 -2
- package/dist/{Filter-C-5VcMDd.js.map → Filter-DcWnAtyi.js.map} +1 -1
- package/dist/{RenderTargetSystem-BYfVM5xS.js → RenderTargetSystem-Ba0m66AZ.js} +3 -3
- package/dist/{RenderTargetSystem-BYfVM5xS.js.map → RenderTargetSystem-Ba0m66AZ.js.map} +1 -1
- package/dist/{WebGLRenderer-BsVSX8De.js → WebGLRenderer-Z06PCBhQ.js} +4 -4
- package/dist/{WebGLRenderer-BsVSX8De.js.map → WebGLRenderer-Z06PCBhQ.js.map} +1 -1
- package/dist/{WebGPURenderer-0iXYgxTx.js → WebGPURenderer-CwrC7W35.js} +4 -4
- package/dist/{WebGPURenderer-0iXYgxTx.js.map → WebGPURenderer-CwrC7W35.js.map} +1 -1
- package/dist/{browserAll-DwisySPK.js → browserAll-Bp7xIfsf.js} +3 -3
- package/dist/{browserAll-DwisySPK.js.map → browserAll-Bp7xIfsf.js.map} +1 -1
- package/dist/{index-CUUJZ_zh.js → index-C_imh7Vn.js} +615 -129
- package/dist/{index-CUUJZ_zh.js.map → index-C_imh7Vn.js.map} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/{init-ChCUli1T.js → init-CjIc_fdP.js} +3 -3
- package/dist/{init-ChCUli1T.js.map → init-CjIc_fdP.js.map} +1 -1
- package/dist/panels/CollectionMapPanel.d.ts +74 -6
- package/dist/panels/CollectionMapPanel.d.ts.map +1 -1
- package/dist/panels/GitProjectsMapPanel.d.ts +15 -0
- package/dist/panels/GitProjectsMapPanel.d.ts.map +1 -1
- package/dist/panels/overworld-map/OverworldMapPanel.d.ts +15 -0
- package/dist/panels/overworld-map/OverworldMapPanel.d.ts.map +1 -1
- package/dist/panels/overworld-map/RegionEditingTest.d.ts +10 -0
- package/dist/panels/overworld-map/RegionEditingTest.d.ts.map +1 -0
- package/dist/panels/overworld-map/components/IsometricRenderer.d.ts +2 -2
- package/dist/panels/overworld-map/components/IsometricRenderer.d.ts.map +1 -1
- package/dist/panels.bundle.js +3 -1
- package/dist/webworkerAll-N1ovo-FZ.js +3 -0
- package/dist/webworkerAll-N1ovo-FZ.js.map +1 -0
- package/package.json +24 -24
- package/dist/webworkerAll-DHfMW-FC.js +0 -3
- package/dist/webworkerAll-DHfMW-FC.js.map +0 -1
|
@@ -9409,135 +9409,152 @@ function getDefaultExportFromCjs(x2) {
|
|
|
9409
9409
|
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
9410
9410
|
}
|
|
9411
9411
|
var withSelector = { exports: {} };
|
|
9412
|
-
var
|
|
9412
|
+
var withSelector_production = {};
|
|
9413
9413
|
var shim = { exports: {} };
|
|
9414
|
-
var
|
|
9414
|
+
var useSyncExternalStoreShim_production = {};
|
|
9415
9415
|
/**
|
|
9416
9416
|
* @license React
|
|
9417
|
-
* use-sync-external-store-shim.production.
|
|
9417
|
+
* use-sync-external-store-shim.production.js
|
|
9418
9418
|
*
|
|
9419
|
-
* Copyright (c)
|
|
9419
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
9420
9420
|
*
|
|
9421
9421
|
* This source code is licensed under the MIT license found in the
|
|
9422
9422
|
* LICENSE file in the root directory of this source tree.
|
|
9423
9423
|
*/
|
|
9424
|
-
var
|
|
9425
|
-
function
|
|
9426
|
-
if (
|
|
9427
|
-
|
|
9428
|
-
var
|
|
9429
|
-
function
|
|
9430
|
-
return
|
|
9431
|
-
}
|
|
9432
|
-
var
|
|
9433
|
-
function
|
|
9434
|
-
var
|
|
9435
|
-
|
|
9436
|
-
|
|
9437
|
-
|
|
9438
|
-
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9444
|
-
|
|
9445
|
-
|
|
9446
|
-
|
|
9447
|
-
|
|
9424
|
+
var hasRequiredUseSyncExternalStoreShim_production;
|
|
9425
|
+
function requireUseSyncExternalStoreShim_production() {
|
|
9426
|
+
if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production;
|
|
9427
|
+
hasRequiredUseSyncExternalStoreShim_production = 1;
|
|
9428
|
+
var React = React2__default;
|
|
9429
|
+
function is(x2, y2) {
|
|
9430
|
+
return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
|
|
9431
|
+
}
|
|
9432
|
+
var objectIs = "function" === typeof Object.is ? Object.is : is, useState2 = React.useState, useEffect2 = React.useEffect, useLayoutEffect2 = React.useLayoutEffect, useDebugValue2 = React.useDebugValue;
|
|
9433
|
+
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
9434
|
+
var value = getSnapshot(), _useState = useState2({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
|
|
9435
|
+
useLayoutEffect2(
|
|
9436
|
+
function() {
|
|
9437
|
+
inst.value = value;
|
|
9438
|
+
inst.getSnapshot = getSnapshot;
|
|
9439
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
9440
|
+
},
|
|
9441
|
+
[subscribe, value, getSnapshot]
|
|
9442
|
+
);
|
|
9443
|
+
useEffect2(
|
|
9444
|
+
function() {
|
|
9445
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
9446
|
+
return subscribe(function() {
|
|
9447
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
9448
|
+
});
|
|
9449
|
+
},
|
|
9450
|
+
[subscribe]
|
|
9451
|
+
);
|
|
9452
|
+
useDebugValue2(value);
|
|
9453
|
+
return value;
|
|
9448
9454
|
}
|
|
9449
|
-
function
|
|
9450
|
-
var
|
|
9451
|
-
|
|
9455
|
+
function checkIfSnapshotChanged(inst) {
|
|
9456
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
9457
|
+
inst = inst.value;
|
|
9452
9458
|
try {
|
|
9453
|
-
var
|
|
9454
|
-
return !
|
|
9455
|
-
} catch (
|
|
9459
|
+
var nextValue = latestGetSnapshot();
|
|
9460
|
+
return !objectIs(inst, nextValue);
|
|
9461
|
+
} catch (error) {
|
|
9456
9462
|
return true;
|
|
9457
9463
|
}
|
|
9458
9464
|
}
|
|
9459
|
-
function
|
|
9460
|
-
return
|
|
9465
|
+
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
9466
|
+
return getSnapshot();
|
|
9461
9467
|
}
|
|
9462
|
-
var
|
|
9463
|
-
|
|
9464
|
-
return
|
|
9468
|
+
var shim2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
9469
|
+
useSyncExternalStoreShim_production.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim2;
|
|
9470
|
+
return useSyncExternalStoreShim_production;
|
|
9465
9471
|
}
|
|
9466
9472
|
var hasRequiredShim;
|
|
9467
9473
|
function requireShim() {
|
|
9468
9474
|
if (hasRequiredShim) return shim.exports;
|
|
9469
9475
|
hasRequiredShim = 1;
|
|
9470
9476
|
{
|
|
9471
|
-
shim.exports =
|
|
9477
|
+
shim.exports = requireUseSyncExternalStoreShim_production();
|
|
9472
9478
|
}
|
|
9473
9479
|
return shim.exports;
|
|
9474
9480
|
}
|
|
9475
9481
|
/**
|
|
9476
9482
|
* @license React
|
|
9477
|
-
* use-sync-external-store-shim/with-selector.production.
|
|
9483
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
9478
9484
|
*
|
|
9479
|
-
* Copyright (c)
|
|
9485
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
9480
9486
|
*
|
|
9481
9487
|
* This source code is licensed under the MIT license found in the
|
|
9482
9488
|
* LICENSE file in the root directory of this source tree.
|
|
9483
9489
|
*/
|
|
9484
|
-
var
|
|
9485
|
-
function
|
|
9486
|
-
if (
|
|
9487
|
-
|
|
9488
|
-
var
|
|
9489
|
-
function
|
|
9490
|
-
return
|
|
9491
|
-
}
|
|
9492
|
-
var
|
|
9493
|
-
|
|
9494
|
-
var
|
|
9495
|
-
if (null ===
|
|
9496
|
-
var
|
|
9497
|
-
|
|
9498
|
-
} else
|
|
9499
|
-
|
|
9500
|
-
function
|
|
9501
|
-
|
|
9502
|
-
|
|
9503
|
-
|
|
9504
|
-
|
|
9505
|
-
|
|
9506
|
-
|
|
9507
|
-
|
|
9490
|
+
var hasRequiredWithSelector_production;
|
|
9491
|
+
function requireWithSelector_production() {
|
|
9492
|
+
if (hasRequiredWithSelector_production) return withSelector_production;
|
|
9493
|
+
hasRequiredWithSelector_production = 1;
|
|
9494
|
+
var React = React2__default, shim2 = requireShim();
|
|
9495
|
+
function is(x2, y2) {
|
|
9496
|
+
return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
|
|
9497
|
+
}
|
|
9498
|
+
var objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = shim2.useSyncExternalStore, useRef2 = React.useRef, useEffect2 = React.useEffect, useMemo2 = React.useMemo, useDebugValue2 = React.useDebugValue;
|
|
9499
|
+
withSelector_production.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector2, isEqual) {
|
|
9500
|
+
var instRef = useRef2(null);
|
|
9501
|
+
if (null === instRef.current) {
|
|
9502
|
+
var inst = { hasValue: false, value: null };
|
|
9503
|
+
instRef.current = inst;
|
|
9504
|
+
} else inst = instRef.current;
|
|
9505
|
+
instRef = useMemo2(
|
|
9506
|
+
function() {
|
|
9507
|
+
function memoizedSelector(nextSnapshot) {
|
|
9508
|
+
if (!hasMemo) {
|
|
9509
|
+
hasMemo = true;
|
|
9510
|
+
memoizedSnapshot = nextSnapshot;
|
|
9511
|
+
nextSnapshot = selector2(nextSnapshot);
|
|
9512
|
+
if (void 0 !== isEqual && inst.hasValue) {
|
|
9513
|
+
var currentSelection = inst.value;
|
|
9514
|
+
if (isEqual(currentSelection, nextSnapshot))
|
|
9515
|
+
return memoizedSelection = currentSelection;
|
|
9516
|
+
}
|
|
9517
|
+
return memoizedSelection = nextSnapshot;
|
|
9518
|
+
}
|
|
9519
|
+
currentSelection = memoizedSelection;
|
|
9520
|
+
if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;
|
|
9521
|
+
var nextSelection = selector2(nextSnapshot);
|
|
9522
|
+
if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
|
|
9523
|
+
return memoizedSnapshot = nextSnapshot, currentSelection;
|
|
9524
|
+
memoizedSnapshot = nextSnapshot;
|
|
9525
|
+
return memoizedSelection = nextSelection;
|
|
9526
|
+
}
|
|
9527
|
+
var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
|
|
9528
|
+
return [
|
|
9529
|
+
function() {
|
|
9530
|
+
return memoizedSelector(getSnapshot());
|
|
9531
|
+
},
|
|
9532
|
+
null === maybeGetServerSnapshot ? void 0 : function() {
|
|
9533
|
+
return memoizedSelector(maybeGetServerSnapshot());
|
|
9508
9534
|
}
|
|
9509
|
-
|
|
9510
|
-
|
|
9511
|
-
|
|
9512
|
-
|
|
9513
|
-
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
var d2 = r2(a2, c2[0], c2[1]);
|
|
9526
|
-
u2(function() {
|
|
9527
|
-
f2.hasValue = true;
|
|
9528
|
-
f2.value = d2;
|
|
9529
|
-
}, [d2]);
|
|
9530
|
-
w2(d2);
|
|
9531
|
-
return d2;
|
|
9532
|
-
};
|
|
9533
|
-
return withSelector_production_min;
|
|
9535
|
+
];
|
|
9536
|
+
},
|
|
9537
|
+
[getSnapshot, getServerSnapshot, selector2, isEqual]
|
|
9538
|
+
);
|
|
9539
|
+
var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
|
|
9540
|
+
useEffect2(
|
|
9541
|
+
function() {
|
|
9542
|
+
inst.hasValue = true;
|
|
9543
|
+
inst.value = value;
|
|
9544
|
+
},
|
|
9545
|
+
[value]
|
|
9546
|
+
);
|
|
9547
|
+
useDebugValue2(value);
|
|
9548
|
+
return value;
|
|
9549
|
+
};
|
|
9550
|
+
return withSelector_production;
|
|
9534
9551
|
}
|
|
9535
9552
|
var hasRequiredWithSelector;
|
|
9536
9553
|
function requireWithSelector() {
|
|
9537
9554
|
if (hasRequiredWithSelector) return withSelector.exports;
|
|
9538
9555
|
hasRequiredWithSelector = 1;
|
|
9539
9556
|
{
|
|
9540
|
-
withSelector.exports =
|
|
9557
|
+
withSelector.exports = requireWithSelector_production();
|
|
9541
9558
|
}
|
|
9542
9559
|
return withSelector.exports;
|
|
9543
9560
|
}
|
|
@@ -9603,8 +9620,7 @@ function shallow$1(objA, objB) {
|
|
|
9603
9620
|
return false;
|
|
9604
9621
|
}
|
|
9605
9622
|
if (objA instanceof Map && objB instanceof Map) {
|
|
9606
|
-
if (objA.size !== objB.size)
|
|
9607
|
-
return false;
|
|
9623
|
+
if (objA.size !== objB.size) return false;
|
|
9608
9624
|
for (const [key, value] of objA) {
|
|
9609
9625
|
if (!Object.is(value, objB.get(key))) {
|
|
9610
9626
|
return false;
|
|
@@ -9613,8 +9629,7 @@ function shallow$1(objA, objB) {
|
|
|
9613
9629
|
return true;
|
|
9614
9630
|
}
|
|
9615
9631
|
if (objA instanceof Set && objB instanceof Set) {
|
|
9616
|
-
if (objA.size !== objB.size)
|
|
9617
|
-
return false;
|
|
9632
|
+
if (objA.size !== objB.size) return false;
|
|
9618
9633
|
for (const value of objA) {
|
|
9619
9634
|
if (!objB.has(value)) {
|
|
9620
9635
|
return false;
|
|
@@ -9626,8 +9641,8 @@ function shallow$1(objA, objB) {
|
|
|
9626
9641
|
if (keysA.length !== Object.keys(objB).length) {
|
|
9627
9642
|
return false;
|
|
9628
9643
|
}
|
|
9629
|
-
for (
|
|
9630
|
-
if (!Object.prototype.hasOwnProperty.call(objB,
|
|
9644
|
+
for (const keyA of keysA) {
|
|
9645
|
+
if (!Object.prototype.hasOwnProperty.call(objB, keyA) || !Object.is(objA[keyA], objB[keyA])) {
|
|
9631
9646
|
return false;
|
|
9632
9647
|
}
|
|
9633
9648
|
}
|
|
@@ -104251,7 +104266,7 @@ const browserExt = {
|
|
|
104251
104266
|
},
|
|
104252
104267
|
test: () => true,
|
|
104253
104268
|
load: async () => {
|
|
104254
|
-
await import("./browserAll-
|
|
104269
|
+
await import("./browserAll-Bp7xIfsf.js");
|
|
104255
104270
|
}
|
|
104256
104271
|
};
|
|
104257
104272
|
const webworkerExt = {
|
|
@@ -104262,7 +104277,7 @@ const webworkerExt = {
|
|
|
104262
104277
|
},
|
|
104263
104278
|
test: () => typeof self !== "undefined" && self.WorkerGlobalScope !== void 0,
|
|
104264
104279
|
load: async () => {
|
|
104265
|
-
await import("./webworkerAll-
|
|
104280
|
+
await import("./webworkerAll-N1ovo-FZ.js");
|
|
104266
104281
|
}
|
|
104267
104282
|
};
|
|
104268
104283
|
class ObservablePoint {
|
|
@@ -116505,19 +116520,19 @@ async function autoDetectRenderer(options) {
|
|
|
116505
116520
|
for (let i2 = 0; i2 < preferredOrder.length; i2++) {
|
|
116506
116521
|
const rendererType = preferredOrder[i2];
|
|
116507
116522
|
if (rendererType === "webgpu" && await isWebGPUSupported()) {
|
|
116508
|
-
const { WebGPURenderer } = await import("./WebGPURenderer-
|
|
116523
|
+
const { WebGPURenderer } = await import("./WebGPURenderer-CwrC7W35.js");
|
|
116509
116524
|
RendererClass = WebGPURenderer;
|
|
116510
116525
|
finalOptions = { ...options, ...options.webgpu };
|
|
116511
116526
|
break;
|
|
116512
116527
|
} else if (rendererType === "webgl" && isWebGLSupported(
|
|
116513
116528
|
options.failIfMajorPerformanceCaveat ?? AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat
|
|
116514
116529
|
)) {
|
|
116515
|
-
const { WebGLRenderer } = await import("./WebGLRenderer-
|
|
116530
|
+
const { WebGLRenderer } = await import("./WebGLRenderer-Z06PCBhQ.js");
|
|
116516
116531
|
RendererClass = WebGLRenderer;
|
|
116517
116532
|
finalOptions = { ...options, ...options.webgl };
|
|
116518
116533
|
break;
|
|
116519
116534
|
} else if (rendererType === "canvas") {
|
|
116520
|
-
const { CanvasRenderer } = await import("./CanvasRenderer-
|
|
116535
|
+
const { CanvasRenderer } = await import("./CanvasRenderer-CxXcVqJ_.js");
|
|
116521
116536
|
RendererClass = CanvasRenderer;
|
|
116522
116537
|
finalOptions = { ...options, ...options.canvasOptions };
|
|
116523
116538
|
break;
|
|
@@ -131113,7 +131128,7 @@ class IsometricRenderer {
|
|
|
131113
131128
|
const paths = new Container();
|
|
131114
131129
|
const nodes = new Container();
|
|
131115
131130
|
if (showGrid) {
|
|
131116
|
-
const grid = this.renderGrid(mapData.width, mapData.height,
|
|
131131
|
+
const grid = this.renderGrid(mapData.width, mapData.height, mapData.regions);
|
|
131117
131132
|
background.addChild(grid);
|
|
131118
131133
|
}
|
|
131119
131134
|
const terrainContainer = this.renderTerrain(mapData.tiles);
|
|
@@ -131147,17 +131162,39 @@ class IsometricRenderer {
|
|
|
131147
131162
|
}
|
|
131148
131163
|
/**
|
|
131149
131164
|
* Render isometric grid with region boundaries
|
|
131150
|
-
*
|
|
131165
|
+
* Only draws grid cells for existing regions (not the entire world)
|
|
131151
131166
|
*/
|
|
131152
|
-
renderGrid(gridWidth, gridHeight,
|
|
131167
|
+
renderGrid(gridWidth, gridHeight, regions) {
|
|
131153
131168
|
const grid = new Graphics();
|
|
131169
|
+
const isInsideRegion = (x2, y2) => {
|
|
131170
|
+
for (const region of regions) {
|
|
131171
|
+
const { x: rx, y: ry, width: rw, height: rh } = region.bounds;
|
|
131172
|
+
if (x2 >= rx && x2 < rx + rw && y2 >= ry && y2 < ry + rh) {
|
|
131173
|
+
return true;
|
|
131174
|
+
}
|
|
131175
|
+
}
|
|
131176
|
+
return false;
|
|
131177
|
+
};
|
|
131178
|
+
const isOnRegionBoundary = (x2, y2) => {
|
|
131179
|
+
for (const region of regions) {
|
|
131180
|
+
const { x: rx, y: ry, width: rw, height: rh } = region.bounds;
|
|
131181
|
+
if ((x2 === rx || x2 === rx + rw - 1) && y2 >= ry && y2 < ry + rh) {
|
|
131182
|
+
return true;
|
|
131183
|
+
}
|
|
131184
|
+
if ((y2 === ry || y2 === ry + rh - 1) && x2 >= rx && x2 < rx + rw) {
|
|
131185
|
+
return true;
|
|
131186
|
+
}
|
|
131187
|
+
}
|
|
131188
|
+
return false;
|
|
131189
|
+
};
|
|
131154
131190
|
for (let y2 = 0; y2 < gridHeight; y2++) {
|
|
131155
131191
|
for (let x2 = 0; x2 < gridWidth; x2++) {
|
|
131192
|
+
if (!isInsideRegion(x2, y2)) {
|
|
131193
|
+
continue;
|
|
131194
|
+
}
|
|
131156
131195
|
const screenX = (x2 - y2) * (this.tileWidth / 2);
|
|
131157
131196
|
const screenY = (x2 + y2) * (this.tileHeight / 2);
|
|
131158
|
-
const
|
|
131159
|
-
const isRegionBoundaryY = y2 % regionSize === 0;
|
|
131160
|
-
const isRegionBoundary = isRegionBoundaryX || isRegionBoundaryY;
|
|
131197
|
+
const isRegionBoundary = isOnRegionBoundary(x2, y2);
|
|
131161
131198
|
grid.strokeStyle = {
|
|
131162
131199
|
width: isRegionBoundary ? 2 : 1,
|
|
131163
131200
|
color: isRegionBoundary ? this.regionColor : this.gridColor
|
|
@@ -131828,7 +131865,13 @@ const OverworldMapPanelContent = ({
|
|
|
131828
131865
|
regionLayout,
|
|
131829
131866
|
width,
|
|
131830
131867
|
height,
|
|
131831
|
-
isLoading = false
|
|
131868
|
+
isLoading = false,
|
|
131869
|
+
onProjectMoved,
|
|
131870
|
+
isEditingRegions = false,
|
|
131871
|
+
customRegions = [],
|
|
131872
|
+
onAddRegion,
|
|
131873
|
+
onRenameRegion,
|
|
131874
|
+
onDeleteRegion
|
|
131832
131875
|
}) => {
|
|
131833
131876
|
const canvasRef = useRef(null);
|
|
131834
131877
|
const appRef = useRef(null);
|
|
@@ -131840,17 +131883,25 @@ const OverworldMapPanelContent = ({
|
|
|
131840
131883
|
const [isRendering, setIsRendering] = useState(true);
|
|
131841
131884
|
const [isResizing, setIsResizing] = useState(false);
|
|
131842
131885
|
const dimensionsRef = useRef({ width: width || 800, height: height || 600 });
|
|
131886
|
+
const placeholdersRef = useRef(null);
|
|
131887
|
+
const sceneContainersRef = useRef(null);
|
|
131888
|
+
const offsetRef = useRef({ offsetX: 0, offsetY: 0 });
|
|
131889
|
+
const renderPlaceholdersRef = useRef(null);
|
|
131890
|
+
const mapDataRef = useRef(null);
|
|
131891
|
+
const isEditingRegionsRef = useRef(isEditingRegions);
|
|
131843
131892
|
const [currentRegionIndex, setCurrentRegionIndex] = useState(0);
|
|
131844
131893
|
const [isAnimating, setIsAnimating] = useState(false);
|
|
131845
131894
|
const animationRef = useRef(null);
|
|
131846
131895
|
const hasInitializedCamera = useRef(false);
|
|
131847
131896
|
const skipNextAnimation = useRef(false);
|
|
131848
131897
|
const mapData = useMemo(() => {
|
|
131849
|
-
|
|
131898
|
+
const map2 = packagesToUnifiedOverworldMap(packages, {
|
|
131850
131899
|
includeDevDependencies,
|
|
131851
131900
|
includePeerDependencies,
|
|
131852
131901
|
regionLayout
|
|
131853
131902
|
});
|
|
131903
|
+
mapDataRef.current = map2;
|
|
131904
|
+
return map2;
|
|
131854
131905
|
}, [packages, includeDevDependencies, includePeerDependencies, regionLayout]);
|
|
131855
131906
|
const currentRegion = mapData.regions[currentRegionIndex] || mapData.regions[0];
|
|
131856
131907
|
useEffect(() => {
|
|
@@ -131923,6 +131974,11 @@ const OverworldMapPanelContent = ({
|
|
|
131923
131974
|
viewport.addChild(scene.paths);
|
|
131924
131975
|
viewport.addChild(scene.nodes);
|
|
131925
131976
|
scene.nodes.sortableChildren = true;
|
|
131977
|
+
sceneContainersRef.current = scene;
|
|
131978
|
+
offsetRef.current = { offsetX: 0, offsetY: 0 };
|
|
131979
|
+
const placeholdersContainer = new Container();
|
|
131980
|
+
viewport.addChild(placeholdersContainer);
|
|
131981
|
+
placeholdersRef.current = placeholdersContainer;
|
|
131926
131982
|
const pathConnections = Array.from(scene.pathGraphics.entries()).map(([id2, graphics]) => {
|
|
131927
131983
|
const pathData = mapData.paths.find((p2) => `${p2.from}-${p2.to}` === id2);
|
|
131928
131984
|
return {
|
|
@@ -131963,6 +132019,7 @@ const OverworldMapPanelContent = ({
|
|
|
131963
132019
|
node2.gridX = gridX;
|
|
131964
132020
|
node2.gridY = gridY;
|
|
131965
132021
|
}
|
|
132022
|
+
onProjectMoved == null ? void 0 : onProjectMoved(nodeId, gridX, gridY);
|
|
131966
132023
|
}
|
|
131967
132024
|
}
|
|
131968
132025
|
);
|
|
@@ -131978,6 +132035,156 @@ const OverworldMapPanelContent = ({
|
|
|
131978
132035
|
gridToScreen(firstRegion.centerX, firstRegion.centerY).screenY
|
|
131979
132036
|
);
|
|
131980
132037
|
}
|
|
132038
|
+
const findAdjacentEmptyPositions = (regions) => {
|
|
132039
|
+
var _a2;
|
|
132040
|
+
const regionSize = ((_a2 = regions[0]) == null ? void 0 : _a2.bounds.width) || 25;
|
|
132041
|
+
const occupied = /* @__PURE__ */ new Set();
|
|
132042
|
+
regions.forEach((r2) => {
|
|
132043
|
+
const row2 = r2.bounds.y / regionSize;
|
|
132044
|
+
const col = r2.bounds.x / regionSize;
|
|
132045
|
+
occupied.add(`${row2}-${col}`);
|
|
132046
|
+
});
|
|
132047
|
+
const adjacent = [];
|
|
132048
|
+
const checked = /* @__PURE__ */ new Set();
|
|
132049
|
+
regions.forEach((r2) => {
|
|
132050
|
+
const row2 = r2.bounds.y / regionSize;
|
|
132051
|
+
const col = r2.bounds.x / regionSize;
|
|
132052
|
+
const directions = [
|
|
132053
|
+
{ row: row2 - 1, col },
|
|
132054
|
+
// up
|
|
132055
|
+
{ row: row2 + 1, col },
|
|
132056
|
+
// down
|
|
132057
|
+
{ row: row2, col: col - 1 },
|
|
132058
|
+
// left
|
|
132059
|
+
{ row: row2, col: col + 1 }
|
|
132060
|
+
// right
|
|
132061
|
+
];
|
|
132062
|
+
directions.forEach((pos) => {
|
|
132063
|
+
const key = `${pos.row}-${pos.col}`;
|
|
132064
|
+
if (!occupied.has(key) && !checked.has(key) && pos.row >= 0 && pos.col >= 0) {
|
|
132065
|
+
adjacent.push(pos);
|
|
132066
|
+
checked.add(key);
|
|
132067
|
+
}
|
|
132068
|
+
});
|
|
132069
|
+
});
|
|
132070
|
+
return adjacent;
|
|
132071
|
+
};
|
|
132072
|
+
const renderPlaceholders = () => {
|
|
132073
|
+
var _a2;
|
|
132074
|
+
if (!placeholdersRef.current || !mapDataRef.current) return;
|
|
132075
|
+
placeholdersRef.current.removeChildren();
|
|
132076
|
+
if (!isEditingRegionsRef.current || !onAddRegion) return;
|
|
132077
|
+
const adjacentPositions = findAdjacentEmptyPositions(mapDataRef.current.regions);
|
|
132078
|
+
const regionSize = ((_a2 = mapDataRef.current.regions[0]) == null ? void 0 : _a2.bounds.width) || 25;
|
|
132079
|
+
const placeholderColor = 2278750;
|
|
132080
|
+
adjacentPositions.forEach((pos) => {
|
|
132081
|
+
const placeholder = new Graphics();
|
|
132082
|
+
const topLeft = gridToScreen(pos.col * regionSize, pos.row * regionSize);
|
|
132083
|
+
const topRight = gridToScreen(pos.col * regionSize + regionSize, pos.row * regionSize);
|
|
132084
|
+
const bottomLeft = gridToScreen(pos.col * regionSize, pos.row * regionSize + regionSize);
|
|
132085
|
+
const bottomRight = gridToScreen(pos.col * regionSize + regionSize, pos.row * regionSize + regionSize);
|
|
132086
|
+
placeholder.setStrokeStyle({
|
|
132087
|
+
width: 2,
|
|
132088
|
+
color: placeholderColor,
|
|
132089
|
+
alpha: 0.6
|
|
132090
|
+
});
|
|
132091
|
+
placeholder.setFillStyle({
|
|
132092
|
+
color: placeholderColor,
|
|
132093
|
+
alpha: 0.1
|
|
132094
|
+
// Very transparent so it's barely visible but still clickable
|
|
132095
|
+
});
|
|
132096
|
+
placeholder.moveTo(topLeft.screenX, topLeft.screenY);
|
|
132097
|
+
placeholder.lineTo(topRight.screenX, topRight.screenY);
|
|
132098
|
+
placeholder.lineTo(bottomRight.screenX, bottomRight.screenY);
|
|
132099
|
+
placeholder.lineTo(bottomLeft.screenX, bottomLeft.screenY);
|
|
132100
|
+
placeholder.lineTo(topLeft.screenX, topLeft.screenY);
|
|
132101
|
+
placeholder.fill();
|
|
132102
|
+
placeholder.stroke();
|
|
132103
|
+
const centerX = pos.col * regionSize + regionSize / 2;
|
|
132104
|
+
const centerY = pos.row * regionSize + regionSize / 2;
|
|
132105
|
+
const centerScreen = gridToScreen(centerX, centerY);
|
|
132106
|
+
const iconSize = 40;
|
|
132107
|
+
placeholder.setStrokeStyle({
|
|
132108
|
+
width: 4,
|
|
132109
|
+
color: placeholderColor,
|
|
132110
|
+
alpha: 0.8
|
|
132111
|
+
});
|
|
132112
|
+
placeholder.moveTo(centerScreen.screenX - iconSize / 2, centerScreen.screenY);
|
|
132113
|
+
placeholder.lineTo(centerScreen.screenX + iconSize / 2, centerScreen.screenY);
|
|
132114
|
+
placeholder.moveTo(centerScreen.screenX, centerScreen.screenY - iconSize / 2);
|
|
132115
|
+
placeholder.lineTo(centerScreen.screenX, centerScreen.screenY + iconSize / 2);
|
|
132116
|
+
placeholder.stroke();
|
|
132117
|
+
placeholder.eventMode = "static";
|
|
132118
|
+
placeholder.cursor = "pointer";
|
|
132119
|
+
placeholder.on("pointerenter", () => {
|
|
132120
|
+
placeholder.clear();
|
|
132121
|
+
placeholder.setStrokeStyle({
|
|
132122
|
+
width: 2,
|
|
132123
|
+
color: placeholderColor,
|
|
132124
|
+
alpha: 1
|
|
132125
|
+
});
|
|
132126
|
+
placeholder.setFillStyle({
|
|
132127
|
+
color: placeholderColor,
|
|
132128
|
+
alpha: 0.2
|
|
132129
|
+
// More visible on hover
|
|
132130
|
+
});
|
|
132131
|
+
placeholder.moveTo(topLeft.screenX, topLeft.screenY);
|
|
132132
|
+
placeholder.lineTo(topRight.screenX, topRight.screenY);
|
|
132133
|
+
placeholder.lineTo(bottomRight.screenX, bottomRight.screenY);
|
|
132134
|
+
placeholder.lineTo(bottomLeft.screenX, bottomLeft.screenY);
|
|
132135
|
+
placeholder.lineTo(topLeft.screenX, topLeft.screenY);
|
|
132136
|
+
placeholder.fill();
|
|
132137
|
+
placeholder.stroke();
|
|
132138
|
+
const iconSize2 = 40;
|
|
132139
|
+
placeholder.setStrokeStyle({
|
|
132140
|
+
width: 4,
|
|
132141
|
+
color: placeholderColor,
|
|
132142
|
+
alpha: 1
|
|
132143
|
+
});
|
|
132144
|
+
placeholder.moveTo(centerScreen.screenX - iconSize2 / 2, centerScreen.screenY);
|
|
132145
|
+
placeholder.lineTo(centerScreen.screenX + iconSize2 / 2, centerScreen.screenY);
|
|
132146
|
+
placeholder.moveTo(centerScreen.screenX, centerScreen.screenY - iconSize2 / 2);
|
|
132147
|
+
placeholder.lineTo(centerScreen.screenX, centerScreen.screenY + iconSize2 / 2);
|
|
132148
|
+
placeholder.stroke();
|
|
132149
|
+
});
|
|
132150
|
+
placeholder.on("pointerleave", () => {
|
|
132151
|
+
placeholder.clear();
|
|
132152
|
+
placeholder.setStrokeStyle({
|
|
132153
|
+
width: 2,
|
|
132154
|
+
color: placeholderColor,
|
|
132155
|
+
alpha: 0.6
|
|
132156
|
+
});
|
|
132157
|
+
placeholder.setFillStyle({
|
|
132158
|
+
color: placeholderColor,
|
|
132159
|
+
alpha: 0.1
|
|
132160
|
+
});
|
|
132161
|
+
placeholder.moveTo(topLeft.screenX, topLeft.screenY);
|
|
132162
|
+
placeholder.lineTo(topRight.screenX, topRight.screenY);
|
|
132163
|
+
placeholder.lineTo(bottomRight.screenX, bottomRight.screenY);
|
|
132164
|
+
placeholder.lineTo(bottomLeft.screenX, bottomLeft.screenY);
|
|
132165
|
+
placeholder.lineTo(topLeft.screenX, topLeft.screenY);
|
|
132166
|
+
placeholder.fill();
|
|
132167
|
+
placeholder.stroke();
|
|
132168
|
+
const iconSize2 = 40;
|
|
132169
|
+
placeholder.setStrokeStyle({
|
|
132170
|
+
width: 4,
|
|
132171
|
+
color: placeholderColor,
|
|
132172
|
+
alpha: 0.8
|
|
132173
|
+
});
|
|
132174
|
+
placeholder.moveTo(centerScreen.screenX - iconSize2 / 2, centerScreen.screenY);
|
|
132175
|
+
placeholder.lineTo(centerScreen.screenX + iconSize2 / 2, centerScreen.screenY);
|
|
132176
|
+
placeholder.moveTo(centerScreen.screenX, centerScreen.screenY - iconSize2 / 2);
|
|
132177
|
+
placeholder.lineTo(centerScreen.screenX, centerScreen.screenY + iconSize2 / 2);
|
|
132178
|
+
placeholder.stroke();
|
|
132179
|
+
});
|
|
132180
|
+
placeholder.on("pointerdown", () => {
|
|
132181
|
+
onAddRegion(pos);
|
|
132182
|
+
});
|
|
132183
|
+
placeholdersRef.current.addChild(placeholder);
|
|
132184
|
+
});
|
|
132185
|
+
};
|
|
132186
|
+
renderPlaceholdersRef.current = renderPlaceholders;
|
|
132187
|
+
renderPlaceholders();
|
|
131981
132188
|
const easeOutCubic2 = (t2) => {
|
|
131982
132189
|
return 1 - Math.pow(1 - t2, 3);
|
|
131983
132190
|
};
|
|
@@ -132071,6 +132278,12 @@ const OverworldMapPanelContent = ({
|
|
|
132071
132278
|
targetY
|
|
132072
132279
|
};
|
|
132073
132280
|
}, [currentRegionIndex, currentRegion, isRendering]);
|
|
132281
|
+
useEffect(() => {
|
|
132282
|
+
isEditingRegionsRef.current = isEditingRegions;
|
|
132283
|
+
if (renderPlaceholdersRef.current) {
|
|
132284
|
+
renderPlaceholdersRef.current();
|
|
132285
|
+
}
|
|
132286
|
+
}, [isEditingRegions]);
|
|
132074
132287
|
return /* @__PURE__ */ jsxs("div", { style: { position: "relative", width: "100%", height: "100%", overflow: "hidden" }, children: [
|
|
132075
132288
|
(isLoading || isRendering) && /* @__PURE__ */ jsx(
|
|
132076
132289
|
"div",
|
|
@@ -132156,7 +132369,8 @@ const OverworldMapPanelContent = ({
|
|
|
132156
132369
|
fontSize: 14,
|
|
132157
132370
|
borderRadius: 6,
|
|
132158
132371
|
border: "2px solid #fbbf24",
|
|
132159
|
-
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.3)"
|
|
132372
|
+
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.3)",
|
|
132373
|
+
pointerEvents: "auto"
|
|
132160
132374
|
},
|
|
132161
132375
|
children: [
|
|
132162
132376
|
/* @__PURE__ */ jsx(
|
|
@@ -132178,7 +132392,65 @@ const OverworldMapPanelContent = ({
|
|
|
132178
132392
|
}
|
|
132179
132393
|
),
|
|
132180
132394
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: "2px" }, children: [
|
|
132181
|
-
/* @__PURE__ */
|
|
132395
|
+
/* @__PURE__ */ jsxs("div", { style: { fontSize: 16, fontWeight: "bold", color: "#fbbf24", display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
132396
|
+
currentRegion.name,
|
|
132397
|
+
isEditingRegions && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
132398
|
+
/* @__PURE__ */ jsx(
|
|
132399
|
+
"button",
|
|
132400
|
+
{
|
|
132401
|
+
onClick: () => {
|
|
132402
|
+
const newName = prompt("Rename region:", currentRegion.name);
|
|
132403
|
+
if (newName && newName.trim() && newName !== currentRegion.name) {
|
|
132404
|
+
const matchingRegion = customRegions.find((r2) => r2.name === currentRegion.name);
|
|
132405
|
+
if (matchingRegion && onRenameRegion) {
|
|
132406
|
+
onRenameRegion(matchingRegion.id, newName.trim());
|
|
132407
|
+
}
|
|
132408
|
+
}
|
|
132409
|
+
},
|
|
132410
|
+
style: {
|
|
132411
|
+
background: "rgba(59, 130, 246, 0.2)",
|
|
132412
|
+
border: "1px solid #3b82f6",
|
|
132413
|
+
borderRadius: 3,
|
|
132414
|
+
padding: "2px 6px",
|
|
132415
|
+
cursor: "pointer",
|
|
132416
|
+
fontSize: 10,
|
|
132417
|
+
color: "#3b82f6",
|
|
132418
|
+
fontWeight: "normal"
|
|
132419
|
+
},
|
|
132420
|
+
title: "Rename region",
|
|
132421
|
+
children: "✏️"
|
|
132422
|
+
}
|
|
132423
|
+
),
|
|
132424
|
+
/* @__PURE__ */ jsx(
|
|
132425
|
+
"button",
|
|
132426
|
+
{
|
|
132427
|
+
onClick: () => {
|
|
132428
|
+
if (confirm(`Delete region "${currentRegion.name}"? Repositories will be unassigned.`)) {
|
|
132429
|
+
const matchingRegion = customRegions.find((r2) => r2.name === currentRegion.name);
|
|
132430
|
+
if (matchingRegion && onDeleteRegion) {
|
|
132431
|
+
onDeleteRegion(matchingRegion.id);
|
|
132432
|
+
if (currentRegionIndex > 0) {
|
|
132433
|
+
setCurrentRegionIndex((prev) => prev - 1);
|
|
132434
|
+
}
|
|
132435
|
+
}
|
|
132436
|
+
}
|
|
132437
|
+
},
|
|
132438
|
+
style: {
|
|
132439
|
+
background: "rgba(239, 68, 68, 0.2)",
|
|
132440
|
+
border: "1px solid #ef4444",
|
|
132441
|
+
borderRadius: 3,
|
|
132442
|
+
padding: "2px 6px",
|
|
132443
|
+
cursor: "pointer",
|
|
132444
|
+
fontSize: 10,
|
|
132445
|
+
color: "#ef4444",
|
|
132446
|
+
fontWeight: "normal"
|
|
132447
|
+
},
|
|
132448
|
+
title: "Delete region",
|
|
132449
|
+
children: "🗑️"
|
|
132450
|
+
}
|
|
132451
|
+
)
|
|
132452
|
+
] })
|
|
132453
|
+
] }),
|
|
132182
132454
|
/* @__PURE__ */ jsxs("div", { style: { fontSize: 10, color: "#94a3b8" }, children: [
|
|
132183
132455
|
"Region ",
|
|
132184
132456
|
currentRegionIndex + 1,
|
|
@@ -132225,7 +132497,7 @@ const OverworldMapPanelContent = ({
|
|
|
132225
132497
|
borderRadius: 4,
|
|
132226
132498
|
pointerEvents: "none"
|
|
132227
132499
|
},
|
|
132228
|
-
children: /* @__PURE__ */ jsx("div", { children: "Click on packages to view details" })
|
|
132500
|
+
children: isEditingRegions ? /* @__PURE__ */ jsx("div", { children: "Click green placeholders to add new regions" }) : /* @__PURE__ */ jsx("div", { children: "Click on packages to view details" })
|
|
132229
132501
|
}
|
|
132230
132502
|
)
|
|
132231
132503
|
] });
|
|
@@ -132235,7 +132507,13 @@ const GitProjectsMapPanelContent = ({
|
|
|
132235
132507
|
regionLayout,
|
|
132236
132508
|
width,
|
|
132237
132509
|
height,
|
|
132238
|
-
isLoading = false
|
|
132510
|
+
isLoading = false,
|
|
132511
|
+
onProjectMoved,
|
|
132512
|
+
isEditingRegions = false,
|
|
132513
|
+
customRegions = [],
|
|
132514
|
+
onAddRegion,
|
|
132515
|
+
onRenameRegion,
|
|
132516
|
+
onDeleteRegion
|
|
132239
132517
|
}) => {
|
|
132240
132518
|
const packages = useMemo(() => {
|
|
132241
132519
|
return projects.map((project) => ({
|
|
@@ -132279,7 +132557,13 @@ const GitProjectsMapPanelContent = ({
|
|
|
132279
132557
|
height,
|
|
132280
132558
|
isLoading,
|
|
132281
132559
|
includeDevDependencies: false,
|
|
132282
|
-
includePeerDependencies: false
|
|
132560
|
+
includePeerDependencies: false,
|
|
132561
|
+
onProjectMoved,
|
|
132562
|
+
isEditingRegions,
|
|
132563
|
+
customRegions,
|
|
132564
|
+
onAddRegion,
|
|
132565
|
+
onRenameRegion,
|
|
132566
|
+
onDeleteRegion
|
|
132283
132567
|
}
|
|
132284
132568
|
);
|
|
132285
132569
|
};
|
|
@@ -132345,6 +132629,49 @@ function calculateAgingMetrics(lastEditedAt) {
|
|
|
132345
132629
|
// Store for region grouping
|
|
132346
132630
|
};
|
|
132347
132631
|
}
|
|
132632
|
+
function generateRegionId() {
|
|
132633
|
+
return `region-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
132634
|
+
}
|
|
132635
|
+
function createDefaultRegion(name2 = "Main") {
|
|
132636
|
+
return {
|
|
132637
|
+
id: generateRegionId(),
|
|
132638
|
+
name: name2,
|
|
132639
|
+
order: 0,
|
|
132640
|
+
createdAt: Date.now()
|
|
132641
|
+
};
|
|
132642
|
+
}
|
|
132643
|
+
function createDefaultAgeRegions() {
|
|
132644
|
+
return [
|
|
132645
|
+
{
|
|
132646
|
+
id: generateRegionId(),
|
|
132647
|
+
name: "Last Month",
|
|
132648
|
+
description: "Repositories edited in the last 30 days",
|
|
132649
|
+
order: 0,
|
|
132650
|
+
createdAt: Date.now()
|
|
132651
|
+
},
|
|
132652
|
+
{
|
|
132653
|
+
id: generateRegionId(),
|
|
132654
|
+
name: "Last 3 Months",
|
|
132655
|
+
description: "Repositories edited in the last 90 days",
|
|
132656
|
+
order: 1,
|
|
132657
|
+
createdAt: Date.now()
|
|
132658
|
+
},
|
|
132659
|
+
{
|
|
132660
|
+
id: generateRegionId(),
|
|
132661
|
+
name: "Last Year",
|
|
132662
|
+
description: "Repositories edited in the last 365 days",
|
|
132663
|
+
order: 2,
|
|
132664
|
+
createdAt: Date.now()
|
|
132665
|
+
},
|
|
132666
|
+
{
|
|
132667
|
+
id: generateRegionId(),
|
|
132668
|
+
name: "Older",
|
|
132669
|
+
description: "Repositories not edited in over a year",
|
|
132670
|
+
order: 3,
|
|
132671
|
+
createdAt: Date.now()
|
|
132672
|
+
}
|
|
132673
|
+
];
|
|
132674
|
+
}
|
|
132348
132675
|
const CollectionMapPanelContent = ({
|
|
132349
132676
|
collection,
|
|
132350
132677
|
memberships,
|
|
@@ -132355,9 +132682,44 @@ const CollectionMapPanelContent = ({
|
|
|
132355
132682
|
height,
|
|
132356
132683
|
isLoading = false,
|
|
132357
132684
|
onProjectMoved,
|
|
132358
|
-
onProjectAdded
|
|
132685
|
+
onProjectAdded,
|
|
132686
|
+
regionCallbacks
|
|
132359
132687
|
}) => {
|
|
132360
|
-
|
|
132688
|
+
var _a, _b;
|
|
132689
|
+
const layoutMode = ((_a = collection.metadata) == null ? void 0 : _a.layoutMode) || "auto";
|
|
132690
|
+
const customRegions = ((_b = collection.metadata) == null ? void 0 : _b.customRegions) || [];
|
|
132691
|
+
const [isEditingRegions, setIsEditingRegions] = React2__default.useState(false);
|
|
132692
|
+
React2__default.useEffect(() => {
|
|
132693
|
+
if (customRegions.length === 0 && (regionCallbacks == null ? void 0 : regionCallbacks.onInitializeDefaultRegions)) {
|
|
132694
|
+
const defaultRegions = createDefaultAgeRegions();
|
|
132695
|
+
regionCallbacks.onInitializeDefaultRegions(collection.id, defaultRegions);
|
|
132696
|
+
}
|
|
132697
|
+
}, [collection.id, customRegions.length, regionCallbacks]);
|
|
132698
|
+
const switchToManualMode = useCallback(async () => {
|
|
132699
|
+
if (layoutMode === "auto" && (regionCallbacks == null ? void 0 : regionCallbacks.onSwitchLayoutMode)) {
|
|
132700
|
+
await regionCallbacks.onSwitchLayoutMode(collection.id, "manual");
|
|
132701
|
+
}
|
|
132702
|
+
}, [layoutMode, collection.id, regionCallbacks]);
|
|
132703
|
+
const handleRenameRegion = useCallback(async (regionId, name2) => {
|
|
132704
|
+
if (!(regionCallbacks == null ? void 0 : regionCallbacks.onRegionUpdated)) {
|
|
132705
|
+
console.warn("No onRegionUpdated callback provided");
|
|
132706
|
+
return;
|
|
132707
|
+
}
|
|
132708
|
+
await switchToManualMode();
|
|
132709
|
+
await regionCallbacks.onRegionUpdated(collection.id, regionId, { name: name2 });
|
|
132710
|
+
console.log("Renamed region:", regionId, name2);
|
|
132711
|
+
}, [regionCallbacks, collection.id, switchToManualMode]);
|
|
132712
|
+
const handleDeleteRegion = useCallback(async (regionId) => {
|
|
132713
|
+
if (!(regionCallbacks == null ? void 0 : regionCallbacks.onRegionDeleted)) {
|
|
132714
|
+
console.warn("No onRegionDeleted callback provided");
|
|
132715
|
+
return;
|
|
132716
|
+
}
|
|
132717
|
+
await switchToManualMode();
|
|
132718
|
+
await regionCallbacks.onRegionDeleted(collection.id, regionId);
|
|
132719
|
+
console.log("Deleted region:", regionId);
|
|
132720
|
+
}, [regionCallbacks, collection.id, switchToManualMode]);
|
|
132721
|
+
const handleProjectDrop = useCallback(async (data, event) => {
|
|
132722
|
+
var _a2;
|
|
132361
132723
|
if (!onProjectAdded) {
|
|
132362
132724
|
console.warn("No onProjectAdded callback provided - cannot add project to collection");
|
|
132363
132725
|
return;
|
|
@@ -132368,10 +132730,32 @@ const CollectionMapPanelContent = ({
|
|
|
132368
132730
|
path: repositoryPath,
|
|
132369
132731
|
metadata: repositoryMetadata,
|
|
132370
132732
|
collectionId: collection.id,
|
|
132371
|
-
sourcePanel: data.sourcePanel
|
|
132733
|
+
sourcePanel: data.sourcePanel,
|
|
132734
|
+
layoutMode
|
|
132372
132735
|
});
|
|
132373
|
-
|
|
132374
|
-
|
|
132736
|
+
if (layoutMode === "manual") {
|
|
132737
|
+
let targetRegionId;
|
|
132738
|
+
if (customRegions.length === 0 && (regionCallbacks == null ? void 0 : regionCallbacks.onRegionCreated)) {
|
|
132739
|
+
console.log("No regions exist - creating default region");
|
|
132740
|
+
const defaultRegion = await regionCallbacks.onRegionCreated(collection.id, {
|
|
132741
|
+
name: "Main",
|
|
132742
|
+
order: 0
|
|
132743
|
+
});
|
|
132744
|
+
targetRegionId = defaultRegion.id;
|
|
132745
|
+
} else {
|
|
132746
|
+
targetRegionId = (_a2 = customRegions[0]) == null ? void 0 : _a2.id;
|
|
132747
|
+
}
|
|
132748
|
+
if (targetRegionId && (regionCallbacks == null ? void 0 : regionCallbacks.onRepositoryAssigned)) {
|
|
132749
|
+
onProjectAdded(repositoryPath, repositoryMetadata);
|
|
132750
|
+
await regionCallbacks.onRepositoryAssigned(collection.id, repositoryPath, targetRegionId);
|
|
132751
|
+
} else {
|
|
132752
|
+
console.warn("No region available to assign repository to");
|
|
132753
|
+
onProjectAdded(repositoryPath, repositoryMetadata);
|
|
132754
|
+
}
|
|
132755
|
+
} else {
|
|
132756
|
+
onProjectAdded(repositoryPath, repositoryMetadata);
|
|
132757
|
+
}
|
|
132758
|
+
}, [collection.id, onProjectAdded, layoutMode, customRegions, regionCallbacks]);
|
|
132375
132759
|
const { isDragOver, ...dropZoneProps } = useDropZone({
|
|
132376
132760
|
handlers: [
|
|
132377
132761
|
{
|
|
@@ -132386,10 +132770,10 @@ const CollectionMapPanelContent = ({
|
|
|
132386
132770
|
(m2) => m2.collectionId === collection.id
|
|
132387
132771
|
);
|
|
132388
132772
|
return collectionMemberships.map((membership) => {
|
|
132389
|
-
var
|
|
132773
|
+
var _a2, _b2, _c, _d, _e2;
|
|
132390
132774
|
const repo = repositories.find((r2) => {
|
|
132391
|
-
var
|
|
132392
|
-
const repoId = ((
|
|
132775
|
+
var _a3;
|
|
132776
|
+
const repoId = ((_a3 = r2.github) == null ? void 0 : _a3.id) || r2.name;
|
|
132393
132777
|
return repoId === membership.repositoryId;
|
|
132394
132778
|
});
|
|
132395
132779
|
if (!repo) {
|
|
@@ -132403,7 +132787,7 @@ const CollectionMapPanelContent = ({
|
|
|
132403
132787
|
}
|
|
132404
132788
|
let language2;
|
|
132405
132789
|
if (repo.github) {
|
|
132406
|
-
language2 = ((
|
|
132790
|
+
language2 = ((_a2 = repo.github) == null ? void 0 : _a2.language) || ((_b2 = repo.github) == null ? void 0 : _b2.primaryLanguage);
|
|
132407
132791
|
}
|
|
132408
132792
|
const importance = ((_c = membership.metadata) == null ? void 0 : _c.pinned) ? 95 : 75;
|
|
132409
132793
|
const size = calculateRepositorySize(repo.metrics);
|
|
@@ -132460,16 +132844,65 @@ const CollectionMapPanelContent = ({
|
|
|
132460
132844
|
children: [
|
|
132461
132845
|
collection.icon && /* @__PURE__ */ jsx("span", { style: { marginRight: 8 }, children: collection.icon }),
|
|
132462
132846
|
collection.name,
|
|
132463
|
-
isDragOver && /* @__PURE__ */ jsx("span", { style: { marginLeft: 8 }, children: "+ Drop to add" })
|
|
132847
|
+
isDragOver && /* @__PURE__ */ jsx("span", { style: { marginLeft: 8 }, children: "+ Drop to add" }),
|
|
132848
|
+
layoutMode === "manual" && /* @__PURE__ */ jsxs("span", { style: { marginLeft: 8, fontSize: 12, opacity: 0.8 }, children: [
|
|
132849
|
+
"(",
|
|
132850
|
+
customRegions.length,
|
|
132851
|
+
" region",
|
|
132852
|
+
customRegions.length !== 1 ? "s" : "",
|
|
132853
|
+
")"
|
|
132854
|
+
] })
|
|
132464
132855
|
]
|
|
132465
132856
|
}
|
|
132466
132857
|
),
|
|
132858
|
+
/* @__PURE__ */ jsx(
|
|
132859
|
+
"button",
|
|
132860
|
+
{
|
|
132861
|
+
onClick: () => setIsEditingRegions(!isEditingRegions),
|
|
132862
|
+
style: {
|
|
132863
|
+
position: "absolute",
|
|
132864
|
+
top: 8,
|
|
132865
|
+
right: 8,
|
|
132866
|
+
zIndex: 100,
|
|
132867
|
+
backgroundColor: isEditingRegions ? "rgba(251, 191, 36, 0.9)" : "rgba(0, 0, 0, 0.7)",
|
|
132868
|
+
border: isEditingRegions ? "2px solid #fbbf24" : "2px solid #4b5563",
|
|
132869
|
+
padding: "8px 16px",
|
|
132870
|
+
borderRadius: 8,
|
|
132871
|
+
color: "white",
|
|
132872
|
+
fontFamily: "monospace",
|
|
132873
|
+
fontSize: 14,
|
|
132874
|
+
fontWeight: "bold",
|
|
132875
|
+
cursor: "pointer",
|
|
132876
|
+
transition: "all 0.2s ease",
|
|
132877
|
+
pointerEvents: "auto"
|
|
132878
|
+
},
|
|
132879
|
+
onMouseEnter: (e2) => {
|
|
132880
|
+
e2.currentTarget.style.backgroundColor = isEditingRegions ? "rgba(251, 191, 36, 1)" : "rgba(75, 85, 99, 0.9)";
|
|
132881
|
+
},
|
|
132882
|
+
onMouseLeave: (e2) => {
|
|
132883
|
+
e2.currentTarget.style.backgroundColor = isEditingRegions ? "rgba(251, 191, 36, 0.9)" : "rgba(0, 0, 0, 0.7)";
|
|
132884
|
+
},
|
|
132885
|
+
children: isEditingRegions ? "✓ Done Editing" : "⚙️ Edit Regions"
|
|
132886
|
+
}
|
|
132887
|
+
),
|
|
132467
132888
|
/* @__PURE__ */ jsx(
|
|
132468
132889
|
GitProjectsMapPanelContent,
|
|
132469
132890
|
{
|
|
132470
132891
|
projects,
|
|
132471
132892
|
regionLayout,
|
|
132472
|
-
isLoading
|
|
132893
|
+
isLoading,
|
|
132894
|
+
isEditingRegions,
|
|
132895
|
+
customRegions,
|
|
132896
|
+
onAddRegion: async (position2) => {
|
|
132897
|
+
await switchToManualMode();
|
|
132898
|
+
const order2 = position2.row * 10 + position2.col;
|
|
132899
|
+
const name2 = `Region ${customRegions.length + 1}`;
|
|
132900
|
+
if (regionCallbacks == null ? void 0 : regionCallbacks.onRegionCreated) {
|
|
132901
|
+
await regionCallbacks.onRegionCreated(collection.id, { name: name2, order: order2 });
|
|
132902
|
+
}
|
|
132903
|
+
},
|
|
132904
|
+
onRenameRegion: handleRenameRegion,
|
|
132905
|
+
onDeleteRegion: handleDeleteRegion
|
|
132473
132906
|
}
|
|
132474
132907
|
)
|
|
132475
132908
|
]
|
|
@@ -132494,6 +132927,56 @@ const CollectionMapPanel = ({ context: context2, actions }) => {
|
|
|
132494
132927
|
console.warn("Actions does not support addRepositoryToCollection - drag-drop feature requires context integration");
|
|
132495
132928
|
}
|
|
132496
132929
|
}, [actions, selectedCollectionId]);
|
|
132930
|
+
const regionCallbacks = useMemo(() => ({
|
|
132931
|
+
onInitializeDefaultRegions: async (collectionId, regions) => {
|
|
132932
|
+
console.log("Initializing default age regions:", { collectionId, regions });
|
|
132933
|
+
if (actions == null ? void 0 : actions.initializeDefaultRegions) {
|
|
132934
|
+
await actions.initializeDefaultRegions(collectionId, regions);
|
|
132935
|
+
} else {
|
|
132936
|
+
console.warn("Actions does not support initializeDefaultRegions - region management requires context integration");
|
|
132937
|
+
}
|
|
132938
|
+
},
|
|
132939
|
+
onSwitchLayoutMode: async (collectionId, mode) => {
|
|
132940
|
+
console.log("Switching layout mode:", { collectionId, mode });
|
|
132941
|
+
if (actions == null ? void 0 : actions.switchLayoutMode) {
|
|
132942
|
+
await actions.switchLayoutMode(collectionId, mode);
|
|
132943
|
+
} else {
|
|
132944
|
+
console.warn("Actions does not support switchLayoutMode - region management requires context integration");
|
|
132945
|
+
}
|
|
132946
|
+
},
|
|
132947
|
+
onRegionCreated: async (collectionId, region) => {
|
|
132948
|
+
console.log("Region created:", { collectionId, region });
|
|
132949
|
+
const newRegion = {
|
|
132950
|
+
...region,
|
|
132951
|
+
id: generateRegionId(),
|
|
132952
|
+
createdAt: Date.now()
|
|
132953
|
+
};
|
|
132954
|
+
if (actions == null ? void 0 : actions.createRegion) {
|
|
132955
|
+
await actions.createRegion(collectionId, newRegion);
|
|
132956
|
+
} else {
|
|
132957
|
+
console.warn("Actions does not support createRegion - region management requires context integration");
|
|
132958
|
+
}
|
|
132959
|
+
return newRegion;
|
|
132960
|
+
},
|
|
132961
|
+
onRegionUpdated: async (collectionId, regionId, updates) => {
|
|
132962
|
+
console.log("Region updated:", { collectionId, regionId, updates });
|
|
132963
|
+
if (actions == null ? void 0 : actions.updateRegion) {
|
|
132964
|
+
await actions.updateRegion(collectionId, regionId, updates);
|
|
132965
|
+
}
|
|
132966
|
+
},
|
|
132967
|
+
onRegionDeleted: async (collectionId, regionId) => {
|
|
132968
|
+
console.log("Region deleted:", { collectionId, regionId });
|
|
132969
|
+
if (actions == null ? void 0 : actions.deleteRegion) {
|
|
132970
|
+
await actions.deleteRegion(collectionId, regionId);
|
|
132971
|
+
}
|
|
132972
|
+
},
|
|
132973
|
+
onRepositoryAssigned: async (collectionId, repositoryId, regionId) => {
|
|
132974
|
+
console.log("Repository assigned to region:", { collectionId, repositoryId, regionId });
|
|
132975
|
+
if (actions == null ? void 0 : actions.assignRepositoryToRegion) {
|
|
132976
|
+
await actions.assignRepositoryToRegion(collectionId, repositoryId, regionId);
|
|
132977
|
+
}
|
|
132978
|
+
}
|
|
132979
|
+
}), [actions]);
|
|
132497
132980
|
if (!selectedCollection) {
|
|
132498
132981
|
return /* @__PURE__ */ jsxs(
|
|
132499
132982
|
"div",
|
|
@@ -132528,7 +133011,8 @@ const CollectionMapPanel = ({ context: context2, actions }) => {
|
|
|
132528
133011
|
repositories,
|
|
132529
133012
|
dependencies,
|
|
132530
133013
|
isLoading,
|
|
132531
|
-
onProjectAdded: handleProjectAdded
|
|
133014
|
+
onProjectAdded: handleProjectAdded,
|
|
133015
|
+
regionCallbacks
|
|
132532
133016
|
}
|
|
132533
133017
|
) });
|
|
132534
133018
|
};
|
|
@@ -133518,6 +134002,8 @@ export {
|
|
|
133518
134002
|
GitProjectsMapPanelContent as aU,
|
|
133519
134003
|
CollectionMapPanel as aV,
|
|
133520
134004
|
CollectionMapPanelContent as aW,
|
|
134005
|
+
createDefaultRegion as aX,
|
|
134006
|
+
createDefaultAgeRegions as aY,
|
|
133521
134007
|
Rectangle as aa,
|
|
133522
134008
|
getLocalBounds as ab,
|
|
133523
134009
|
color32BitToUniform as ac,
|
|
@@ -133570,4 +134056,4 @@ export {
|
|
|
133570
134056
|
UPDATE_PRIORITY as y,
|
|
133571
134057
|
removeItems as z
|
|
133572
134058
|
};
|
|
133573
|
-
//# sourceMappingURL=index-
|
|
134059
|
+
//# sourceMappingURL=index-C_imh7Vn.js.map
|