history-react.less 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. @versions-list-width: 320px;
  2. @history-toolbar-height: 40px;
  3. @history-change-list-padding: 16px;
  4. history-root {
  5. height: 100%;
  6. display: block;
  7. }
  8. // Adding !important to override the styling of overlays and popovers
  9. .history-popover {
  10. top: 90px !important;
  11. .arrow {
  12. top: 20px !important;
  13. }
  14. }
  15. .history-react {
  16. display: flex;
  17. height: 100%;
  18. background-color: @history-main-bg;
  19. .history-header {
  20. height: @history-toolbar-height;
  21. background-color: @history-react-header-bg;
  22. color: @history-react-header-color;
  23. font-size: @font-size-small;
  24. display: flex;
  25. flex-direction: column;
  26. justify-content: center;
  27. box-sizing: border-box;
  28. }
  29. .doc-panel {
  30. flex: 1;
  31. display: flex;
  32. flex-direction: column;
  33. .toolbar-container {
  34. border-bottom: 1px solid @history-react-separator-color;
  35. padding: 0 8px;
  36. }
  37. .doc-container {
  38. flex: 1;
  39. overflow-y: auto;
  40. }
  41. }
  42. .change-list {
  43. display: flex;
  44. flex-direction: column;
  45. width: @versions-list-width;
  46. font-size: @font-size-small;
  47. border-left: 1px solid @history-react-separator-color;
  48. box-sizing: content-box;
  49. }
  50. .toggle-switch-label {
  51. flex: 1;
  52. span {
  53. display: block;
  54. }
  55. }
  56. .history-version-list-container {
  57. flex: 1;
  58. overflow-y: auto;
  59. }
  60. .history-all-versions-scroller {
  61. overflow-y: auto;
  62. height: 100%;
  63. }
  64. .history-all-versions-container {
  65. position: relative;
  66. }
  67. .history-versions-bottom {
  68. position: absolute;
  69. height: 8em;
  70. bottom: 0;
  71. }
  72. .history-toggle-switch-container,
  73. .history-version-day,
  74. .history-version-details {
  75. padding: 0 @history-change-list-padding;
  76. }
  77. .history-version-day {
  78. background-color: white;
  79. position: sticky;
  80. z-index: 1;
  81. top: 0;
  82. display: block;
  83. padding-top: 12px;
  84. padding-bottom: 4px;
  85. line-height: 20px;
  86. }
  87. .history-version-details {
  88. padding-top: 8px;
  89. padding-bottom: 8px;
  90. position: relative;
  91. &.history-version-selectable {
  92. cursor: pointer;
  93. &:hover {
  94. background-color: @neutral-10;
  95. }
  96. }
  97. &.history-version-selected {
  98. background-color: @green-10;
  99. border-left: 3px solid @green-50;
  100. padding-left: @history-change-list-padding - 3px;
  101. }
  102. &.history-version-selected.history-version-selectable:hover {
  103. background-color: fade(@green-70, 16%);
  104. border-left: 3px solid @green-50;
  105. }
  106. &.history-version-within-selected {
  107. background-color: @neutral-10;
  108. border-left: 3px solid @green-50;
  109. }
  110. &.history-version-within-selected:hover {
  111. background-color: fade(@neutral-90, 8%);
  112. }
  113. }
  114. .version-element-within-selected {
  115. background-color: @neutral-10;
  116. border-left: 3px solid @green-50;
  117. }
  118. .version-element-selected {
  119. background-color: @green-10;
  120. border-left: 3px solid @green-50;
  121. }
  122. .history-version-metadata-time {
  123. display: block;
  124. margin-bottom: 4px;
  125. color: @neutral-90;
  126. &:last-child {
  127. margin-bottom: initial;
  128. }
  129. }
  130. .history-version-metadata-users,
  131. .history-version-changes {
  132. margin: 0;
  133. padding: 0;
  134. list-style: none;
  135. }
  136. .history-version-metadata-users {
  137. display: inline;
  138. > li {
  139. display: inline-flex;
  140. align-items: center;
  141. margin-right: 8px;
  142. }
  143. }
  144. .history-version-changes {
  145. > li {
  146. margin-bottom: 4px;
  147. }
  148. }
  149. .history-version-user-badge-color {
  150. @size: 8px;
  151. display: inline-block;
  152. width: @size;
  153. height: @size;
  154. margin-right: 4px;
  155. border-radius: 2px;
  156. }
  157. .history-version-user-badge-text {
  158. overflow-wrap: anywhere;
  159. flex: 1;
  160. }
  161. .history-version-day,
  162. .history-version-change-action,
  163. .history-version-metadata-users,
  164. .history-version-origin,
  165. .history-version-saved-by {
  166. color: @neutral-70;
  167. }
  168. .history-version-change-action {
  169. overflow-wrap: anywhere;
  170. }
  171. .history-version-change-doc {
  172. color: @neutral-90;
  173. overflow-wrap: anywhere;
  174. white-space: pre-wrap;
  175. }
  176. .history-version-divider-container {
  177. padding: 6px 8px;
  178. }
  179. .history-version-divider {
  180. margin: 0px;
  181. border-color: @neutral-20;
  182. }
  183. .history-version-badge {
  184. margin-bottom: 4px;
  185. margin-right: 10px;
  186. height: unset;
  187. white-space: normal;
  188. overflow-wrap: anywhere;
  189. }
  190. .history-version-label {
  191. margin-bottom: 4px;
  192. &:last-child {
  193. margin-bottom: initial;
  194. }
  195. }
  196. .loading {
  197. padding-top: 10rem;
  198. font-family: @font-family-serif;
  199. text-align: center;
  200. }
  201. & > .loading {
  202. flex: 1;
  203. }
  204. .history-all-versions-scroller .loading {
  205. position: sticky;
  206. bottom: 0;
  207. padding: @line-height-computed / 2 0;
  208. background-color: @gray-lightest;
  209. }
  210. .history-version-saved-by {
  211. &-label {
  212. margin-right: 8px;
  213. }
  214. }
  215. .dropdown.open {
  216. .history-version-dropdown-menu-btn {
  217. background-color: rgba(@neutral-90, 0.08);
  218. box-shadow: initial;
  219. }
  220. }
  221. .history-compare-btn,
  222. .history-version-dropdown-menu-btn {
  223. @size: 30px;
  224. padding: 0;
  225. width: @size;
  226. height: @size;
  227. line-height: 1;
  228. font-size: @font-size-small;
  229. color: @neutral-90;
  230. background-color: transparent;
  231. &:hover,
  232. &:active {
  233. z-index: initial;
  234. background-color: rgba(@neutral-90, 0.08);
  235. box-shadow: initial;
  236. }
  237. }
  238. .history-loading-panel {
  239. padding-top: 10rem;
  240. font-family: @font-family-serif;
  241. text-align: center;
  242. }
  243. .history-file-entity-operation-badge {
  244. flex: 0 0 auto;
  245. text-transform: lowercase;
  246. margin-left: 0.5em;
  247. font-size: 0.7em;
  248. background: @history-file-badge-bg;
  249. color: @history-file-badge-color;
  250. border-radius: 8px;
  251. line-height: 1;
  252. padding: 2px 4px 3px;
  253. margin-top: 2px;
  254. }
  255. .history-react-toolbar {
  256. display: flex;
  257. align-items: center;
  258. gap: 8px;
  259. .history-react-toolbar-file-info {
  260. flex: 1;
  261. text-align: right;
  262. }
  263. .history-react-toolbar-time {
  264. font-weight: 700;
  265. }
  266. }
  267. .history-paywall-prompt {
  268. padding: @history-change-list-padding;
  269. .history-feature-list {
  270. list-style: none;
  271. padding-left: 8px;
  272. li {
  273. margin-bottom: 16px;
  274. }
  275. }
  276. button {
  277. width: 100%;
  278. }
  279. }
  280. .history-version-faded .history-version-details {
  281. max-height: 6em;
  282. .mask-image(linear-gradient(black 35%, transparent));
  283. overflow: hidden;
  284. }
  285. .history-paywall-heading {
  286. .premium-text;
  287. font-family: inherit;
  288. font-size: 20px;
  289. font-weight: 700;
  290. }
  291. .history-content {
  292. padding: @line-height-computed / 2;
  293. }
  294. }
  295. .history-version-label-tooltip {
  296. padding: 6px;
  297. text-align: initial;
  298. &-row {
  299. margin-bottom: 6.25px;
  300. &-comment {
  301. overflow-wrap: anywhere;
  302. }
  303. &:last-child {
  304. margin-bottom: initial;
  305. }
  306. }
  307. }
  308. .history-version-dropdown-menu {
  309. [role='menuitem'] {
  310. padding: 10px 12px;
  311. color: @neutral-90;
  312. &:hover,
  313. &:focus {
  314. color: @neutral-90;
  315. background-color: @neutral-10;
  316. }
  317. span.material-symbols {
  318. vertical-align: middle;
  319. font-size: inherit;
  320. }
  321. }
  322. }
  323. .document-diff-container {
  324. height: 100%;
  325. display: flex;
  326. flex-direction: column;
  327. position: relative;
  328. .cm-viewer-container,
  329. .cm-editor {
  330. height: 100%;
  331. }
  332. .previous-highlight-button,
  333. .next-highlight-button {
  334. position: absolute;
  335. right: 16px;
  336. box-shadow: @box-shadow;
  337. }
  338. .previous-highlight-button {
  339. top: 16px;
  340. }
  341. .next-highlight-button {
  342. bottom: 16px;
  343. }
  344. }
  345. .history-dropdown-icon {
  346. color: @neutral-90;
  347. }
  348. .history-dropdown-icon-inverted {
  349. color: @neutral-10;
  350. vertical-align: top;
  351. }
  352. .history-file-tree {
  353. display: flex !important; // To work around jQuery layout's inline styles
  354. flex-direction: column;
  355. flex-grow: 1;
  356. max-height: 100%;
  357. ul.history-file-tree-list {
  358. margin: 0;
  359. overflow-x: hidden;
  360. height: 100%;
  361. flex-grow: 1;
  362. position: relative;
  363. overflow-y: auto;
  364. .history-file-tree-item > ul,
  365. ul[role='tree'] {
  366. margin-left: 22px;
  367. }
  368. &::after {
  369. content: '';
  370. display: block;
  371. min-height: @line-height-computed;
  372. }
  373. li {
  374. line-height: @file-tree-line-height;
  375. position: relative;
  376. margin-left: 8px;
  377. &:focus {
  378. outline: none;
  379. }
  380. .history-file-tree-item {
  381. color: @file-tree-item-color;
  382. cursor: pointer;
  383. white-space: nowrap;
  384. user-select: none;
  385. display: flex;
  386. align-items: center;
  387. &:focus {
  388. outline: none;
  389. }
  390. .fake-full-width-bg(transparent);
  391. &:hover {
  392. background-color: @file-tree-item-hover-bg;
  393. // When the entity is a subfolder, the DOM element is "indented" via margin-left. This makes the
  394. // element not fill the entire file-tree width (as it's spaced from the left-hand side via margin)
  395. // and, in consequence, the background gets clipped. The ::before pseudo-selector is used to fill
  396. // the empty space.
  397. .fake-full-width-bg(@file-tree-item-hover-bg);
  398. }
  399. .history-file-tree-folder-button,
  400. .history-file-tree-item-button {
  401. .reset-button;
  402. &:focus {
  403. outline: none;
  404. }
  405. }
  406. .history-file-tree-item-name-wrapper {
  407. display: flex;
  408. align-items: center;
  409. width: 100%;
  410. overflow: hidden;
  411. .history-file-tree-item-name {
  412. margin-right: @margin-xs;
  413. overflow: hidden;
  414. text-overflow: ellipsis;
  415. text-align: left;
  416. font-weight: normal;
  417. flex-grow: 1;
  418. white-space: pre;
  419. &.strikethrough {
  420. text-decoration: line-through;
  421. }
  422. }
  423. .history-file-tree-item-badge {
  424. text-transform: capitalize;
  425. font-weight: normal;
  426. margin-right: @margin-sm;
  427. flex-shrink: 0;
  428. &:hover {
  429. background-color: @neutral-20;
  430. }
  431. }
  432. }
  433. }
  434. i.fa {
  435. color: @file-tree-item-icon-color;
  436. font-size: 14px;
  437. display: inline-flex;
  438. flex-shrink: 0;
  439. &.file-tree-icon {
  440. margin-right: 4px;
  441. margin-left: 8px;
  442. }
  443. &.file-tree-folder-icon {
  444. margin-right: 4px;
  445. }
  446. &.file-tree-expand-icon {
  447. margin-left: 8px;
  448. }
  449. }
  450. i.fa-folder-open,
  451. i.fa-folder {
  452. color: @file-tree-item-folder-color;
  453. font-size: 14px;
  454. }
  455. }
  456. li.selected > .history-file-tree-item {
  457. color: @file-tree-item-selected-color;
  458. background-color: @file-tree-item-selected-bg;
  459. font-weight: bold;
  460. > div > i.fa,
  461. > button > i.fa,
  462. > i.fa {
  463. color: @file-tree-item-selected-color;
  464. }
  465. .fake-full-width-bg(@file-tree-item-selected-bg);
  466. }
  467. }
  468. }
  469. .history-error {
  470. padding: 16px;
  471. }