2023-10-06 12:08:44 +00:00
|
|
|
@use "sass:map";
|
|
|
|
|
2024-01-24 08:22:17 +00:00
|
|
|
#zotero-items-pane-container {
|
|
|
|
min-width: $min-width-items-pane;
|
2024-01-09 19:11:25 +00:00
|
|
|
height: 150px;
|
2024-04-13 07:44:17 +00:00
|
|
|
min-height: $min-height-items-pane;
|
2024-01-24 08:22:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#zotero-items-pane {
|
|
|
|
min-width: $min-width-items-pane;
|
|
|
|
}
|
2023-11-28 08:29:55 +00:00
|
|
|
|
2024-01-24 08:22:17 +00:00
|
|
|
#zotero-items-tree {
|
2024-01-08 16:32:06 +00:00
|
|
|
.virtualized-table-body, .drag-image-container {
|
2024-01-12 05:20:34 +00:00
|
|
|
padding: 4px 8px 8px;
|
2023-11-28 08:29:55 +00:00
|
|
|
}
|
|
|
|
|
2024-05-15 04:45:57 +00:00
|
|
|
.virtualized-table-body {
|
|
|
|
scrollbar-color: var(--color-scrollbar) var(--color-scrollbar-background);
|
|
|
|
}
|
|
|
|
|
2023-11-28 08:29:55 +00:00
|
|
|
.virtualized-table-header {
|
2024-01-11 06:46:10 +00:00
|
|
|
padding-inline-start: 8px;
|
|
|
|
padding-inline-end: calc(8px + var(--scrollbar-width, 0px));
|
2023-11-28 08:29:55 +00:00
|
|
|
box-sizing: border-box;
|
2024-01-05 01:04:37 +00:00
|
|
|
|
2024-01-29 07:37:46 +00:00
|
|
|
.cell.hasAttachment,
|
|
|
|
.cell.numNotes {
|
|
|
|
padding: 0;
|
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
&.first-column {
|
|
|
|
padding-inline-start: 32px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-01-05 01:04:37 +00:00
|
|
|
.first-column {
|
2024-03-02 07:51:55 +00:00
|
|
|
padding-inline-start: 36px;
|
|
|
|
|
2024-01-05 01:04:37 +00:00
|
|
|
&::before {
|
|
|
|
content: "";
|
|
|
|
display: inline-block;
|
|
|
|
width: 8px;
|
|
|
|
height: 100%;
|
|
|
|
background: transparent;
|
|
|
|
position: absolute;
|
2024-01-10 15:52:53 +00:00
|
|
|
inset-inline-start: -8px;
|
2024-01-05 01:04:37 +00:00
|
|
|
|
|
|
|
@include state(".first-column:hover") {
|
|
|
|
background: var(--material-mix-quinary);
|
|
|
|
}
|
|
|
|
|
|
|
|
@include state(".first-column.dragging") {
|
|
|
|
background: var(--material-mix-quarternary);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.cell:last-child {
|
|
|
|
&::after {
|
|
|
|
content: "";
|
|
|
|
display: inline-block;
|
|
|
|
width: calc(var(--scrollbar-width, 0px) + 8px);
|
|
|
|
height: 100%;
|
|
|
|
background: transparent;
|
|
|
|
position: absolute;
|
2024-01-10 15:52:53 +00:00
|
|
|
inset-inline-end: calc(-1 * var(--scrollbar-width, 0px) - 8px);
|
2024-01-05 01:04:37 +00:00
|
|
|
|
|
|
|
@include state(".cell:hover") {
|
|
|
|
background: var(--material-mix-quinary);
|
|
|
|
}
|
|
|
|
|
|
|
|
@include state(".cell.dragging") {
|
|
|
|
background: var(--material-mix-quarternary);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-04-09 09:00:34 +00:00
|
|
|
}
|
2021-09-17 10:02:25 +00:00
|
|
|
|
2024-01-08 16:32:06 +00:00
|
|
|
.virtualized-table, .drag-image-container {
|
2023-11-28 08:29:55 +00:00
|
|
|
.row {
|
|
|
|
&.odd:not(.selected) {
|
2024-02-02 08:20:47 +00:00
|
|
|
background-color: var(--material-stripe);
|
2023-11-28 08:29:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&.even:not(.selected) {
|
2024-01-13 09:19:36 +00:00
|
|
|
background-color: var(--material-background);
|
2023-11-28 08:29:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&.selected {
|
|
|
|
border-radius: 0;
|
|
|
|
|
|
|
|
&.first-selected {
|
|
|
|
border-top-left-radius: 5px;
|
|
|
|
border-top-right-radius: 5px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.last-selected {
|
|
|
|
border-bottom-left-radius: 5px;
|
|
|
|
border-bottom-right-radius: 5px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-01-11 06:46:10 +00:00
|
|
|
.colored-tag-swatches {
|
|
|
|
direction: ltr;
|
2024-02-21 11:39:12 +00:00
|
|
|
display: flex;
|
2024-08-15 09:15:25 +00:00
|
|
|
|
|
|
|
:root:-moz-locale-dir(rtl) & {
|
|
|
|
transform: scaleX(-1);
|
|
|
|
}
|
2024-01-11 06:46:10 +00:00
|
|
|
}
|
2024-03-12 23:02:52 +00:00
|
|
|
|
|
|
|
.icon-item-type + .tag-swatch,
|
|
|
|
.icon-item-type + .colored-tag-swatches {
|
|
|
|
margin-left: 4px;
|
|
|
|
}
|
2024-08-08 16:03:24 +00:00
|
|
|
|
|
|
|
.emoji + .emoji,
|
|
|
|
.emoji + .colored-tag-swatches,
|
|
|
|
.colored-tag-swatches + .emoji {
|
|
|
|
margin-left: 4px;
|
|
|
|
|
|
|
|
:root:-moz-locale-dir(rtl) & {
|
|
|
|
margin-left: 0;
|
|
|
|
margin-right: 4px;
|
|
|
|
}
|
|
|
|
}
|
2024-01-11 06:46:10 +00:00
|
|
|
|
2023-11-28 08:29:55 +00:00
|
|
|
.tag-swatch {
|
|
|
|
display: inline-block;
|
|
|
|
|
|
|
|
&.colored {
|
|
|
|
-moz-context-properties: fill, fill-opacity, stroke, stroke-opacity;
|
2024-02-21 11:39:12 +00:00
|
|
|
width: 0.92307692em;
|
|
|
|
height: 0.92307692em;
|
2023-11-28 08:29:55 +00:00
|
|
|
background:
|
2024-02-21 11:39:12 +00:00
|
|
|
url("chrome://zotero/skin/tag-circle.svg") no-repeat center/100%,
|
2023-11-28 08:29:55 +00:00
|
|
|
url("chrome://zotero/skin/tag-circle-border.svg") no-repeat center/0;
|
|
|
|
fill: currentcolor;
|
|
|
|
|
|
|
|
@each $colorHex, $colorVar in $tagColorsLookup {
|
|
|
|
&[data-color="#{$colorHex}"] {
|
|
|
|
fill: var($colorVar);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@include focus-states using($color) {
|
|
|
|
@if $color =="white" {
|
|
|
|
background: url("chrome://zotero/skin/tag-circle-border.svg") no-repeat center/contain;
|
|
|
|
stroke: var(--accent-white);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.colored + .colored {
|
|
|
|
background:
|
2024-02-21 11:39:12 +00:00
|
|
|
url("chrome://zotero/skin/tag-crescent.svg") no-repeat center/100%,
|
2023-11-28 08:29:55 +00:00
|
|
|
url("chrome://zotero/skin/tag-crescent-border.svg") no-repeat center/0;
|
2024-02-21 11:39:12 +00:00
|
|
|
margin-left: -0.38461538em;
|
2023-11-28 08:29:55 +00:00
|
|
|
|
|
|
|
@include focus-states using($color) {
|
|
|
|
@if $color =="white" {
|
|
|
|
background: url("chrome://zotero/skin/tag-crescent-border.svg") no-repeat center/contain;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-09-17 10:02:25 +00:00
|
|
|
}
|
2023-11-28 08:29:55 +00:00
|
|
|
|
2021-09-17 10:02:25 +00:00
|
|
|
|
2023-11-28 08:29:55 +00:00
|
|
|
.cell.primary {
|
|
|
|
.retracted {
|
|
|
|
width: 12px;
|
|
|
|
margin-inline-start: 3px;
|
|
|
|
}
|
2021-12-22 08:38:12 +00:00
|
|
|
}
|
2024-01-29 07:37:46 +00:00
|
|
|
|
|
|
|
.cell.no-padding {
|
|
|
|
padding: 0;
|
|
|
|
}
|
2021-12-22 08:38:12 +00:00
|
|
|
|
2023-11-28 08:29:55 +00:00
|
|
|
.cell.hasAttachment {
|
|
|
|
text-overflow: unset;
|
2024-01-29 07:37:46 +00:00
|
|
|
align-items: center;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
.cell-text {
|
|
|
|
text-overflow: unset;
|
|
|
|
align-items: center;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
2023-11-28 08:29:55 +00:00
|
|
|
|
|
|
|
.icon-missing-file {
|
|
|
|
opacity: 0.4;
|
|
|
|
}
|
2021-12-22 08:38:12 +00:00
|
|
|
}
|
|
|
|
|
2024-01-29 07:37:46 +00:00
|
|
|
.numNotes, .hasAttachment {
|
2023-11-28 08:29:55 +00:00
|
|
|
text-align: center;
|
2024-01-29 07:37:46 +00:00
|
|
|
|
|
|
|
.cell-text {
|
|
|
|
text-align: center;
|
|
|
|
}
|
2021-12-22 08:38:12 +00:00
|
|
|
}
|
2021-09-17 10:02:25 +00:00
|
|
|
}
|
2023-11-01 12:00:21 +00:00
|
|
|
}
|
2023-10-06 12:08:44 +00:00
|
|
|
|
2023-11-01 12:00:21 +00:00
|
|
|
$-itemTypesIcons: (
|
2023-10-06 12:08:44 +00:00
|
|
|
artwork,
|
|
|
|
attachment-epub,
|
2023-11-01 12:00:21 +00:00
|
|
|
attachment-epub-link,
|
2023-10-06 12:08:44 +00:00
|
|
|
attachment-file, // mapped to document below
|
|
|
|
attachment-link,
|
|
|
|
attachment-pdf-link,
|
|
|
|
attachment-pdf,
|
|
|
|
attachment-snapshot,
|
|
|
|
attachment-web-link,
|
2024-02-23 11:11:40 +00:00
|
|
|
attachment-image,
|
|
|
|
attachment-image-link,
|
|
|
|
attachment-video,
|
|
|
|
attachment-video-link,
|
2023-10-06 12:08:44 +00:00
|
|
|
audio-recording,
|
|
|
|
bill,
|
|
|
|
blog-post,
|
|
|
|
book-section,
|
|
|
|
book,
|
|
|
|
case,
|
|
|
|
computer-program,
|
|
|
|
conference-paper,
|
|
|
|
dataset,
|
|
|
|
dictionary-entry,
|
|
|
|
document,
|
|
|
|
email,
|
|
|
|
encyclopedia-article,
|
|
|
|
epub,
|
|
|
|
film,
|
|
|
|
forum-post,
|
|
|
|
hearing,
|
|
|
|
instant-message,
|
|
|
|
interview,
|
|
|
|
journal-article,
|
|
|
|
letter,
|
|
|
|
magazine-article,
|
|
|
|
manuscript,
|
|
|
|
map,
|
|
|
|
newspaper-article,
|
|
|
|
note,
|
|
|
|
patent,
|
|
|
|
podcast,
|
|
|
|
preprint,
|
|
|
|
presentation,
|
|
|
|
radio-broadcast,
|
|
|
|
report,
|
|
|
|
standard,
|
|
|
|
statute,
|
|
|
|
thesis,
|
|
|
|
tv-broadcast,
|
|
|
|
video-recording,
|
|
|
|
webpage
|
2023-11-01 12:00:21 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
$-itemTypesMap: (
|
2023-10-06 12:08:44 +00:00
|
|
|
"attachment-file": "document"
|
2023-11-01 12:00:21 +00:00
|
|
|
);
|
|
|
|
|
2023-11-28 08:29:55 +00:00
|
|
|
$-attachmentIcons: (
|
|
|
|
attachment-epub,
|
|
|
|
attachment-epub-link,
|
|
|
|
attachment-link,
|
|
|
|
attachment-pdf-link,
|
|
|
|
attachment-pdf,
|
|
|
|
attachment-snapshot,
|
|
|
|
attachment-web-link,
|
2024-02-23 11:11:40 +00:00
|
|
|
attachment-file,
|
|
|
|
attachment-image,
|
|
|
|
attachment-video
|
2023-11-28 08:29:55 +00:00
|
|
|
);
|
|
|
|
|
2024-05-13 11:07:12 +00:00
|
|
|
// Non-item objects that can appear in the trash
|
|
|
|
$-trashableObjectIcons: (
|
|
|
|
"collection",
|
|
|
|
"search"
|
|
|
|
);
|
|
|
|
|
2023-11-01 12:00:21 +00:00
|
|
|
.icon-item-type {
|
|
|
|
width: 16px;
|
|
|
|
height: 16px;
|
|
|
|
}
|
|
|
|
|
2023-11-28 08:29:55 +00:00
|
|
|
.icon-attachment-type {
|
|
|
|
width: 12px;
|
|
|
|
height: 12px;
|
|
|
|
padding: 1px;
|
|
|
|
box-sizing: content-box;
|
|
|
|
}
|
|
|
|
|
2023-11-01 12:00:21 +00:00
|
|
|
// Due to quirks of the state() mixin, we need two sets of .icon-item-type rules:
|
|
|
|
// one when the icon is within a virtualized-table, and one when it isn't. We declare
|
|
|
|
// a mixin here to avoid duplication.
|
|
|
|
|
|
|
|
@mixin -icon-item-type-rules($color) {
|
|
|
|
.icon-item-type {
|
|
|
|
// default icon, for known item types more specific selectors below will apply
|
|
|
|
@include svgicon("document", $color, "16", "item-type", true);
|
|
|
|
}
|
|
|
|
|
|
|
|
@each $itemTypeIcon in $-itemTypesIcons {
|
|
|
|
$itemType: camelCase(str-replace(str-replace($itemTypeIcon, "pdf", "PDF"), "epub", "EPUB"));
|
|
|
|
|
|
|
|
@if map.has-key($-itemTypesMap, $itemTypeIcon) {
|
|
|
|
$itemTypeIcon: map.get($-itemTypesMap, $itemTypeIcon);
|
2023-10-06 12:08:44 +00:00
|
|
|
}
|
2023-11-01 12:00:21 +00:00
|
|
|
|
|
|
|
.icon-item-type[data-item-type=#{$itemType}] {
|
|
|
|
@include svgicon($itemTypeIcon, $color, "16", "item-type", true);
|
2023-10-06 12:08:44 +00:00
|
|
|
}
|
|
|
|
}
|
XUL -> JS tree megacommit
- Just a single huge commit. This has been developed over too long a
time, required many tiny changes across too many files and has seen too
many iterations to be separated into separate commits.
The original branch with all the messy commits will be kept around for
posterity
https://github.com/zotero/zotero/compare/bb220ad0f2d6bf0eca6df6d225d3d358cb50a27b...adomasven:feature/react-item-tree
- Replaces XUL <tree> element across the whole zotero client codebase
with a custom supermegafast virtualized-table inspired by
react-virtualized yet mimicking old XUL treeview API. The
virtualized-table sits on top on a raw-to-the-metal,
interpreted-at-runtime JS based windowing solution inspired by
react-window. React-based solutions could not be used because they were
slow and Zotero UI needs to be responsive and be able to
display thousands of rows in a treeview without any slowdowns.
- Attempts were made at making this screen-reader friendly, but yet to
be tested with something like JAWS
- RTL-friendly
- Styling and behaviour across all platforms was copied as closely as
possible to the original XUL tree
- Instead of row-based scroll snapping this has smooth-scrolling. If
you're using arrow keys to browse through the tree then it effectively
snap-scrolls. Current CSS snap scroll attributes do not seem to work in
the way we would require even on up-to-date browsers, yet alone the ESR
version of FX that Zotero is on. JS solutions are either terrible for
performance or produce inexcusable jitter.
- When dragging-and-dropping items the initial drag freezes the UI for
a fairly jarring amount of time. Does not seem to be fixable due to
the synchronous code that needs to be run in the dragstart handler.
Used to be possible to run that code async with the XUL tree.
- Item tree column picker no longer has a dedicated button. Just
right-click the columns. The column preferences (width, order, etc) are
no longer handled by XUL, which required a custom serialization and
storage solution that throws warnings in the developer console due to
the amount of data being stored. Might cause temporary freezing on HDDs
upon column resize/reorder/visibility toggling.
- Context menu handling code basically unchanged, but any UI changes
that plugins may have wanted to do (including adding new columns) will
have to be redone by them. No serious thought has gone into how plugin
developers would achieve that yet.
- Opens up the possibility for awesome alternative ways to render the
tree items, including things like multiple-row view for the item tree,
which has been requested for a long while especially by users switching
from other referencing software
2020-06-03 07:29:46 +00:00
|
|
|
}
|
2023-11-01 12:00:21 +00:00
|
|
|
|
|
|
|
@include focus-states using($color) {
|
|
|
|
@include -icon-item-type-rules($color);
|
|
|
|
}
|
|
|
|
|
|
|
|
.virtualized-table .row {
|
|
|
|
@include focus-states using($color) {
|
|
|
|
@include -icon-item-type-rules($color);
|
2024-02-23 11:11:40 +00:00
|
|
|
|
|
|
|
@each $itemAttachmentIcon in $-attachmentIcons {
|
|
|
|
$itemType: camelCase(str-replace(str-replace($itemAttachmentIcon, "pdf", "PDF"), "epub", "EPUB"));
|
|
|
|
.icon-attachment-type[data-item-type=#{$itemType}] {
|
|
|
|
@include svgicon($itemAttachmentIcon, $color, "12", "item-type", false);
|
|
|
|
background-origin: content-box;
|
|
|
|
}
|
|
|
|
}
|
2024-05-13 11:07:12 +00:00
|
|
|
|
|
|
|
@each $icon in $-trashableObjectIcons {
|
|
|
|
.icon-css.icon-#{$icon} {
|
|
|
|
@include svgicon($icon, $color, "16", "collection-tree");
|
|
|
|
}
|
|
|
|
}
|
2023-11-01 12:00:21 +00:00
|
|
|
}
|
|
|
|
}
|