@industry-theme/repository-composition-panels 0.6.13 → 0.6.14
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-i7tMqQmj.js → BufferResource-CrgUyw7_.js} +2 -2
- package/dist/{BufferResource-i7tMqQmj.js.map → BufferResource-CrgUyw7_.js.map} +1 -1
- package/dist/{CanvasRenderer-DnPcUXMo.js → CanvasRenderer-DLdkHlL4.js} +3 -3
- package/dist/{CanvasRenderer-DnPcUXMo.js.map → CanvasRenderer-DLdkHlL4.js.map} +1 -1
- package/dist/{Filter-CxIayjfy.js → Filter-jQTTJwb_.js} +2 -2
- package/dist/{Filter-CxIayjfy.js.map → Filter-jQTTJwb_.js.map} +1 -1
- package/dist/{RenderTargetSystem-Dx92416G.js → RenderTargetSystem-BI6sIv_Y.js} +3 -3
- package/dist/{RenderTargetSystem-Dx92416G.js.map → RenderTargetSystem-BI6sIv_Y.js.map} +1 -1
- package/dist/{WebGLRenderer-DW3r21B_.js → WebGLRenderer-0i8_RMNF.js} +4 -4
- package/dist/{WebGLRenderer-DW3r21B_.js.map → WebGLRenderer-0i8_RMNF.js.map} +1 -1
- package/dist/{WebGPURenderer-Cd7zwQIV.js → WebGPURenderer-DY5uJ8HH.js} +4 -4
- package/dist/{WebGPURenderer-Cd7zwQIV.js.map → WebGPURenderer-DY5uJ8HH.js.map} +1 -1
- package/dist/{browserAll-v89RKEz2.js → browserAll-CjpUV6Zh.js} +3 -3
- package/dist/{browserAll-v89RKEz2.js.map → browserAll-CjpUV6Zh.js.map} +1 -1
- package/dist/{index-BWinsP45.js → index-DtyaVT4V.js} +2070 -968
- package/dist/{index-BWinsP45.js.map → index-DtyaVT4V.js.map} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/{init-B2YVg9nT.js → init-QEF9WcqC.js} +3 -3
- package/dist/{init-B2YVg9nT.js.map → init-QEF9WcqC.js.map} +1 -1
- package/dist/panels/CollectionMapPanel.d.ts +6 -3
- package/dist/panels/CollectionMapPanel.d.ts.map +1 -1
- package/dist/panels/TelemetryCoveragePanel.d.ts.map +1 -1
- package/dist/panels/overworld-map/BuildingSizeTest.d.ts.map +1 -1
- package/dist/panels/overworld-map/IsometricGridTest.d.ts.map +1 -1
- package/dist/panels/overworld-map/LayoutEngineTest.d.ts.map +1 -1
- package/dist/panels/overworld-map/OverworldMapPanel.d.ts +2 -1
- package/dist/panels/overworld-map/OverworldMapPanel.d.ts.map +1 -1
- package/dist/panels/overworld-map/PackageExpansionTest.d.ts +25 -0
- package/dist/panels/overworld-map/PackageExpansionTest.d.ts.map +1 -0
- package/dist/panels/overworld-map/RegionEditingTest.d.ts.map +1 -1
- package/dist/panels/overworld-map/collaboratorDecoration.d.ts +30 -0
- package/dist/panels/overworld-map/collaboratorDecoration.d.ts.map +1 -0
- package/dist/panels/overworld-map/components/IsometricRenderer.d.ts +4 -0
- package/dist/panels/overworld-map/components/IsometricRenderer.d.ts.map +1 -1
- package/dist/panels/overworld-map/components/buildingSpriteGenerator.d.ts +2 -0
- package/dist/panels/overworld-map/components/buildingSpriteGenerator.d.ts.map +1 -1
- package/dist/panels/overworld-map/components/collaboratorDecorationSprites.d.ts +25 -0
- package/dist/panels/overworld-map/components/collaboratorDecorationSprites.d.ts.map +1 -0
- package/dist/panels/overworld-map/components/starDecorationSprites.d.ts +18 -0
- package/dist/panels/overworld-map/components/starDecorationSprites.d.ts.map +1 -0
- package/dist/panels/overworld-map/genericMapper.d.ts +10 -1
- package/dist/panels/overworld-map/genericMapper.d.ts.map +1 -1
- package/dist/panels/overworld-map/packageExpansion.d.ts +15 -0
- package/dist/panels/overworld-map/packageExpansion.d.ts.map +1 -0
- package/dist/panels/overworld-map/starDecoration.d.ts +29 -0
- package/dist/panels/overworld-map/starDecoration.d.ts.map +1 -0
- package/dist/panels/overworld-map/types.d.ts +8 -0
- package/dist/panels/overworld-map/types.d.ts.map +1 -1
- package/dist/panels.bundle.js +1 -1
- package/dist/webworkerAll-Blmn9DEN.js +3 -0
- package/dist/webworkerAll-Blmn9DEN.js.map +1 -0
- package/package.json +22 -10
- package/dist/webworkerAll-BMsTq_fc.js +0 -3
- package/dist/webworkerAll-BMsTq_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
|
}
|
|
@@ -12604,6 +12619,366 @@ function NodeResizer({ nodeId, isVisible = true, handleClassName, handleStyle, l
|
|
|
12604
12619
|
}
|
|
12605
12620
|
return jsxs(Fragment, { children: [XY_RESIZER_LINE_POSITIONS.map((position2) => jsx(NodeResizeControl, { className: lineClassName, style: lineStyle, nodeId, position: position2, variant: ResizeControlVariant.Line, color: color2, minWidth, minHeight, maxWidth, maxHeight, onResizeStart, keepAspectRatio, shouldResize, onResize, onResizeEnd }, position2)), XY_RESIZER_HANDLE_POSITIONS.map((position2) => jsx(NodeResizeControl, { className: handleClassName, style: handleStyle, nodeId, position: position2, color: color2, minWidth, minHeight, maxWidth, maxHeight, onResizeStart, keepAspectRatio, shouldResize, onResize, onResizeEnd }, position2))] });
|
|
12606
12621
|
}
|
|
12622
|
+
const CANVAS_COLOR_PRESETS = {
|
|
12623
|
+
1: "#ef4444",
|
|
12624
|
+
2: "#f97316",
|
|
12625
|
+
3: "#eab308",
|
|
12626
|
+
4: "#22c55e",
|
|
12627
|
+
5: "#06b6d4",
|
|
12628
|
+
6: "#8b5cf6"
|
|
12629
|
+
// purple
|
|
12630
|
+
};
|
|
12631
|
+
function resolveCanvasColor(color2) {
|
|
12632
|
+
if (color2 === void 0)
|
|
12633
|
+
return void 0;
|
|
12634
|
+
if (typeof color2 === "number") {
|
|
12635
|
+
return CANVAS_COLOR_PRESETS[color2];
|
|
12636
|
+
}
|
|
12637
|
+
const numericValue = parseInt(color2, 10);
|
|
12638
|
+
if (!isNaN(numericValue) && numericValue >= 1 && numericValue <= 6) {
|
|
12639
|
+
return CANVAS_COLOR_PRESETS[numericValue];
|
|
12640
|
+
}
|
|
12641
|
+
return color2;
|
|
12642
|
+
}
|
|
12643
|
+
function sideToHandle(side) {
|
|
12644
|
+
if (!side)
|
|
12645
|
+
return void 0;
|
|
12646
|
+
return side;
|
|
12647
|
+
}
|
|
12648
|
+
function styleToStrokeDasharray(style2) {
|
|
12649
|
+
switch (style2) {
|
|
12650
|
+
case "dashed":
|
|
12651
|
+
return "5,5";
|
|
12652
|
+
case "dotted":
|
|
12653
|
+
return "2,2";
|
|
12654
|
+
default:
|
|
12655
|
+
return void 0;
|
|
12656
|
+
}
|
|
12657
|
+
}
|
|
12658
|
+
class CanvasConverter {
|
|
12659
|
+
/**
|
|
12660
|
+
* Convert Extended Canvas to React Flow nodes and edges
|
|
12661
|
+
*/
|
|
12662
|
+
static canvasToReactFlow(canvas) {
|
|
12663
|
+
const nodes = [];
|
|
12664
|
+
const edges = [];
|
|
12665
|
+
if (canvas.nodes) {
|
|
12666
|
+
for (const node2 of canvas.nodes) {
|
|
12667
|
+
nodes.push(this.convertNode(node2, canvas));
|
|
12668
|
+
}
|
|
12669
|
+
}
|
|
12670
|
+
if (canvas.edges) {
|
|
12671
|
+
for (const edge of canvas.edges) {
|
|
12672
|
+
edges.push(this.convertEdge(edge, canvas));
|
|
12673
|
+
}
|
|
12674
|
+
}
|
|
12675
|
+
return { nodes, edges };
|
|
12676
|
+
}
|
|
12677
|
+
/**
|
|
12678
|
+
* Convert a single canvas node to React Flow node
|
|
12679
|
+
*/
|
|
12680
|
+
static convertNode(node2, _canvas) {
|
|
12681
|
+
var _a, _b, _c, _d;
|
|
12682
|
+
const pv = node2.pv;
|
|
12683
|
+
const color2 = resolveCanvasColor(node2.color);
|
|
12684
|
+
let nodeName;
|
|
12685
|
+
switch (node2.type) {
|
|
12686
|
+
case "text":
|
|
12687
|
+
nodeName = ((_a = node2.text) == null ? void 0 : _a.split("\n")[0].replace(/^#+ /, "").substring(0, 50)) || "Text";
|
|
12688
|
+
break;
|
|
12689
|
+
case "file":
|
|
12690
|
+
nodeName = ((_b = node2.file) == null ? void 0 : _b.split("/").pop()) || node2.file || "File";
|
|
12691
|
+
break;
|
|
12692
|
+
case "link":
|
|
12693
|
+
nodeName = node2.url || "Link";
|
|
12694
|
+
break;
|
|
12695
|
+
case "group":
|
|
12696
|
+
nodeName = node2.label || "Group";
|
|
12697
|
+
break;
|
|
12698
|
+
}
|
|
12699
|
+
const data = {
|
|
12700
|
+
name: nodeName,
|
|
12701
|
+
nodeType: (pv == null ? void 0 : pv.nodeType) || node2.id,
|
|
12702
|
+
canvasType: node2.type,
|
|
12703
|
+
shape: (pv == null ? void 0 : pv.shape) || "rectangle",
|
|
12704
|
+
icon: pv == null ? void 0 : pv.icon,
|
|
12705
|
+
color: ((_d = (_c = pv == null ? void 0 : pv.states) == null ? void 0 : _c.idle) == null ? void 0 : _d.color) || color2,
|
|
12706
|
+
width: node2.width,
|
|
12707
|
+
height: node2.height
|
|
12708
|
+
};
|
|
12709
|
+
if (node2.type === "text") {
|
|
12710
|
+
data.text = node2.text;
|
|
12711
|
+
} else if (node2.type === "file") {
|
|
12712
|
+
data.file = node2.file;
|
|
12713
|
+
} else if (node2.type === "link") {
|
|
12714
|
+
data.url = node2.url;
|
|
12715
|
+
}
|
|
12716
|
+
if (pv) {
|
|
12717
|
+
if (pv.states)
|
|
12718
|
+
data.states = pv.states;
|
|
12719
|
+
if (pv.sources)
|
|
12720
|
+
data.sources = pv.sources;
|
|
12721
|
+
if (pv.status)
|
|
12722
|
+
data.status = pv.status;
|
|
12723
|
+
if (pv.dataSchema)
|
|
12724
|
+
data.dataSchema = pv.dataSchema;
|
|
12725
|
+
if (pv.event)
|
|
12726
|
+
data.event = pv.event;
|
|
12727
|
+
if (pv.eventRef)
|
|
12728
|
+
data.eventRef = pv.eventRef;
|
|
12729
|
+
}
|
|
12730
|
+
return {
|
|
12731
|
+
id: node2.id,
|
|
12732
|
+
type: (pv == null ? void 0 : pv.shape) || "default",
|
|
12733
|
+
position: { x: node2.x, y: node2.y },
|
|
12734
|
+
data,
|
|
12735
|
+
style: {
|
|
12736
|
+
width: node2.width,
|
|
12737
|
+
height: node2.height
|
|
12738
|
+
}
|
|
12739
|
+
};
|
|
12740
|
+
}
|
|
12741
|
+
/**
|
|
12742
|
+
* Convert a single canvas edge to React Flow edge
|
|
12743
|
+
*/
|
|
12744
|
+
static convertEdge(edge, canvas) {
|
|
12745
|
+
var _a, _b;
|
|
12746
|
+
const pv = edge.pv;
|
|
12747
|
+
const edgeTypeDef = (pv == null ? void 0 : pv.edgeType) ? (_b = (_a = canvas.pv) == null ? void 0 : _a.edgeTypes) == null ? void 0 : _b[pv.edgeType] : void 0;
|
|
12748
|
+
const color2 = resolveCanvasColor(edge.color) || (edgeTypeDef == null ? void 0 : edgeTypeDef.color);
|
|
12749
|
+
const rfEdge = {
|
|
12750
|
+
id: edge.id,
|
|
12751
|
+
source: edge.fromNode,
|
|
12752
|
+
target: edge.toNode,
|
|
12753
|
+
sourceHandle: sideToHandle(edge.fromSide),
|
|
12754
|
+
targetHandle: sideToHandle(edge.toSide),
|
|
12755
|
+
label: edge.label,
|
|
12756
|
+
data: {
|
|
12757
|
+
edgeType: (pv == null ? void 0 : pv.edgeType) || "default",
|
|
12758
|
+
style: (pv == null ? void 0 : pv.style) || (edgeTypeDef == null ? void 0 : edgeTypeDef.style) || "solid",
|
|
12759
|
+
color: color2,
|
|
12760
|
+
width: (pv == null ? void 0 : pv.width) || (edgeTypeDef == null ? void 0 : edgeTypeDef.width) || 2,
|
|
12761
|
+
animation: (pv == null ? void 0 : pv.animation) || (edgeTypeDef == null ? void 0 : edgeTypeDef.animation)
|
|
12762
|
+
// activatedBy removed - legacy path-based
|
|
12763
|
+
},
|
|
12764
|
+
style: {
|
|
12765
|
+
stroke: color2,
|
|
12766
|
+
strokeWidth: (pv == null ? void 0 : pv.width) || (edgeTypeDef == null ? void 0 : edgeTypeDef.width) || 2,
|
|
12767
|
+
strokeDasharray: styleToStrokeDasharray((pv == null ? void 0 : pv.style) || (edgeTypeDef == null ? void 0 : edgeTypeDef.style))
|
|
12768
|
+
},
|
|
12769
|
+
animated: (pv == null ? void 0 : pv.style) === "animated" || (edgeTypeDef == null ? void 0 : edgeTypeDef.style) === "animated"
|
|
12770
|
+
};
|
|
12771
|
+
if (edge.toEnd !== "none") {
|
|
12772
|
+
rfEdge.markerEnd = {
|
|
12773
|
+
type: "arrowclosed",
|
|
12774
|
+
color: color2
|
|
12775
|
+
};
|
|
12776
|
+
}
|
|
12777
|
+
return rfEdge;
|
|
12778
|
+
}
|
|
12779
|
+
/**
|
|
12780
|
+
* Convert Extended Canvas to internal NodeState/EdgeState format
|
|
12781
|
+
*/
|
|
12782
|
+
static canvasToGraph(canvas) {
|
|
12783
|
+
var _a, _b, _c, _d, _e2;
|
|
12784
|
+
const nodes = [];
|
|
12785
|
+
const edges = [];
|
|
12786
|
+
const now2 = Date.now();
|
|
12787
|
+
if (canvas.nodes) {
|
|
12788
|
+
for (const node2 of canvas.nodes) {
|
|
12789
|
+
const pv = node2.pv;
|
|
12790
|
+
let nodeName;
|
|
12791
|
+
let nodeDescription;
|
|
12792
|
+
switch (node2.type) {
|
|
12793
|
+
case "text": {
|
|
12794
|
+
const lines = ((_a = node2.text) == null ? void 0 : _a.split("\n")) || [];
|
|
12795
|
+
nodeName = ((_b = lines[0]) == null ? void 0 : _b.replace(/^#+ /, "").substring(0, 50)) || "Text";
|
|
12796
|
+
nodeDescription = lines.slice(1).join("\n").trim() || void 0;
|
|
12797
|
+
break;
|
|
12798
|
+
}
|
|
12799
|
+
case "file":
|
|
12800
|
+
nodeName = ((_c = node2.file) == null ? void 0 : _c.split("/").pop()) || node2.file || "File";
|
|
12801
|
+
break;
|
|
12802
|
+
case "link":
|
|
12803
|
+
nodeName = node2.url || "Link";
|
|
12804
|
+
break;
|
|
12805
|
+
case "group":
|
|
12806
|
+
nodeName = node2.label || "Group";
|
|
12807
|
+
break;
|
|
12808
|
+
default:
|
|
12809
|
+
nodeName = (pv == null ? void 0 : pv.nodeType) || node2.id;
|
|
12810
|
+
break;
|
|
12811
|
+
}
|
|
12812
|
+
const finalName = (pv == null ? void 0 : pv.name) || nodeName;
|
|
12813
|
+
const finalDescription = (pv == null ? void 0 : pv.description) || nodeDescription;
|
|
12814
|
+
const nodeData = {
|
|
12815
|
+
description: finalDescription || "",
|
|
12816
|
+
shape: (pv == null ? void 0 : pv.shape) || "rectangle",
|
|
12817
|
+
color: (pv == null ? void 0 : pv.fill) || resolveCanvasColor(node2.color) || "",
|
|
12818
|
+
width: node2.width,
|
|
12819
|
+
height: node2.height,
|
|
12820
|
+
sources: (pv == null ? void 0 : pv.sources) || [],
|
|
12821
|
+
// actions removed - legacy path-based
|
|
12822
|
+
canvasType: node2.type
|
|
12823
|
+
};
|
|
12824
|
+
if (pv == null ? void 0 : pv.icon)
|
|
12825
|
+
nodeData.icon = pv.icon;
|
|
12826
|
+
if (pv == null ? void 0 : pv.stroke)
|
|
12827
|
+
nodeData.stroke = pv.stroke;
|
|
12828
|
+
if (pv == null ? void 0 : pv.states)
|
|
12829
|
+
nodeData.states = pv.states;
|
|
12830
|
+
if (pv == null ? void 0 : pv.status)
|
|
12831
|
+
nodeData.status = pv.status;
|
|
12832
|
+
if (pv == null ? void 0 : pv.otel)
|
|
12833
|
+
nodeData.otel = pv.otel;
|
|
12834
|
+
if (pv == null ? void 0 : pv.resourceMatch)
|
|
12835
|
+
nodeData.resourceMatch = pv.resourceMatch;
|
|
12836
|
+
if (pv == null ? void 0 : pv.event)
|
|
12837
|
+
nodeData.event = pv.event;
|
|
12838
|
+
if (pv == null ? void 0 : pv.eventRef)
|
|
12839
|
+
nodeData.eventRef = pv.eventRef;
|
|
12840
|
+
if (node2.type === "text" && node2.text)
|
|
12841
|
+
nodeData.text = node2.text;
|
|
12842
|
+
if (node2.type === "file" && node2.file)
|
|
12843
|
+
nodeData.file = node2.file;
|
|
12844
|
+
if (node2.type === "link" && node2.url)
|
|
12845
|
+
nodeData.url = node2.url;
|
|
12846
|
+
nodes.push({
|
|
12847
|
+
id: node2.id,
|
|
12848
|
+
type: (pv == null ? void 0 : pv.nodeType) || node2.type,
|
|
12849
|
+
name: finalName,
|
|
12850
|
+
data: nodeData,
|
|
12851
|
+
position: { x: node2.x, y: node2.y },
|
|
12852
|
+
// Persist node dimensions at top level for xyflow
|
|
12853
|
+
width: node2.width,
|
|
12854
|
+
height: node2.height,
|
|
12855
|
+
// Don't set a default state - only show state labels when explicitly set via events
|
|
12856
|
+
state: void 0,
|
|
12857
|
+
createdAt: now2,
|
|
12858
|
+
updatedAt: now2
|
|
12859
|
+
});
|
|
12860
|
+
}
|
|
12861
|
+
}
|
|
12862
|
+
if (canvas.edges) {
|
|
12863
|
+
for (const edge of canvas.edges) {
|
|
12864
|
+
const pv = edge.pv;
|
|
12865
|
+
const edgeTypeDef = (pv == null ? void 0 : pv.edgeType) ? (_e2 = (_d = canvas.pv) == null ? void 0 : _d.edgeTypes) == null ? void 0 : _e2[pv.edgeType] : void 0;
|
|
12866
|
+
const edgeData = {
|
|
12867
|
+
style: (pv == null ? void 0 : pv.style) || (edgeTypeDef == null ? void 0 : edgeTypeDef.style) || "solid"
|
|
12868
|
+
};
|
|
12869
|
+
if (edge.label)
|
|
12870
|
+
edgeData.label = edge.label;
|
|
12871
|
+
const color2 = resolveCanvasColor(edge.color) || (edgeTypeDef == null ? void 0 : edgeTypeDef.color);
|
|
12872
|
+
if (color2)
|
|
12873
|
+
edgeData.color = color2;
|
|
12874
|
+
const width = (pv == null ? void 0 : pv.width) || (edgeTypeDef == null ? void 0 : edgeTypeDef.width);
|
|
12875
|
+
if (width !== void 0)
|
|
12876
|
+
edgeData.width = width;
|
|
12877
|
+
const animation = (pv == null ? void 0 : pv.animation) || (edgeTypeDef == null ? void 0 : edgeTypeDef.animation);
|
|
12878
|
+
if (animation)
|
|
12879
|
+
edgeData.animation = animation;
|
|
12880
|
+
if (edge.fromSide)
|
|
12881
|
+
edgeData.fromSide = edge.fromSide;
|
|
12882
|
+
if (edge.toSide)
|
|
12883
|
+
edgeData.toSide = edge.toSide;
|
|
12884
|
+
edges.push({
|
|
12885
|
+
id: edge.id,
|
|
12886
|
+
type: (pv == null ? void 0 : pv.edgeType) || "default",
|
|
12887
|
+
from: edge.fromNode,
|
|
12888
|
+
to: edge.toNode,
|
|
12889
|
+
data: edgeData,
|
|
12890
|
+
createdAt: now2,
|
|
12891
|
+
updatedAt: now2
|
|
12892
|
+
});
|
|
12893
|
+
}
|
|
12894
|
+
}
|
|
12895
|
+
return { nodes, edges };
|
|
12896
|
+
}
|
|
12897
|
+
/**
|
|
12898
|
+
* Convert React Flow nodes/edges back to Extended Canvas format
|
|
12899
|
+
*/
|
|
12900
|
+
static reactFlowToCanvas(nodes, edges, metadata) {
|
|
12901
|
+
var _a, _b, _c, _d, _e2;
|
|
12902
|
+
const canvas = {
|
|
12903
|
+
nodes: [],
|
|
12904
|
+
edges: [],
|
|
12905
|
+
pv: {
|
|
12906
|
+
version: (metadata == null ? void 0 : metadata.version) || "1.0.0",
|
|
12907
|
+
name: (metadata == null ? void 0 : metadata.name) || "Untitled",
|
|
12908
|
+
description: metadata == null ? void 0 : metadata.description,
|
|
12909
|
+
edgeTypes: {}
|
|
12910
|
+
}
|
|
12911
|
+
};
|
|
12912
|
+
const edgeTypes2 = /* @__PURE__ */ new Map();
|
|
12913
|
+
for (const node2 of nodes) {
|
|
12914
|
+
const canvasNode = {
|
|
12915
|
+
id: node2.id,
|
|
12916
|
+
type: node2.data.canvasType || "text",
|
|
12917
|
+
x: node2.position.x,
|
|
12918
|
+
y: node2.position.y,
|
|
12919
|
+
width: ((_a = node2.style) == null ? void 0 : _a.width) || node2.data.width || 150,
|
|
12920
|
+
height: ((_b = node2.style) == null ? void 0 : _b.height) || node2.data.height || 80,
|
|
12921
|
+
text: node2.data.text || ""
|
|
12922
|
+
};
|
|
12923
|
+
if (node2.data.color && typeof node2.data.color === "string") {
|
|
12924
|
+
canvasNode.color = node2.data.color;
|
|
12925
|
+
}
|
|
12926
|
+
if (node2.data.nodeType || node2.data.shape || ((_c = node2.data.sources) == null ? void 0 : _c.length)) {
|
|
12927
|
+
canvasNode.pv = {
|
|
12928
|
+
nodeType: node2.data.nodeType || node2.id,
|
|
12929
|
+
shape: node2.data.shape,
|
|
12930
|
+
icon: node2.data.icon,
|
|
12931
|
+
states: node2.data.states,
|
|
12932
|
+
sources: node2.data.sources,
|
|
12933
|
+
// actions removed - legacy path-based
|
|
12934
|
+
dataSchema: node2.data.dataSchema
|
|
12935
|
+
};
|
|
12936
|
+
}
|
|
12937
|
+
if (node2.data.canvasType === "text" || !node2.data.canvasType) {
|
|
12938
|
+
const name2 = node2.data.name || node2.id;
|
|
12939
|
+
const description = node2.data.description;
|
|
12940
|
+
canvasNode.text = description ? `# ${name2}
|
|
12941
|
+
|
|
12942
|
+
${description}` : `# ${name2}`;
|
|
12943
|
+
}
|
|
12944
|
+
canvas.nodes.push(canvasNode);
|
|
12945
|
+
}
|
|
12946
|
+
for (const edge of edges) {
|
|
12947
|
+
const canvasEdge = {
|
|
12948
|
+
id: edge.id,
|
|
12949
|
+
fromNode: edge.source,
|
|
12950
|
+
toNode: edge.target,
|
|
12951
|
+
fromSide: edge.sourceHandle,
|
|
12952
|
+
toSide: edge.targetHandle,
|
|
12953
|
+
label: edge.label
|
|
12954
|
+
};
|
|
12955
|
+
if ((_d = edge.style) == null ? void 0 : _d.stroke) {
|
|
12956
|
+
canvasEdge.color = edge.style.stroke;
|
|
12957
|
+
}
|
|
12958
|
+
if ((_e2 = edge.data) == null ? void 0 : _e2.edgeType) {
|
|
12959
|
+
canvasEdge.pv = {
|
|
12960
|
+
edgeType: edge.data.edgeType,
|
|
12961
|
+
style: edge.data.style,
|
|
12962
|
+
width: edge.data.width,
|
|
12963
|
+
animation: edge.data.animation
|
|
12964
|
+
// activatedBy removed - legacy path-based
|
|
12965
|
+
};
|
|
12966
|
+
if (!edgeTypes2.has(edge.data.edgeType)) {
|
|
12967
|
+
edgeTypes2.set(edge.data.edgeType, {
|
|
12968
|
+
style: edge.data.style,
|
|
12969
|
+
color: edge.data.color,
|
|
12970
|
+
width: edge.data.width,
|
|
12971
|
+
animation: edge.data.animation
|
|
12972
|
+
// activatedBy removed - legacy path-based
|
|
12973
|
+
});
|
|
12974
|
+
}
|
|
12975
|
+
}
|
|
12976
|
+
canvas.edges.push(canvasEdge);
|
|
12977
|
+
}
|
|
12978
|
+
canvas.pv.edgeTypes = Object.fromEntries(edgeTypes2);
|
|
12979
|
+
return canvas;
|
|
12980
|
+
}
|
|
12981
|
+
}
|
|
12607
12982
|
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
|
|
12608
12983
|
function isNothing(subject) {
|
|
12609
12984
|
return typeof subject === "undefined" || subject === null;
|
|
@@ -13336,366 +13711,6 @@ for (var i$1 = 0; i$1 < 256; i$1++) {
|
|
|
13336
13711
|
simpleEscapeCheck[i$1] = simpleEscapeSequence(i$1) ? 1 : 0;
|
|
13337
13712
|
simpleEscapeMap[i$1] = simpleEscapeSequence(i$1);
|
|
13338
13713
|
}
|
|
13339
|
-
const CANVAS_COLOR_PRESETS = {
|
|
13340
|
-
1: "#ef4444",
|
|
13341
|
-
2: "#f97316",
|
|
13342
|
-
3: "#eab308",
|
|
13343
|
-
4: "#22c55e",
|
|
13344
|
-
5: "#06b6d4",
|
|
13345
|
-
6: "#8b5cf6"
|
|
13346
|
-
// purple
|
|
13347
|
-
};
|
|
13348
|
-
function resolveCanvasColor(color2) {
|
|
13349
|
-
if (color2 === void 0)
|
|
13350
|
-
return void 0;
|
|
13351
|
-
if (typeof color2 === "number") {
|
|
13352
|
-
return CANVAS_COLOR_PRESETS[color2];
|
|
13353
|
-
}
|
|
13354
|
-
const numericValue = parseInt(color2, 10);
|
|
13355
|
-
if (!isNaN(numericValue) && numericValue >= 1 && numericValue <= 6) {
|
|
13356
|
-
return CANVAS_COLOR_PRESETS[numericValue];
|
|
13357
|
-
}
|
|
13358
|
-
return color2;
|
|
13359
|
-
}
|
|
13360
|
-
function sideToHandle(side) {
|
|
13361
|
-
if (!side)
|
|
13362
|
-
return void 0;
|
|
13363
|
-
return side;
|
|
13364
|
-
}
|
|
13365
|
-
function styleToStrokeDasharray(style2) {
|
|
13366
|
-
switch (style2) {
|
|
13367
|
-
case "dashed":
|
|
13368
|
-
return "5,5";
|
|
13369
|
-
case "dotted":
|
|
13370
|
-
return "2,2";
|
|
13371
|
-
default:
|
|
13372
|
-
return void 0;
|
|
13373
|
-
}
|
|
13374
|
-
}
|
|
13375
|
-
class CanvasConverter {
|
|
13376
|
-
/**
|
|
13377
|
-
* Convert Extended Canvas to React Flow nodes and edges
|
|
13378
|
-
*/
|
|
13379
|
-
static canvasToReactFlow(canvas) {
|
|
13380
|
-
const nodes = [];
|
|
13381
|
-
const edges = [];
|
|
13382
|
-
if (canvas.nodes) {
|
|
13383
|
-
for (const node2 of canvas.nodes) {
|
|
13384
|
-
nodes.push(this.convertNode(node2, canvas));
|
|
13385
|
-
}
|
|
13386
|
-
}
|
|
13387
|
-
if (canvas.edges) {
|
|
13388
|
-
for (const edge of canvas.edges) {
|
|
13389
|
-
edges.push(this.convertEdge(edge, canvas));
|
|
13390
|
-
}
|
|
13391
|
-
}
|
|
13392
|
-
return { nodes, edges };
|
|
13393
|
-
}
|
|
13394
|
-
/**
|
|
13395
|
-
* Convert a single canvas node to React Flow node
|
|
13396
|
-
*/
|
|
13397
|
-
static convertNode(node2, _canvas) {
|
|
13398
|
-
var _a, _b, _c, _d;
|
|
13399
|
-
const pv = node2.pv;
|
|
13400
|
-
const color2 = resolveCanvasColor(node2.color);
|
|
13401
|
-
let nodeName;
|
|
13402
|
-
switch (node2.type) {
|
|
13403
|
-
case "text":
|
|
13404
|
-
nodeName = ((_a = node2.text) == null ? void 0 : _a.split("\n")[0].replace(/^#+ /, "").substring(0, 50)) || "Text";
|
|
13405
|
-
break;
|
|
13406
|
-
case "file":
|
|
13407
|
-
nodeName = ((_b = node2.file) == null ? void 0 : _b.split("/").pop()) || node2.file || "File";
|
|
13408
|
-
break;
|
|
13409
|
-
case "link":
|
|
13410
|
-
nodeName = node2.url || "Link";
|
|
13411
|
-
break;
|
|
13412
|
-
case "group":
|
|
13413
|
-
nodeName = node2.label || "Group";
|
|
13414
|
-
break;
|
|
13415
|
-
}
|
|
13416
|
-
const data = {
|
|
13417
|
-
name: nodeName,
|
|
13418
|
-
nodeType: (pv == null ? void 0 : pv.nodeType) || node2.id,
|
|
13419
|
-
canvasType: node2.type,
|
|
13420
|
-
shape: (pv == null ? void 0 : pv.shape) || "rectangle",
|
|
13421
|
-
icon: pv == null ? void 0 : pv.icon,
|
|
13422
|
-
color: ((_d = (_c = pv == null ? void 0 : pv.states) == null ? void 0 : _c.idle) == null ? void 0 : _d.color) || color2,
|
|
13423
|
-
width: node2.width,
|
|
13424
|
-
height: node2.height
|
|
13425
|
-
};
|
|
13426
|
-
if (node2.type === "text") {
|
|
13427
|
-
data.text = node2.text;
|
|
13428
|
-
} else if (node2.type === "file") {
|
|
13429
|
-
data.file = node2.file;
|
|
13430
|
-
} else if (node2.type === "link") {
|
|
13431
|
-
data.url = node2.url;
|
|
13432
|
-
}
|
|
13433
|
-
if (pv) {
|
|
13434
|
-
if (pv.states)
|
|
13435
|
-
data.states = pv.states;
|
|
13436
|
-
if (pv.sources)
|
|
13437
|
-
data.sources = pv.sources;
|
|
13438
|
-
if (pv.status)
|
|
13439
|
-
data.status = pv.status;
|
|
13440
|
-
if (pv.dataSchema)
|
|
13441
|
-
data.dataSchema = pv.dataSchema;
|
|
13442
|
-
if (pv.event)
|
|
13443
|
-
data.event = pv.event;
|
|
13444
|
-
if (pv.eventRef)
|
|
13445
|
-
data.eventRef = pv.eventRef;
|
|
13446
|
-
}
|
|
13447
|
-
return {
|
|
13448
|
-
id: node2.id,
|
|
13449
|
-
type: (pv == null ? void 0 : pv.shape) || "default",
|
|
13450
|
-
position: { x: node2.x, y: node2.y },
|
|
13451
|
-
data,
|
|
13452
|
-
style: {
|
|
13453
|
-
width: node2.width,
|
|
13454
|
-
height: node2.height
|
|
13455
|
-
}
|
|
13456
|
-
};
|
|
13457
|
-
}
|
|
13458
|
-
/**
|
|
13459
|
-
* Convert a single canvas edge to React Flow edge
|
|
13460
|
-
*/
|
|
13461
|
-
static convertEdge(edge, canvas) {
|
|
13462
|
-
var _a, _b;
|
|
13463
|
-
const pv = edge.pv;
|
|
13464
|
-
const edgeTypeDef = (pv == null ? void 0 : pv.edgeType) ? (_b = (_a = canvas.pv) == null ? void 0 : _a.edgeTypes) == null ? void 0 : _b[pv.edgeType] : void 0;
|
|
13465
|
-
const color2 = resolveCanvasColor(edge.color) || (edgeTypeDef == null ? void 0 : edgeTypeDef.color);
|
|
13466
|
-
const rfEdge = {
|
|
13467
|
-
id: edge.id,
|
|
13468
|
-
source: edge.fromNode,
|
|
13469
|
-
target: edge.toNode,
|
|
13470
|
-
sourceHandle: sideToHandle(edge.fromSide),
|
|
13471
|
-
targetHandle: sideToHandle(edge.toSide),
|
|
13472
|
-
label: edge.label,
|
|
13473
|
-
data: {
|
|
13474
|
-
edgeType: (pv == null ? void 0 : pv.edgeType) || "default",
|
|
13475
|
-
style: (pv == null ? void 0 : pv.style) || (edgeTypeDef == null ? void 0 : edgeTypeDef.style) || "solid",
|
|
13476
|
-
color: color2,
|
|
13477
|
-
width: (pv == null ? void 0 : pv.width) || (edgeTypeDef == null ? void 0 : edgeTypeDef.width) || 2,
|
|
13478
|
-
animation: (pv == null ? void 0 : pv.animation) || (edgeTypeDef == null ? void 0 : edgeTypeDef.animation)
|
|
13479
|
-
// activatedBy removed - legacy path-based
|
|
13480
|
-
},
|
|
13481
|
-
style: {
|
|
13482
|
-
stroke: color2,
|
|
13483
|
-
strokeWidth: (pv == null ? void 0 : pv.width) || (edgeTypeDef == null ? void 0 : edgeTypeDef.width) || 2,
|
|
13484
|
-
strokeDasharray: styleToStrokeDasharray((pv == null ? void 0 : pv.style) || (edgeTypeDef == null ? void 0 : edgeTypeDef.style))
|
|
13485
|
-
},
|
|
13486
|
-
animated: (pv == null ? void 0 : pv.style) === "animated" || (edgeTypeDef == null ? void 0 : edgeTypeDef.style) === "animated"
|
|
13487
|
-
};
|
|
13488
|
-
if (edge.toEnd !== "none") {
|
|
13489
|
-
rfEdge.markerEnd = {
|
|
13490
|
-
type: "arrowclosed",
|
|
13491
|
-
color: color2
|
|
13492
|
-
};
|
|
13493
|
-
}
|
|
13494
|
-
return rfEdge;
|
|
13495
|
-
}
|
|
13496
|
-
/**
|
|
13497
|
-
* Convert Extended Canvas to internal NodeState/EdgeState format
|
|
13498
|
-
*/
|
|
13499
|
-
static canvasToGraph(canvas) {
|
|
13500
|
-
var _a, _b, _c, _d, _e2;
|
|
13501
|
-
const nodes = [];
|
|
13502
|
-
const edges = [];
|
|
13503
|
-
const now2 = Date.now();
|
|
13504
|
-
if (canvas.nodes) {
|
|
13505
|
-
for (const node2 of canvas.nodes) {
|
|
13506
|
-
const pv = node2.pv;
|
|
13507
|
-
let nodeName;
|
|
13508
|
-
let nodeDescription;
|
|
13509
|
-
switch (node2.type) {
|
|
13510
|
-
case "text": {
|
|
13511
|
-
const lines = ((_a = node2.text) == null ? void 0 : _a.split("\n")) || [];
|
|
13512
|
-
nodeName = ((_b = lines[0]) == null ? void 0 : _b.replace(/^#+ /, "").substring(0, 50)) || "Text";
|
|
13513
|
-
nodeDescription = lines.slice(1).join("\n").trim() || void 0;
|
|
13514
|
-
break;
|
|
13515
|
-
}
|
|
13516
|
-
case "file":
|
|
13517
|
-
nodeName = ((_c = node2.file) == null ? void 0 : _c.split("/").pop()) || node2.file || "File";
|
|
13518
|
-
break;
|
|
13519
|
-
case "link":
|
|
13520
|
-
nodeName = node2.url || "Link";
|
|
13521
|
-
break;
|
|
13522
|
-
case "group":
|
|
13523
|
-
nodeName = node2.label || "Group";
|
|
13524
|
-
break;
|
|
13525
|
-
default:
|
|
13526
|
-
nodeName = (pv == null ? void 0 : pv.nodeType) || node2.id;
|
|
13527
|
-
break;
|
|
13528
|
-
}
|
|
13529
|
-
const finalName = (pv == null ? void 0 : pv.name) || nodeName;
|
|
13530
|
-
const finalDescription = (pv == null ? void 0 : pv.description) || nodeDescription;
|
|
13531
|
-
const nodeData = {
|
|
13532
|
-
description: finalDescription || "",
|
|
13533
|
-
shape: (pv == null ? void 0 : pv.shape) || "rectangle",
|
|
13534
|
-
color: (pv == null ? void 0 : pv.fill) || resolveCanvasColor(node2.color) || "",
|
|
13535
|
-
width: node2.width,
|
|
13536
|
-
height: node2.height,
|
|
13537
|
-
sources: (pv == null ? void 0 : pv.sources) || [],
|
|
13538
|
-
// actions removed - legacy path-based
|
|
13539
|
-
canvasType: node2.type
|
|
13540
|
-
};
|
|
13541
|
-
if (pv == null ? void 0 : pv.icon)
|
|
13542
|
-
nodeData.icon = pv.icon;
|
|
13543
|
-
if (pv == null ? void 0 : pv.stroke)
|
|
13544
|
-
nodeData.stroke = pv.stroke;
|
|
13545
|
-
if (pv == null ? void 0 : pv.states)
|
|
13546
|
-
nodeData.states = pv.states;
|
|
13547
|
-
if (pv == null ? void 0 : pv.status)
|
|
13548
|
-
nodeData.status = pv.status;
|
|
13549
|
-
if (pv == null ? void 0 : pv.otel)
|
|
13550
|
-
nodeData.otel = pv.otel;
|
|
13551
|
-
if (pv == null ? void 0 : pv.resourceMatch)
|
|
13552
|
-
nodeData.resourceMatch = pv.resourceMatch;
|
|
13553
|
-
if (pv == null ? void 0 : pv.event)
|
|
13554
|
-
nodeData.event = pv.event;
|
|
13555
|
-
if (pv == null ? void 0 : pv.eventRef)
|
|
13556
|
-
nodeData.eventRef = pv.eventRef;
|
|
13557
|
-
if (node2.type === "text" && node2.text)
|
|
13558
|
-
nodeData.text = node2.text;
|
|
13559
|
-
if (node2.type === "file" && node2.file)
|
|
13560
|
-
nodeData.file = node2.file;
|
|
13561
|
-
if (node2.type === "link" && node2.url)
|
|
13562
|
-
nodeData.url = node2.url;
|
|
13563
|
-
nodes.push({
|
|
13564
|
-
id: node2.id,
|
|
13565
|
-
type: (pv == null ? void 0 : pv.nodeType) || node2.type,
|
|
13566
|
-
name: finalName,
|
|
13567
|
-
data: nodeData,
|
|
13568
|
-
position: { x: node2.x, y: node2.y },
|
|
13569
|
-
// Persist node dimensions at top level for xyflow
|
|
13570
|
-
width: node2.width,
|
|
13571
|
-
height: node2.height,
|
|
13572
|
-
// Don't set a default state - only show state labels when explicitly set via events
|
|
13573
|
-
state: void 0,
|
|
13574
|
-
createdAt: now2,
|
|
13575
|
-
updatedAt: now2
|
|
13576
|
-
});
|
|
13577
|
-
}
|
|
13578
|
-
}
|
|
13579
|
-
if (canvas.edges) {
|
|
13580
|
-
for (const edge of canvas.edges) {
|
|
13581
|
-
const pv = edge.pv;
|
|
13582
|
-
const edgeTypeDef = (pv == null ? void 0 : pv.edgeType) ? (_e2 = (_d = canvas.pv) == null ? void 0 : _d.edgeTypes) == null ? void 0 : _e2[pv.edgeType] : void 0;
|
|
13583
|
-
const edgeData = {
|
|
13584
|
-
style: (pv == null ? void 0 : pv.style) || (edgeTypeDef == null ? void 0 : edgeTypeDef.style) || "solid"
|
|
13585
|
-
};
|
|
13586
|
-
if (edge.label)
|
|
13587
|
-
edgeData.label = edge.label;
|
|
13588
|
-
const color2 = resolveCanvasColor(edge.color) || (edgeTypeDef == null ? void 0 : edgeTypeDef.color);
|
|
13589
|
-
if (color2)
|
|
13590
|
-
edgeData.color = color2;
|
|
13591
|
-
const width = (pv == null ? void 0 : pv.width) || (edgeTypeDef == null ? void 0 : edgeTypeDef.width);
|
|
13592
|
-
if (width !== void 0)
|
|
13593
|
-
edgeData.width = width;
|
|
13594
|
-
const animation = (pv == null ? void 0 : pv.animation) || (edgeTypeDef == null ? void 0 : edgeTypeDef.animation);
|
|
13595
|
-
if (animation)
|
|
13596
|
-
edgeData.animation = animation;
|
|
13597
|
-
if (edge.fromSide)
|
|
13598
|
-
edgeData.fromSide = edge.fromSide;
|
|
13599
|
-
if (edge.toSide)
|
|
13600
|
-
edgeData.toSide = edge.toSide;
|
|
13601
|
-
edges.push({
|
|
13602
|
-
id: edge.id,
|
|
13603
|
-
type: (pv == null ? void 0 : pv.edgeType) || "default",
|
|
13604
|
-
from: edge.fromNode,
|
|
13605
|
-
to: edge.toNode,
|
|
13606
|
-
data: edgeData,
|
|
13607
|
-
createdAt: now2,
|
|
13608
|
-
updatedAt: now2
|
|
13609
|
-
});
|
|
13610
|
-
}
|
|
13611
|
-
}
|
|
13612
|
-
return { nodes, edges };
|
|
13613
|
-
}
|
|
13614
|
-
/**
|
|
13615
|
-
* Convert React Flow nodes/edges back to Extended Canvas format
|
|
13616
|
-
*/
|
|
13617
|
-
static reactFlowToCanvas(nodes, edges, metadata) {
|
|
13618
|
-
var _a, _b, _c, _d, _e2;
|
|
13619
|
-
const canvas = {
|
|
13620
|
-
nodes: [],
|
|
13621
|
-
edges: [],
|
|
13622
|
-
pv: {
|
|
13623
|
-
version: (metadata == null ? void 0 : metadata.version) || "1.0.0",
|
|
13624
|
-
name: (metadata == null ? void 0 : metadata.name) || "Untitled",
|
|
13625
|
-
description: metadata == null ? void 0 : metadata.description,
|
|
13626
|
-
edgeTypes: {}
|
|
13627
|
-
}
|
|
13628
|
-
};
|
|
13629
|
-
const edgeTypes2 = /* @__PURE__ */ new Map();
|
|
13630
|
-
for (const node2 of nodes) {
|
|
13631
|
-
const canvasNode = {
|
|
13632
|
-
id: node2.id,
|
|
13633
|
-
type: node2.data.canvasType || "text",
|
|
13634
|
-
x: node2.position.x,
|
|
13635
|
-
y: node2.position.y,
|
|
13636
|
-
width: ((_a = node2.style) == null ? void 0 : _a.width) || node2.data.width || 150,
|
|
13637
|
-
height: ((_b = node2.style) == null ? void 0 : _b.height) || node2.data.height || 80,
|
|
13638
|
-
text: node2.data.text || ""
|
|
13639
|
-
};
|
|
13640
|
-
if (node2.data.color && typeof node2.data.color === "string") {
|
|
13641
|
-
canvasNode.color = node2.data.color;
|
|
13642
|
-
}
|
|
13643
|
-
if (node2.data.nodeType || node2.data.shape || ((_c = node2.data.sources) == null ? void 0 : _c.length)) {
|
|
13644
|
-
canvasNode.pv = {
|
|
13645
|
-
nodeType: node2.data.nodeType || node2.id,
|
|
13646
|
-
shape: node2.data.shape,
|
|
13647
|
-
icon: node2.data.icon,
|
|
13648
|
-
states: node2.data.states,
|
|
13649
|
-
sources: node2.data.sources,
|
|
13650
|
-
// actions removed - legacy path-based
|
|
13651
|
-
dataSchema: node2.data.dataSchema
|
|
13652
|
-
};
|
|
13653
|
-
}
|
|
13654
|
-
if (node2.data.canvasType === "text" || !node2.data.canvasType) {
|
|
13655
|
-
const name2 = node2.data.name || node2.id;
|
|
13656
|
-
const description = node2.data.description;
|
|
13657
|
-
canvasNode.text = description ? `# ${name2}
|
|
13658
|
-
|
|
13659
|
-
${description}` : `# ${name2}`;
|
|
13660
|
-
}
|
|
13661
|
-
canvas.nodes.push(canvasNode);
|
|
13662
|
-
}
|
|
13663
|
-
for (const edge of edges) {
|
|
13664
|
-
const canvasEdge = {
|
|
13665
|
-
id: edge.id,
|
|
13666
|
-
fromNode: edge.source,
|
|
13667
|
-
toNode: edge.target,
|
|
13668
|
-
fromSide: edge.sourceHandle,
|
|
13669
|
-
toSide: edge.targetHandle,
|
|
13670
|
-
label: edge.label
|
|
13671
|
-
};
|
|
13672
|
-
if ((_d = edge.style) == null ? void 0 : _d.stroke) {
|
|
13673
|
-
canvasEdge.color = edge.style.stroke;
|
|
13674
|
-
}
|
|
13675
|
-
if ((_e2 = edge.data) == null ? void 0 : _e2.edgeType) {
|
|
13676
|
-
canvasEdge.pv = {
|
|
13677
|
-
edgeType: edge.data.edgeType,
|
|
13678
|
-
style: edge.data.style,
|
|
13679
|
-
width: edge.data.width,
|
|
13680
|
-
animation: edge.data.animation
|
|
13681
|
-
// activatedBy removed - legacy path-based
|
|
13682
|
-
};
|
|
13683
|
-
if (!edgeTypes2.has(edge.data.edgeType)) {
|
|
13684
|
-
edgeTypes2.set(edge.data.edgeType, {
|
|
13685
|
-
style: edge.data.style,
|
|
13686
|
-
color: edge.data.color,
|
|
13687
|
-
width: edge.data.width,
|
|
13688
|
-
animation: edge.data.animation
|
|
13689
|
-
// activatedBy removed - legacy path-based
|
|
13690
|
-
});
|
|
13691
|
-
}
|
|
13692
|
-
}
|
|
13693
|
-
canvas.edges.push(canvasEdge);
|
|
13694
|
-
}
|
|
13695
|
-
canvas.pv.edgeTypes = Object.fromEntries(edgeTypes2);
|
|
13696
|
-
return canvas;
|
|
13697
|
-
}
|
|
13698
|
-
}
|
|
13699
13714
|
var handlebars = { exports: {} };
|
|
13700
13715
|
var handlebars_runtime = { exports: {} };
|
|
13701
13716
|
var base$1 = {};
|
|
@@ -104904,7 +104919,7 @@ const browserExt = {
|
|
|
104904
104919
|
},
|
|
104905
104920
|
test: () => true,
|
|
104906
104921
|
load: async () => {
|
|
104907
|
-
await import("./browserAll-
|
|
104922
|
+
await import("./browserAll-CjpUV6Zh.js");
|
|
104908
104923
|
}
|
|
104909
104924
|
};
|
|
104910
104925
|
const webworkerExt = {
|
|
@@ -104915,7 +104930,7 @@ const webworkerExt = {
|
|
|
104915
104930
|
},
|
|
104916
104931
|
test: () => typeof self !== "undefined" && self.WorkerGlobalScope !== void 0,
|
|
104917
104932
|
load: async () => {
|
|
104918
|
-
await import("./webworkerAll-
|
|
104933
|
+
await import("./webworkerAll-Blmn9DEN.js");
|
|
104919
104934
|
}
|
|
104920
104935
|
};
|
|
104921
104936
|
class ObservablePoint {
|
|
@@ -117158,19 +117173,19 @@ async function autoDetectRenderer(options) {
|
|
|
117158
117173
|
for (let i2 = 0; i2 < preferredOrder.length; i2++) {
|
|
117159
117174
|
const rendererType = preferredOrder[i2];
|
|
117160
117175
|
if (rendererType === "webgpu" && await isWebGPUSupported()) {
|
|
117161
|
-
const { WebGPURenderer } = await import("./WebGPURenderer-
|
|
117176
|
+
const { WebGPURenderer } = await import("./WebGPURenderer-DY5uJ8HH.js");
|
|
117162
117177
|
RendererClass = WebGPURenderer;
|
|
117163
117178
|
finalOptions = { ...options, ...options.webgpu };
|
|
117164
117179
|
break;
|
|
117165
117180
|
} else if (rendererType === "webgl" && isWebGLSupported(
|
|
117166
117181
|
options.failIfMajorPerformanceCaveat ?? AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat
|
|
117167
117182
|
)) {
|
|
117168
|
-
const { WebGLRenderer } = await import("./WebGLRenderer-
|
|
117183
|
+
const { WebGLRenderer } = await import("./WebGLRenderer-0i8_RMNF.js");
|
|
117169
117184
|
RendererClass = WebGLRenderer;
|
|
117170
117185
|
finalOptions = { ...options, ...options.webgl };
|
|
117171
117186
|
break;
|
|
117172
117187
|
} else if (rendererType === "canvas") {
|
|
117173
|
-
const { CanvasRenderer } = await import("./CanvasRenderer-
|
|
117188
|
+
const { CanvasRenderer } = await import("./CanvasRenderer-DLdkHlL4.js");
|
|
117174
117189
|
RendererClass = CanvasRenderer;
|
|
117175
117190
|
finalOptions = { ...options, ...options.canvasOptions };
|
|
117176
117191
|
break;
|
|
@@ -131075,8 +131090,407 @@ class it extends Container {
|
|
|
131075
131090
|
t2 < this.left ? (this.left = t2, h2 = true) : t2 + n2 > this.right && (this.right = t2 + n2, h2 = true), e2 < this.top ? (this.top = e2, h2 = true) : e2 + i2 > this.bottom && (this.bottom = e2 + i2, h2 = true), h2 && this.emit("moved", { viewport: this, type: "ensureVisible" });
|
|
131076
131091
|
}
|
|
131077
131092
|
}
|
|
131093
|
+
const STAR_TIERS = [
|
|
131094
|
+
// Flags (basic tiers)
|
|
131095
|
+
{ min: 0, max: 100, name: "New", decorationType: "flag", color: 9741240 },
|
|
131096
|
+
// Gray
|
|
131097
|
+
{
|
|
131098
|
+
min: 101,
|
|
131099
|
+
max: 500,
|
|
131100
|
+
name: "Growing",
|
|
131101
|
+
decorationType: "flag",
|
|
131102
|
+
color: 2278750
|
|
131103
|
+
},
|
|
131104
|
+
// Green
|
|
131105
|
+
{
|
|
131106
|
+
min: 501,
|
|
131107
|
+
max: 1e3,
|
|
131108
|
+
name: "Popular",
|
|
131109
|
+
decorationType: "flag",
|
|
131110
|
+
color: 440020
|
|
131111
|
+
},
|
|
131112
|
+
// Cyan
|
|
131113
|
+
// Trophies (mid tiers)
|
|
131114
|
+
{
|
|
131115
|
+
min: 1001,
|
|
131116
|
+
max: 5e3,
|
|
131117
|
+
name: "Notable",
|
|
131118
|
+
decorationType: "trophy",
|
|
131119
|
+
color: 16096779
|
|
131120
|
+
},
|
|
131121
|
+
// Amber
|
|
131122
|
+
{
|
|
131123
|
+
min: 5001,
|
|
131124
|
+
max: 1e4,
|
|
131125
|
+
name: "Renowned",
|
|
131126
|
+
decorationType: "trophy",
|
|
131127
|
+
color: 16347926
|
|
131128
|
+
},
|
|
131129
|
+
// Orange
|
|
131130
|
+
// Statues (high tiers)
|
|
131131
|
+
{
|
|
131132
|
+
min: 10001,
|
|
131133
|
+
max: 25e3,
|
|
131134
|
+
name: "Famous",
|
|
131135
|
+
decorationType: "statue",
|
|
131136
|
+
color: 15381256
|
|
131137
|
+
},
|
|
131138
|
+
// Yellow
|
|
131139
|
+
{
|
|
131140
|
+
min: 25001,
|
|
131141
|
+
max: 5e4,
|
|
131142
|
+
name: "Legendary",
|
|
131143
|
+
decorationType: "statue",
|
|
131144
|
+
color: 16498468
|
|
131145
|
+
},
|
|
131146
|
+
// Gold
|
|
131147
|
+
{
|
|
131148
|
+
min: 50001,
|
|
131149
|
+
max: 1e5,
|
|
131150
|
+
name: "Epic",
|
|
131151
|
+
decorationType: "statue",
|
|
131152
|
+
color: 11032055
|
|
131153
|
+
},
|
|
131154
|
+
// Purple
|
|
131155
|
+
{
|
|
131156
|
+
min: 100001,
|
|
131157
|
+
max: 25e4,
|
|
131158
|
+
name: "Mythic",
|
|
131159
|
+
decorationType: "statue",
|
|
131160
|
+
color: 9133302
|
|
131161
|
+
},
|
|
131162
|
+
// Deep Purple
|
|
131163
|
+
{
|
|
131164
|
+
min: 250001,
|
|
131165
|
+
max: 5e5,
|
|
131166
|
+
name: "Godlike",
|
|
131167
|
+
decorationType: "statue",
|
|
131168
|
+
color: 6514417
|
|
131169
|
+
},
|
|
131170
|
+
// Indigo
|
|
131171
|
+
{
|
|
131172
|
+
min: 500001,
|
|
131173
|
+
max: Infinity,
|
|
131174
|
+
name: "Celestial",
|
|
131175
|
+
decorationType: "statue",
|
|
131176
|
+
color: 15485081
|
|
131177
|
+
}
|
|
131178
|
+
// Pink
|
|
131179
|
+
];
|
|
131180
|
+
function getStarTier(stars) {
|
|
131181
|
+
if (stars === 0) return null;
|
|
131182
|
+
for (const tier of STAR_TIERS) {
|
|
131183
|
+
if (stars >= tier.min && stars <= tier.max) {
|
|
131184
|
+
return tier;
|
|
131185
|
+
}
|
|
131186
|
+
}
|
|
131187
|
+
return STAR_TIERS[STAR_TIERS.length - 1];
|
|
131188
|
+
}
|
|
131189
|
+
function formatStarCount(stars) {
|
|
131190
|
+
if (stars < 1e3) {
|
|
131191
|
+
return stars.toString();
|
|
131192
|
+
} else if (stars < 1e6) {
|
|
131193
|
+
return `${(stars / 1e3).toFixed(1)}k`;
|
|
131194
|
+
} else {
|
|
131195
|
+
return `${(stars / 1e6).toFixed(1)}M`;
|
|
131196
|
+
}
|
|
131197
|
+
}
|
|
131198
|
+
function getDecorationSizeBonus(stars) {
|
|
131199
|
+
if (!stars || stars === 0) return 0;
|
|
131200
|
+
const tier = getStarTier(stars);
|
|
131201
|
+
if (!tier) return 0;
|
|
131202
|
+
switch (tier.decorationType) {
|
|
131203
|
+
case "flag":
|
|
131204
|
+
return 0.2;
|
|
131205
|
+
// Small flags need 20% extra space
|
|
131206
|
+
case "trophy":
|
|
131207
|
+
return 0.25;
|
|
131208
|
+
// Medium trophies need 25% extra
|
|
131209
|
+
case "statue":
|
|
131210
|
+
return 0.35;
|
|
131211
|
+
// Large statues need 35% extra
|
|
131212
|
+
default:
|
|
131213
|
+
return 0;
|
|
131214
|
+
}
|
|
131215
|
+
}
|
|
131216
|
+
function generateFlagSprite(color2) {
|
|
131217
|
+
const flag = new Graphics();
|
|
131218
|
+
flag.rect(0, 0, 2, 12);
|
|
131219
|
+
flag.fill(9127187);
|
|
131220
|
+
flag.rect(2, 0, 6, 4);
|
|
131221
|
+
flag.fill(color2);
|
|
131222
|
+
flag.rect(2, 0, 6, 1);
|
|
131223
|
+
flag.fill(multiplyColor(color2, 0.7));
|
|
131224
|
+
flag.rect(2, 3, 6, 1);
|
|
131225
|
+
flag.fill(multiplyColor(color2, 0.7));
|
|
131226
|
+
return flag;
|
|
131227
|
+
}
|
|
131228
|
+
function generateTrophySprite(color2) {
|
|
131229
|
+
const trophy = new Graphics();
|
|
131230
|
+
trophy.rect(1, 2, 6, 6);
|
|
131231
|
+
trophy.fill(color2);
|
|
131232
|
+
trophy.rect(0, 3, 1, 3);
|
|
131233
|
+
trophy.fill(color2);
|
|
131234
|
+
trophy.rect(7, 3, 1, 3);
|
|
131235
|
+
trophy.fill(color2);
|
|
131236
|
+
trophy.rect(0, 8, 8, 2);
|
|
131237
|
+
trophy.fill(multiplyColor(color2, 0.8));
|
|
131238
|
+
trophy.rect(1, 2, 6, 1);
|
|
131239
|
+
trophy.fill(multiplyColor(color2, 1.3));
|
|
131240
|
+
return trophy;
|
|
131241
|
+
}
|
|
131242
|
+
function generateStatueSprite(color2) {
|
|
131243
|
+
const statue = new Graphics();
|
|
131244
|
+
statue.rect(0, 12, 10, 3);
|
|
131245
|
+
statue.fill(8421504);
|
|
131246
|
+
statue.rect(1, 10, 8, 2);
|
|
131247
|
+
statue.fill(9474192);
|
|
131248
|
+
statue.rect(2, 2, 6, 8);
|
|
131249
|
+
statue.fill(color2);
|
|
131250
|
+
statue.rect(3, 0, 4, 3);
|
|
131251
|
+
statue.fill(color2);
|
|
131252
|
+
statue.rect(1, 4, 1, 3);
|
|
131253
|
+
statue.fill(color2);
|
|
131254
|
+
statue.rect(8, 4, 1, 3);
|
|
131255
|
+
statue.fill(color2);
|
|
131256
|
+
statue.rect(3, 0, 4, 1);
|
|
131257
|
+
statue.fill(multiplyColor(color2, 1.3));
|
|
131258
|
+
return statue;
|
|
131259
|
+
}
|
|
131260
|
+
function multiplyColor(color2, factor) {
|
|
131261
|
+
const r2 = Math.min(255, Math.floor((color2 >> 16 & 255) * factor));
|
|
131262
|
+
const g2 = Math.min(255, Math.floor((color2 >> 8 & 255) * factor));
|
|
131263
|
+
const b2 = Math.min(255, Math.floor((color2 & 255) * factor));
|
|
131264
|
+
return r2 << 16 | g2 << 8 | b2;
|
|
131265
|
+
}
|
|
131266
|
+
const COLLABORATOR_TIERS = [
|
|
131267
|
+
{ min: 1, max: 3, name: "Solo", decorationType: "bench", color: 9139029 },
|
|
131268
|
+
// Brown
|
|
131269
|
+
{
|
|
131270
|
+
min: 4,
|
|
131271
|
+
max: 10,
|
|
131272
|
+
name: "Small Team",
|
|
131273
|
+
decorationType: "bench",
|
|
131274
|
+
color: 10519149
|
|
131275
|
+
},
|
|
131276
|
+
// Light brown
|
|
131277
|
+
{
|
|
131278
|
+
min: 11,
|
|
131279
|
+
max: 25,
|
|
131280
|
+
name: "Active Team",
|
|
131281
|
+
decorationType: "pavilion",
|
|
131282
|
+
color: 9741240
|
|
131283
|
+
},
|
|
131284
|
+
// Silver
|
|
131285
|
+
{
|
|
131286
|
+
min: 26,
|
|
131287
|
+
max: 50,
|
|
131288
|
+
name: "Large Team",
|
|
131289
|
+
decorationType: "pavilion",
|
|
131290
|
+
color: 16498468
|
|
131291
|
+
},
|
|
131292
|
+
// Gold
|
|
131293
|
+
{
|
|
131294
|
+
min: 51,
|
|
131295
|
+
max: 100,
|
|
131296
|
+
name: "Community",
|
|
131297
|
+
decorationType: "gazebo",
|
|
131298
|
+
color: 11032055
|
|
131299
|
+
},
|
|
131300
|
+
// Purple
|
|
131301
|
+
{
|
|
131302
|
+
min: 101,
|
|
131303
|
+
max: 250,
|
|
131304
|
+
name: "Major Project",
|
|
131305
|
+
decorationType: "gazebo",
|
|
131306
|
+
color: 3900150
|
|
131307
|
+
},
|
|
131308
|
+
// Blue
|
|
131309
|
+
{
|
|
131310
|
+
min: 251,
|
|
131311
|
+
max: Number.POSITIVE_INFINITY,
|
|
131312
|
+
name: "Open Source Hub",
|
|
131313
|
+
decorationType: "bandstand",
|
|
131314
|
+
color: 1096065
|
|
131315
|
+
}
|
|
131316
|
+
// Green
|
|
131317
|
+
];
|
|
131318
|
+
function getCollaboratorTier(count2) {
|
|
131319
|
+
if (count2 <= 0) return null;
|
|
131320
|
+
return COLLABORATOR_TIERS.find((tier) => count2 >= tier.min && count2 <= tier.max) || null;
|
|
131321
|
+
}
|
|
131322
|
+
function getCollaboratorDecorationSizeBonus(count2) {
|
|
131323
|
+
const tier = getCollaboratorTier(count2);
|
|
131324
|
+
if (!tier) return 0;
|
|
131325
|
+
switch (tier.decorationType) {
|
|
131326
|
+
case "bench":
|
|
131327
|
+
return 0.15;
|
|
131328
|
+
// Small footprint
|
|
131329
|
+
case "pavilion":
|
|
131330
|
+
return 0.2;
|
|
131331
|
+
// Medium footprint
|
|
131332
|
+
case "gazebo":
|
|
131333
|
+
return 0.25;
|
|
131334
|
+
// Larger structure
|
|
131335
|
+
case "bandstand":
|
|
131336
|
+
return 0.3;
|
|
131337
|
+
// Largest structure
|
|
131338
|
+
default:
|
|
131339
|
+
return 0.15;
|
|
131340
|
+
}
|
|
131341
|
+
}
|
|
131342
|
+
function formatCollaboratorCount(count2) {
|
|
131343
|
+
if (count2 < 1e3) {
|
|
131344
|
+
return count2.toString();
|
|
131345
|
+
} else if (count2 < 1e6) {
|
|
131346
|
+
return `${(count2 / 1e3).toFixed(1)}k`;
|
|
131347
|
+
} else {
|
|
131348
|
+
return `${(count2 / 1e6).toFixed(1)}M`;
|
|
131349
|
+
}
|
|
131350
|
+
}
|
|
131351
|
+
function generateBenchSprite(color2) {
|
|
131352
|
+
const bench = new Graphics();
|
|
131353
|
+
bench.rect(1, 6, 1, 3);
|
|
131354
|
+
bench.fill(6636321);
|
|
131355
|
+
bench.rect(6, 6, 1, 3);
|
|
131356
|
+
bench.fill(6636321);
|
|
131357
|
+
bench.rect(0, 5, 8, 2);
|
|
131358
|
+
bench.fill(color2);
|
|
131359
|
+
bench.rect(0, 2, 8, 1);
|
|
131360
|
+
bench.fill(color2);
|
|
131361
|
+
bench.rect(1, 3, 1, 2);
|
|
131362
|
+
bench.fill(6636321);
|
|
131363
|
+
bench.rect(6, 3, 1, 2);
|
|
131364
|
+
bench.fill(6636321);
|
|
131365
|
+
return bench;
|
|
131366
|
+
}
|
|
131367
|
+
function generatePavilionSprite(color2) {
|
|
131368
|
+
const pavilion = new Graphics();
|
|
131369
|
+
pavilion.rect(1, 6, 1, 6);
|
|
131370
|
+
pavilion.fill(9127187);
|
|
131371
|
+
pavilion.rect(10, 6, 1, 6);
|
|
131372
|
+
pavilion.fill(9127187);
|
|
131373
|
+
pavilion.rect(1, 10, 1, 2);
|
|
131374
|
+
pavilion.fill(9127187);
|
|
131375
|
+
pavilion.rect(10, 10, 1, 2);
|
|
131376
|
+
pavilion.fill(9127187);
|
|
131377
|
+
pavilion.beginPath();
|
|
131378
|
+
pavilion.moveTo(0, 6);
|
|
131379
|
+
pavilion.lineTo(6, 3);
|
|
131380
|
+
pavilion.lineTo(12, 6);
|
|
131381
|
+
pavilion.lineTo(6, 7);
|
|
131382
|
+
pavilion.closePath();
|
|
131383
|
+
pavilion.fill(adjustBrightness$1(color2, 0.7));
|
|
131384
|
+
pavilion.beginPath();
|
|
131385
|
+
pavilion.moveTo(1, 5);
|
|
131386
|
+
pavilion.lineTo(6, 2);
|
|
131387
|
+
pavilion.lineTo(11, 5);
|
|
131388
|
+
pavilion.lineTo(6, 6);
|
|
131389
|
+
pavilion.closePath();
|
|
131390
|
+
pavilion.fill(color2);
|
|
131391
|
+
pavilion.rect(2, 11, 8, 1);
|
|
131392
|
+
pavilion.fill(6636321);
|
|
131393
|
+
return pavilion;
|
|
131394
|
+
}
|
|
131395
|
+
function generateGazeboSprite(color2) {
|
|
131396
|
+
const gazebo = new Graphics();
|
|
131397
|
+
gazebo.beginPath();
|
|
131398
|
+
gazebo.moveTo(5, 14);
|
|
131399
|
+
gazebo.lineTo(9, 14);
|
|
131400
|
+
gazebo.lineTo(11, 12);
|
|
131401
|
+
gazebo.lineTo(11, 10);
|
|
131402
|
+
gazebo.lineTo(9, 8);
|
|
131403
|
+
gazebo.lineTo(5, 8);
|
|
131404
|
+
gazebo.lineTo(3, 10);
|
|
131405
|
+
gazebo.lineTo(3, 12);
|
|
131406
|
+
gazebo.closePath();
|
|
131407
|
+
gazebo.fill(9139029);
|
|
131408
|
+
gazebo.rect(4, 8, 1, 6);
|
|
131409
|
+
gazebo.fill(6636321);
|
|
131410
|
+
gazebo.rect(9, 8, 1, 6);
|
|
131411
|
+
gazebo.fill(6636321);
|
|
131412
|
+
gazebo.beginPath();
|
|
131413
|
+
gazebo.moveTo(2, 8);
|
|
131414
|
+
gazebo.lineTo(7, 4);
|
|
131415
|
+
gazebo.lineTo(12, 8);
|
|
131416
|
+
gazebo.lineTo(7, 9);
|
|
131417
|
+
gazebo.closePath();
|
|
131418
|
+
gazebo.fill(adjustBrightness$1(color2, 0.6));
|
|
131419
|
+
gazebo.beginPath();
|
|
131420
|
+
gazebo.moveTo(3, 6);
|
|
131421
|
+
gazebo.lineTo(7, 3);
|
|
131422
|
+
gazebo.lineTo(11, 6);
|
|
131423
|
+
gazebo.lineTo(7, 7);
|
|
131424
|
+
gazebo.closePath();
|
|
131425
|
+
gazebo.fill(adjustBrightness$1(color2, 0.8));
|
|
131426
|
+
gazebo.beginPath();
|
|
131427
|
+
gazebo.moveTo(4, 4);
|
|
131428
|
+
gazebo.lineTo(7, 2);
|
|
131429
|
+
gazebo.lineTo(10, 4);
|
|
131430
|
+
gazebo.lineTo(7, 5);
|
|
131431
|
+
gazebo.closePath();
|
|
131432
|
+
gazebo.fill(color2);
|
|
131433
|
+
gazebo.rect(6, 0, 2, 2);
|
|
131434
|
+
gazebo.fill(16766720);
|
|
131435
|
+
return gazebo;
|
|
131436
|
+
}
|
|
131437
|
+
function generateBandstandSprite(color2) {
|
|
131438
|
+
const bandstand = new Graphics();
|
|
131439
|
+
bandstand.beginPath();
|
|
131440
|
+
bandstand.moveTo(2, 16);
|
|
131441
|
+
bandstand.lineTo(14, 16);
|
|
131442
|
+
bandstand.lineTo(16, 14);
|
|
131443
|
+
bandstand.lineTo(16, 11);
|
|
131444
|
+
bandstand.lineTo(14, 9);
|
|
131445
|
+
bandstand.lineTo(2, 9);
|
|
131446
|
+
bandstand.lineTo(0, 11);
|
|
131447
|
+
bandstand.lineTo(0, 14);
|
|
131448
|
+
bandstand.closePath();
|
|
131449
|
+
bandstand.fill(9139029);
|
|
131450
|
+
bandstand.rect(2, 15, 12, 1);
|
|
131451
|
+
bandstand.fill(6636321);
|
|
131452
|
+
bandstand.rect(3, 9, 2, 6);
|
|
131453
|
+
bandstand.fill(9127187);
|
|
131454
|
+
bandstand.rect(11, 9, 2, 6);
|
|
131455
|
+
bandstand.fill(9127187);
|
|
131456
|
+
bandstand.beginPath();
|
|
131457
|
+
bandstand.moveTo(0, 9);
|
|
131458
|
+
bandstand.lineTo(8, 3);
|
|
131459
|
+
bandstand.lineTo(16, 9);
|
|
131460
|
+
bandstand.lineTo(8, 11);
|
|
131461
|
+
bandstand.closePath();
|
|
131462
|
+
bandstand.fill(adjustBrightness$1(color2, 0.6));
|
|
131463
|
+
bandstand.beginPath();
|
|
131464
|
+
bandstand.moveTo(2, 7);
|
|
131465
|
+
bandstand.lineTo(8, 2);
|
|
131466
|
+
bandstand.lineTo(14, 7);
|
|
131467
|
+
bandstand.lineTo(8, 9);
|
|
131468
|
+
bandstand.closePath();
|
|
131469
|
+
bandstand.fill(adjustBrightness$1(color2, 0.8));
|
|
131470
|
+
bandstand.beginPath();
|
|
131471
|
+
bandstand.moveTo(4, 5);
|
|
131472
|
+
bandstand.lineTo(8, 1);
|
|
131473
|
+
bandstand.lineTo(12, 5);
|
|
131474
|
+
bandstand.lineTo(8, 7);
|
|
131475
|
+
bandstand.closePath();
|
|
131476
|
+
bandstand.fill(color2);
|
|
131477
|
+
bandstand.circle(8, 0, 2);
|
|
131478
|
+
bandstand.fill(16766720);
|
|
131479
|
+
bandstand.rect(3, 9, 10, 1);
|
|
131480
|
+
bandstand.fill(adjustBrightness$1(color2, 1.2));
|
|
131481
|
+
return bandstand;
|
|
131482
|
+
}
|
|
131483
|
+
function adjustBrightness$1(color2, factor) {
|
|
131484
|
+
const r2 = color2 >> 16 & 255;
|
|
131485
|
+
const g2 = color2 >> 8 & 255;
|
|
131486
|
+
const b2 = color2 & 255;
|
|
131487
|
+
const newR = Math.min(255, Math.floor(r2 * factor));
|
|
131488
|
+
const newG = Math.min(255, Math.floor(g2 * factor));
|
|
131489
|
+
const newB = Math.min(255, Math.floor(b2 * factor));
|
|
131490
|
+
return newR << 16 | newG << 8 | newB;
|
|
131491
|
+
}
|
|
131078
131492
|
function generateBuildingSprite(config) {
|
|
131079
|
-
const { size, color: color2 = 13789470 } = config;
|
|
131493
|
+
const { size, color: color2 = 13789470, stars, collaborators } = config;
|
|
131080
131494
|
const building = new Graphics();
|
|
131081
131495
|
const baseWidth = 40 * size;
|
|
131082
131496
|
const baseDepth = 40 * size;
|
|
@@ -131130,9 +131544,85 @@ function generateBuildingSprite(config) {
|
|
|
131130
131544
|
building.lineTo(isoWidth / 2, -height);
|
|
131131
131545
|
building.lineTo(isoWidth / 2, 0);
|
|
131132
131546
|
building.stroke();
|
|
131133
|
-
|
|
131134
|
-
|
|
131135
|
-
|
|
131547
|
+
if (stars && stars > 0) {
|
|
131548
|
+
const tier = getStarTier(stars);
|
|
131549
|
+
if (tier) {
|
|
131550
|
+
let decoration;
|
|
131551
|
+
switch (tier.decorationType) {
|
|
131552
|
+
case "flag":
|
|
131553
|
+
decoration = generateFlagSprite(tier.color);
|
|
131554
|
+
break;
|
|
131555
|
+
case "trophy":
|
|
131556
|
+
decoration = generateTrophySprite(tier.color);
|
|
131557
|
+
break;
|
|
131558
|
+
case "statue":
|
|
131559
|
+
decoration = generateStatueSprite(tier.color);
|
|
131560
|
+
break;
|
|
131561
|
+
}
|
|
131562
|
+
const decorationX = isoWidth * 0.4;
|
|
131563
|
+
const decorationY = -10;
|
|
131564
|
+
decoration.x = decorationX;
|
|
131565
|
+
decoration.y = decorationY;
|
|
131566
|
+
decoration.scale.set(2.5);
|
|
131567
|
+
building.addChild(decoration);
|
|
131568
|
+
const countText = new Text({
|
|
131569
|
+
text: formatStarCount(stars),
|
|
131570
|
+
style: {
|
|
131571
|
+
fontSize: 11,
|
|
131572
|
+
fill: 16777215,
|
|
131573
|
+
fontFamily: "Arial",
|
|
131574
|
+
fontWeight: "bold",
|
|
131575
|
+
stroke: { color: 0, width: 3 }
|
|
131576
|
+
},
|
|
131577
|
+
resolution: 2
|
|
131578
|
+
});
|
|
131579
|
+
countText.x = decorationX;
|
|
131580
|
+
countText.y = decorationY + 20;
|
|
131581
|
+
countText.anchor.set(0.5, 0);
|
|
131582
|
+
building.addChild(countText);
|
|
131583
|
+
}
|
|
131584
|
+
}
|
|
131585
|
+
if (collaborators && collaborators > 0) {
|
|
131586
|
+
const tier = getCollaboratorTier(collaborators);
|
|
131587
|
+
if (tier) {
|
|
131588
|
+
let decoration;
|
|
131589
|
+
switch (tier.decorationType) {
|
|
131590
|
+
case "bench":
|
|
131591
|
+
decoration = generateBenchSprite(tier.color);
|
|
131592
|
+
break;
|
|
131593
|
+
case "pavilion":
|
|
131594
|
+
decoration = generatePavilionSprite(tier.color);
|
|
131595
|
+
break;
|
|
131596
|
+
case "gazebo":
|
|
131597
|
+
decoration = generateGazeboSprite(tier.color);
|
|
131598
|
+
break;
|
|
131599
|
+
case "bandstand":
|
|
131600
|
+
decoration = generateBandstandSprite(tier.color);
|
|
131601
|
+
break;
|
|
131602
|
+
}
|
|
131603
|
+
const decorationX = -isoWidth * 0.4;
|
|
131604
|
+
const decorationY = -10;
|
|
131605
|
+
decoration.x = decorationX;
|
|
131606
|
+
decoration.y = decorationY;
|
|
131607
|
+
decoration.scale.set(2.5);
|
|
131608
|
+
building.addChild(decoration);
|
|
131609
|
+
const countText = new Text({
|
|
131610
|
+
text: formatCollaboratorCount(collaborators),
|
|
131611
|
+
style: {
|
|
131612
|
+
fontSize: 11,
|
|
131613
|
+
fill: 16777215,
|
|
131614
|
+
fontFamily: "Arial",
|
|
131615
|
+
fontWeight: "bold",
|
|
131616
|
+
stroke: { color: 0, width: 3 }
|
|
131617
|
+
},
|
|
131618
|
+
resolution: 2
|
|
131619
|
+
});
|
|
131620
|
+
countText.x = decorationX;
|
|
131621
|
+
countText.y = decorationY + 20;
|
|
131622
|
+
countText.anchor.set(0.5, 0);
|
|
131623
|
+
building.addChild(countText);
|
|
131624
|
+
}
|
|
131625
|
+
}
|
|
131136
131626
|
return building;
|
|
131137
131627
|
}
|
|
131138
131628
|
function adjustBrightness(color2, factor) {
|
|
@@ -131213,7 +131703,11 @@ class IsometricRenderer {
|
|
|
131213
131703
|
const paths = new Container();
|
|
131214
131704
|
const nodes = new Container();
|
|
131215
131705
|
if (showGrid) {
|
|
131216
|
-
const grid = this.renderGrid(
|
|
131706
|
+
const grid = this.renderGrid(
|
|
131707
|
+
mapData.width,
|
|
131708
|
+
mapData.height,
|
|
131709
|
+
mapData.regions
|
|
131710
|
+
);
|
|
131217
131711
|
background.addChild(grid);
|
|
131218
131712
|
}
|
|
131219
131713
|
const terrainContainer = this.renderTerrain(mapData.tiles);
|
|
@@ -131286,9 +131780,15 @@ class IsometricRenderer {
|
|
|
131286
131780
|
};
|
|
131287
131781
|
grid.beginPath();
|
|
131288
131782
|
grid.moveTo(screenX, screenY);
|
|
131289
|
-
grid.lineTo(
|
|
131783
|
+
grid.lineTo(
|
|
131784
|
+
screenX + this.tileWidth / 2,
|
|
131785
|
+
screenY + this.tileHeight / 2
|
|
131786
|
+
);
|
|
131290
131787
|
grid.lineTo(screenX, screenY + this.tileHeight);
|
|
131291
|
-
grid.lineTo(
|
|
131788
|
+
grid.lineTo(
|
|
131789
|
+
screenX - this.tileWidth / 2,
|
|
131790
|
+
screenY + this.tileHeight / 2
|
|
131791
|
+
);
|
|
131292
131792
|
grid.closePath();
|
|
131293
131793
|
grid.stroke();
|
|
131294
131794
|
}
|
|
@@ -131367,7 +131867,10 @@ class IsometricRenderer {
|
|
|
131367
131867
|
const totalLength = Math.sqrt(
|
|
131368
131868
|
Math.pow(to2.screenX - from.screenX, 2) + Math.pow(to2.screenY - from.screenY, 2)
|
|
131369
131869
|
);
|
|
131370
|
-
const angle = Math.atan2(
|
|
131870
|
+
const angle = Math.atan2(
|
|
131871
|
+
to2.screenY - from.screenY,
|
|
131872
|
+
to2.screenX - from.screenX
|
|
131873
|
+
);
|
|
131371
131874
|
let currentLength = 0;
|
|
131372
131875
|
while (currentLength < totalLength) {
|
|
131373
131876
|
const startX = from.screenX + Math.cos(angle) * currentLength;
|
|
@@ -131379,6 +131882,252 @@ class IsometricRenderer {
|
|
|
131379
131882
|
currentLength += dashLength + gapLength;
|
|
131380
131883
|
}
|
|
131381
131884
|
}
|
|
131885
|
+
/**
|
|
131886
|
+
* Render a node with multiple sub-packages as a grouped cluster
|
|
131887
|
+
*/
|
|
131888
|
+
renderSubdividedNode(node2) {
|
|
131889
|
+
const { screenX, screenY } = gridToScreen(node2.gridX, node2.gridY);
|
|
131890
|
+
const sizeMultiplier = node2.size || 1;
|
|
131891
|
+
const container = new Container();
|
|
131892
|
+
container.x = screenX;
|
|
131893
|
+
container.y = screenY;
|
|
131894
|
+
const footprintTiles = 4 * sizeMultiplier;
|
|
131895
|
+
const footprintWidth = footprintTiles * this.tileWidth / 2;
|
|
131896
|
+
const footprintHeight = footprintTiles * this.tileHeight / 2;
|
|
131897
|
+
const subCount = node2.subdivisions.length;
|
|
131898
|
+
const positions = [];
|
|
131899
|
+
const spacing = 0.35;
|
|
131900
|
+
if (subCount === 2) {
|
|
131901
|
+
positions.push(
|
|
131902
|
+
{ x: -footprintWidth * spacing, y: 0 },
|
|
131903
|
+
{ x: footprintWidth * spacing, y: 0 }
|
|
131904
|
+
);
|
|
131905
|
+
} else if (subCount === 3) {
|
|
131906
|
+
positions.push(
|
|
131907
|
+
{
|
|
131908
|
+
x: -footprintWidth * spacing * 0.6,
|
|
131909
|
+
y: -footprintHeight * spacing * 0.6
|
|
131910
|
+
},
|
|
131911
|
+
{
|
|
131912
|
+
x: footprintWidth * spacing * 0.6,
|
|
131913
|
+
y: -footprintHeight * spacing * 0.6
|
|
131914
|
+
},
|
|
131915
|
+
{ x: 0, y: footprintHeight * spacing * 0.8 }
|
|
131916
|
+
);
|
|
131917
|
+
} else if (subCount === 4) {
|
|
131918
|
+
positions.push(
|
|
131919
|
+
{ x: -footprintWidth * spacing, y: -footprintHeight * spacing },
|
|
131920
|
+
{ x: footprintWidth * spacing, y: -footprintHeight * spacing },
|
|
131921
|
+
{ x: -footprintWidth * spacing, y: footprintHeight * spacing },
|
|
131922
|
+
{ x: footprintWidth * spacing, y: footprintHeight * spacing }
|
|
131923
|
+
);
|
|
131924
|
+
} else {
|
|
131925
|
+
const cols = Math.ceil(Math.sqrt(subCount));
|
|
131926
|
+
const rows = Math.ceil(subCount / cols);
|
|
131927
|
+
for (let i2 = 0; i2 < subCount; i2++) {
|
|
131928
|
+
const row2 = Math.floor(i2 / cols);
|
|
131929
|
+
const col = i2 % cols;
|
|
131930
|
+
const offsetX = (col - (cols - 1) / 2) * (footprintWidth * 2 * spacing / cols);
|
|
131931
|
+
const offsetY = (row2 - (rows - 1) / 2) * (footprintHeight * 2 * spacing / rows);
|
|
131932
|
+
positions.push({ x: offsetX, y: offsetY });
|
|
131933
|
+
}
|
|
131934
|
+
}
|
|
131935
|
+
for (let i2 = 0; i2 < node2.subdivisions.length; i2++) {
|
|
131936
|
+
const sub = node2.subdivisions[i2];
|
|
131937
|
+
const texture = this.atlas[sub.sprite];
|
|
131938
|
+
if (!texture) continue;
|
|
131939
|
+
const sprite = new Sprite(texture);
|
|
131940
|
+
const offset = positions[i2] || { x: 0, y: 0 };
|
|
131941
|
+
const padding = 0.7;
|
|
131942
|
+
const boundarySize = 4 * sub.size;
|
|
131943
|
+
const boundaryWidth = boundarySize * this.tileWidth;
|
|
131944
|
+
const boundaryHeight = boundarySize * this.tileHeight;
|
|
131945
|
+
const baseScale = Math.min(
|
|
131946
|
+
boundaryWidth * padding / texture.width,
|
|
131947
|
+
boundaryHeight * padding / texture.height
|
|
131948
|
+
);
|
|
131949
|
+
sprite.scale.set(baseScale * 0.5);
|
|
131950
|
+
sprite.x = offset.x;
|
|
131951
|
+
sprite.y = offset.y;
|
|
131952
|
+
sprite.anchor.set(0.5, 0.85);
|
|
131953
|
+
if (node2.aging && node2.aging.colorFade > 0) {
|
|
131954
|
+
const fadeAmount = node2.aging.colorFade;
|
|
131955
|
+
const grayValue = Math.floor((1 - fadeAmount + fadeAmount * 0.6) * 255);
|
|
131956
|
+
sprite.tint = grayValue << 16 | grayValue << 8 | grayValue;
|
|
131957
|
+
}
|
|
131958
|
+
container.addChild(sprite);
|
|
131959
|
+
const subLabel = new Text({
|
|
131960
|
+
text: sub.name,
|
|
131961
|
+
style: {
|
|
131962
|
+
fontSize: 10,
|
|
131963
|
+
fill: 16777215,
|
|
131964
|
+
fontFamily: "Arial",
|
|
131965
|
+
fontWeight: "400"
|
|
131966
|
+
},
|
|
131967
|
+
resolution: 2
|
|
131968
|
+
});
|
|
131969
|
+
subLabel.x = offset.x;
|
|
131970
|
+
subLabel.y = offset.y + sprite.height * 0.15 + 4;
|
|
131971
|
+
subLabel.anchor.set(0.5, 0);
|
|
131972
|
+
container.addChild(subLabel);
|
|
131973
|
+
}
|
|
131974
|
+
if (node2.stars && node2.stars > 0) {
|
|
131975
|
+
const tier = getStarTier(node2.stars);
|
|
131976
|
+
if (tier) {
|
|
131977
|
+
let decoration;
|
|
131978
|
+
switch (tier.decorationType) {
|
|
131979
|
+
case "flag":
|
|
131980
|
+
decoration = generateFlagSprite(tier.color);
|
|
131981
|
+
break;
|
|
131982
|
+
case "trophy":
|
|
131983
|
+
decoration = generateTrophySprite(tier.color);
|
|
131984
|
+
break;
|
|
131985
|
+
case "statue":
|
|
131986
|
+
decoration = generateStatueSprite(tier.color);
|
|
131987
|
+
break;
|
|
131988
|
+
}
|
|
131989
|
+
const decorationX = 0;
|
|
131990
|
+
const decorationY = -footprintHeight * 0.35;
|
|
131991
|
+
decoration.x = decorationX;
|
|
131992
|
+
decoration.y = decorationY;
|
|
131993
|
+
decoration.scale.set(2.5);
|
|
131994
|
+
container.addChild(decoration);
|
|
131995
|
+
const countText = new Text({
|
|
131996
|
+
text: formatStarCount(node2.stars),
|
|
131997
|
+
style: {
|
|
131998
|
+
fontSize: 11,
|
|
131999
|
+
fill: 16777215,
|
|
132000
|
+
fontFamily: "Arial",
|
|
132001
|
+
fontWeight: "bold",
|
|
132002
|
+
stroke: { color: 0, width: 3 }
|
|
132003
|
+
},
|
|
132004
|
+
resolution: 2
|
|
132005
|
+
});
|
|
132006
|
+
countText.x = decorationX;
|
|
132007
|
+
countText.y = decorationY + 20;
|
|
132008
|
+
countText.anchor.set(0.5, 0);
|
|
132009
|
+
container.addChild(countText);
|
|
132010
|
+
}
|
|
132011
|
+
}
|
|
132012
|
+
if (node2.collaborators && node2.collaborators > 0) {
|
|
132013
|
+
const tier = getCollaboratorTier(node2.collaborators);
|
|
132014
|
+
if (tier) {
|
|
132015
|
+
let decoration;
|
|
132016
|
+
switch (tier.decorationType) {
|
|
132017
|
+
case "bench":
|
|
132018
|
+
decoration = generateBenchSprite(tier.color);
|
|
132019
|
+
break;
|
|
132020
|
+
case "pavilion":
|
|
132021
|
+
decoration = generatePavilionSprite(tier.color);
|
|
132022
|
+
break;
|
|
132023
|
+
case "gazebo":
|
|
132024
|
+
decoration = generateGazeboSprite(tier.color);
|
|
132025
|
+
break;
|
|
132026
|
+
case "bandstand":
|
|
132027
|
+
decoration = generateBandstandSprite(tier.color);
|
|
132028
|
+
break;
|
|
132029
|
+
}
|
|
132030
|
+
const decorationX = -footprintWidth * 0.4;
|
|
132031
|
+
const decorationY = -footprintHeight * 0.35;
|
|
132032
|
+
decoration.x = decorationX;
|
|
132033
|
+
decoration.y = decorationY;
|
|
132034
|
+
decoration.scale.set(2.5);
|
|
132035
|
+
container.addChild(decoration);
|
|
132036
|
+
const countText = new Text({
|
|
132037
|
+
text: formatCollaboratorCount(node2.collaborators),
|
|
132038
|
+
style: {
|
|
132039
|
+
fontSize: 11,
|
|
132040
|
+
fill: 16777215,
|
|
132041
|
+
fontFamily: "Arial",
|
|
132042
|
+
fontWeight: "bold",
|
|
132043
|
+
stroke: { color: 0, width: 3 }
|
|
132044
|
+
},
|
|
132045
|
+
resolution: 2
|
|
132046
|
+
});
|
|
132047
|
+
countText.x = decorationX;
|
|
132048
|
+
countText.y = decorationY + 20;
|
|
132049
|
+
countText.anchor.set(0.5, 0);
|
|
132050
|
+
container.addChild(countText);
|
|
132051
|
+
}
|
|
132052
|
+
}
|
|
132053
|
+
const highlight = this.createHighlight(
|
|
132054
|
+
node2.gridX,
|
|
132055
|
+
node2.gridY,
|
|
132056
|
+
sizeMultiplier
|
|
132057
|
+
);
|
|
132058
|
+
highlight.visible = false;
|
|
132059
|
+
highlight.zIndex = getIsometricZIndex(node2.gridX, node2.gridY);
|
|
132060
|
+
const label = new Text({
|
|
132061
|
+
text: node2.label,
|
|
132062
|
+
style: {
|
|
132063
|
+
fontSize: 11,
|
|
132064
|
+
fill: 11184810,
|
|
132065
|
+
// Lighter gray to distinguish from package labels
|
|
132066
|
+
fontFamily: "Arial",
|
|
132067
|
+
fontWeight: "500",
|
|
132068
|
+
fontStyle: "italic"
|
|
132069
|
+
},
|
|
132070
|
+
resolution: 2
|
|
132071
|
+
});
|
|
132072
|
+
label.x = screenX;
|
|
132073
|
+
label.y = screenY + footprintHeight * 0.6 + 12;
|
|
132074
|
+
label.anchor.set(0.5, 0);
|
|
132075
|
+
label.zIndex = highlight.zIndex + 0.2;
|
|
132076
|
+
container.zIndex = highlight.zIndex;
|
|
132077
|
+
let weathering;
|
|
132078
|
+
if (node2.aging && node2.aging.weatheringLevel > 0.3) {
|
|
132079
|
+
weathering = this.createWeathering(
|
|
132080
|
+
screenX,
|
|
132081
|
+
screenY,
|
|
132082
|
+
80,
|
|
132083
|
+
80,
|
|
132084
|
+
node2.aging.weatheringLevel
|
|
132085
|
+
);
|
|
132086
|
+
weathering.zIndex = container.zIndex + 0.1;
|
|
132087
|
+
}
|
|
132088
|
+
const instance = {
|
|
132089
|
+
sprite: container,
|
|
132090
|
+
// Container acts as the sprite
|
|
132091
|
+
highlight,
|
|
132092
|
+
label,
|
|
132093
|
+
weathering,
|
|
132094
|
+
gridPosition: { gridX: node2.gridX, gridY: node2.gridY },
|
|
132095
|
+
size: sizeMultiplier,
|
|
132096
|
+
update: (gridX, gridY) => {
|
|
132097
|
+
const pos = gridToScreen(gridX, gridY);
|
|
132098
|
+
container.x = pos.screenX;
|
|
132099
|
+
container.y = pos.screenY;
|
|
132100
|
+
label.x = pos.screenX;
|
|
132101
|
+
label.y = pos.screenY + footprintHeight * 0.6 + 12;
|
|
132102
|
+
highlight.clear();
|
|
132103
|
+
const hoverSize = 4 * sizeMultiplier;
|
|
132104
|
+
const tileWidth = hoverSize * this.tileWidth;
|
|
132105
|
+
const tileHeight = hoverSize * this.tileHeight;
|
|
132106
|
+
highlight.strokeStyle = { width: 3, color: 16776960 };
|
|
132107
|
+
highlight.fillStyle = { color: 16776960, alpha: 0.1 };
|
|
132108
|
+
highlight.beginPath();
|
|
132109
|
+
highlight.moveTo(pos.screenX, pos.screenY - tileHeight / 2);
|
|
132110
|
+
highlight.lineTo(pos.screenX + tileWidth / 2, pos.screenY);
|
|
132111
|
+
highlight.lineTo(pos.screenX, pos.screenY + tileHeight / 2);
|
|
132112
|
+
highlight.lineTo(pos.screenX - tileWidth / 2, pos.screenY);
|
|
132113
|
+
highlight.closePath();
|
|
132114
|
+
highlight.fill();
|
|
132115
|
+
highlight.stroke();
|
|
132116
|
+
if (weathering) {
|
|
132117
|
+
weathering.x = pos.screenX;
|
|
132118
|
+
weathering.y = pos.screenY;
|
|
132119
|
+
}
|
|
132120
|
+
instance.gridPosition = { gridX, gridY };
|
|
132121
|
+
},
|
|
132122
|
+
destroy: () => {
|
|
132123
|
+
container.destroy({ children: true });
|
|
132124
|
+
highlight.destroy();
|
|
132125
|
+
label.destroy();
|
|
132126
|
+
weathering == null ? void 0 : weathering.destroy();
|
|
132127
|
+
}
|
|
132128
|
+
};
|
|
132129
|
+
return instance;
|
|
132130
|
+
}
|
|
131382
132131
|
/**
|
|
131383
132132
|
* Render sprites with scaling, aging, and weathering effects
|
|
131384
132133
|
* Extracted from OverworldMapPanel.tsx lines 457-507
|
|
@@ -131386,6 +132135,11 @@ class IsometricRenderer {
|
|
|
131386
132135
|
renderSprites(nodes) {
|
|
131387
132136
|
const spriteInstances = /* @__PURE__ */ new Map();
|
|
131388
132137
|
for (const node2 of nodes) {
|
|
132138
|
+
if (node2.subdivisions && node2.subdivisions.length > 1) {
|
|
132139
|
+
const instance2 = this.renderSubdividedNode(node2);
|
|
132140
|
+
spriteInstances.set(node2.id, instance2);
|
|
132141
|
+
continue;
|
|
132142
|
+
}
|
|
131389
132143
|
const texture = this.atlas[node2.sprite];
|
|
131390
132144
|
if (!texture) continue;
|
|
131391
132145
|
const sprite = new Sprite(texture);
|
|
@@ -131410,7 +132164,11 @@ class IsometricRenderer {
|
|
|
131410
132164
|
sprite.tint = grayValue << 16 | grayValue << 8 | grayValue;
|
|
131411
132165
|
}
|
|
131412
132166
|
sprite.zIndex = getIsometricZIndex(node2.gridX, node2.gridY);
|
|
131413
|
-
const highlight = this.createHighlight(
|
|
132167
|
+
const highlight = this.createHighlight(
|
|
132168
|
+
node2.gridX,
|
|
132169
|
+
node2.gridY,
|
|
132170
|
+
sizeMultiplier
|
|
132171
|
+
);
|
|
131414
132172
|
highlight.visible = false;
|
|
131415
132173
|
highlight.zIndex = sprite.zIndex;
|
|
131416
132174
|
let weathering;
|
|
@@ -132365,19 +133123,27 @@ function nodesToUnifiedOverworldMap(nodes, options = {}) {
|
|
|
132365
133123
|
}
|
|
132366
133124
|
}
|
|
132367
133125
|
if (needsPositioning.length > 0) {
|
|
132368
|
-
const result = layoutSpritesInRegion(
|
|
132369
|
-
|
|
132370
|
-
|
|
132371
|
-
|
|
132372
|
-
|
|
132373
|
-
|
|
132374
|
-
|
|
132375
|
-
|
|
132376
|
-
|
|
132377
|
-
|
|
132378
|
-
|
|
133126
|
+
const result = layoutSpritesInRegion(
|
|
133127
|
+
needsPositioning,
|
|
133128
|
+
{
|
|
133129
|
+
width: REGION_SIZE_TILES,
|
|
133130
|
+
height: REGION_SIZE_TILES
|
|
133131
|
+
},
|
|
133132
|
+
{ spacing: 0.5 }
|
|
133133
|
+
);
|
|
133134
|
+
placedNodes.push(
|
|
133135
|
+
...result.placed.map((node2) => ({
|
|
133136
|
+
id: node2.id,
|
|
133137
|
+
gridX: region.bounds.x + node2.gridX,
|
|
133138
|
+
gridY: region.bounds.y + node2.gridY,
|
|
133139
|
+
size: node2.size,
|
|
133140
|
+
language: node2.language
|
|
133141
|
+
}))
|
|
133142
|
+
);
|
|
132379
133143
|
if (result.overflow.length > 0) {
|
|
132380
|
-
console.warn(
|
|
133144
|
+
console.warn(
|
|
133145
|
+
`[nodesToUnifiedOverworldMap] ${result.overflow.length} nodes didn't fit in region ${region.name}`
|
|
133146
|
+
);
|
|
132381
133147
|
}
|
|
132382
133148
|
}
|
|
132383
133149
|
region.nodes = placedNodes;
|
|
@@ -132390,10 +133156,20 @@ function nodesToUnifiedOverworldMap(nodes, options = {}) {
|
|
|
132390
133156
|
});
|
|
132391
133157
|
if (hasAgeData && layoutRegions.length >= 2) {
|
|
132392
133158
|
const regionMapping = /* @__PURE__ */ new Map();
|
|
132393
|
-
const ageBuckets = [
|
|
133159
|
+
const ageBuckets = [
|
|
133160
|
+
"LAST_MONTH",
|
|
133161
|
+
"LAST_3_MONTHS",
|
|
133162
|
+
"LAST_YEAR",
|
|
133163
|
+
"OLDER"
|
|
133164
|
+
];
|
|
132394
133165
|
ageBuckets.forEach((bucket, index2) => {
|
|
132395
|
-
const regionIndex = Math.floor(
|
|
132396
|
-
|
|
133166
|
+
const regionIndex = Math.floor(
|
|
133167
|
+
index2 / ageBuckets.length * layoutRegions.length
|
|
133168
|
+
);
|
|
133169
|
+
regionMapping.set(
|
|
133170
|
+
bucket,
|
|
133171
|
+
layoutRegions[Math.min(regionIndex, layoutRegions.length - 1)]
|
|
133172
|
+
);
|
|
132397
133173
|
});
|
|
132398
133174
|
const getAgeBucket2 = (lastEditedAt) => {
|
|
132399
133175
|
if (!lastEditedAt) return "OLDER";
|
|
@@ -132416,35 +133192,51 @@ function nodesToUnifiedOverworldMap(nodes, options = {}) {
|
|
|
132416
133192
|
}
|
|
132417
133193
|
for (const [bucket, nodes2] of nodesByAge.entries()) {
|
|
132418
133194
|
const targetRegion = regionMapping.get(bucket) || layoutRegions[0];
|
|
132419
|
-
const result = layoutSpritesInRegion(
|
|
133195
|
+
const result = layoutSpritesInRegion(
|
|
133196
|
+
nodes2,
|
|
133197
|
+
{
|
|
133198
|
+
width: REGION_SIZE_TILES,
|
|
133199
|
+
height: REGION_SIZE_TILES
|
|
133200
|
+
},
|
|
133201
|
+
{ spacing: 0.5 }
|
|
133202
|
+
);
|
|
133203
|
+
targetRegion.nodes.push(
|
|
133204
|
+
...result.placed.map((node2) => ({
|
|
133205
|
+
id: node2.id,
|
|
133206
|
+
gridX: targetRegion.bounds.x + node2.gridX,
|
|
133207
|
+
gridY: targetRegion.bounds.y + node2.gridY,
|
|
133208
|
+
size: node2.size,
|
|
133209
|
+
language: node2.language
|
|
133210
|
+
}))
|
|
133211
|
+
);
|
|
133212
|
+
}
|
|
133213
|
+
} else {
|
|
133214
|
+
const firstRegion = layoutRegions[0];
|
|
133215
|
+
const result = layoutSpritesInRegion(
|
|
133216
|
+
unassignedNodes,
|
|
133217
|
+
{
|
|
132420
133218
|
width: REGION_SIZE_TILES,
|
|
132421
133219
|
height: REGION_SIZE_TILES
|
|
132422
|
-
},
|
|
132423
|
-
|
|
133220
|
+
},
|
|
133221
|
+
{ spacing: 0.5 }
|
|
133222
|
+
);
|
|
133223
|
+
firstRegion.nodes.push(
|
|
133224
|
+
...result.placed.map((node2) => ({
|
|
132424
133225
|
id: node2.id,
|
|
132425
|
-
gridX:
|
|
132426
|
-
gridY:
|
|
133226
|
+
gridX: firstRegion.bounds.x + node2.gridX,
|
|
133227
|
+
gridY: firstRegion.bounds.y + node2.gridY,
|
|
132427
133228
|
size: node2.size,
|
|
132428
133229
|
language: node2.language
|
|
132429
|
-
}))
|
|
132430
|
-
|
|
132431
|
-
} else {
|
|
132432
|
-
const firstRegion = layoutRegions[0];
|
|
132433
|
-
const result = layoutSpritesInRegion(unassignedNodes, {
|
|
132434
|
-
width: REGION_SIZE_TILES,
|
|
132435
|
-
height: REGION_SIZE_TILES
|
|
132436
|
-
}, { spacing: 0.5 });
|
|
132437
|
-
firstRegion.nodes.push(...result.placed.map((node2) => ({
|
|
132438
|
-
id: node2.id,
|
|
132439
|
-
gridX: firstRegion.bounds.x + node2.gridX,
|
|
132440
|
-
gridY: firstRegion.bounds.y + node2.gridY,
|
|
132441
|
-
size: node2.size,
|
|
132442
|
-
language: node2.language
|
|
132443
|
-
})));
|
|
133230
|
+
}))
|
|
133231
|
+
);
|
|
132444
133232
|
}
|
|
132445
133233
|
}
|
|
132446
133234
|
} else {
|
|
132447
|
-
const autoLayoutRegions = layoutSpritesMultiRegion(
|
|
133235
|
+
const autoLayoutRegions = layoutSpritesMultiRegion(
|
|
133236
|
+
layoutNodes,
|
|
133237
|
+
REGION_SIZE_TILES,
|
|
133238
|
+
{ spacing: 0.5 }
|
|
133239
|
+
);
|
|
132448
133240
|
layoutRegions = autoLayoutRegions.map((region, index2) => ({
|
|
132449
133241
|
regionId: region.regionId,
|
|
132450
133242
|
name: region.name || `Region ${index2 + 1}`,
|
|
@@ -132457,7 +133249,12 @@ function nodesToUnifiedOverworldMap(nodes, options = {}) {
|
|
|
132457
133249
|
regionId: "region-0-0",
|
|
132458
133250
|
name: "Main",
|
|
132459
133251
|
gridPosition: { row: 0, col: 0 },
|
|
132460
|
-
bounds: {
|
|
133252
|
+
bounds: {
|
|
133253
|
+
x: 0,
|
|
133254
|
+
y: 0,
|
|
133255
|
+
width: REGION_SIZE_TILES,
|
|
133256
|
+
height: REGION_SIZE_TILES
|
|
133257
|
+
},
|
|
132461
133258
|
nodes: []
|
|
132462
133259
|
});
|
|
132463
133260
|
}
|
|
@@ -132474,16 +133271,37 @@ function nodesToUnifiedOverworldMap(nodes, options = {}) {
|
|
|
132474
133271
|
}
|
|
132475
133272
|
}
|
|
132476
133273
|
const locationNodes = nodeWithSizes.map((node2) => {
|
|
132477
|
-
|
|
133274
|
+
var _a2;
|
|
133275
|
+
const pos = nodePositions.get(node2.id) || {
|
|
133276
|
+
gridX: 0,
|
|
133277
|
+
gridY: 0,
|
|
133278
|
+
size: node2.size
|
|
133279
|
+
};
|
|
132478
133280
|
const isRoot = node2.isRoot || false;
|
|
132479
133281
|
const theme2 = getCategoryTheme(node2.category, options.getCategoryTheme);
|
|
132480
133282
|
const nodeType = options.getNodeType ? options.getNodeType(node2) : determineNodeType(node2, isRoot);
|
|
132481
133283
|
const size = node2.size;
|
|
132482
133284
|
const color2 = options.getNodeColor ? options.getNodeColor(node2) : getCategoryColor(node2.category || node2.language, isRoot);
|
|
132483
|
-
const spriteKey = `building-${size.toFixed(2)}-${color2}`;
|
|
132484
|
-
const
|
|
133285
|
+
const spriteKey = `building-${size.toFixed(2)}-${color2}-${node2.stars || 0}-${node2.collaborators || 0}`;
|
|
133286
|
+
const validPackageTypes = [
|
|
133287
|
+
"node",
|
|
133288
|
+
"python",
|
|
133289
|
+
"cargo",
|
|
133290
|
+
"go",
|
|
133291
|
+
"package"
|
|
133292
|
+
];
|
|
133293
|
+
const packageType = validPackageTypes.includes(
|
|
132485
133294
|
node2.category
|
|
132486
133295
|
) ? node2.category : "package";
|
|
133296
|
+
const subdivisions = (_a2 = node2.packages) == null ? void 0 : _a2.map((pkg) => {
|
|
133297
|
+
const pkgColor = getCategoryColor(pkg.language, false);
|
|
133298
|
+
return {
|
|
133299
|
+
name: pkg.name,
|
|
133300
|
+
size: pkg.size,
|
|
133301
|
+
sprite: `building-${pkg.size.toFixed(2)}-${pkgColor}-0-0`
|
|
133302
|
+
// Subdivisions don't have individual decorations
|
|
133303
|
+
};
|
|
133304
|
+
});
|
|
132487
133305
|
return {
|
|
132488
133306
|
id: node2.id,
|
|
132489
133307
|
gridX: pos.gridX,
|
|
@@ -132496,7 +133314,10 @@ function nodesToUnifiedOverworldMap(nodes, options = {}) {
|
|
|
132496
133314
|
packageType,
|
|
132497
133315
|
isRoot,
|
|
132498
133316
|
color: color2,
|
|
132499
|
-
aging: node2.aging
|
|
133317
|
+
aging: node2.aging,
|
|
133318
|
+
subdivisions,
|
|
133319
|
+
stars: node2.stars,
|
|
133320
|
+
collaborators: node2.collaborators
|
|
132500
133321
|
};
|
|
132501
133322
|
});
|
|
132502
133323
|
const paths = [];
|
|
@@ -132617,13 +133438,18 @@ const OverworldMapPanelContent = ({
|
|
|
132617
133438
|
const rendererRef = useRef(null);
|
|
132618
133439
|
const [isRendering, setIsRendering] = useState(true);
|
|
132619
133440
|
const [isResizing, setIsResizing] = useState(false);
|
|
133441
|
+
const [initializationComplete, setInitializationComplete] = useState(0);
|
|
132620
133442
|
const dimensionsRef = useRef({ width: width || 800, height: height || 600 });
|
|
132621
133443
|
const placeholdersRef = useRef(null);
|
|
132622
133444
|
const sceneContainersRef = useRef(null);
|
|
132623
|
-
const offsetRef = useRef({
|
|
133445
|
+
const offsetRef = useRef({
|
|
133446
|
+
offsetX: 0,
|
|
133447
|
+
offsetY: 0
|
|
133448
|
+
});
|
|
132624
133449
|
const renderPlaceholdersRef = useRef(null);
|
|
132625
133450
|
const mapDataRef = useRef(null);
|
|
132626
133451
|
const isEditingRegionsRef = useRef(isEditingRegions);
|
|
133452
|
+
const isInitializedRef = useRef(false);
|
|
132627
133453
|
const [currentRegionIndex, setCurrentRegionIndex] = useState(0);
|
|
132628
133454
|
const [isAnimating, setIsAnimating] = useState(false);
|
|
132629
133455
|
const animationRef = useRef(null);
|
|
@@ -132636,14 +133462,12 @@ const OverworldMapPanelContent = ({
|
|
|
132636
133462
|
return nodes.map((n2) => n2.id).sort().join(",");
|
|
132637
133463
|
}, [collectionKey, nodes]);
|
|
132638
133464
|
const mapData = useMemo(() => {
|
|
132639
|
-
console.log("[OverworldMapPanel] mapData memo recalculating", { nodeCount: nodes.length, customRegions: customRegions.length });
|
|
132640
133465
|
const map2 = nodesToUnifiedOverworldMap(nodes, {
|
|
132641
133466
|
includeDevDependencies,
|
|
132642
133467
|
regionLayout,
|
|
132643
133468
|
customRegions
|
|
132644
133469
|
// Pass through custom regions for manual layout
|
|
132645
133470
|
});
|
|
132646
|
-
console.log("[OverworldMapPanel] mapData created:", { mapNodeCount: map2.nodes.length, mapRegions: map2.regions.length });
|
|
132647
133471
|
mapDataRef.current = map2;
|
|
132648
133472
|
return map2;
|
|
132649
133473
|
}, [nodes, includeDevDependencies, regionLayout, customRegions]);
|
|
@@ -132653,6 +133477,9 @@ const OverworldMapPanelContent = ({
|
|
|
132653
133477
|
const isCollectionChange = previousCollectionKeyRef.current !== stableCollectionKey;
|
|
132654
133478
|
const isRegionOnlyUpdate = !isCollectionChange && previousCollectionKeyRef.current !== null;
|
|
132655
133479
|
previousCollectionKeyRef.current = stableCollectionKey;
|
|
133480
|
+
if (isCollectionChange) {
|
|
133481
|
+
isInitializedRef.current = false;
|
|
133482
|
+
}
|
|
132656
133483
|
if (isRegionOnlyUpdate && viewportRef.current && rendererRef.current) {
|
|
132657
133484
|
const renderer = rendererRef.current;
|
|
132658
133485
|
const viewport = viewportRef.current;
|
|
@@ -132689,7 +133516,10 @@ const OverworldMapPanelContent = ({
|
|
|
132689
133516
|
}
|
|
132690
133517
|
const containerWidth = ((_a = canvasRef.current) == null ? void 0 : _a.clientWidth) || width || 800;
|
|
132691
133518
|
const containerHeight = ((_b = canvasRef.current) == null ? void 0 : _b.clientHeight) || height || 600;
|
|
132692
|
-
dimensionsRef.current = {
|
|
133519
|
+
dimensionsRef.current = {
|
|
133520
|
+
width: containerWidth,
|
|
133521
|
+
height: containerHeight
|
|
133522
|
+
};
|
|
132693
133523
|
app = new Application();
|
|
132694
133524
|
await app.init({
|
|
132695
133525
|
width: containerWidth,
|
|
@@ -132760,19 +133590,27 @@ const OverworldMapPanelContent = ({
|
|
|
132760
133590
|
const placeholdersContainer = new Container();
|
|
132761
133591
|
viewport.addChild(placeholdersContainer);
|
|
132762
133592
|
placeholdersRef.current = placeholdersContainer;
|
|
132763
|
-
const pathConnections = Array.from(scene.pathGraphics.entries()).map(
|
|
132764
|
-
|
|
132765
|
-
|
|
132766
|
-
|
|
132767
|
-
|
|
132768
|
-
|
|
132769
|
-
|
|
132770
|
-
|
|
132771
|
-
|
|
133593
|
+
const pathConnections = Array.from(scene.pathGraphics.entries()).map(
|
|
133594
|
+
([id2, graphics]) => {
|
|
133595
|
+
const pathData = mapData.paths.find(
|
|
133596
|
+
(p2) => `${p2.from}-${p2.to}` === id2
|
|
133597
|
+
);
|
|
133598
|
+
return {
|
|
133599
|
+
id: id2,
|
|
133600
|
+
fromNodeId: (pathData == null ? void 0 : pathData.from) || "",
|
|
133601
|
+
toNodeId: (pathData == null ? void 0 : pathData.to) || "",
|
|
133602
|
+
graphics
|
|
133603
|
+
};
|
|
133604
|
+
}
|
|
133605
|
+
);
|
|
132772
133606
|
const nodePositions = new Map(
|
|
132773
133607
|
mapData.nodes.map((n2) => [n2.id, { gridX: n2.gridX, gridY: n2.gridY }])
|
|
132774
133608
|
);
|
|
132775
|
-
const pathManager = new IsometricPathManager(
|
|
133609
|
+
const pathManager = new IsometricPathManager(
|
|
133610
|
+
pathConnections,
|
|
133611
|
+
nodePositions,
|
|
133612
|
+
renderer
|
|
133613
|
+
);
|
|
132776
133614
|
const interaction = new IsometricInteractionManager(
|
|
132777
133615
|
{
|
|
132778
133616
|
viewport,
|
|
@@ -132803,7 +133641,10 @@ const OverworldMapPanelContent = ({
|
|
|
132803
133641
|
interactionRef.current = interaction;
|
|
132804
133642
|
pathManagerRef.current = pathManager;
|
|
132805
133643
|
if (savedCameraPosition.current) {
|
|
132806
|
-
viewport.moveCenter(
|
|
133644
|
+
viewport.moveCenter(
|
|
133645
|
+
savedCameraPosition.current.x,
|
|
133646
|
+
savedCameraPosition.current.y
|
|
133647
|
+
);
|
|
132807
133648
|
viewport.setZoom(savedCameraPosition.current.scale);
|
|
132808
133649
|
} else if (mapData.regions.length > 0 && !hasInitializedCamera.current) {
|
|
132809
133650
|
const firstRegion = mapData.regions[0];
|
|
@@ -132852,15 +133693,29 @@ const OverworldMapPanelContent = ({
|
|
|
132852
133693
|
if (!placeholdersRef.current || !mapDataRef.current) return;
|
|
132853
133694
|
placeholdersRef.current.removeChildren();
|
|
132854
133695
|
if (!isEditingRegionsRef.current || !onAddRegion) return;
|
|
132855
|
-
const adjacentPositions = findAdjacentEmptyPositions(
|
|
133696
|
+
const adjacentPositions = findAdjacentEmptyPositions(
|
|
133697
|
+
mapDataRef.current.regions
|
|
133698
|
+
);
|
|
132856
133699
|
const regionSize = ((_a2 = mapDataRef.current.regions[0]) == null ? void 0 : _a2.bounds.width) || 25;
|
|
132857
133700
|
const placeholderColor = 2278750;
|
|
132858
133701
|
adjacentPositions.forEach((pos) => {
|
|
132859
133702
|
const placeholder = new Graphics();
|
|
132860
|
-
const topLeft = gridToScreen(
|
|
132861
|
-
|
|
132862
|
-
|
|
132863
|
-
|
|
133703
|
+
const topLeft = gridToScreen(
|
|
133704
|
+
pos.col * regionSize,
|
|
133705
|
+
pos.row * regionSize
|
|
133706
|
+
);
|
|
133707
|
+
const topRight = gridToScreen(
|
|
133708
|
+
pos.col * regionSize + regionSize,
|
|
133709
|
+
pos.row * regionSize
|
|
133710
|
+
);
|
|
133711
|
+
const bottomLeft = gridToScreen(
|
|
133712
|
+
pos.col * regionSize,
|
|
133713
|
+
pos.row * regionSize + regionSize
|
|
133714
|
+
);
|
|
133715
|
+
const bottomRight = gridToScreen(
|
|
133716
|
+
pos.col * regionSize + regionSize,
|
|
133717
|
+
pos.row * regionSize + regionSize
|
|
133718
|
+
);
|
|
132864
133719
|
placeholder.setStrokeStyle({
|
|
132865
133720
|
width: 2,
|
|
132866
133721
|
color: placeholderColor,
|
|
@@ -132887,10 +133742,22 @@ const OverworldMapPanelContent = ({
|
|
|
132887
133742
|
color: placeholderColor,
|
|
132888
133743
|
alpha: 0.8
|
|
132889
133744
|
});
|
|
132890
|
-
placeholder.moveTo(
|
|
132891
|
-
|
|
132892
|
-
|
|
132893
|
-
|
|
133745
|
+
placeholder.moveTo(
|
|
133746
|
+
centerScreen.screenX - iconSize / 2,
|
|
133747
|
+
centerScreen.screenY
|
|
133748
|
+
);
|
|
133749
|
+
placeholder.lineTo(
|
|
133750
|
+
centerScreen.screenX + iconSize / 2,
|
|
133751
|
+
centerScreen.screenY
|
|
133752
|
+
);
|
|
133753
|
+
placeholder.moveTo(
|
|
133754
|
+
centerScreen.screenX,
|
|
133755
|
+
centerScreen.screenY - iconSize / 2
|
|
133756
|
+
);
|
|
133757
|
+
placeholder.lineTo(
|
|
133758
|
+
centerScreen.screenX,
|
|
133759
|
+
centerScreen.screenY + iconSize / 2
|
|
133760
|
+
);
|
|
132894
133761
|
placeholder.stroke();
|
|
132895
133762
|
placeholder.eventMode = "static";
|
|
132896
133763
|
placeholder.cursor = "pointer";
|
|
@@ -132919,10 +133786,22 @@ const OverworldMapPanelContent = ({
|
|
|
132919
133786
|
color: placeholderColor,
|
|
132920
133787
|
alpha: 1
|
|
132921
133788
|
});
|
|
132922
|
-
placeholder.moveTo(
|
|
132923
|
-
|
|
132924
|
-
|
|
132925
|
-
|
|
133789
|
+
placeholder.moveTo(
|
|
133790
|
+
centerScreen.screenX - iconSize2 / 2,
|
|
133791
|
+
centerScreen.screenY
|
|
133792
|
+
);
|
|
133793
|
+
placeholder.lineTo(
|
|
133794
|
+
centerScreen.screenX + iconSize2 / 2,
|
|
133795
|
+
centerScreen.screenY
|
|
133796
|
+
);
|
|
133797
|
+
placeholder.moveTo(
|
|
133798
|
+
centerScreen.screenX,
|
|
133799
|
+
centerScreen.screenY - iconSize2 / 2
|
|
133800
|
+
);
|
|
133801
|
+
placeholder.lineTo(
|
|
133802
|
+
centerScreen.screenX,
|
|
133803
|
+
centerScreen.screenY + iconSize2 / 2
|
|
133804
|
+
);
|
|
132926
133805
|
placeholder.stroke();
|
|
132927
133806
|
});
|
|
132928
133807
|
placeholder.on("pointerleave", () => {
|
|
@@ -132949,10 +133828,22 @@ const OverworldMapPanelContent = ({
|
|
|
132949
133828
|
color: placeholderColor,
|
|
132950
133829
|
alpha: 0.8
|
|
132951
133830
|
});
|
|
132952
|
-
placeholder.moveTo(
|
|
132953
|
-
|
|
132954
|
-
|
|
132955
|
-
|
|
133831
|
+
placeholder.moveTo(
|
|
133832
|
+
centerScreen.screenX - iconSize2 / 2,
|
|
133833
|
+
centerScreen.screenY
|
|
133834
|
+
);
|
|
133835
|
+
placeholder.lineTo(
|
|
133836
|
+
centerScreen.screenX + iconSize2 / 2,
|
|
133837
|
+
centerScreen.screenY
|
|
133838
|
+
);
|
|
133839
|
+
placeholder.moveTo(
|
|
133840
|
+
centerScreen.screenX,
|
|
133841
|
+
centerScreen.screenY - iconSize2 / 2
|
|
133842
|
+
);
|
|
133843
|
+
placeholder.lineTo(
|
|
133844
|
+
centerScreen.screenX,
|
|
133845
|
+
centerScreen.screenY + iconSize2 / 2
|
|
133846
|
+
);
|
|
132956
133847
|
placeholder.stroke();
|
|
132957
133848
|
});
|
|
132958
133849
|
placeholder.on("pointerdown", () => {
|
|
@@ -132980,6 +133871,8 @@ const OverworldMapPanelContent = ({
|
|
|
132980
133871
|
}
|
|
132981
133872
|
});
|
|
132982
133873
|
setIsRendering(false);
|
|
133874
|
+
isInitializedRef.current = true;
|
|
133875
|
+
setInitializationComplete((prev) => prev + 1);
|
|
132983
133876
|
};
|
|
132984
133877
|
let resizeObserver = null;
|
|
132985
133878
|
let resizeTimeout = null;
|
|
@@ -133009,6 +133902,7 @@ const OverworldMapPanelContent = ({
|
|
|
133009
133902
|
initAndSetupResize();
|
|
133010
133903
|
return () => {
|
|
133011
133904
|
cleanup = true;
|
|
133905
|
+
isInitializedRef.current = false;
|
|
133012
133906
|
if (resizeTimeout) {
|
|
133013
133907
|
clearTimeout(resizeTimeout);
|
|
133014
133908
|
}
|
|
@@ -133035,43 +133929,48 @@ const OverworldMapPanelContent = ({
|
|
|
133035
133929
|
}, [stableCollectionKey, width, height]);
|
|
133036
133930
|
useEffect(() => {
|
|
133037
133931
|
var _a;
|
|
133038
|
-
|
|
133039
|
-
|
|
133932
|
+
if (!isInitializedRef.current) {
|
|
133933
|
+
return;
|
|
133934
|
+
}
|
|
133935
|
+
if (!viewportRef.current || !rendererRef.current || !mapData || !appRef.current) {
|
|
133936
|
+
return;
|
|
133937
|
+
}
|
|
133040
133938
|
if ((_a = interactionRef.current) == null ? void 0 : _a.isDragging()) {
|
|
133041
|
-
console.log("[OverworldMapPanel] Skipping scene re-render - drag in progress");
|
|
133042
133939
|
return;
|
|
133043
133940
|
}
|
|
133044
|
-
console.log("[OverworldMapPanel] Re-rendering scene with", { nodes: mapData.nodes.length, regions: mapData.regions.length });
|
|
133045
133941
|
const renderer = rendererRef.current;
|
|
133046
133942
|
const viewport = viewportRef.current;
|
|
133047
133943
|
const app = appRef.current;
|
|
133048
|
-
const existingKeys = new Set(renderer.getTextureKeys().filter((k2) => k2.startsWith("building-")));
|
|
133049
133944
|
const neededCombos = /* @__PURE__ */ new Set();
|
|
133050
133945
|
for (const node2 of mapData.nodes) {
|
|
133051
|
-
|
|
133052
|
-
|
|
133946
|
+
neededCombos.add(node2.sprite);
|
|
133947
|
+
if (node2.subdivisions) {
|
|
133948
|
+
for (const sub of node2.subdivisions) {
|
|
133949
|
+
neededCombos.add(sub.sprite);
|
|
133950
|
+
}
|
|
133951
|
+
}
|
|
133053
133952
|
}
|
|
133054
|
-
console.log("[OverworldMapPanel] Checking sprites:", { existing: existingKeys.size, needed: neededCombos.size });
|
|
133055
|
-
let generatedCount = 0;
|
|
133056
133953
|
for (const key of neededCombos) {
|
|
133057
133954
|
if (!renderer.hasTexture(key)) {
|
|
133058
|
-
const [, sizeStr, colorHex] = key.split("-");
|
|
133955
|
+
const [, sizeStr, colorHex, starsStr, collaboratorsStr] = key.split("-");
|
|
133059
133956
|
const size = parseFloat(sizeStr);
|
|
133060
133957
|
const color2 = parseInt(colorHex.replace("#", ""), 16);
|
|
133061
|
-
|
|
133062
|
-
const
|
|
133958
|
+
const stars = parseInt(starsStr) || 0;
|
|
133959
|
+
const collaborators = parseInt(collaboratorsStr) || 0;
|
|
133960
|
+
const buildingGraphics = generateBuildingSprite({
|
|
133961
|
+
size,
|
|
133962
|
+
color: color2,
|
|
133963
|
+
stars,
|
|
133964
|
+
collaborators
|
|
133965
|
+
});
|
|
133063
133966
|
const texture = app.renderer.generateTexture({
|
|
133064
133967
|
target: buildingGraphics,
|
|
133065
133968
|
resolution: 2
|
|
133066
133969
|
});
|
|
133067
133970
|
renderer.addTexture(key, texture);
|
|
133068
133971
|
buildingGraphics.destroy();
|
|
133069
|
-
generatedCount++;
|
|
133070
133972
|
}
|
|
133071
133973
|
}
|
|
133072
|
-
if (generatedCount > 0) {
|
|
133073
|
-
console.log("[OverworldMapPanel] Generated", generatedCount, "new sprite textures");
|
|
133074
|
-
}
|
|
133075
133974
|
if (sceneContainersRef.current) {
|
|
133076
133975
|
viewport.removeChild(sceneContainersRef.current.background);
|
|
133077
133976
|
viewport.removeChild(sceneContainersRef.current.tiles);
|
|
@@ -133084,9 +133983,7 @@ const OverworldMapPanelContent = ({
|
|
|
133084
133983
|
sceneContainersRef.current.paths.destroy({ children: true });
|
|
133085
133984
|
sceneContainersRef.current.nodes.destroy({ children: true });
|
|
133086
133985
|
}
|
|
133087
|
-
console.log("[OverworldMapPanel] Calling renderer.renderScene...");
|
|
133088
133986
|
const scene = renderer.renderScene(mapData, true);
|
|
133089
|
-
console.log("[OverworldMapPanel] Scene rendered, sprite count:", scene.spriteInstances.size);
|
|
133090
133987
|
viewport.addChild(scene.background);
|
|
133091
133988
|
viewport.addChild(scene.tiles);
|
|
133092
133989
|
viewport.addChild(scene.bridges);
|
|
@@ -133103,7 +134000,7 @@ const OverworldMapPanelContent = ({
|
|
|
133103
134000
|
if (renderPlaceholdersRef.current) {
|
|
133104
134001
|
renderPlaceholdersRef.current();
|
|
133105
134002
|
}
|
|
133106
|
-
}, [mapData]);
|
|
134003
|
+
}, [mapData, initializationComplete]);
|
|
133107
134004
|
useEffect(() => {
|
|
133108
134005
|
if (!viewportRef.current || !mapData || isRendering) return;
|
|
133109
134006
|
const region = mapData.regions[currentRegionIndex] || mapData.regions[0];
|
|
@@ -133136,176 +134033,223 @@ const OverworldMapPanelContent = ({
|
|
|
133136
134033
|
renderPlaceholdersRef.current();
|
|
133137
134034
|
}
|
|
133138
134035
|
}, [isEditingRegions]);
|
|
133139
|
-
return /* @__PURE__ */ jsxs(
|
|
133140
|
-
|
|
133141
|
-
|
|
133142
|
-
{
|
|
133143
|
-
|
|
133144
|
-
|
|
133145
|
-
|
|
133146
|
-
|
|
133147
|
-
|
|
133148
|
-
|
|
133149
|
-
|
|
133150
|
-
|
|
133151
|
-
|
|
133152
|
-
|
|
133153
|
-
|
|
133154
|
-
|
|
133155
|
-
|
|
133156
|
-
|
|
133157
|
-
|
|
133158
|
-
|
|
133159
|
-
|
|
133160
|
-
|
|
133161
|
-
|
|
133162
|
-
|
|
133163
|
-
|
|
133164
|
-
|
|
133165
|
-
|
|
133166
|
-
|
|
133167
|
-
|
|
133168
|
-
|
|
133169
|
-
|
|
133170
|
-
|
|
133171
|
-
|
|
133172
|
-
|
|
133173
|
-
|
|
133174
|
-
|
|
133175
|
-
|
|
133176
|
-
|
|
133177
|
-
|
|
133178
|
-
|
|
133179
|
-
|
|
133180
|
-
|
|
133181
|
-
|
|
133182
|
-
|
|
133183
|
-
left: "50%",
|
|
133184
|
-
transform: "translateX(-50%)",
|
|
133185
|
-
display: "flex",
|
|
133186
|
-
alignItems: "center",
|
|
133187
|
-
gap: "12px",
|
|
133188
|
-
padding: "8px 16px",
|
|
133189
|
-
backgroundColor: "rgba(0, 0, 0, 0.85)",
|
|
133190
|
-
color: "#ffffff",
|
|
133191
|
-
fontFamily: "monospace",
|
|
133192
|
-
fontSize: 14,
|
|
133193
|
-
borderRadius: 6,
|
|
133194
|
-
border: "2px solid #fbbf24",
|
|
133195
|
-
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.3)",
|
|
133196
|
-
pointerEvents: "auto"
|
|
133197
|
-
},
|
|
133198
|
-
children: [
|
|
133199
|
-
/* @__PURE__ */ jsx(
|
|
133200
|
-
"button",
|
|
133201
|
-
{
|
|
133202
|
-
onClick: () => !isAnimating && setCurrentRegionIndex((prev) => Math.max(0, prev - 1)),
|
|
133203
|
-
disabled: currentRegionIndex === 0 || isAnimating,
|
|
133204
|
-
style: {
|
|
133205
|
-
background: currentRegionIndex === 0 || isAnimating ? "rgba(100, 100, 100, 0.3)" : "rgba(251, 191, 36, 0.2)",
|
|
133206
|
-
border: "1px solid #fbbf24",
|
|
133207
|
-
borderRadius: 4,
|
|
133208
|
-
padding: "4px 8px",
|
|
133209
|
-
cursor: currentRegionIndex === 0 || isAnimating ? "not-allowed" : "pointer",
|
|
133210
|
-
display: "flex",
|
|
133211
|
-
alignItems: "center",
|
|
133212
|
-
opacity: currentRegionIndex === 0 || isAnimating ? 0.5 : 1
|
|
133213
|
-
},
|
|
133214
|
-
children: /* @__PURE__ */ jsx(ChevronLeft$1, { size: 16, color: "#fbbf24" })
|
|
134036
|
+
return /* @__PURE__ */ jsxs(
|
|
134037
|
+
"div",
|
|
134038
|
+
{
|
|
134039
|
+
style: {
|
|
134040
|
+
position: "relative",
|
|
134041
|
+
width: "100%",
|
|
134042
|
+
height: "100%",
|
|
134043
|
+
overflow: "hidden"
|
|
134044
|
+
},
|
|
134045
|
+
children: [
|
|
134046
|
+
(isLoading || isRendering) && /* @__PURE__ */ jsx(
|
|
134047
|
+
"div",
|
|
134048
|
+
{
|
|
134049
|
+
style: {
|
|
134050
|
+
position: "absolute",
|
|
134051
|
+
top: 0,
|
|
134052
|
+
left: 0,
|
|
134053
|
+
width: "100%",
|
|
134054
|
+
height: "100%",
|
|
134055
|
+
display: "flex",
|
|
134056
|
+
alignItems: "center",
|
|
134057
|
+
justifyContent: "center",
|
|
134058
|
+
backgroundColor: "#87ceeb",
|
|
134059
|
+
fontFamily: "monospace",
|
|
134060
|
+
color: "#ffffff",
|
|
134061
|
+
zIndex: 10
|
|
134062
|
+
},
|
|
134063
|
+
children: "Loading map..."
|
|
134064
|
+
}
|
|
134065
|
+
),
|
|
134066
|
+
/* @__PURE__ */ jsx(
|
|
134067
|
+
"div",
|
|
134068
|
+
{
|
|
134069
|
+
ref: canvasRef,
|
|
134070
|
+
style: {
|
|
134071
|
+
width: "100%",
|
|
134072
|
+
height: "100%",
|
|
134073
|
+
imageRendering: "pixelated",
|
|
134074
|
+
border: "2px solid #1f2937",
|
|
134075
|
+
boxSizing: "border-box",
|
|
134076
|
+
backgroundColor: "#1a1a1a",
|
|
134077
|
+
// Match Pixi background to prevent flash
|
|
134078
|
+
opacity: isResizing ? 0.95 : 1,
|
|
134079
|
+
transition: "opacity 0.1s ease-out"
|
|
133215
134080
|
}
|
|
133216
|
-
|
|
133217
|
-
|
|
133218
|
-
|
|
133219
|
-
|
|
133220
|
-
|
|
133221
|
-
|
|
133222
|
-
|
|
133223
|
-
|
|
133224
|
-
|
|
133225
|
-
|
|
133226
|
-
|
|
133227
|
-
|
|
133228
|
-
|
|
133229
|
-
|
|
133230
|
-
|
|
133231
|
-
|
|
133232
|
-
|
|
133233
|
-
|
|
133234
|
-
|
|
133235
|
-
|
|
133236
|
-
|
|
133237
|
-
|
|
133238
|
-
|
|
133239
|
-
|
|
133240
|
-
|
|
133241
|
-
|
|
133242
|
-
|
|
133243
|
-
|
|
133244
|
-
|
|
133245
|
-
|
|
133246
|
-
|
|
133247
|
-
|
|
133248
|
-
|
|
133249
|
-
|
|
133250
|
-
|
|
133251
|
-
|
|
133252
|
-
|
|
133253
|
-
|
|
133254
|
-
|
|
133255
|
-
|
|
133256
|
-
|
|
133257
|
-
|
|
133258
|
-
|
|
134081
|
+
}
|
|
134082
|
+
),
|
|
134083
|
+
mapData.regions.length > 1 && /* @__PURE__ */ jsxs(
|
|
134084
|
+
"div",
|
|
134085
|
+
{
|
|
134086
|
+
style: {
|
|
134087
|
+
position: "absolute",
|
|
134088
|
+
top: 8,
|
|
134089
|
+
left: "50%",
|
|
134090
|
+
transform: "translateX(-50%)",
|
|
134091
|
+
display: "flex",
|
|
134092
|
+
alignItems: "center",
|
|
134093
|
+
gap: "12px",
|
|
134094
|
+
padding: "8px 16px",
|
|
134095
|
+
backgroundColor: "rgba(0, 0, 0, 0.85)",
|
|
134096
|
+
color: "#ffffff",
|
|
134097
|
+
fontFamily: "monospace",
|
|
134098
|
+
fontSize: 14,
|
|
134099
|
+
borderRadius: 6,
|
|
134100
|
+
border: "2px solid #fbbf24",
|
|
134101
|
+
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.3)",
|
|
134102
|
+
pointerEvents: "auto"
|
|
134103
|
+
},
|
|
134104
|
+
children: [
|
|
134105
|
+
/* @__PURE__ */ jsx(
|
|
134106
|
+
"button",
|
|
134107
|
+
{
|
|
134108
|
+
onClick: () => !isAnimating && setCurrentRegionIndex((prev) => Math.max(0, prev - 1)),
|
|
134109
|
+
disabled: currentRegionIndex === 0 || isAnimating,
|
|
134110
|
+
style: {
|
|
134111
|
+
background: currentRegionIndex === 0 || isAnimating ? "rgba(100, 100, 100, 0.3)" : "rgba(251, 191, 36, 0.2)",
|
|
134112
|
+
border: "1px solid #fbbf24",
|
|
134113
|
+
borderRadius: 4,
|
|
134114
|
+
padding: "4px 8px",
|
|
134115
|
+
cursor: currentRegionIndex === 0 || isAnimating ? "not-allowed" : "pointer",
|
|
134116
|
+
display: "flex",
|
|
134117
|
+
alignItems: "center",
|
|
134118
|
+
opacity: currentRegionIndex === 0 || isAnimating ? 0.5 : 1
|
|
134119
|
+
},
|
|
134120
|
+
children: /* @__PURE__ */ jsx(ChevronLeft$1, { size: 16, color: "#fbbf24" })
|
|
134121
|
+
}
|
|
134122
|
+
),
|
|
134123
|
+
/* @__PURE__ */ jsxs(
|
|
134124
|
+
"div",
|
|
134125
|
+
{
|
|
134126
|
+
style: {
|
|
134127
|
+
display: "flex",
|
|
134128
|
+
flexDirection: "column",
|
|
134129
|
+
alignItems: "center",
|
|
134130
|
+
gap: "2px"
|
|
134131
|
+
},
|
|
134132
|
+
children: [
|
|
134133
|
+
/* @__PURE__ */ jsxs(
|
|
134134
|
+
"div",
|
|
134135
|
+
{
|
|
134136
|
+
style: {
|
|
134137
|
+
fontSize: 16,
|
|
134138
|
+
fontWeight: "bold",
|
|
134139
|
+
color: "#fbbf24",
|
|
134140
|
+
display: "flex",
|
|
134141
|
+
alignItems: "center",
|
|
134142
|
+
gap: "8px"
|
|
134143
|
+
},
|
|
134144
|
+
children: [
|
|
134145
|
+
currentRegion.name,
|
|
134146
|
+
isEditingRegions && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
134147
|
+
/* @__PURE__ */ jsx(
|
|
134148
|
+
"button",
|
|
134149
|
+
{
|
|
134150
|
+
onClick: () => {
|
|
134151
|
+
const newName = prompt(
|
|
134152
|
+
"Rename region:",
|
|
134153
|
+
currentRegion.name
|
|
134154
|
+
);
|
|
134155
|
+
if (newName && newName.trim() && newName !== currentRegion.name) {
|
|
134156
|
+
const matchingRegion = customRegions.find(
|
|
134157
|
+
(r2) => r2.name === currentRegion.name
|
|
134158
|
+
);
|
|
134159
|
+
if (matchingRegion && onRenameRegion) {
|
|
134160
|
+
onRenameRegion(matchingRegion.id, newName.trim());
|
|
134161
|
+
}
|
|
134162
|
+
}
|
|
134163
|
+
},
|
|
134164
|
+
style: {
|
|
134165
|
+
background: "rgba(59, 130, 246, 0.2)",
|
|
134166
|
+
border: "1px solid #3b82f6",
|
|
134167
|
+
borderRadius: 3,
|
|
134168
|
+
padding: "2px 6px",
|
|
134169
|
+
cursor: "pointer",
|
|
134170
|
+
fontSize: 10,
|
|
134171
|
+
color: "#3b82f6",
|
|
134172
|
+
fontWeight: "normal"
|
|
134173
|
+
},
|
|
134174
|
+
title: "Rename region",
|
|
134175
|
+
children: "Rename"
|
|
134176
|
+
}
|
|
134177
|
+
),
|
|
134178
|
+
/* @__PURE__ */ jsx(
|
|
134179
|
+
"button",
|
|
134180
|
+
{
|
|
134181
|
+
onClick: () => {
|
|
134182
|
+
if (confirm(
|
|
134183
|
+
`Delete region "${currentRegion.name}"? Repositories will be unassigned.`
|
|
134184
|
+
)) {
|
|
134185
|
+
const matchingRegion = customRegions.find(
|
|
134186
|
+
(r2) => r2.name === currentRegion.name
|
|
134187
|
+
);
|
|
134188
|
+
if (matchingRegion && onDeleteRegion) {
|
|
134189
|
+
onDeleteRegion(matchingRegion.id);
|
|
134190
|
+
if (currentRegionIndex > 0) {
|
|
134191
|
+
setCurrentRegionIndex((prev) => prev - 1);
|
|
134192
|
+
}
|
|
134193
|
+
}
|
|
134194
|
+
}
|
|
134195
|
+
},
|
|
134196
|
+
style: {
|
|
134197
|
+
background: "rgba(239, 68, 68, 0.2)",
|
|
134198
|
+
border: "1px solid #ef4444",
|
|
134199
|
+
borderRadius: 3,
|
|
134200
|
+
padding: "2px 6px",
|
|
134201
|
+
cursor: "pointer",
|
|
134202
|
+
fontSize: 10,
|
|
134203
|
+
color: "#ef4444",
|
|
134204
|
+
fontWeight: "normal"
|
|
134205
|
+
},
|
|
134206
|
+
title: "Delete region",
|
|
134207
|
+
children: "Delete"
|
|
134208
|
+
}
|
|
134209
|
+
)
|
|
134210
|
+
] })
|
|
134211
|
+
]
|
|
133259
134212
|
}
|
|
133260
|
-
|
|
133261
|
-
style: {
|
|
133262
|
-
|
|
133263
|
-
|
|
133264
|
-
|
|
133265
|
-
|
|
133266
|
-
|
|
133267
|
-
|
|
133268
|
-
|
|
133269
|
-
|
|
133270
|
-
}
|
|
133271
|
-
|
|
133272
|
-
|
|
133273
|
-
|
|
133274
|
-
|
|
133275
|
-
|
|
133276
|
-
|
|
133277
|
-
|
|
133278
|
-
|
|
133279
|
-
|
|
133280
|
-
|
|
133281
|
-
|
|
133282
|
-
|
|
133283
|
-
|
|
133284
|
-
|
|
133285
|
-
|
|
133286
|
-
|
|
133287
|
-
|
|
133288
|
-
|
|
133289
|
-
|
|
133290
|
-
|
|
133291
|
-
|
|
133292
|
-
|
|
133293
|
-
|
|
133294
|
-
|
|
133295
|
-
|
|
133296
|
-
|
|
133297
|
-
|
|
133298
|
-
|
|
133299
|
-
|
|
133300
|
-
opacity: currentRegionIndex === mapData.regions.length - 1 || isAnimating ? 0.5 : 1
|
|
133301
|
-
},
|
|
133302
|
-
children: /* @__PURE__ */ jsx(ChevronRight$1, { size: 16, color: "#fbbf24" })
|
|
133303
|
-
}
|
|
133304
|
-
)
|
|
133305
|
-
]
|
|
133306
|
-
}
|
|
133307
|
-
)
|
|
133308
|
-
] });
|
|
134213
|
+
),
|
|
134214
|
+
/* @__PURE__ */ jsxs("div", { style: { fontSize: 10, color: "#94a3b8" }, children: [
|
|
134215
|
+
"Region ",
|
|
134216
|
+
currentRegionIndex + 1,
|
|
134217
|
+
" of ",
|
|
134218
|
+
mapData.regions.length,
|
|
134219
|
+
" |",
|
|
134220
|
+
" ",
|
|
134221
|
+
currentRegion.nodeIds.length,
|
|
134222
|
+
" packages"
|
|
134223
|
+
] })
|
|
134224
|
+
]
|
|
134225
|
+
}
|
|
134226
|
+
),
|
|
134227
|
+
/* @__PURE__ */ jsx(
|
|
134228
|
+
"button",
|
|
134229
|
+
{
|
|
134230
|
+
onClick: () => !isAnimating && setCurrentRegionIndex(
|
|
134231
|
+
(prev) => Math.min(mapData.regions.length - 1, prev + 1)
|
|
134232
|
+
),
|
|
134233
|
+
disabled: currentRegionIndex === mapData.regions.length - 1 || isAnimating,
|
|
134234
|
+
style: {
|
|
134235
|
+
background: currentRegionIndex === mapData.regions.length - 1 || isAnimating ? "rgba(100, 100, 100, 0.3)" : "rgba(251, 191, 36, 0.2)",
|
|
134236
|
+
border: "1px solid #fbbf24",
|
|
134237
|
+
borderRadius: 4,
|
|
134238
|
+
padding: "4px 8px",
|
|
134239
|
+
cursor: currentRegionIndex === mapData.regions.length - 1 || isAnimating ? "not-allowed" : "pointer",
|
|
134240
|
+
display: "flex",
|
|
134241
|
+
alignItems: "center",
|
|
134242
|
+
opacity: currentRegionIndex === mapData.regions.length - 1 || isAnimating ? 0.5 : 1
|
|
134243
|
+
},
|
|
134244
|
+
children: /* @__PURE__ */ jsx(ChevronRight$1, { size: 16, color: "#fbbf24" })
|
|
134245
|
+
}
|
|
134246
|
+
)
|
|
134247
|
+
]
|
|
134248
|
+
}
|
|
134249
|
+
)
|
|
134250
|
+
]
|
|
134251
|
+
}
|
|
134252
|
+
);
|
|
133309
134253
|
};
|
|
133310
134254
|
const SIZE_TIERS = [1, 1.5, 2, 2.5, 3, 3.5, 4];
|
|
133311
134255
|
function roundToNearestTier(size) {
|
|
@@ -133328,6 +134272,44 @@ function calculateRepositorySize(metrics) {
|
|
|
133328
134272
|
}
|
|
133329
134273
|
return 1;
|
|
133330
134274
|
}
|
|
134275
|
+
function calculatePackageFileCount(fileSets) {
|
|
134276
|
+
return fileSets.reduce((total, fileSet) => {
|
|
134277
|
+
var _a;
|
|
134278
|
+
if (fileSet.fileCount !== void 0) {
|
|
134279
|
+
return total + fileSet.fileCount;
|
|
134280
|
+
}
|
|
134281
|
+
if ((_a = fileSet.matchedFiles) == null ? void 0 : _a.length) {
|
|
134282
|
+
return total + fileSet.matchedFiles.length;
|
|
134283
|
+
}
|
|
134284
|
+
return total;
|
|
134285
|
+
}, 0);
|
|
134286
|
+
}
|
|
134287
|
+
function extractPackageInfo(repository) {
|
|
134288
|
+
if (!repository.packages || repository.packages.length <= 1) {
|
|
134289
|
+
return void 0;
|
|
134290
|
+
}
|
|
134291
|
+
return repository.packages.map((pkg) => {
|
|
134292
|
+
const fileCount = calculatePackageFileCount(pkg.derivedFrom.fileSets);
|
|
134293
|
+
const size = calculateSizeFromFileCount(fileCount);
|
|
134294
|
+
let language2;
|
|
134295
|
+
if (pkg.type !== "package") {
|
|
134296
|
+
const typeToLanguage = {
|
|
134297
|
+
node: "typescript",
|
|
134298
|
+
python: "python",
|
|
134299
|
+
cargo: "rust",
|
|
134300
|
+
go: "go"
|
|
134301
|
+
};
|
|
134302
|
+
language2 = typeToLanguage[pkg.type];
|
|
134303
|
+
} else if (repository.github) {
|
|
134304
|
+
language2 = repository.github.primaryLanguage;
|
|
134305
|
+
}
|
|
134306
|
+
return {
|
|
134307
|
+
name: pkg.packageData.name,
|
|
134308
|
+
size,
|
|
134309
|
+
language: language2
|
|
134310
|
+
};
|
|
134311
|
+
});
|
|
134312
|
+
}
|
|
133331
134313
|
function calculateAgingMetrics(lastEditedAt) {
|
|
133332
134314
|
if (!lastEditedAt) {
|
|
133333
134315
|
return {
|
|
@@ -133381,140 +134363,159 @@ const CollectionMapPanelContent = ({
|
|
|
133381
134363
|
regionCallbacks
|
|
133382
134364
|
}) => {
|
|
133383
134365
|
var _a;
|
|
133384
|
-
const customRegions = (
|
|
134366
|
+
const customRegions = React2__default.useMemo(
|
|
134367
|
+
() => {
|
|
134368
|
+
var _a2;
|
|
134369
|
+
return ((_a2 = collection.metadata) == null ? void 0 : _a2.customRegions) || [];
|
|
134370
|
+
},
|
|
134371
|
+
[(_a = collection.metadata) == null ? void 0 : _a.customRegions]
|
|
134372
|
+
);
|
|
133385
134373
|
const [isEditingRegions, setIsEditingRegions] = React2__default.useState(false);
|
|
133386
134374
|
const viewportRef = React2__default.useRef(null);
|
|
133387
134375
|
const canvasRef = React2__default.useRef(null);
|
|
133388
|
-
const handleRenameRegion = useCallback(
|
|
133389
|
-
|
|
133390
|
-
|
|
133391
|
-
|
|
133392
|
-
|
|
133393
|
-
|
|
133394
|
-
|
|
133395
|
-
|
|
133396
|
-
|
|
133397
|
-
|
|
133398
|
-
|
|
133399
|
-
|
|
133400
|
-
|
|
133401
|
-
|
|
133402
|
-
|
|
133403
|
-
|
|
133404
|
-
|
|
133405
|
-
|
|
133406
|
-
|
|
134376
|
+
const handleRenameRegion = useCallback(
|
|
134377
|
+
async (regionId, name2) => {
|
|
134378
|
+
await regionCallbacks.onRegionUpdated(collection.id, regionId, { name: name2 });
|
|
134379
|
+
},
|
|
134380
|
+
[regionCallbacks, collection.id]
|
|
134381
|
+
);
|
|
134382
|
+
const handleDeleteRegion = useCallback(
|
|
134383
|
+
async (regionId) => {
|
|
134384
|
+
if (customRegions.length <= 1) {
|
|
134385
|
+
console.warn(
|
|
134386
|
+
"Cannot delete the last region - at least one region must exist"
|
|
134387
|
+
);
|
|
134388
|
+
alert("Cannot delete the last region. At least one region must exist.");
|
|
134389
|
+
return;
|
|
134390
|
+
}
|
|
134391
|
+
await regionCallbacks.onRegionDeleted(collection.id, regionId);
|
|
134392
|
+
},
|
|
134393
|
+
[regionCallbacks, collection.id, customRegions.length]
|
|
134394
|
+
);
|
|
134395
|
+
const handleProjectMoved = useCallback(
|
|
134396
|
+
async (projectId, gridX, gridY, metadata) => {
|
|
134397
|
+
var _a2, _b;
|
|
134398
|
+
const isNewRepo = !!metadata;
|
|
134399
|
+
const existingMembership = memberships.find(
|
|
134400
|
+
(m2) => m2.repositoryId === projectId
|
|
134401
|
+
);
|
|
134402
|
+
if (!isNewRepo && !existingMembership) {
|
|
134403
|
+
const error = new Error(
|
|
134404
|
+
`[handleProjectMoved] FATAL ERROR: Attempting to move repo "${projectId}" that doesn't exist in collection!
|
|
133407
134405
|
Memberships (${memberships.length}): [${memberships.map((m2) => m2.repositoryId).join(", ")}]
|
|
133408
134406
|
This indicates a sprite was rendered without valid backing data.`
|
|
133409
|
-
|
|
133410
|
-
|
|
133411
|
-
throw error;
|
|
133412
|
-
}
|
|
133413
|
-
const isFirstPlacement = isNewRepo || !!existingMembership && !((_a2 = existingMembership.metadata) == null ? void 0 : _a2.regionId);
|
|
133414
|
-
console.log("[handleProjectMoved] Placement check:", {
|
|
133415
|
-
isNewRepo,
|
|
133416
|
-
existingMembership: existingMembership ? { id: existingMembership.repositoryId, hasMetadata: !!existingMembership.metadata, regionId: (_b = existingMembership.metadata) == null ? void 0 : _b.regionId } : null,
|
|
133417
|
-
isExistingWithoutRegion: !!existingMembership && !((_c = existingMembership.metadata) == null ? void 0 : _c.regionId),
|
|
133418
|
-
isFirstPlacement
|
|
133419
|
-
});
|
|
133420
|
-
const regionCol = Math.floor(gridX / REGION_SIZE_TILES);
|
|
133421
|
-
const regionRow = Math.floor(gridY / REGION_SIZE_TILES);
|
|
133422
|
-
const regionOrder = regionRow * 10 + regionCol;
|
|
133423
|
-
const targetRegion = customRegions.find((r2) => r2.order === regionOrder);
|
|
133424
|
-
const newRegionId = targetRegion == null ? void 0 : targetRegion.id;
|
|
133425
|
-
console.log("[handleProjectMoved] Target region:", { regionOrder, newRegionId, targetRegion });
|
|
133426
|
-
if (!newRegionId) {
|
|
133427
|
-
console.warn("[CollectionMapPanel] ⚠️ Could not determine region for position:", { gridX, gridY, regionOrder });
|
|
133428
|
-
return;
|
|
133429
|
-
}
|
|
133430
|
-
if (isFirstPlacement) {
|
|
133431
|
-
console.log("[PLACEMENT] Starting placement for:", projectId);
|
|
133432
|
-
console.log("[PLACEMENT] Target region:", newRegionId);
|
|
133433
|
-
console.log("[PLACEMENT] Target position:", { gridX, gridY });
|
|
133434
|
-
try {
|
|
133435
|
-
if (isNewRepo) {
|
|
133436
|
-
if (!onProjectAdded) {
|
|
133437
|
-
throw new Error("onProjectAdded callback not available");
|
|
133438
|
-
}
|
|
133439
|
-
console.log("[PLACEMENT] Step 1: Calling onProjectAdded (repo not in collection yet)...");
|
|
133440
|
-
await onProjectAdded(projectId, metadata);
|
|
133441
|
-
console.log("[PLACEMENT] Step 1: onProjectAdded completed");
|
|
133442
|
-
} else {
|
|
133443
|
-
console.log("[PLACEMENT] Step 1: SKIPPED (repo already in collection as membership)");
|
|
133444
|
-
}
|
|
133445
|
-
const regionBoundsX2 = regionCol * REGION_SIZE_TILES;
|
|
133446
|
-
const regionBoundsY2 = regionRow * REGION_SIZE_TILES;
|
|
133447
|
-
const relativeGridX2 = gridX - regionBoundsX2;
|
|
133448
|
-
const relativeGridY2 = gridY - regionBoundsY2;
|
|
133449
|
-
const layout2 = {
|
|
133450
|
-
gridX: relativeGridX2,
|
|
133451
|
-
gridY: relativeGridY2
|
|
133452
|
-
};
|
|
133453
|
-
console.log("[PLACEMENT] Step 2: Setting position:", layout2);
|
|
133454
|
-
await regionCallbacks.onRepositoryPositionUpdated(collection.id, projectId, layout2);
|
|
133455
|
-
console.log("[PLACEMENT] Step 2: Position updated");
|
|
133456
|
-
console.log("[PLACEMENT] Step 3: Assigning region:", newRegionId);
|
|
133457
|
-
await regionCallbacks.onRepositoryAssigned(collection.id, projectId, newRegionId);
|
|
133458
|
-
console.log("[PLACEMENT] Step 3: Region assigned");
|
|
133459
|
-
console.log("[PLACEMENT] ✓ Placement completed successfully");
|
|
133460
|
-
} catch (error) {
|
|
133461
|
-
console.error("[PLACEMENT] ✗ ERROR during placement:", error);
|
|
134407
|
+
);
|
|
134408
|
+
console.error(error);
|
|
133462
134409
|
throw error;
|
|
133463
134410
|
}
|
|
133464
|
-
|
|
133465
|
-
|
|
133466
|
-
|
|
133467
|
-
|
|
133468
|
-
|
|
133469
|
-
|
|
133470
|
-
|
|
133471
|
-
|
|
133472
|
-
|
|
133473
|
-
|
|
133474
|
-
|
|
133475
|
-
|
|
133476
|
-
|
|
133477
|
-
|
|
133478
|
-
|
|
133479
|
-
|
|
133480
|
-
|
|
133481
|
-
|
|
133482
|
-
|
|
133483
|
-
|
|
133484
|
-
|
|
133485
|
-
|
|
133486
|
-
|
|
133487
|
-
|
|
133488
|
-
|
|
133489
|
-
|
|
133490
|
-
|
|
133491
|
-
|
|
133492
|
-
|
|
133493
|
-
|
|
133494
|
-
|
|
133495
|
-
|
|
133496
|
-
|
|
133497
|
-
|
|
133498
|
-
|
|
133499
|
-
|
|
133500
|
-
|
|
133501
|
-
|
|
133502
|
-
|
|
133503
|
-
|
|
133504
|
-
|
|
133505
|
-
|
|
133506
|
-
|
|
133507
|
-
|
|
133508
|
-
|
|
133509
|
-
|
|
133510
|
-
|
|
133511
|
-
|
|
133512
|
-
|
|
133513
|
-
|
|
133514
|
-
|
|
133515
|
-
|
|
133516
|
-
|
|
133517
|
-
|
|
134411
|
+
const isFirstPlacement = isNewRepo || !!existingMembership && !((_a2 = existingMembership.metadata) == null ? void 0 : _a2.regionId);
|
|
134412
|
+
const regionCol = Math.floor(gridX / REGION_SIZE_TILES);
|
|
134413
|
+
const regionRow = Math.floor(gridY / REGION_SIZE_TILES);
|
|
134414
|
+
const regionOrder = regionRow * 10 + regionCol;
|
|
134415
|
+
const targetRegion = customRegions.find((r2) => r2.order === regionOrder);
|
|
134416
|
+
const newRegionId = targetRegion == null ? void 0 : targetRegion.id;
|
|
134417
|
+
if (!newRegionId) {
|
|
134418
|
+
console.warn(
|
|
134419
|
+
"[CollectionMapPanel] ⚠️ Could not determine region for position:",
|
|
134420
|
+
{ gridX, gridY, regionOrder }
|
|
134421
|
+
);
|
|
134422
|
+
return;
|
|
134423
|
+
}
|
|
134424
|
+
if (isFirstPlacement) {
|
|
134425
|
+
try {
|
|
134426
|
+
if (isNewRepo) {
|
|
134427
|
+
if (!onProjectAdded) {
|
|
134428
|
+
throw new Error("onProjectAdded callback not available");
|
|
134429
|
+
}
|
|
134430
|
+
await onProjectAdded(projectId, metadata);
|
|
134431
|
+
}
|
|
134432
|
+
const regionBoundsX2 = regionCol * REGION_SIZE_TILES;
|
|
134433
|
+
const regionBoundsY2 = regionRow * REGION_SIZE_TILES;
|
|
134434
|
+
const relativeGridX2 = gridX - regionBoundsX2;
|
|
134435
|
+
const relativeGridY2 = gridY - regionBoundsY2;
|
|
134436
|
+
const layout2 = {
|
|
134437
|
+
gridX: relativeGridX2,
|
|
134438
|
+
gridY: relativeGridY2
|
|
134439
|
+
};
|
|
134440
|
+
await regionCallbacks.onRepositoryPositionUpdated(
|
|
134441
|
+
collection.id,
|
|
134442
|
+
projectId,
|
|
134443
|
+
layout2
|
|
134444
|
+
);
|
|
134445
|
+
await regionCallbacks.onRepositoryAssigned(
|
|
134446
|
+
collection.id,
|
|
134447
|
+
projectId,
|
|
134448
|
+
newRegionId
|
|
134449
|
+
);
|
|
134450
|
+
} catch (error) {
|
|
134451
|
+
console.error("[PLACEMENT] ✗ ERROR during placement:", error);
|
|
134452
|
+
throw error;
|
|
134453
|
+
}
|
|
134454
|
+
return;
|
|
134455
|
+
}
|
|
134456
|
+
const regionBoundsX = regionCol * REGION_SIZE_TILES;
|
|
134457
|
+
const regionBoundsY = regionRow * REGION_SIZE_TILES;
|
|
134458
|
+
const relativeGridX = gridX - regionBoundsX;
|
|
134459
|
+
const relativeGridY = gridY - regionBoundsY;
|
|
134460
|
+
const layout = {
|
|
134461
|
+
gridX: relativeGridX,
|
|
134462
|
+
gridY: relativeGridY
|
|
134463
|
+
};
|
|
134464
|
+
await regionCallbacks.onRepositoryPositionUpdated(
|
|
134465
|
+
collection.id,
|
|
134466
|
+
projectId,
|
|
134467
|
+
layout
|
|
134468
|
+
);
|
|
134469
|
+
const membership = memberships.find((m2) => m2.repositoryId === projectId);
|
|
134470
|
+
const oldRegionId = (_b = membership == null ? void 0 : membership.metadata) == null ? void 0 : _b.regionId;
|
|
134471
|
+
if (oldRegionId !== newRegionId) {
|
|
134472
|
+
await regionCallbacks.onRepositoryAssigned(
|
|
134473
|
+
collection.id,
|
|
134474
|
+
projectId,
|
|
134475
|
+
newRegionId
|
|
134476
|
+
);
|
|
134477
|
+
}
|
|
134478
|
+
},
|
|
134479
|
+
[collection.id, regionCallbacks, memberships, customRegions, onProjectAdded]
|
|
134480
|
+
);
|
|
134481
|
+
const handleProjectDrop = useCallback(
|
|
134482
|
+
async (data, event) => {
|
|
134483
|
+
const repositoryPath = data.primaryData;
|
|
134484
|
+
const repositoryMetadata = data.metadata || {};
|
|
134485
|
+
const repoId = (repositoryMetadata == null ? void 0 : repositoryMetadata.name) || repositoryPath;
|
|
134486
|
+
const gridCoords = domEventToGridCoords(
|
|
134487
|
+
event.clientX,
|
|
134488
|
+
event.clientY,
|
|
134489
|
+
viewportRef.current,
|
|
134490
|
+
canvasRef.current
|
|
134491
|
+
);
|
|
134492
|
+
const gridX = Math.round(gridCoords.gridX);
|
|
134493
|
+
const gridY = Math.round(gridCoords.gridY);
|
|
134494
|
+
await handleProjectMoved(repoId, gridX, gridY, repositoryMetadata);
|
|
134495
|
+
},
|
|
134496
|
+
[handleProjectMoved]
|
|
134497
|
+
);
|
|
134498
|
+
const handleDrawerDrop = useCallback(
|
|
134499
|
+
async (event) => {
|
|
134500
|
+
const unplacedNodeData = event.dataTransfer.getData(
|
|
134501
|
+
"application/x-unplaced-node"
|
|
134502
|
+
);
|
|
134503
|
+
if (!unplacedNodeData) return;
|
|
134504
|
+
event.preventDefault();
|
|
134505
|
+
event.stopPropagation();
|
|
134506
|
+
const { nodeId } = JSON.parse(unplacedNodeData);
|
|
134507
|
+
const gridCoords = domEventToGridCoords(
|
|
134508
|
+
event.clientX,
|
|
134509
|
+
event.clientY,
|
|
134510
|
+
viewportRef.current,
|
|
134511
|
+
canvasRef.current
|
|
134512
|
+
);
|
|
134513
|
+
const gridX = Math.round(gridCoords.gridX);
|
|
134514
|
+
const gridY = Math.round(gridCoords.gridY);
|
|
134515
|
+
await handleProjectMoved(nodeId, gridX, gridY);
|
|
134516
|
+
},
|
|
134517
|
+
[handleProjectMoved]
|
|
134518
|
+
);
|
|
133518
134519
|
const { isDragOver, ...dropZoneProps } = useDropZone({
|
|
133519
134520
|
handlers: [
|
|
133520
134521
|
{
|
|
@@ -133536,15 +134537,9 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
133536
134537
|
span.setAttribute("collection.id", collection.id);
|
|
133537
134538
|
span.setAttribute("memberships.count", memberships.length);
|
|
133538
134539
|
span.setAttribute("repositories.count", repositories.length);
|
|
133539
|
-
console.log("[nodes memo] Converting memberships to nodes", {
|
|
133540
|
-
collectionId: collection.id,
|
|
133541
|
-
totalMemberships: memberships.length,
|
|
133542
|
-
totalRepositories: repositories.length
|
|
133543
|
-
});
|
|
133544
134540
|
const collectionMemberships = memberships.filter(
|
|
133545
134541
|
(m2) => m2.collectionId === collection.id
|
|
133546
134542
|
);
|
|
133547
|
-
console.log("[nodes memo] Filtered memberships for collection:", collectionMemberships);
|
|
133548
134543
|
const memberNodes = collectionMemberships.map((membership) => {
|
|
133549
134544
|
var _a2, _b, _c, _d, _e2, _f, _g;
|
|
133550
134545
|
const repo = repositories.find((r2) => {
|
|
@@ -133553,10 +134548,12 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
133553
134548
|
return repoId === membership.repositoryId;
|
|
133554
134549
|
});
|
|
133555
134550
|
if (!repo) {
|
|
133556
|
-
console.warn(
|
|
134551
|
+
console.warn(
|
|
134552
|
+
"[nodes memo] No repository found for membership:",
|
|
134553
|
+
membership.repositoryId
|
|
134554
|
+
);
|
|
133557
134555
|
return null;
|
|
133558
134556
|
}
|
|
133559
|
-
console.log("[nodes memo] Creating node for:", membership.repositoryId);
|
|
133560
134557
|
let category;
|
|
133561
134558
|
if (repo.github) {
|
|
133562
134559
|
category = "git-repo";
|
|
@@ -133565,11 +134562,22 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
133565
134562
|
}
|
|
133566
134563
|
let language2;
|
|
133567
134564
|
if (repo.github) {
|
|
133568
|
-
language2 =
|
|
134565
|
+
language2 = repo.github.primaryLanguage;
|
|
134566
|
+
}
|
|
134567
|
+
const importance = ((_a2 = membership.metadata) == null ? void 0 : _a2.pinned) ? 95 : 75;
|
|
134568
|
+
let size = calculateRepositorySize(repo.metrics);
|
|
134569
|
+
const aging = calculateAgingMetrics((_b = repo.metrics) == null ? void 0 : _b.lastEditedAt);
|
|
134570
|
+
const packages = extractPackageInfo(repo);
|
|
134571
|
+
const stars = (_c = repo.github) == null ? void 0 : _c.stars;
|
|
134572
|
+
if (stars && stars > 0) {
|
|
134573
|
+
const decorationBonus = getDecorationSizeBonus(stars);
|
|
134574
|
+
size = size + decorationBonus;
|
|
134575
|
+
}
|
|
134576
|
+
const collaborators = (_d = repo.metrics) == null ? void 0 : _d.contributors;
|
|
134577
|
+
if (collaborators && collaborators > 0) {
|
|
134578
|
+
const decorationBonus = getCollaboratorDecorationSizeBonus(collaborators);
|
|
134579
|
+
size = size + decorationBonus;
|
|
133569
134580
|
}
|
|
133570
|
-
const importance = ((_c = membership.metadata) == null ? void 0 : _c.pinned) ? 95 : 75;
|
|
133571
|
-
const size = calculateRepositorySize(repo.metrics);
|
|
133572
|
-
const aging = calculateAgingMetrics((_d = repo.metrics) == null ? void 0 : _d.lastEditedAt);
|
|
133573
134581
|
const node2 = {
|
|
133574
134582
|
id: membership.repositoryId,
|
|
133575
134583
|
name: repo.name,
|
|
@@ -133580,6 +134588,12 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
133580
134588
|
size,
|
|
133581
134589
|
aging,
|
|
133582
134590
|
// Pass aging metrics for visual weathering
|
|
134591
|
+
packages,
|
|
134592
|
+
// Package subdivision data
|
|
134593
|
+
stars,
|
|
134594
|
+
// GitHub star count for decorations
|
|
134595
|
+
collaborators,
|
|
134596
|
+
// Contributor count for community space decorations
|
|
133583
134597
|
dependencies: dependencies[membership.repositoryId] || [],
|
|
133584
134598
|
isRoot: ((_e2 = membership.metadata) == null ? void 0 : _e2.pinned) || false,
|
|
133585
134599
|
regionId: (_f = membership.metadata) == null ? void 0 : _f.regionId,
|
|
@@ -133589,7 +134603,6 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
133589
134603
|
};
|
|
133590
134604
|
return node2;
|
|
133591
134605
|
}).filter((n2) => n2 !== null);
|
|
133592
|
-
console.log("[nodes memo] Created nodes:", { total: memberNodes.length });
|
|
133593
134606
|
span.setAttribute("nodes.created", memberNodes.length);
|
|
133594
134607
|
span.end();
|
|
133595
134608
|
return memberNodes;
|
|
@@ -133601,7 +134614,6 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
133601
134614
|
});
|
|
133602
134615
|
}, [collection.id, memberships, repositories, dependencies]);
|
|
133603
134616
|
const { validNodes, unplacedNodes } = useMemo(() => {
|
|
133604
|
-
console.log("[nodeValidation] Validating nodes:", nodes.length);
|
|
133605
134617
|
const nodesWithPositions = nodes.filter(
|
|
133606
134618
|
(n2) => {
|
|
133607
134619
|
var _a2, _b;
|
|
@@ -133610,7 +134622,6 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
133610
134622
|
);
|
|
133611
134623
|
const isInitialLoad = nodesWithPositions.length === 0 && nodes.length > 0;
|
|
133612
134624
|
if (isInitialLoad) {
|
|
133613
|
-
console.log("[nodeValidation] Initial load detected, skipping validation (auto-layout will run)");
|
|
133614
134625
|
return { validNodes: nodes, unplacedNodes: [] };
|
|
133615
134626
|
}
|
|
133616
134627
|
const valid2 = [];
|
|
@@ -133628,8 +134639,6 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
133628
134639
|
`[nodeValidation] Found ${unplaced.length} unplaced nodes (no regionId):
|
|
133629
134640
|
` + unplaced.map((n2) => ` - ${n2.id}`).join("\n")
|
|
133630
134641
|
);
|
|
133631
|
-
} else {
|
|
133632
|
-
console.log("[nodeValidation] ✓ All nodes have regionId");
|
|
133633
134642
|
}
|
|
133634
134643
|
return { validNodes: valid2, unplacedNodes: unplaced };
|
|
133635
134644
|
}, [nodes]);
|
|
@@ -133728,7 +134737,6 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
133728
134737
|
})();
|
|
133729
134738
|
}, [collection.id, nodes, regionLayout, customRegions, regionCallbacks]);
|
|
133730
134739
|
const handleViewportReady = useCallback((viewport) => {
|
|
133731
|
-
console.log("[CollectionMapPanel] Viewport ready for coordinate conversion");
|
|
133732
134740
|
viewportRef.current = viewport;
|
|
133733
134741
|
}, []);
|
|
133734
134742
|
const handleDragOver = useCallback((e2) => {
|
|
@@ -133737,15 +134745,18 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
133737
134745
|
e2.stopPropagation();
|
|
133738
134746
|
}
|
|
133739
134747
|
}, []);
|
|
133740
|
-
const handleDrop = useCallback(
|
|
133741
|
-
|
|
133742
|
-
e2.
|
|
133743
|
-
|
|
133744
|
-
|
|
133745
|
-
|
|
133746
|
-
dropZoneProps.onDrop
|
|
133747
|
-
|
|
133748
|
-
|
|
134748
|
+
const handleDrop = useCallback(
|
|
134749
|
+
(e2) => {
|
|
134750
|
+
if (e2.dataTransfer.types.includes("application/x-unplaced-node")) {
|
|
134751
|
+
e2.preventDefault();
|
|
134752
|
+
e2.stopPropagation();
|
|
134753
|
+
handleDrawerDrop(e2);
|
|
134754
|
+
} else if (dropZoneProps.onDrop) {
|
|
134755
|
+
dropZoneProps.onDrop(e2);
|
|
134756
|
+
}
|
|
134757
|
+
},
|
|
134758
|
+
[handleDrawerDrop, dropZoneProps]
|
|
134759
|
+
);
|
|
133749
134760
|
return /* @__PURE__ */ jsxs(
|
|
133750
134761
|
"div",
|
|
133751
134762
|
{
|
|
@@ -133807,7 +134818,11 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
133807
134818
|
onAddRegion: async (position2) => {
|
|
133808
134819
|
const order2 = position2.row * 10 + position2.col;
|
|
133809
134820
|
const name2 = `Region ${customRegions.length + 1}`;
|
|
133810
|
-
await regionCallbacks.onRegionCreated(collection.id, {
|
|
134821
|
+
await regionCallbacks.onRegionCreated(collection.id, {
|
|
134822
|
+
name: name2,
|
|
134823
|
+
order: order2,
|
|
134824
|
+
createdAt: 0
|
|
134825
|
+
});
|
|
133811
134826
|
},
|
|
133812
134827
|
onRenameRegion: handleRenameRegion,
|
|
133813
134828
|
onDeleteRegion: handleDeleteRegion
|
|
@@ -133870,10 +134885,13 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
133870
134885
|
draggable: true,
|
|
133871
134886
|
onDragStart: (e2) => {
|
|
133872
134887
|
e2.dataTransfer.setData("text/plain", node2.id);
|
|
133873
|
-
e2.dataTransfer.setData(
|
|
133874
|
-
|
|
133875
|
-
|
|
133876
|
-
|
|
134888
|
+
e2.dataTransfer.setData(
|
|
134889
|
+
"application/x-unplaced-node",
|
|
134890
|
+
JSON.stringify({
|
|
134891
|
+
nodeId: node2.id,
|
|
134892
|
+
name: node2.name
|
|
134893
|
+
})
|
|
134894
|
+
);
|
|
133877
134895
|
},
|
|
133878
134896
|
style: {
|
|
133879
134897
|
flexShrink: 0,
|
|
@@ -133921,27 +134939,37 @@ const CollectionMapPanel = ({ context: context2, actions }) => {
|
|
|
133921
134939
|
const repositories = selectedCollectionView.data.repositories;
|
|
133922
134940
|
const dependencies = selectedCollectionView.data.dependencies || {};
|
|
133923
134941
|
const isLoading = selectedCollectionView.loading;
|
|
133924
|
-
const handleProjectAdded = useCallback(
|
|
133925
|
-
|
|
133926
|
-
|
|
133927
|
-
|
|
133928
|
-
|
|
133929
|
-
|
|
133930
|
-
|
|
133931
|
-
|
|
133932
|
-
|
|
133933
|
-
|
|
133934
|
-
|
|
133935
|
-
|
|
133936
|
-
|
|
133937
|
-
|
|
133938
|
-
|
|
133939
|
-
|
|
133940
|
-
|
|
133941
|
-
|
|
133942
|
-
|
|
133943
|
-
|
|
133944
|
-
|
|
134942
|
+
const handleProjectAdded = useCallback(
|
|
134943
|
+
(repositoryPath, repositoryMetadata) => {
|
|
134944
|
+
if (!selectedCollection) {
|
|
134945
|
+
console.warn("[handleProjectAdded] No selected collection");
|
|
134946
|
+
return;
|
|
134947
|
+
}
|
|
134948
|
+
if (actions.addRepositoryToCollection) {
|
|
134949
|
+
actions.addRepositoryToCollection(
|
|
134950
|
+
selectedCollection.id,
|
|
134951
|
+
repositoryPath,
|
|
134952
|
+
repositoryMetadata
|
|
134953
|
+
);
|
|
134954
|
+
} else {
|
|
134955
|
+
console.warn(
|
|
134956
|
+
"Actions does not support addRepositoryToCollection - drag-drop feature requires context integration"
|
|
134957
|
+
);
|
|
134958
|
+
}
|
|
134959
|
+
},
|
|
134960
|
+
[actions, selectedCollection]
|
|
134961
|
+
);
|
|
134962
|
+
const regionCallbacks = useMemo(
|
|
134963
|
+
() => ({
|
|
134964
|
+
onRegionCreated: actions.onRegionCreated,
|
|
134965
|
+
onRegionUpdated: actions.onRegionUpdated,
|
|
134966
|
+
onRegionDeleted: actions.onRegionDeleted,
|
|
134967
|
+
onRepositoryAssigned: actions.onRepositoryAssigned,
|
|
134968
|
+
onRepositoryPositionUpdated: actions.onRepositoryPositionUpdated,
|
|
134969
|
+
onBatchLayoutInitialized: actions.onBatchLayoutInitialized
|
|
134970
|
+
}),
|
|
134971
|
+
[actions]
|
|
134972
|
+
);
|
|
133945
134973
|
if (!selectedCollection) {
|
|
133946
134974
|
return /* @__PURE__ */ jsxs(
|
|
133947
134975
|
"div",
|
|
@@ -134020,7 +135048,15 @@ const PackageCoverageCard = ({
|
|
|
134020
135048
|
const { theme: theme2 } = useTheme();
|
|
134021
135049
|
const stats = useMemo(() => {
|
|
134022
135050
|
if (!coverage || coverage.files.length === 0) {
|
|
134023
|
-
return {
|
|
135051
|
+
return {
|
|
135052
|
+
percentage: 0,
|
|
135053
|
+
totalTraced: 0,
|
|
135054
|
+
totalTests: 0,
|
|
135055
|
+
testFiles: 0,
|
|
135056
|
+
coveredFiles: 0,
|
|
135057
|
+
partialFiles: 0,
|
|
135058
|
+
uncoveredFiles: 0
|
|
135059
|
+
};
|
|
134024
135060
|
}
|
|
134025
135061
|
const result = calculateTelemetryCoverageStats(coverage.files);
|
|
134026
135062
|
return result;
|
|
@@ -134184,7 +135220,9 @@ const TelemetryCoveragePanelContent = ({
|
|
|
134184
135220
|
onViewTrace
|
|
134185
135221
|
}) => {
|
|
134186
135222
|
const { theme: theme2 } = useTheme();
|
|
134187
|
-
const [selectedPackageId, setSelectedPackageId] = useState(
|
|
135223
|
+
const [selectedPackageId, setSelectedPackageId] = useState(
|
|
135224
|
+
null
|
|
135225
|
+
);
|
|
134188
135226
|
const coverageMap = useMemo(() => {
|
|
134189
135227
|
const map2 = /* @__PURE__ */ new Map();
|
|
134190
135228
|
coverageData.forEach((c2) => map2.set(c2.packageId, c2));
|
|
@@ -134210,7 +135248,15 @@ const TelemetryCoveragePanelContent = ({
|
|
|
134210
135248
|
const overallStats = useMemo(() => {
|
|
134211
135249
|
const allFiles = coverageData.flatMap((c2) => c2.files);
|
|
134212
135250
|
if (allFiles.length === 0) {
|
|
134213
|
-
return {
|
|
135251
|
+
return {
|
|
135252
|
+
percentage: 0,
|
|
135253
|
+
totalTraced: 0,
|
|
135254
|
+
totalTests: 0,
|
|
135255
|
+
testFiles: 0,
|
|
135256
|
+
coveredFiles: 0,
|
|
135257
|
+
partialFiles: 0,
|
|
135258
|
+
uncoveredFiles: 0
|
|
135259
|
+
};
|
|
134214
135260
|
}
|
|
134215
135261
|
return calculateTelemetryCoverageStats(allFiles);
|
|
134216
135262
|
}, [coverageData]);
|
|
@@ -134283,12 +135329,21 @@ const TelemetryCoveragePanelContent = ({
|
|
|
134283
135329
|
/* @__PURE__ */ jsx(Activity$1, { size: 20, color: theme2.colors.primary }),
|
|
134284
135330
|
/* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
|
|
134285
135331
|
/* @__PURE__ */ jsx("div", { style: { fontWeight: 600, color: theme2.colors.text }, children: pkg.packageData.name }),
|
|
134286
|
-
/* @__PURE__ */ jsxs(
|
|
134287
|
-
|
|
134288
|
-
|
|
134289
|
-
|
|
134290
|
-
|
|
134291
|
-
|
|
135332
|
+
/* @__PURE__ */ jsxs(
|
|
135333
|
+
"div",
|
|
135334
|
+
{
|
|
135335
|
+
style: {
|
|
135336
|
+
fontSize: theme2.fontSizes[0],
|
|
135337
|
+
color: theme2.colors.textSecondary
|
|
135338
|
+
},
|
|
135339
|
+
children: [
|
|
135340
|
+
overallStats.totalTraced,
|
|
135341
|
+
"/",
|
|
135342
|
+
overallStats.totalTests,
|
|
135343
|
+
" tests traced"
|
|
135344
|
+
]
|
|
135345
|
+
}
|
|
135346
|
+
)
|
|
134292
135347
|
] }),
|
|
134293
135348
|
/* @__PURE__ */ jsx(CoverageBar, { percentage: overallStats.percentage, width: 80 }),
|
|
134294
135349
|
/* @__PURE__ */ jsxs(
|
|
@@ -134372,12 +135427,30 @@ const TelemetryCoveragePanelContent = ({
|
|
|
134372
135427
|
},
|
|
134373
135428
|
children: [
|
|
134374
135429
|
/* @__PURE__ */ jsx(Activity$1, { size: 16, color: theme2.colors.primary }),
|
|
134375
|
-
/* @__PURE__ */ jsxs(
|
|
134376
|
-
|
|
134377
|
-
|
|
134378
|
-
|
|
135430
|
+
/* @__PURE__ */ jsxs(
|
|
135431
|
+
"span",
|
|
135432
|
+
{
|
|
135433
|
+
style: {
|
|
135434
|
+
fontSize: theme2.fontSizes[1],
|
|
135435
|
+
color: theme2.colors.textSecondary
|
|
135436
|
+
},
|
|
135437
|
+
children: [
|
|
135438
|
+
packages.length,
|
|
135439
|
+
" packages"
|
|
135440
|
+
]
|
|
135441
|
+
}
|
|
135442
|
+
),
|
|
134379
135443
|
/* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
|
|
134380
|
-
/* @__PURE__ */ jsx(
|
|
135444
|
+
/* @__PURE__ */ jsx(
|
|
135445
|
+
"span",
|
|
135446
|
+
{
|
|
135447
|
+
style: {
|
|
135448
|
+
fontSize: theme2.fontSizes[0],
|
|
135449
|
+
color: theme2.colors.textSecondary
|
|
135450
|
+
},
|
|
135451
|
+
children: "Overall:"
|
|
135452
|
+
}
|
|
135453
|
+
),
|
|
134381
135454
|
/* @__PURE__ */ jsx(CoverageBar, { percentage: overallStats.percentage }),
|
|
134382
135455
|
/* @__PURE__ */ jsxs(
|
|
134383
135456
|
"span",
|
|
@@ -134524,7 +135597,16 @@ const TelemetryCoveragePanelContent = ({
|
|
|
134524
135597
|
/* @__PURE__ */ jsx(FolderOpen$1, { size: 16, color: theme2.colors.primary }),
|
|
134525
135598
|
/* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
|
|
134526
135599
|
/* @__PURE__ */ jsx("div", { style: { fontWeight: 600, color: theme2.colors.text }, children: selectedPackage.packageData.name }),
|
|
134527
|
-
/* @__PURE__ */ jsx(
|
|
135600
|
+
/* @__PURE__ */ jsx(
|
|
135601
|
+
"div",
|
|
135602
|
+
{
|
|
135603
|
+
style: {
|
|
135604
|
+
fontSize: theme2.fontSizes[0],
|
|
135605
|
+
color: theme2.colors.textSecondary
|
|
135606
|
+
},
|
|
135607
|
+
children: selectedPackage.packageData.path || "/"
|
|
135608
|
+
}
|
|
135609
|
+
)
|
|
134528
135610
|
] }),
|
|
134529
135611
|
selectedCoverage && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
134530
135612
|
/* @__PURE__ */ jsx(
|
|
@@ -134540,7 +135622,9 @@ const TelemetryCoveragePanelContent = ({
|
|
|
134540
135622
|
style: {
|
|
134541
135623
|
padding: "2px 8px",
|
|
134542
135624
|
backgroundColor: getCoverageColor(
|
|
134543
|
-
calculateTelemetryCoverageStats(
|
|
135625
|
+
calculateTelemetryCoverageStats(
|
|
135626
|
+
selectedCoverage.files
|
|
135627
|
+
).percentage
|
|
134544
135628
|
) + "20",
|
|
134545
135629
|
color: getCoverageColor(
|
|
134546
135630
|
calculateTelemetryCoverageStats(selectedCoverage.files).percentage
|
|
@@ -134601,56 +135685,74 @@ const TelemetryCoveragePanelPreview = () => {
|
|
|
134601
135685
|
/* @__PURE__ */ jsx(Activity$1, { size: 14, color: theme2.colors.primary }),
|
|
134602
135686
|
/* @__PURE__ */ jsx("span", { children: "Telemetry Coverage" })
|
|
134603
135687
|
] }),
|
|
134604
|
-
/* @__PURE__ */ jsxs(
|
|
134605
|
-
|
|
134606
|
-
|
|
134607
|
-
|
|
134608
|
-
|
|
134609
|
-
|
|
134610
|
-
|
|
134611
|
-
|
|
134612
|
-
|
|
134613
|
-
|
|
134614
|
-
|
|
134615
|
-
|
|
134616
|
-
|
|
134617
|
-
|
|
134618
|
-
|
|
134619
|
-
|
|
134620
|
-
|
|
134621
|
-
|
|
135688
|
+
/* @__PURE__ */ jsxs(
|
|
135689
|
+
"div",
|
|
135690
|
+
{
|
|
135691
|
+
style: {
|
|
135692
|
+
display: "flex",
|
|
135693
|
+
alignItems: "center",
|
|
135694
|
+
gap: "6px",
|
|
135695
|
+
paddingLeft: "8px"
|
|
135696
|
+
},
|
|
135697
|
+
children: [
|
|
135698
|
+
/* @__PURE__ */ jsx(TestTube$1, { size: 12, color: theme2.colors.textSecondary }),
|
|
135699
|
+
/* @__PURE__ */ jsx("span", { style: { color: theme2.colors.textSecondary }, children: "8/14 tests traced" })
|
|
135700
|
+
]
|
|
135701
|
+
}
|
|
135702
|
+
),
|
|
135703
|
+
/* @__PURE__ */ jsxs(
|
|
135704
|
+
"div",
|
|
135705
|
+
{
|
|
135706
|
+
style: {
|
|
135707
|
+
display: "flex",
|
|
135708
|
+
alignItems: "center",
|
|
135709
|
+
gap: "6px",
|
|
135710
|
+
paddingLeft: "8px"
|
|
135711
|
+
},
|
|
135712
|
+
children: [
|
|
135713
|
+
/* @__PURE__ */ jsx(CoverageBar, { percentage: 57, width: 40 }),
|
|
135714
|
+
/* @__PURE__ */ jsx(
|
|
135715
|
+
"span",
|
|
135716
|
+
{
|
|
135717
|
+
style: {
|
|
135718
|
+
color: getCoverageColor(57),
|
|
135719
|
+
fontWeight: "bold",
|
|
135720
|
+
fontFamily: "monospace"
|
|
135721
|
+
},
|
|
135722
|
+
children: "57%"
|
|
135723
|
+
}
|
|
135724
|
+
)
|
|
135725
|
+
]
|
|
135726
|
+
}
|
|
135727
|
+
)
|
|
134622
135728
|
]
|
|
134623
135729
|
}
|
|
134624
135730
|
);
|
|
134625
135731
|
};
|
|
134626
|
-
const TelemetryCoveragePanel = ({
|
|
135732
|
+
const TelemetryCoveragePanel = ({
|
|
135733
|
+
context: context2,
|
|
135734
|
+
events
|
|
135735
|
+
}) => {
|
|
134627
135736
|
var _a;
|
|
134628
135737
|
const packagesSlice = context2.getSlice("packages");
|
|
134629
135738
|
const fileTreeSlice = context2.getSlice("fileTree");
|
|
134630
|
-
const packages = (
|
|
135739
|
+
const packages = useMemo(
|
|
135740
|
+
() => {
|
|
135741
|
+
var _a2;
|
|
135742
|
+
return ((_a2 = packagesSlice == null ? void 0 : packagesSlice.data) == null ? void 0 : _a2.packages) ?? [];
|
|
135743
|
+
},
|
|
135744
|
+
[(_a = packagesSlice == null ? void 0 : packagesSlice.data) == null ? void 0 : _a.packages]
|
|
135745
|
+
);
|
|
134631
135746
|
const fileTree = (fileTreeSlice == null ? void 0 : fileTreeSlice.data) ?? void 0;
|
|
134632
135747
|
const isLoading = (packagesSlice == null ? void 0 : packagesSlice.loading) || (fileTreeSlice == null ? void 0 : fileTreeSlice.loading) || false;
|
|
134633
135748
|
const coverageData = useMemo(() => {
|
|
134634
135749
|
const allFiles = (fileTree == null ? void 0 : fileTree.allFiles) ?? [];
|
|
134635
|
-
if (allFiles.length > 0) {
|
|
134636
|
-
const traceFiles = allFiles.filter(
|
|
134637
|
-
(f2) => (f2.relativePath || f2.path || "").includes("__traces__")
|
|
134638
|
-
);
|
|
134639
|
-
console.log("[TelemetryCoveragePanel] Total files:", allFiles.length);
|
|
134640
|
-
console.log("[TelemetryCoveragePanel] Trace files found:", traceFiles.length);
|
|
134641
|
-
if (traceFiles.length > 0) {
|
|
134642
|
-
console.log("[TelemetryCoveragePanel] Sample trace file:", {
|
|
134643
|
-
path: traceFiles[0].path,
|
|
134644
|
-
relativePath: traceFiles[0].relativePath,
|
|
134645
|
-
name: traceFiles[0].name
|
|
134646
|
-
});
|
|
134647
|
-
}
|
|
134648
|
-
console.log("[TelemetryCoveragePanel] Sample paths:", allFiles.slice(0, 3).map((f2) => f2.relativePath || f2.path));
|
|
134649
|
-
}
|
|
134650
135750
|
const traceFilesByPackage = /* @__PURE__ */ new Map();
|
|
134651
135751
|
for (const file of allFiles) {
|
|
134652
135752
|
const filePath = file.relativePath || file.path || "";
|
|
134653
|
-
const packageMatch = filePath.match(
|
|
135753
|
+
const packageMatch = filePath.match(
|
|
135754
|
+
/^packages\/([^/]+)(?:\/.*)?__traces__\/[^/]+\.canvas\.json$/
|
|
135755
|
+
);
|
|
134654
135756
|
const rootMatch = filePath.match(/^__traces__\/[^/]+\.canvas\.json$/);
|
|
134655
135757
|
if (packageMatch) {
|
|
134656
135758
|
const pkgName = packageMatch[1];
|
|
@@ -134664,8 +135766,6 @@ const TelemetryCoveragePanel = ({ context: context2, events }) => {
|
|
|
134664
135766
|
}
|
|
134665
135767
|
}
|
|
134666
135768
|
}
|
|
134667
|
-
console.log("[TelemetryCoveragePanel] Trace files by package:", Object.fromEntries(traceFilesByPackage));
|
|
134668
|
-
console.log("[TelemetryCoveragePanel] Packages:", packages.map((p2) => ({ name: p2.packageData.name, path: p2.packageData.path })));
|
|
134669
135769
|
return packages.map((pkg) => {
|
|
134670
135770
|
const pkgPath = pkg.packageData.path.replace(/^\//, "");
|
|
134671
135771
|
const traceFilePath = traceFilesByPackage.get(pkgPath);
|
|
@@ -134726,7 +135826,9 @@ const TelemetryCoveragePanel = ({ context: context2, events }) => {
|
|
|
134726
135826
|
} : null
|
|
134727
135827
|
});
|
|
134728
135828
|
if (pkg) {
|
|
134729
|
-
const pkgCoverage = coverageData.find(
|
|
135829
|
+
const pkgCoverage = coverageData.find(
|
|
135830
|
+
(c2) => c2.packagePath === pkg.packageData.path
|
|
135831
|
+
);
|
|
134730
135832
|
if (pkgCoverage == null ? void 0 : pkgCoverage.traceFilePath) {
|
|
134731
135833
|
events == null ? void 0 : events.emit({
|
|
134732
135834
|
type: "trace:load",
|
|
@@ -135009,4 +136111,4 @@ export {
|
|
|
135009
136111
|
UPDATE_PRIORITY as y,
|
|
135010
136112
|
removeItems as z
|
|
135011
136113
|
};
|
|
135012
|
-
//# sourceMappingURL=index-
|
|
136114
|
+
//# sourceMappingURL=index-DtyaVT4V.js.map
|