  In this article, we study the fully differential observables of exclusive
production of heavy (charm and bottom) quark pairs in high-energy
ultraperipheral $pA$ and $AA$ collisions. In these processes, the nucleus $A$
serves as an efficient source of the photon flux, while the QCD interaction of
the produced heavy-quark pair with the target ($p$ or $A$) proceeds via an
exchange of gluons in a color singlet state, described by the gluon Wigner
distribution. The corresponding predictions for differential cross sections
were obtained by using the dipole $S$-matrix in the McLerran--Venugopalan
saturation model with impact parameter dependence for the nucleus target, and
its recent generalization, for the proton target. Prospects of experimental
constraints on the gluon Wigner distribution in this class of reactions are
discussed.
