From 6f58e9e7bb36a5a781ba1685e8c77ea1e15eb93f Mon Sep 17 00:00:00 2001 From: Geometrically <18202329+Geometrically@users.noreply.github.com> Date: Tue, 20 Dec 2022 11:15:31 -0700 Subject: [PATCH] Redo version page (#777) * Redo version page * More work on editing page * Make saving work * Finish version editing * Version creation (base) * Add creation buttons * Add file uploader to versions page * Add version file parsing * Finish PR * Fix version page responsiveness and use more consistent card design * Whoops that wasn't supposed to be there * Fixes + allow whole page dragging * Re-add lost merge data * Remove debug line * Move back to list btm Co-authored-by: Prospector --- assets/images/utils/file.svg | 1 + assets/images/utils/hash.svg | 1 + assets/styles/components.scss | 63 +- assets/styles/global.scss | 4 +- assets/styles/layout.scss | 49 +- components/ui/DropArea.vue | 82 ++ components/ui/FileInput.vue | 65 +- generated/.gitkeep | 0 layouts/default.vue | 23 +- package-lock.json | 179 +++- package.json | 3 + pages/_type/_id.vue | 713 ++++--------- pages/_type/_id/edit.vue | 8 +- pages/_type/_id/gallery.vue | 7 +- pages/_type/_id/index.vue | 8 +- pages/_type/_id/version.vue | 1886 ++++++++++++++++++--------------- pages/_type/_id/versions.vue | 76 +- pages/user/_id.vue | 53 +- plugins/fileUtils.js | 214 +++- 19 files changed, 1922 insertions(+), 1513 deletions(-) create mode 100644 assets/images/utils/file.svg create mode 100644 assets/images/utils/hash.svg create mode 100644 components/ui/DropArea.vue delete mode 100644 generated/.gitkeep diff --git a/assets/images/utils/file.svg b/assets/images/utils/file.svg new file mode 100644 index 000000000..09dcf7612 --- /dev/null +++ b/assets/images/utils/file.svg @@ -0,0 +1 @@ + diff --git a/assets/images/utils/hash.svg b/assets/images/utils/hash.svg new file mode 100644 index 000000000..e7ed57c05 --- /dev/null +++ b/assets/images/utils/hash.svg @@ -0,0 +1 @@ + diff --git a/assets/styles/components.scss b/assets/styles/components.scss index 39c7807fe..e194e2d1d 100644 --- a/assets/styles/components.scss +++ b/assets/styles/components.scss @@ -381,25 +381,25 @@ tr.button-transparent { background-color: transparent; border-radius: var(--size-rounded-sm); - &:focus-visible:not(&:disabled) > *, - &:hover:not(&:disabled) > * { - cursor: pointer; - filter: brightness(0.85); - background-color: var(--color-raised-bg); - } + &:focus-visible:not(&:disabled) > *, + &:hover:not(&:disabled) > * { + cursor: pointer; + filter: brightness(0.85); + background-color: var(--color-raised-bg); + } - &:active:not(&:disabled) > * { - filter: brightness(0.8); - background-color: var(--color-raised-bg); - } + &:active:not(&:disabled) > * { + filter: brightness(0.8); + background-color: var(--color-raised-bg); + } - &:disabled > *, - &[disabled] > * { - cursor: not-allowed; - filter: grayscale(50%); - opacity: 0.5; - box-shadow: none; - } + &:disabled > *, + &[disabled] > * { + cursor: not-allowed; + filter: grayscale(50%); + opacity: 0.5; + box-shadow: none; + } } .button-within { @@ -886,6 +886,7 @@ textarea.known-error { } .known-errors { + min-height: 0; color: var(--color-special-red); ul { @@ -999,6 +1000,7 @@ h1 { color: var(--color-special-red); } } + .label__description { display: block; margin-block-end: var(--spacing-card-sm); @@ -1067,11 +1069,14 @@ h1 { width: 15rem; } - >, - .extend-styling> { - input + *, - .input-group + * { - margin-block-start: var(--spacing-card-md); + > :where(input + *, .input-group + *) { + margin-block-start: var(--spacing-card-md); + } + + .input-group { + .multiselect, input { + width: auto; + flex-basis: 0; } } @@ -1146,6 +1151,13 @@ h1 { margin-right: 0; } +.full-width-inputs { + .multiselect, input, .iconified-input { + width: 100%; + flex-basis: 100%; + } +} + input, button { &:disabled { @@ -1356,3 +1368,10 @@ button { grid-template-columns: repeat(1, minmax(0, 1fr)); } } + +.sr-only { + position: absolute; + width: 0; + height: 0; + overflow: hidden; +} diff --git a/assets/styles/global.scss b/assets/styles/global.scss index 0aaf134c2..ea55a9b39 100644 --- a/assets/styles/global.scss +++ b/assets/styles/global.scss @@ -72,7 +72,7 @@ html { --color-banner-side: hsl(357, 78%, 40%); --color-block-quote: var(--color-tooltip-bg); - --color-header-underline: var(--color-tooltip-text); + --color-header-underline: var(--color-divider-dark); --color-hr: var(--color-text); --color-table-border: #dfe2e5; @@ -156,7 +156,7 @@ html { --color-banner-side: hsl(357, 78%, 40%); --color-block-quote: var(--color-code-bg); - --color-header-underline: var(--color-tooltip-text); + --color-header-underline: var(--color-divider-dark); --color-hr: var(--color-text); --color-table-border: #4f5864; diff --git a/assets/styles/layout.scss b/assets/styles/layout.scss index 2b5b4abf2..c9a88b796 100644 --- a/assets/styles/layout.scss +++ b/assets/styles/layout.scss @@ -38,9 +38,26 @@ } .normal-page { - display: flex; - flex-direction: column; - margin: 0 0.75rem; + display: grid; + padding: 0 0.75rem; + + grid-template: + 'sidebar' + 'content' + 'info' + / 100%; + + .normal-page__sidebar { + grid-area: sidebar; + } + + .normal-page__info { + grid-area: info; + } + + .normal-page__content { + grid-area: content; + } } .site-header { @@ -49,13 +66,22 @@ @media (min-width: 1024px) { .normal-page { - flex-direction: row; margin: 0 auto; max-width: 80rem; column-gap: 0.75rem; + grid-template: + 'sidebar content' auto + 'info content' auto + 'dummy content' 1fr + / 20rem 1fr; + &.alt-layout { - flex-direction: row-reverse; + grid-template: + 'content sidebar' auto + 'content info' auto + 'content dummy' 1fr + / 1fr 20rem; } } @@ -65,11 +91,12 @@ } .normal-page__content { - width: 60rem; - max-width: 60rem; - } - - .site-header { - margin: 0 auto; + max-width: calc(60rem - .75rem); + } +} + +@media (min-width: 80rem) { + .normal-page__content { + width: calc(60rem - .75rem); } } diff --git a/components/ui/DropArea.vue b/components/ui/DropArea.vue new file mode 100644 index 000000000..375f6d000 --- /dev/null +++ b/components/ui/DropArea.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/components/ui/FileInput.vue b/components/ui/FileInput.vue index 6c546b2cc..affaad9cc 100644 --- a/components/ui/FileInput.vue +++ b/components/ui/FileInput.vue @@ -1,31 +1,26 @@ - + diff --git a/pages/_type/_id/version.vue b/pages/_type/_id/version.vue index fe64f9117..9cfbb2c4d 100644 --- a/pages/_type/_id/version.vue +++ b/pages/_type/_id/version.vue @@ -1,44 +1,133 @@