@industry-theme/repository-composition-panels 0.7.3 → 0.7.5
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-BscnQCBn.js → BufferResource-CHhoaerO.js} +2 -2
- package/dist/{BufferResource-BscnQCBn.js.map → BufferResource-CHhoaerO.js.map} +1 -1
- package/dist/{CanvasRenderer-DXt8RTfi.js → CanvasRenderer-ByT5AV8x.js} +3 -3
- package/dist/{CanvasRenderer-DXt8RTfi.js.map → CanvasRenderer-ByT5AV8x.js.map} +1 -1
- package/dist/{Filter-DUJ3jI7H.js → Filter-Dhhy5IL7.js} +2 -2
- package/dist/{Filter-DUJ3jI7H.js.map → Filter-Dhhy5IL7.js.map} +1 -1
- package/dist/{RenderTargetSystem-D5QkA2zW.js → RenderTargetSystem-BEQsi09b.js} +3 -3
- package/dist/{RenderTargetSystem-D5QkA2zW.js.map → RenderTargetSystem-BEQsi09b.js.map} +1 -1
- package/dist/{WebGLRenderer-B_nBw2ba.js → WebGLRenderer-BnHZE5Mp.js} +4 -4
- package/dist/{WebGLRenderer-B_nBw2ba.js.map → WebGLRenderer-BnHZE5Mp.js.map} +1 -1
- package/dist/{WebGPURenderer-B2Pmx2Hh.js → WebGPURenderer-Bggk73-1.js} +4 -4
- package/dist/{WebGPURenderer-B2Pmx2Hh.js.map → WebGPURenderer-Bggk73-1.js.map} +1 -1
- package/dist/{browserAll-CiG96Bal.js → browserAll-DMDsy2el.js} +3 -3
- package/dist/{browserAll-CiG96Bal.js.map → browserAll-DMDsy2el.js.map} +1 -1
- package/dist/{index-D-SkQLOk.js → index-7aQ4t9XI.js} +574 -99
- package/dist/{index-D-SkQLOk.js.map → index-7aQ4t9XI.js.map} +1 -1
- package/dist/{init-DBllvWLw.js → init-BFRc255S.js} +3 -3
- package/dist/{init-DBllvWLw.js.map → init-BFRc255S.js.map} +1 -1
- package/dist/panels/CollectionMapPanel.d.ts.map +1 -1
- package/dist/panels/PackageCompositionPanel.d.ts.map +1 -1
- package/dist/panels/components/PackageLoadingGraph.d.ts +3 -0
- package/dist/panels/components/PackageLoadingGraph.d.ts.map +1 -0
- package/dist/panels/components/PackageManagerIcon.d.ts.map +1 -1
- package/dist/panels/components/index.d.ts +1 -0
- package/dist/panels/components/index.d.ts.map +1 -1
- package/dist/panels/overworld-map/OverworldMapPanel.d.ts.map +1 -1
- package/dist/panels/overworld-map/isometricUtils.d.ts +33 -0
- package/dist/panels/overworld-map/isometricUtils.d.ts.map +1 -1
- package/dist/panels.bundle.js +1 -1
- package/dist/webworkerAll-D8hIL1sE.js +3 -0
- package/dist/webworkerAll-D8hIL1sE.js.map +1 -0
- package/package.json +1 -1
- package/dist/webworkerAll-ApBSWfHO.js +0 -3
- package/dist/webworkerAll-ApBSWfHO.js.map +0 -1
|
@@ -1272,7 +1272,7 @@ const RustIcon = ({ size }) => /* @__PURE__ */ jsxs(
|
|
|
1272
1272
|
width: size,
|
|
1273
1273
|
height: size,
|
|
1274
1274
|
viewBox: "0 0 24 24",
|
|
1275
|
-
fill: "#
|
|
1275
|
+
fill: "#DEA584",
|
|
1276
1276
|
role: "img",
|
|
1277
1277
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1278
1278
|
children: [
|
|
@@ -1567,6 +1567,267 @@ const InfoItem = ({ badge, title, description, theme: theme2 }) => /* @__PURE__
|
|
|
1567
1567
|
]
|
|
1568
1568
|
}
|
|
1569
1569
|
);
|
|
1570
|
+
const PM_COLORS = {
|
|
1571
|
+
npm: "#CB3837",
|
|
1572
|
+
yarn: "#2C8EBB",
|
|
1573
|
+
pnpm: "#F69220",
|
|
1574
|
+
bun: "#FBF0DF",
|
|
1575
|
+
pip: "#3776AB",
|
|
1576
|
+
poetry: "#60A5FA",
|
|
1577
|
+
cargo: "#DEA584"
|
|
1578
|
+
};
|
|
1579
|
+
const PackageLoadingGraph = () => {
|
|
1580
|
+
const { theme: theme2 } = useTheme();
|
|
1581
|
+
const dropDuration = 1;
|
|
1582
|
+
const staggerDelay = 0.7;
|
|
1583
|
+
const pauseDuration = 4;
|
|
1584
|
+
const fadeDuration = 0.4;
|
|
1585
|
+
const boxes = [
|
|
1586
|
+
// Bottom row - drops first, left to right (no bounce)
|
|
1587
|
+
{
|
|
1588
|
+
id: "pkg-1",
|
|
1589
|
+
x: 20,
|
|
1590
|
+
finalY: 78,
|
|
1591
|
+
delay: 0,
|
|
1592
|
+
size: "md",
|
|
1593
|
+
bounce: [0, 0, 0],
|
|
1594
|
+
pm: "npm"
|
|
1595
|
+
},
|
|
1596
|
+
{
|
|
1597
|
+
id: "pkg-2",
|
|
1598
|
+
x: 40,
|
|
1599
|
+
finalY: 78,
|
|
1600
|
+
delay: staggerDelay * 1,
|
|
1601
|
+
size: "md",
|
|
1602
|
+
bounce: [0, 0, 0],
|
|
1603
|
+
pm: "yarn"
|
|
1604
|
+
},
|
|
1605
|
+
{
|
|
1606
|
+
id: "pkg-3",
|
|
1607
|
+
x: 60,
|
|
1608
|
+
finalY: 78,
|
|
1609
|
+
delay: staggerDelay * 2,
|
|
1610
|
+
size: "md",
|
|
1611
|
+
bounce: [0, 0, 0],
|
|
1612
|
+
pm: "pnpm"
|
|
1613
|
+
},
|
|
1614
|
+
{
|
|
1615
|
+
id: "pkg-4",
|
|
1616
|
+
x: 80,
|
|
1617
|
+
finalY: 78,
|
|
1618
|
+
delay: staggerDelay * 3,
|
|
1619
|
+
size: "md",
|
|
1620
|
+
bounce: [0, 0, 0],
|
|
1621
|
+
pm: "cargo"
|
|
1622
|
+
},
|
|
1623
|
+
// Middle row - stacks on top (bounces)
|
|
1624
|
+
{
|
|
1625
|
+
id: "pkg-5",
|
|
1626
|
+
x: 35,
|
|
1627
|
+
finalY: 50,
|
|
1628
|
+
delay: staggerDelay * 4,
|
|
1629
|
+
size: "md",
|
|
1630
|
+
bounce: [9, 4, 0],
|
|
1631
|
+
pm: "pip"
|
|
1632
|
+
},
|
|
1633
|
+
{
|
|
1634
|
+
id: "pkg-6",
|
|
1635
|
+
x: 65,
|
|
1636
|
+
finalY: 50,
|
|
1637
|
+
delay: staggerDelay * 5,
|
|
1638
|
+
size: "md",
|
|
1639
|
+
bounce: [11, 5, 0],
|
|
1640
|
+
pm: "poetry"
|
|
1641
|
+
},
|
|
1642
|
+
// Top - crown of the pyramid (bounces + wobbles!)
|
|
1643
|
+
{
|
|
1644
|
+
id: "pkg-7",
|
|
1645
|
+
x: 50,
|
|
1646
|
+
finalY: 22,
|
|
1647
|
+
delay: staggerDelay * 6,
|
|
1648
|
+
size: "lg",
|
|
1649
|
+
bounce: [15, 7, 6],
|
|
1650
|
+
pm: "bun"
|
|
1651
|
+
}
|
|
1652
|
+
];
|
|
1653
|
+
const bounceDuration = 0.6;
|
|
1654
|
+
const lastDropEnd = boxes[boxes.length - 1].delay + dropDuration + bounceDuration;
|
|
1655
|
+
const totalCycleDuration = lastDropEnd + pauseDuration + fadeDuration;
|
|
1656
|
+
const sizeMap = {
|
|
1657
|
+
sm: { width: 42, height: 38, iconSize: 18 },
|
|
1658
|
+
md: { width: 54, height: 48, iconSize: 24 },
|
|
1659
|
+
lg: { width: 68, height: 60, iconSize: 30 }
|
|
1660
|
+
};
|
|
1661
|
+
return /* @__PURE__ */ jsxs(
|
|
1662
|
+
"div",
|
|
1663
|
+
{
|
|
1664
|
+
style: {
|
|
1665
|
+
height: "100%",
|
|
1666
|
+
display: "flex",
|
|
1667
|
+
flexDirection: "column",
|
|
1668
|
+
alignItems: "center",
|
|
1669
|
+
justifyContent: "center",
|
|
1670
|
+
color: theme2.colors.textSecondary,
|
|
1671
|
+
padding: theme2.space[5]
|
|
1672
|
+
},
|
|
1673
|
+
children: [
|
|
1674
|
+
/* @__PURE__ */ jsx("style", { children: `
|
|
1675
|
+
${boxes.map((box, index2) => {
|
|
1676
|
+
const [bounce1, bounce2, wobble] = box.bounce;
|
|
1677
|
+
const dropStart = box.delay / totalCycleDuration * 100;
|
|
1678
|
+
const landPoint = (box.delay + dropDuration * 0.6) / totalCycleDuration * 100;
|
|
1679
|
+
const bounce1Up = (box.delay + dropDuration * 0.7) / totalCycleDuration * 100;
|
|
1680
|
+
const bounce1Down = (box.delay + dropDuration * 0.8) / totalCycleDuration * 100;
|
|
1681
|
+
const bounce2Up = (box.delay + dropDuration * 0.9) / totalCycleDuration * 100;
|
|
1682
|
+
const settlePoint = (box.delay + dropDuration + bounceDuration) / totalCycleDuration * 100;
|
|
1683
|
+
const fadeStart = (lastDropEnd + pauseDuration) / totalCycleDuration * 100;
|
|
1684
|
+
return `
|
|
1685
|
+
@keyframes boxDrop-${index2} {
|
|
1686
|
+
0% {
|
|
1687
|
+
opacity: 0;
|
|
1688
|
+
transform: translate(-50%, -50%) translateY(-120px) rotate(-5deg);
|
|
1689
|
+
}
|
|
1690
|
+
${dropStart}% {
|
|
1691
|
+
opacity: 0;
|
|
1692
|
+
transform: translate(-50%, -50%) translateY(-120px) rotate(-5deg);
|
|
1693
|
+
}
|
|
1694
|
+
${landPoint}% {
|
|
1695
|
+
opacity: 1;
|
|
1696
|
+
transform: translate(-50%, -50%) translateY(4px) rotate(${wobble}deg);
|
|
1697
|
+
}
|
|
1698
|
+
${bounce1Up}% {
|
|
1699
|
+
opacity: 1;
|
|
1700
|
+
transform: translate(-50%, -50%) translateY(-${bounce1}px) rotate(${-wobble * 0.5}deg);
|
|
1701
|
+
}
|
|
1702
|
+
${bounce1Down}% {
|
|
1703
|
+
opacity: 1;
|
|
1704
|
+
transform: translate(-50%, -50%) translateY(2px) rotate(${wobble * 0.3}deg);
|
|
1705
|
+
}
|
|
1706
|
+
${bounce2Up}% {
|
|
1707
|
+
opacity: 1;
|
|
1708
|
+
transform: translate(-50%, -50%) translateY(-${bounce2}px) rotate(${-wobble * 0.2}deg);
|
|
1709
|
+
}
|
|
1710
|
+
${settlePoint}% {
|
|
1711
|
+
opacity: 1;
|
|
1712
|
+
transform: translate(-50%, -50%) translateY(0) rotate(0deg);
|
|
1713
|
+
}
|
|
1714
|
+
${fadeStart}% {
|
|
1715
|
+
opacity: 1;
|
|
1716
|
+
transform: translate(-50%, -50%) translateY(0) rotate(0deg);
|
|
1717
|
+
}
|
|
1718
|
+
100% {
|
|
1719
|
+
opacity: 0;
|
|
1720
|
+
transform: translate(-50%, -50%) translateY(20px) rotate(0deg);
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
`;
|
|
1724
|
+
}).join("")}
|
|
1725
|
+
|
|
1726
|
+
@keyframes shadowPulse {
|
|
1727
|
+
0%, 100% {
|
|
1728
|
+
opacity: 0.1;
|
|
1729
|
+
transform: translateX(-50%) scaleX(0.5);
|
|
1730
|
+
}
|
|
1731
|
+
50% {
|
|
1732
|
+
opacity: 0.2;
|
|
1733
|
+
transform: translateX(-50%) scaleX(1);
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
` }),
|
|
1737
|
+
/* @__PURE__ */ jsxs(
|
|
1738
|
+
"div",
|
|
1739
|
+
{
|
|
1740
|
+
style: {
|
|
1741
|
+
position: "relative",
|
|
1742
|
+
width: "100%",
|
|
1743
|
+
maxWidth: "400px",
|
|
1744
|
+
height: "220px",
|
|
1745
|
+
marginBottom: theme2.space[4]
|
|
1746
|
+
},
|
|
1747
|
+
children: [
|
|
1748
|
+
boxes.map((box) => {
|
|
1749
|
+
const { width } = sizeMap[box.size];
|
|
1750
|
+
const color2 = PM_COLORS[box.pm];
|
|
1751
|
+
return /* @__PURE__ */ jsx(
|
|
1752
|
+
"div",
|
|
1753
|
+
{
|
|
1754
|
+
style: {
|
|
1755
|
+
position: "absolute",
|
|
1756
|
+
left: `${box.x}%`,
|
|
1757
|
+
top: `${box.finalY + 12}%`,
|
|
1758
|
+
width: width * 0.8,
|
|
1759
|
+
height: 6,
|
|
1760
|
+
borderRadius: "50%",
|
|
1761
|
+
backgroundColor: color2,
|
|
1762
|
+
opacity: 0.2,
|
|
1763
|
+
transform: "translateX(-50%)",
|
|
1764
|
+
animation: `shadowPulse ${totalCycleDuration}s ease-in-out infinite`,
|
|
1765
|
+
animationDelay: `${box.delay}s`
|
|
1766
|
+
}
|
|
1767
|
+
},
|
|
1768
|
+
`shadow-${box.id}`
|
|
1769
|
+
);
|
|
1770
|
+
}),
|
|
1771
|
+
boxes.map((box, index2) => {
|
|
1772
|
+
const { width, height, iconSize } = sizeMap[box.size];
|
|
1773
|
+
const color2 = PM_COLORS[box.pm];
|
|
1774
|
+
return /* @__PURE__ */ jsx(
|
|
1775
|
+
"div",
|
|
1776
|
+
{
|
|
1777
|
+
style: {
|
|
1778
|
+
position: "absolute",
|
|
1779
|
+
left: `${box.x}%`,
|
|
1780
|
+
top: `${box.finalY}%`,
|
|
1781
|
+
width,
|
|
1782
|
+
height,
|
|
1783
|
+
borderRadius: theme2.radii[2],
|
|
1784
|
+
backgroundColor: theme2.colors.backgroundSecondary,
|
|
1785
|
+
border: `2px solid ${color2}`,
|
|
1786
|
+
display: "flex",
|
|
1787
|
+
alignItems: "center",
|
|
1788
|
+
justifyContent: "center",
|
|
1789
|
+
opacity: 0,
|
|
1790
|
+
boxShadow: `0 4px 12px ${color2}40`,
|
|
1791
|
+
animation: `boxDrop-${index2} ${totalCycleDuration}s ease-out infinite`
|
|
1792
|
+
},
|
|
1793
|
+
children: /* @__PURE__ */ jsx(PackageManagerIcon, { packageManager: box.pm, size: iconSize })
|
|
1794
|
+
},
|
|
1795
|
+
box.id
|
|
1796
|
+
);
|
|
1797
|
+
})
|
|
1798
|
+
]
|
|
1799
|
+
}
|
|
1800
|
+
),
|
|
1801
|
+
/* @__PURE__ */ jsx(
|
|
1802
|
+
"div",
|
|
1803
|
+
{
|
|
1804
|
+
style: {
|
|
1805
|
+
fontSize: theme2.fontSizes[2],
|
|
1806
|
+
fontFamily: theme2.fonts.body,
|
|
1807
|
+
fontWeight: theme2.fontWeights.medium,
|
|
1808
|
+
color: theme2.colors.text,
|
|
1809
|
+
textAlign: "center",
|
|
1810
|
+
marginBottom: theme2.space[2]
|
|
1811
|
+
},
|
|
1812
|
+
children: "Loading packages..."
|
|
1813
|
+
}
|
|
1814
|
+
),
|
|
1815
|
+
/* @__PURE__ */ jsx(
|
|
1816
|
+
"div",
|
|
1817
|
+
{
|
|
1818
|
+
style: {
|
|
1819
|
+
fontSize: theme2.fontSizes[1],
|
|
1820
|
+
fontFamily: theme2.fonts.body,
|
|
1821
|
+
color: theme2.colors.textSecondary,
|
|
1822
|
+
textAlign: "center"
|
|
1823
|
+
},
|
|
1824
|
+
children: "Discovering dependencies and configurations"
|
|
1825
|
+
}
|
|
1826
|
+
)
|
|
1827
|
+
]
|
|
1828
|
+
}
|
|
1829
|
+
);
|
|
1830
|
+
};
|
|
1570
1831
|
const typeLabels = {
|
|
1571
1832
|
production: "prod",
|
|
1572
1833
|
development: "dev",
|
|
@@ -4412,18 +4673,7 @@ const PackageCompositionPanelContent = ({
|
|
|
4412
4673
|
return packages.find((p2) => p2.id === selectedPackageId) || null;
|
|
4413
4674
|
}, [selectedPackageId, packages]);
|
|
4414
4675
|
if (isLoading) {
|
|
4415
|
-
return /* @__PURE__ */ jsx(
|
|
4416
|
-
"div",
|
|
4417
|
-
{
|
|
4418
|
-
style: {
|
|
4419
|
-
padding: "20px",
|
|
4420
|
-
textAlign: "center",
|
|
4421
|
-
color: theme2.colors.textSecondary,
|
|
4422
|
-
fontFamily: theme2.fonts.body
|
|
4423
|
-
},
|
|
4424
|
-
children: "Loading packages..."
|
|
4425
|
-
}
|
|
4426
|
-
);
|
|
4676
|
+
return /* @__PURE__ */ jsx(PackageLoadingGraph, {});
|
|
4427
4677
|
}
|
|
4428
4678
|
if (packages.length === 0) {
|
|
4429
4679
|
return /* @__PURE__ */ jsx(EmptyDependencies, {});
|
|
@@ -105994,7 +106244,7 @@ const browserExt = {
|
|
|
105994
106244
|
},
|
|
105995
106245
|
test: () => true,
|
|
105996
106246
|
load: async () => {
|
|
105997
|
-
await import("./browserAll-
|
|
106247
|
+
await import("./browserAll-DMDsy2el.js");
|
|
105998
106248
|
}
|
|
105999
106249
|
};
|
|
106000
106250
|
const webworkerExt = {
|
|
@@ -106005,7 +106255,7 @@ const webworkerExt = {
|
|
|
106005
106255
|
},
|
|
106006
106256
|
test: () => typeof self !== "undefined" && self.WorkerGlobalScope !== void 0,
|
|
106007
106257
|
load: async () => {
|
|
106008
|
-
await import("./webworkerAll-
|
|
106258
|
+
await import("./webworkerAll-D8hIL1sE.js");
|
|
106009
106259
|
}
|
|
106010
106260
|
};
|
|
106011
106261
|
class ObservablePoint {
|
|
@@ -118248,19 +118498,19 @@ async function autoDetectRenderer(options) {
|
|
|
118248
118498
|
for (let i2 = 0; i2 < preferredOrder.length; i2++) {
|
|
118249
118499
|
const rendererType = preferredOrder[i2];
|
|
118250
118500
|
if (rendererType === "webgpu" && await isWebGPUSupported()) {
|
|
118251
|
-
const { WebGPURenderer } = await import("./WebGPURenderer-
|
|
118501
|
+
const { WebGPURenderer } = await import("./WebGPURenderer-Bggk73-1.js");
|
|
118252
118502
|
RendererClass = WebGPURenderer;
|
|
118253
118503
|
finalOptions = { ...options, ...options.webgpu };
|
|
118254
118504
|
break;
|
|
118255
118505
|
} else if (rendererType === "webgl" && isWebGLSupported(
|
|
118256
118506
|
options.failIfMajorPerformanceCaveat ?? AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat
|
|
118257
118507
|
)) {
|
|
118258
|
-
const { WebGLRenderer } = await import("./WebGLRenderer-
|
|
118508
|
+
const { WebGLRenderer } = await import("./WebGLRenderer-BnHZE5Mp.js");
|
|
118259
118509
|
RendererClass = WebGLRenderer;
|
|
118260
118510
|
finalOptions = { ...options, ...options.webgl };
|
|
118261
118511
|
break;
|
|
118262
118512
|
} else if (rendererType === "canvas") {
|
|
118263
|
-
const { CanvasRenderer } = await import("./CanvasRenderer-
|
|
118513
|
+
const { CanvasRenderer } = await import("./CanvasRenderer-ByT5AV8x.js");
|
|
118264
118514
|
RendererClass = CanvasRenderer;
|
|
118265
118515
|
finalOptions = { ...options, ...options.canvasOptions };
|
|
118266
118516
|
break;
|
|
@@ -132727,6 +132977,24 @@ function screenToGrid(screenX, screenY) {
|
|
|
132727
132977
|
function getIsometricZIndex(gridX, gridY) {
|
|
132728
132978
|
return gridX + gridY;
|
|
132729
132979
|
}
|
|
132980
|
+
function calculateRegionCameraPosition(regionCenterX, regionCenterY, bounds) {
|
|
132981
|
+
const center = gridToScreen(regionCenterX, regionCenterY);
|
|
132982
|
+
const topCorner = gridToScreen(bounds.x, bounds.y);
|
|
132983
|
+
const bottomCorner = gridToScreen(
|
|
132984
|
+
bounds.x + bounds.width,
|
|
132985
|
+
bounds.y + bounds.height
|
|
132986
|
+
);
|
|
132987
|
+
const leftCorner = gridToScreen(bounds.x, bounds.y + bounds.height);
|
|
132988
|
+
const rightCorner = gridToScreen(bounds.x + bounds.width, bounds.y);
|
|
132989
|
+
const screenWidth = rightCorner.screenX - leftCorner.screenX;
|
|
132990
|
+
const screenHeight = bottomCorner.screenY - topCorner.screenY;
|
|
132991
|
+
return {
|
|
132992
|
+
centerX: center.screenX,
|
|
132993
|
+
centerY: center.screenY,
|
|
132994
|
+
screenWidth,
|
|
132995
|
+
screenHeight
|
|
132996
|
+
};
|
|
132997
|
+
}
|
|
132730
132998
|
function domEventToGridCoords(clientX, clientY, viewport, canvasElement) {
|
|
132731
132999
|
if (!viewport || !canvasElement) {
|
|
132732
133000
|
console.warn("[domEventToGridCoords] Missing viewport or canvas element, returning (0, 0)");
|
|
@@ -135675,6 +135943,7 @@ const OverworldMapPanelContent = ({
|
|
|
135675
135943
|
const animationRef = useRef(null);
|
|
135676
135944
|
const hasInitializedCamera = useRef(false);
|
|
135677
135945
|
const skipNextAnimation = useRef(false);
|
|
135946
|
+
const skipInitialAnimation = useRef(false);
|
|
135678
135947
|
const previousCollectionKeyRef = useRef(null);
|
|
135679
135948
|
const savedCameraPosition = useRef(null);
|
|
135680
135949
|
const stableCollectionKey = useMemo(() => {
|
|
@@ -135879,28 +136148,16 @@ const OverworldMapPanelContent = ({
|
|
|
135879
136148
|
viewport.setZoom(savedCameraPosition.current.scale);
|
|
135880
136149
|
} else if (mapData.regions.length > 0 && !hasInitializedCamera.current) {
|
|
135881
136150
|
const firstRegion = mapData.regions[0];
|
|
135882
|
-
const
|
|
135883
|
-
|
|
135884
|
-
|
|
135885
|
-
|
|
135886
|
-
bounds.y + bounds.height
|
|
136151
|
+
const cameraPosition = calculateRegionCameraPosition(
|
|
136152
|
+
firstRegion.centerX,
|
|
136153
|
+
firstRegion.centerY,
|
|
136154
|
+
firstRegion.bounds
|
|
135887
136155
|
);
|
|
135888
|
-
const
|
|
135889
|
-
const
|
|
135890
|
-
const spriteHeightOffset = 140;
|
|
135891
|
-
const screenMinX = leftCorner.screenX;
|
|
135892
|
-
const screenMaxX = rightCorner.screenX;
|
|
135893
|
-
const screenMinY = topCorner.screenY - spriteHeightOffset;
|
|
135894
|
-
const screenMaxY = bottomCorner.screenY;
|
|
135895
|
-
const screenCenterX = (screenMinX + screenMaxX) / 2;
|
|
135896
|
-
const screenCenterY = (screenMinY + screenMaxY) / 2;
|
|
135897
|
-
viewport.moveCenter(screenCenterX, screenCenterY);
|
|
135898
|
-
const regionScreenWidth = screenMaxX - screenMinX;
|
|
135899
|
-
const regionScreenHeight = screenMaxY - screenMinY;
|
|
135900
|
-
const zoomX = visibleWidth * 0.65 / regionScreenWidth;
|
|
135901
|
-
const zoomY = visibleHeight * 0.65 / regionScreenHeight;
|
|
136156
|
+
const zoomX = visibleWidth * 0.65 / cameraPosition.screenWidth;
|
|
136157
|
+
const zoomY = visibleHeight * 0.65 / cameraPosition.screenHeight;
|
|
135902
136158
|
const fitZoom = Math.min(zoomX, zoomY, 1);
|
|
135903
136159
|
viewport.setZoom(fitZoom);
|
|
136160
|
+
viewport.moveCenter(cameraPosition.centerX, cameraPosition.centerY);
|
|
135904
136161
|
hasInitializedCamera.current = true;
|
|
135905
136162
|
}
|
|
135906
136163
|
const findAdjacentEmptyPositions = (regions) => {
|
|
@@ -136121,6 +136378,7 @@ const OverworldMapPanelContent = ({
|
|
|
136121
136378
|
});
|
|
136122
136379
|
setIsRendering(false);
|
|
136123
136380
|
isInitializedRef.current = true;
|
|
136381
|
+
skipInitialAnimation.current = true;
|
|
136124
136382
|
setInitializationComplete((prev) => prev + 1);
|
|
136125
136383
|
};
|
|
136126
136384
|
let resizeObserver = null;
|
|
@@ -136304,6 +136562,10 @@ const OverworldMapPanelContent = ({
|
|
|
136304
136562
|
skipNextAnimation.current = false;
|
|
136305
136563
|
return;
|
|
136306
136564
|
}
|
|
136565
|
+
if (skipInitialAnimation.current) {
|
|
136566
|
+
skipInitialAnimation.current = false;
|
|
136567
|
+
return;
|
|
136568
|
+
}
|
|
136307
136569
|
setIsAnimating(true);
|
|
136308
136570
|
const targetX = visibleDimensionsRef.current.width / 2 - regionCenter.screenX;
|
|
136309
136571
|
const targetY = visibleDimensionsRef.current.height / 2 - regionCenter.screenY;
|
|
@@ -136670,9 +136932,29 @@ const CollectionMapPanelContent = ({
|
|
|
136670
136932
|
const canvasRef = React2__default.useRef(null);
|
|
136671
136933
|
const handleRenameRegion = useCallback(
|
|
136672
136934
|
async (regionId, name2) => {
|
|
136673
|
-
|
|
136935
|
+
const span = getTracer().startSpan("collection-map.region-renamed");
|
|
136936
|
+
try {
|
|
136937
|
+
const oldRegion = customRegions.find((r2) => r2.id === regionId);
|
|
136938
|
+
const oldName = (oldRegion == null ? void 0 : oldRegion.name) || "Unknown";
|
|
136939
|
+
span.addEvent("collection-map.region-renamed", {
|
|
136940
|
+
"collection.id": collection.id,
|
|
136941
|
+
"region.id": regionId,
|
|
136942
|
+
"region.old.name": oldName,
|
|
136943
|
+
"region.new.name": name2
|
|
136944
|
+
});
|
|
136945
|
+
await regionCallbacks.onRegionUpdated(collection.id, regionId, {
|
|
136946
|
+
name: name2
|
|
136947
|
+
});
|
|
136948
|
+
span.setStatus({ code: 1 });
|
|
136949
|
+
span.end();
|
|
136950
|
+
} catch (error) {
|
|
136951
|
+
span.recordException(error);
|
|
136952
|
+
span.setStatus({ code: 2, message: error.message });
|
|
136953
|
+
span.end();
|
|
136954
|
+
throw error;
|
|
136955
|
+
}
|
|
136674
136956
|
},
|
|
136675
|
-
[regionCallbacks, collection.id]
|
|
136957
|
+
[regionCallbacks, collection.id, customRegions]
|
|
136676
136958
|
);
|
|
136677
136959
|
const handleDeleteRegion = useCallback(
|
|
136678
136960
|
async (regionId) => {
|
|
@@ -136683,13 +136965,39 @@ const CollectionMapPanelContent = ({
|
|
|
136683
136965
|
alert("Cannot delete the last region. At least one region must exist.");
|
|
136684
136966
|
return;
|
|
136685
136967
|
}
|
|
136686
|
-
|
|
136968
|
+
const span = getTracer().startSpan("collection-map.region-deleted");
|
|
136969
|
+
try {
|
|
136970
|
+
const region = customRegions.find((r2) => r2.id === regionId);
|
|
136971
|
+
const regionName = (region == null ? void 0 : region.name) || "Unknown";
|
|
136972
|
+
const orphanedCount = collection.members.filter(
|
|
136973
|
+
(m2) => {
|
|
136974
|
+
var _a2;
|
|
136975
|
+
return ((_a2 = m2.metadata) == null ? void 0 : _a2.regionId) === regionId;
|
|
136976
|
+
}
|
|
136977
|
+
).length;
|
|
136978
|
+
span.addEvent("collection-map.region-deleted", {
|
|
136979
|
+
"collection.id": collection.id,
|
|
136980
|
+
"region.id": regionId,
|
|
136981
|
+
"region.name": regionName,
|
|
136982
|
+
"nodes.orphaned": orphanedCount
|
|
136983
|
+
});
|
|
136984
|
+
await regionCallbacks.onRegionDeleted(collection.id, regionId);
|
|
136985
|
+
span.setStatus({ code: 1 });
|
|
136986
|
+
span.end();
|
|
136987
|
+
} catch (error) {
|
|
136988
|
+
span.recordException(error);
|
|
136989
|
+
span.setStatus({ code: 2, message: error.message });
|
|
136990
|
+
span.end();
|
|
136991
|
+
throw error;
|
|
136992
|
+
}
|
|
136687
136993
|
},
|
|
136688
|
-
[regionCallbacks, collection.id, customRegions.
|
|
136994
|
+
[regionCallbacks, collection.id, customRegions, collection.members]
|
|
136689
136995
|
);
|
|
136690
136996
|
const handleProjectMoved = useCallback(
|
|
136691
|
-
async (projectId, gridX, gridY, metadata) => {
|
|
136997
|
+
async (projectId, gridX, gridY, metadata, parentSpan) => {
|
|
136692
136998
|
var _a2, _b;
|
|
136999
|
+
const span = parentSpan ?? getTracer().startSpan("collection-map.project-moved");
|
|
137000
|
+
const ownsSpan = !parentSpan;
|
|
136693
137001
|
const isNewRepo = !!metadata;
|
|
136694
137002
|
const existingMembership = collection.members.find(
|
|
136695
137003
|
(m2) => m2.repositoryId === projectId
|
|
@@ -136701,6 +137009,11 @@ Memberships (${collection.members.length}): [${collection.members.map((m2) => m2
|
|
|
136701
137009
|
This indicates a sprite was rendered without valid backing data.`
|
|
136702
137010
|
);
|
|
136703
137011
|
console.error(error);
|
|
137012
|
+
if (ownsSpan) {
|
|
137013
|
+
span.recordException(error);
|
|
137014
|
+
span.setStatus({ code: 2, message: error.message });
|
|
137015
|
+
span.end();
|
|
137016
|
+
}
|
|
136704
137017
|
throw error;
|
|
136705
137018
|
}
|
|
136706
137019
|
const isFirstPlacement = isNewRepo || !!existingMembership && !((_a2 = existingMembership.metadata) == null ? void 0 : _a2.regionId);
|
|
@@ -136721,6 +137034,15 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
136721
137034
|
});
|
|
136722
137035
|
newRegionId = newRegion.id;
|
|
136723
137036
|
}
|
|
137037
|
+
span.addEvent("collection-map.project-moved", {
|
|
137038
|
+
"collection.id": collection.id,
|
|
137039
|
+
"repository.id": projectId,
|
|
137040
|
+
"is.new.repo": isNewRepo,
|
|
137041
|
+
"is.first.placement": isFirstPlacement,
|
|
137042
|
+
"region.id": newRegionId,
|
|
137043
|
+
"grid.x": gridX,
|
|
137044
|
+
"grid.y": gridY
|
|
137045
|
+
});
|
|
136724
137046
|
if (isFirstPlacement) {
|
|
136725
137047
|
try {
|
|
136726
137048
|
const regionBoundsX2 = regionCol * REGION_SIZE_TILES;
|
|
@@ -136749,8 +137071,25 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
136749
137071
|
newRegionId
|
|
136750
137072
|
);
|
|
136751
137073
|
}
|
|
137074
|
+
span.addEvent("collection-map.position-saved", {
|
|
137075
|
+
"collection.id": collection.id,
|
|
137076
|
+
"repository.id": projectId,
|
|
137077
|
+
"region.id": newRegionId,
|
|
137078
|
+
"region.changed": true,
|
|
137079
|
+
"grid.x": relativeGridX2,
|
|
137080
|
+
"grid.y": relativeGridY2
|
|
137081
|
+
});
|
|
137082
|
+
if (ownsSpan) {
|
|
137083
|
+
span.setStatus({ code: 1 });
|
|
137084
|
+
span.end();
|
|
137085
|
+
}
|
|
136752
137086
|
} catch (error) {
|
|
136753
137087
|
console.error("[PLACEMENT] ✗ ERROR during placement:", error);
|
|
137088
|
+
if (ownsSpan) {
|
|
137089
|
+
span.recordException(error);
|
|
137090
|
+
span.setStatus({ code: 2, message: error.message });
|
|
137091
|
+
span.end();
|
|
137092
|
+
}
|
|
136754
137093
|
throw error;
|
|
136755
137094
|
}
|
|
136756
137095
|
return;
|
|
@@ -136772,13 +137111,26 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
136772
137111
|
(m2) => m2.repositoryId === projectId
|
|
136773
137112
|
);
|
|
136774
137113
|
const oldRegionId = (_b = membership == null ? void 0 : membership.metadata) == null ? void 0 : _b.regionId;
|
|
136775
|
-
|
|
137114
|
+
const regionChanged = oldRegionId !== newRegionId;
|
|
137115
|
+
if (regionChanged) {
|
|
136776
137116
|
await regionCallbacks.onRepositoryAssigned(
|
|
136777
137117
|
collection.id,
|
|
136778
137118
|
projectId,
|
|
136779
137119
|
newRegionId
|
|
136780
137120
|
);
|
|
136781
137121
|
}
|
|
137122
|
+
span.addEvent("collection-map.position-saved", {
|
|
137123
|
+
"collection.id": collection.id,
|
|
137124
|
+
"repository.id": projectId,
|
|
137125
|
+
"region.id": newRegionId,
|
|
137126
|
+
"region.changed": regionChanged,
|
|
137127
|
+
"grid.x": relativeGridX,
|
|
137128
|
+
"grid.y": relativeGridY
|
|
137129
|
+
});
|
|
137130
|
+
if (ownsSpan) {
|
|
137131
|
+
span.setStatus({ code: 1 });
|
|
137132
|
+
span.end();
|
|
137133
|
+
}
|
|
136782
137134
|
},
|
|
136783
137135
|
[
|
|
136784
137136
|
collection.id,
|
|
@@ -136790,20 +137142,43 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
136790
137142
|
);
|
|
136791
137143
|
const handleProjectDrop = useCallback(
|
|
136792
137144
|
async (data, event) => {
|
|
136793
|
-
const
|
|
136794
|
-
|
|
136795
|
-
|
|
136796
|
-
|
|
136797
|
-
|
|
136798
|
-
|
|
136799
|
-
|
|
136800
|
-
|
|
136801
|
-
|
|
136802
|
-
|
|
136803
|
-
|
|
136804
|
-
|
|
137145
|
+
const span = getTracer().startSpan("collection-map.project-drop");
|
|
137146
|
+
try {
|
|
137147
|
+
const repositoryPath = data.primaryData;
|
|
137148
|
+
const repositoryMetadata = data.metadata || {};
|
|
137149
|
+
const repoId = (repositoryMetadata == null ? void 0 : repositoryMetadata.name) || repositoryPath;
|
|
137150
|
+
const gridCoords = domEventToGridCoords(
|
|
137151
|
+
event.clientX,
|
|
137152
|
+
event.clientY,
|
|
137153
|
+
viewportRef.current,
|
|
137154
|
+
canvasRef.current
|
|
137155
|
+
);
|
|
137156
|
+
const gridX = Math.round(gridCoords.gridX);
|
|
137157
|
+
const gridY = Math.round(gridCoords.gridY);
|
|
137158
|
+
span.addEvent("collection-map.project-drop", {
|
|
137159
|
+
"collection.id": collection.id,
|
|
137160
|
+
"source.type": "repository-project",
|
|
137161
|
+
"repository.id": repoId,
|
|
137162
|
+
"grid.x": gridX,
|
|
137163
|
+
"grid.y": gridY
|
|
137164
|
+
});
|
|
137165
|
+
await handleProjectMoved(
|
|
137166
|
+
repoId,
|
|
137167
|
+
gridX,
|
|
137168
|
+
gridY,
|
|
137169
|
+
repositoryMetadata,
|
|
137170
|
+
span
|
|
137171
|
+
);
|
|
137172
|
+
span.setStatus({ code: 1 });
|
|
137173
|
+
span.end();
|
|
137174
|
+
} catch (error) {
|
|
137175
|
+
span.recordException(error);
|
|
137176
|
+
span.setStatus({ code: 2, message: error.message });
|
|
137177
|
+
span.end();
|
|
137178
|
+
throw error;
|
|
137179
|
+
}
|
|
136805
137180
|
},
|
|
136806
|
-
[handleProjectMoved]
|
|
137181
|
+
[handleProjectMoved, collection.id]
|
|
136807
137182
|
);
|
|
136808
137183
|
const handleDrawerDrop = useCallback(
|
|
136809
137184
|
async (event) => {
|
|
@@ -136813,41 +137188,80 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
136813
137188
|
if (!unplacedNodeData) return;
|
|
136814
137189
|
event.preventDefault();
|
|
136815
137190
|
event.stopPropagation();
|
|
136816
|
-
const
|
|
136817
|
-
|
|
136818
|
-
|
|
136819
|
-
|
|
136820
|
-
|
|
136821
|
-
|
|
136822
|
-
|
|
136823
|
-
|
|
136824
|
-
|
|
136825
|
-
|
|
137191
|
+
const span = getTracer().startSpan("collection-map.drawer-drop");
|
|
137192
|
+
try {
|
|
137193
|
+
const { nodeId } = JSON.parse(unplacedNodeData);
|
|
137194
|
+
const gridCoords = domEventToGridCoords(
|
|
137195
|
+
event.clientX,
|
|
137196
|
+
event.clientY,
|
|
137197
|
+
viewportRef.current,
|
|
137198
|
+
canvasRef.current
|
|
137199
|
+
);
|
|
137200
|
+
const gridX = Math.round(gridCoords.gridX);
|
|
137201
|
+
const gridY = Math.round(gridCoords.gridY);
|
|
137202
|
+
span.addEvent("collection-map.drawer-drop", {
|
|
137203
|
+
"collection.id": collection.id,
|
|
137204
|
+
"repository.id": nodeId,
|
|
137205
|
+
"grid.x": gridX,
|
|
137206
|
+
"grid.y": gridY
|
|
137207
|
+
});
|
|
137208
|
+
await handleProjectMoved(nodeId, gridX, gridY, void 0, span);
|
|
137209
|
+
span.setStatus({ code: 1 });
|
|
137210
|
+
span.end();
|
|
137211
|
+
} catch (error) {
|
|
137212
|
+
span.recordException(error);
|
|
137213
|
+
span.setStatus({ code: 2, message: error.message });
|
|
137214
|
+
span.end();
|
|
137215
|
+
throw error;
|
|
137216
|
+
}
|
|
136826
137217
|
},
|
|
136827
|
-
[handleProjectMoved]
|
|
137218
|
+
[handleProjectMoved, collection.id]
|
|
136828
137219
|
);
|
|
136829
137220
|
const handleGitHubDrop = useCallback(
|
|
136830
137221
|
async (data, event) => {
|
|
136831
|
-
const
|
|
136832
|
-
|
|
136833
|
-
|
|
136834
|
-
|
|
136835
|
-
|
|
136836
|
-
|
|
136837
|
-
|
|
136838
|
-
|
|
136839
|
-
|
|
136840
|
-
|
|
136841
|
-
|
|
136842
|
-
|
|
136843
|
-
|
|
136844
|
-
|
|
136845
|
-
|
|
136846
|
-
|
|
136847
|
-
|
|
136848
|
-
|
|
137222
|
+
const span = getTracer().startSpan("collection-map.project-drop");
|
|
137223
|
+
try {
|
|
137224
|
+
const fullName = data.primaryData;
|
|
137225
|
+
const metadata = data.metadata || {};
|
|
137226
|
+
const repoId = fullName;
|
|
137227
|
+
const repositoryMetadata = {
|
|
137228
|
+
name: metadata.name || fullName.split("/")[1] || fullName,
|
|
137229
|
+
path: fullName,
|
|
137230
|
+
// Use full_name as path for GitHub repos
|
|
137231
|
+
...metadata
|
|
137232
|
+
};
|
|
137233
|
+
const gridCoords = domEventToGridCoords(
|
|
137234
|
+
event.clientX,
|
|
137235
|
+
event.clientY,
|
|
137236
|
+
viewportRef.current,
|
|
137237
|
+
canvasRef.current
|
|
137238
|
+
);
|
|
137239
|
+
const gridX = Math.round(gridCoords.gridX);
|
|
137240
|
+
const gridY = Math.round(gridCoords.gridY);
|
|
137241
|
+
span.addEvent("collection-map.project-drop", {
|
|
137242
|
+
"collection.id": collection.id,
|
|
137243
|
+
"source.type": "repository-github",
|
|
137244
|
+
"repository.id": repoId,
|
|
137245
|
+
"grid.x": gridX,
|
|
137246
|
+
"grid.y": gridY
|
|
137247
|
+
});
|
|
137248
|
+
await handleProjectMoved(
|
|
137249
|
+
repoId,
|
|
137250
|
+
gridX,
|
|
137251
|
+
gridY,
|
|
137252
|
+
repositoryMetadata,
|
|
137253
|
+
span
|
|
137254
|
+
);
|
|
137255
|
+
span.setStatus({ code: 1 });
|
|
137256
|
+
span.end();
|
|
137257
|
+
} catch (error) {
|
|
137258
|
+
span.recordException(error);
|
|
137259
|
+
span.setStatus({ code: 2, message: error.message });
|
|
137260
|
+
span.end();
|
|
137261
|
+
throw error;
|
|
137262
|
+
}
|
|
136849
137263
|
},
|
|
136850
|
-
[handleProjectMoved]
|
|
137264
|
+
[handleProjectMoved, collection.id]
|
|
136851
137265
|
);
|
|
136852
137266
|
const { isDragOver, ...dropZoneProps } = useDropZone({
|
|
136853
137267
|
handlers: [
|
|
@@ -136996,14 +137410,26 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
136996
137410
|
return;
|
|
136997
137411
|
}
|
|
136998
137412
|
hasComputedLayout.current = true;
|
|
136999
|
-
const span = getTracer().startSpan("collection-map.
|
|
137413
|
+
const span = getTracer().startSpan("collection-map.collection-selected");
|
|
137000
137414
|
span.setAttribute("collection.id", collection.id);
|
|
137415
|
+
span.addEvent("collection-map.collection-selected", {
|
|
137416
|
+
"collection.id": collection.id,
|
|
137417
|
+
"collection.name": collection.name,
|
|
137418
|
+
"members.count": collection.members.length
|
|
137419
|
+
});
|
|
137001
137420
|
span.addEvent("collection-map.convert-nodes", {
|
|
137002
137421
|
"collection.id": collection.id,
|
|
137003
137422
|
"memberships.count": collection.members.length,
|
|
137004
137423
|
"repositories.count": repositories.length,
|
|
137005
137424
|
"nodes.created": nodes.length
|
|
137006
137425
|
});
|
|
137426
|
+
span.addEvent("collection-map.validate-nodes", {
|
|
137427
|
+
"collection.id": collection.id,
|
|
137428
|
+
"nodes.total": nodes.length,
|
|
137429
|
+
"nodes.valid": validNodes.length,
|
|
137430
|
+
"nodes.unplaced": unplacedNodes.length,
|
|
137431
|
+
"is.initial.load": isInitialLoad
|
|
137432
|
+
});
|
|
137007
137433
|
const map2 = nodesToUnifiedOverworldMap(nodes, {
|
|
137008
137434
|
regionLayout,
|
|
137009
137435
|
customRegions
|
|
@@ -137017,7 +137443,7 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
137017
137443
|
"nodes.positioned": map2.nodes.length
|
|
137018
137444
|
});
|
|
137019
137445
|
(async () => {
|
|
137020
|
-
var _a2;
|
|
137446
|
+
var _a2, _b, _c, _d;
|
|
137021
137447
|
try {
|
|
137022
137448
|
const updates = {};
|
|
137023
137449
|
if (needsRegions && map2.regions.length > 0) {
|
|
@@ -137057,6 +137483,18 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
137057
137483
|
}
|
|
137058
137484
|
}
|
|
137059
137485
|
await regionCallbacks.onBatchLayoutInitialized(collection.id, updates);
|
|
137486
|
+
span.addEvent("collection-map.batch-save", {
|
|
137487
|
+
"collection.id": collection.id,
|
|
137488
|
+
"regions.saved": ((_b = updates.regions) == null ? void 0 : _b.length) || 0,
|
|
137489
|
+
"assignments.saved": ((_c = updates.assignments) == null ? void 0 : _c.length) || 0,
|
|
137490
|
+
"positions.saved": ((_d = updates.positions) == null ? void 0 : _d.length) || 0
|
|
137491
|
+
});
|
|
137492
|
+
span.addEvent("collection-map.map-rendered", {
|
|
137493
|
+
"collection.id": collection.id,
|
|
137494
|
+
"nodes.rendered": validNodes.length,
|
|
137495
|
+
"regions.rendered": customRegions.length || map2.regions.length,
|
|
137496
|
+
"unplaced.count": unplacedNodes.length
|
|
137497
|
+
});
|
|
137060
137498
|
span.setStatus({ code: 1 });
|
|
137061
137499
|
span.end();
|
|
137062
137500
|
} catch (error) {
|
|
@@ -137068,9 +137506,12 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
137068
137506
|
})();
|
|
137069
137507
|
}, [
|
|
137070
137508
|
collection.id,
|
|
137509
|
+
collection.name,
|
|
137071
137510
|
collection.members.length,
|
|
137072
137511
|
repositories.length,
|
|
137073
137512
|
nodes,
|
|
137513
|
+
validNodes.length,
|
|
137514
|
+
unplacedNodes.length,
|
|
137074
137515
|
regionLayout,
|
|
137075
137516
|
customRegions,
|
|
137076
137517
|
regionCallbacks
|
|
@@ -137078,6 +137519,48 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
137078
137519
|
const handleViewportReady = useCallback((viewport) => {
|
|
137079
137520
|
viewportRef.current = viewport;
|
|
137080
137521
|
}, []);
|
|
137522
|
+
const handleRepositoryClicked = useCallback(
|
|
137523
|
+
(repositoryId) => {
|
|
137524
|
+
const span = getTracer().startSpan("collection-map.repository-clicked");
|
|
137525
|
+
span.addEvent("collection-map.repository-clicked", {
|
|
137526
|
+
"collection.id": collection.id,
|
|
137527
|
+
"repository.id": repositoryId || "",
|
|
137528
|
+
action: repositoryId ? "selected" : "deselected"
|
|
137529
|
+
});
|
|
137530
|
+
span.setStatus({ code: 1 });
|
|
137531
|
+
span.end();
|
|
137532
|
+
onRepositoryClicked == null ? void 0 : onRepositoryClicked(repositoryId);
|
|
137533
|
+
},
|
|
137534
|
+
[collection.id, onRepositoryClicked]
|
|
137535
|
+
);
|
|
137536
|
+
const handleAddRegion = useCallback(
|
|
137537
|
+
async (position2) => {
|
|
137538
|
+
const span = getTracer().startSpan("collection-map.region-created");
|
|
137539
|
+
try {
|
|
137540
|
+
const order2 = position2.row * 10 + position2.col;
|
|
137541
|
+
const name2 = `Region ${customRegions.length + 1}`;
|
|
137542
|
+
const newRegion = await regionCallbacks.onRegionCreated(collection.id, {
|
|
137543
|
+
name: name2,
|
|
137544
|
+
order: order2,
|
|
137545
|
+
createdAt: 0
|
|
137546
|
+
});
|
|
137547
|
+
span.addEvent("collection-map.region-created", {
|
|
137548
|
+
"collection.id": collection.id,
|
|
137549
|
+
"region.id": newRegion.id,
|
|
137550
|
+
"region.name": name2,
|
|
137551
|
+
"region.order": order2
|
|
137552
|
+
});
|
|
137553
|
+
span.setStatus({ code: 1 });
|
|
137554
|
+
span.end();
|
|
137555
|
+
} catch (error) {
|
|
137556
|
+
span.recordException(error);
|
|
137557
|
+
span.setStatus({ code: 2, message: error.message });
|
|
137558
|
+
span.end();
|
|
137559
|
+
throw error;
|
|
137560
|
+
}
|
|
137561
|
+
},
|
|
137562
|
+
[collection.id, customRegions.length, regionCallbacks]
|
|
137563
|
+
);
|
|
137081
137564
|
const handleDragOver = useCallback((e2) => {
|
|
137082
137565
|
if (e2.dataTransfer.types.includes("application/x-unplaced-node") || e2.dataTransfer.types.includes("application/x-panel-data")) {
|
|
137083
137566
|
e2.preventDefault();
|
|
@@ -137153,21 +137636,13 @@ This indicates a sprite was rendered without valid backing data.`
|
|
|
137153
137636
|
customRegions,
|
|
137154
137637
|
collectionKey: collection.id,
|
|
137155
137638
|
onProjectMoved: handleProjectMoved,
|
|
137156
|
-
onNodeClicked:
|
|
137639
|
+
onNodeClicked: handleRepositoryClicked,
|
|
137157
137640
|
selectedNodeId: selectedRepositoryId,
|
|
137158
137641
|
onPackageHover,
|
|
137159
137642
|
onPackageHoverEnd,
|
|
137160
137643
|
onPackageClick,
|
|
137161
137644
|
onViewportReady: handleViewportReady,
|
|
137162
|
-
onAddRegion:
|
|
137163
|
-
const order2 = position2.row * 10 + position2.col;
|
|
137164
|
-
const name2 = `Region ${customRegions.length + 1}`;
|
|
137165
|
-
await regionCallbacks.onRegionCreated(collection.id, {
|
|
137166
|
-
name: name2,
|
|
137167
|
-
order: order2,
|
|
137168
|
-
createdAt: 0
|
|
137169
|
-
});
|
|
137170
|
-
},
|
|
137645
|
+
onAddRegion: handleAddRegion,
|
|
137171
137646
|
onRenameRegion: handleRenameRegion,
|
|
137172
137647
|
onDeleteRegion: handleDeleteRegion
|
|
137173
137648
|
}
|
|
@@ -138421,4 +138896,4 @@ export {
|
|
|
138421
138896
|
UPDATE_PRIORITY as y,
|
|
138422
138897
|
removeItems as z
|
|
138423
138898
|
};
|
|
138424
|
-
//# sourceMappingURL=index-
|
|
138899
|
+
//# sourceMappingURL=index-7aQ4t9XI.js.map
|