diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 4e0fa640c..614a4b2f1 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -26,8 +26,5 @@ jobs: - name: Build run: yarn run build - - name: Format - run: yarn run format:check - - name: Lint run: yarn run lint diff --git a/package.json b/package.json index 48ba0359b..044cabcb0 100644 --- a/package.json +++ b/package.json @@ -1,22 +1,20 @@ { "name": "snapshot", "version": "0.1.4", + "license": "MIT", + "repository": "snapshot-labs/snapshot", "scripts": { "dev": "vite --port=8080", - "preinstall": "yarn run init-submodules", "build": "vite build", "lint": "eslint \"*.{ts,js,vue,json}\" src/ --ext .ts,.js,.vue,.json", "lint:fix": "yarn lint --fix", - "format": "prettier \"**/*.{ts,js,vue,json}\"", - "format:check": "yarn format --check || exit 1", - "format:fix": "yarn format --write", + "preinstall": "yarn run init-submodules", "postinstall": "patch-package && husky install", "init-submodules": "git submodule update --init", "test:unit": "vitest run", "test:unit:coverage": "vitest run --coverage" }, "dependencies": { - "@adraffy/ens-normalize": "^1.10.0", "@apollo/client": "^3.8.7", "@braintree/sanitize-url": "^6.0.4", "@ensdomains/eth-ens-namehash": "^2.0.15", @@ -38,8 +36,7 @@ "@shutter-network/shutter-crypto": "1.0.1", "@snapshot-labs/lock": "^0.2.1", "@snapshot-labs/pineapple": "^1.1.0", - "@snapshot-labs/snapshot.js": "^0.9.2", - "@snapshot-labs/tune": "^0.1.34", + "@snapshot-labs/snapshot.js": "^0.9.5", "@vue/apollo-composable": "4.0.0-beta.11", "@vueuse/core": "^10.6.1", "@vueuse/head": "^2.0.0", @@ -52,6 +49,7 @@ "js-sha256": "^0.10.1", "jsonexport": "^3.2.0", "lodash": "^4.17.21", + "minisearch": "^6.2.0", "mixpanel-browser": "^2.48.1", "remarkable": "^2.0.1", "remove-markdown": "^0.5.0", @@ -105,7 +103,5 @@ "resolutions": { "ansi-regex": "^5.0.1", "axios": "^0.21.1" - }, - "license": "MIT", - "repository": "snapshot-labs/snapshot" + } } diff --git a/src/style.scss b/src/assets/css/main.scss similarity index 60% rename from src/style.scss rename to src/assets/css/main.scss index 8f3485827..a51a013b3 100644 --- a/src/style.scss +++ b/src/assets/css/main.scss @@ -1,4 +1,7 @@ -@import './assets/fonts/iconfont.css'; +@import '../fonts/iconfont.css'; +@import 'viewerjs/dist/viewer.css'; +@import './tippy.scss'; +@import './tune.scss'; @tailwind base; @tailwind components; @@ -33,21 +36,21 @@ @layer base { @font-face { font-family: 'Calibre'; - src: url('./assets/fonts/Calibre-Medium-Custom.woff2') format('woff2'); + src: url('../fonts/Calibre-Medium-Custom.woff2') format('woff2'); font-weight: 500; font-style: normal; } @font-face { font-family: 'Calibre'; - src: url('./assets/fonts/Calibre-Semibold-Custom.woff2') format('woff2'); + src: url('../fonts/Calibre-Semibold-Custom.woff2') format('woff2'); font-weight: 600; font-style: normal; } @font-face { font-family: 'SpaceMono'; - src: url('./assets/fonts/space-mono-v11-latin-700.woff2') format('woff2'); + src: url('../fonts/space-mono-v11-latin-700.woff2') format('woff2'); } html { @@ -115,44 +118,6 @@ } } -// Tune component styles - -.tune-label { - @apply font-sans; -} - -.tune-sublabel { - @apply font-sans; -} - -.tune-button { - @apply rounded-full; -} - -.tune-input { - @apply rounded-full; -} - -.tune-textarea { - @apply rounded-3xl px-3; -} - -.tune-listbox-button { - @apply rounded-full; -} - -.tune-button-select { - @apply rounded-full; -} - -.tune-input-duration { - @apply rounded-full; -} - -.tune-error-text { - @apply font-sans; -} - // Fade transition for Vue's transition and transition-group .fade-enter-active, .fade-leave-active { @@ -219,94 +184,6 @@ input[type='number'] { -moz-appearance: textfield; } -// V-Tippy tooltip package styling - could be moved somewhere else? -.tippy-box[data-animation='fade'][data-state='hidden'] { - opacity: 0; -} -[data-tippy-root] { - max-width: calc(100vw - 10px); -} -.tippy-box { - position: relative; - background-color: var(--text-color); - color: var(--header-bg); - border-radius: 7px; - font-size: 16px; - line-height: 1.4; - outline: 0; - transition-property: transform, visibility, opacity; - padding: 2px 4px; - text-align: center; - font-weight: 500; -} -.tippy-box[data-placement^='top'] > .tippy-arrow { - bottom: 0; -} -.tippy-box[data-placement^='top'] > .tippy-arrow:before { - bottom: -7px; - left: 0; - border-width: 8px 8px 0; - border-top-color: var(--text-color); - transform-origin: center top; -} -.tippy-box[data-placement^='bottom'] > .tippy-arrow { - top: 0; -} -.tippy-box[data-placement^='bottom'] > .tippy-arrow:before { - top: -7px; - left: 0; - border-width: 0 8px 8px; - border-bottom-color: var(--text-color); - transform-origin: center bottom; -} -.tippy-box[data-placement^='left'] > .tippy-arrow { - right: 0; -} -.tippy-box[data-placement^='left'] > .tippy-arrow:before { - border-width: 8px 0 8px 8px; - border-left-color: var(--text-color); - right: -7px; - transform-origin: center left; -} -.tippy-box[data-placement^='right'] > .tippy-arrow { - left: 0; -} -.tippy-box[data-placement^='right'] > .tippy-arrow:before { - left: -7px; - border-width: 8px 8px 8px 0; - border-right-color: var(--text-color); - transform-origin: center right; -} -.tippy-box[data-inertia][data-state='visible'] { - transition-timing-function: cubic-bezier(0.54, 1.5, 0.38, 1.11); -} -.tippy-arrow { - width: 16px; - height: 16px; - color: #333; -} -.tippy-arrow:before { - content: ''; - position: absolute; - border-color: transparent; - border-style: solid; -} -.tippy-content { - position: relative; - padding: 5px 9px; - z-index: 1; - overflow-wrap: break-word; -} -.tippy-box[data-theme~='urlified'] { - max-width: 200px; - white-space: pre-wrap; - color: var(--header-bg); - - a { - color: var(--header-bg); - } -} - .lazy-loading { @apply animate-pulse-fast bg-skin-border; } diff --git a/src/assets/css/tippy.scss b/src/assets/css/tippy.scss new file mode 100644 index 000000000..0455b0265 --- /dev/null +++ b/src/assets/css/tippy.scss @@ -0,0 +1,87 @@ +// V-Tippy tooltip package styling - could be moved somewhere else? +.tippy-box[data-animation='fade'][data-state='hidden'] { + opacity: 0; +} +[data-tippy-root] { + max-width: calc(100vw - 10px); +} +.tippy-box { + position: relative; + background-color: var(--text-color); + color: var(--header-bg); + border-radius: 7px; + font-size: 16px; + line-height: 1.4; + outline: 0; + transition-property: transform, visibility, opacity; + padding: 2px 4px; + text-align: center; + font-weight: 500; +} +.tippy-box[data-placement^='top'] > .tippy-arrow { + bottom: 0; +} +.tippy-box[data-placement^='top'] > .tippy-arrow:before { + bottom: -7px; + left: 0; + border-width: 8px 8px 0; + border-top-color: var(--text-color); + transform-origin: center top; +} +.tippy-box[data-placement^='bottom'] > .tippy-arrow { + top: 0; +} +.tippy-box[data-placement^='bottom'] > .tippy-arrow:before { + top: -7px; + left: 0; + border-width: 0 8px 8px; + border-bottom-color: var(--text-color); + transform-origin: center bottom; +} +.tippy-box[data-placement^='left'] > .tippy-arrow { + right: 0; +} +.tippy-box[data-placement^='left'] > .tippy-arrow:before { + border-width: 8px 0 8px 8px; + border-left-color: var(--text-color); + right: -7px; + transform-origin: center left; +} +.tippy-box[data-placement^='right'] > .tippy-arrow { + left: 0; +} +.tippy-box[data-placement^='right'] > .tippy-arrow:before { + left: -7px; + border-width: 8px 8px 8px 0; + border-right-color: var(--text-color); + transform-origin: center right; +} +.tippy-box[data-inertia][data-state='visible'] { + transition-timing-function: cubic-bezier(0.54, 1.5, 0.38, 1.11); +} +.tippy-arrow { + width: 16px; + height: 16px; + color: #333; +} +.tippy-arrow:before { + content: ''; + position: absolute; + border-color: transparent; + border-style: solid; +} +.tippy-content { + position: relative; + padding: 5px 9px; + z-index: 1; + overflow-wrap: break-word; +} +.tippy-box[data-theme~='urlified'] { + max-width: 200px; + white-space: pre-wrap; + color: var(--header-bg); + + a { + color: var(--header-bg); + } +} diff --git a/src/assets/css/tune.scss b/src/assets/css/tune.scss new file mode 100644 index 000000000..fd6ccbc99 --- /dev/null +++ b/src/assets/css/tune.scss @@ -0,0 +1,181 @@ +.tune-input { + @apply form-input rounded-full border-skin-border bg-transparent text-base text-skin-link focus:border-skin-text focus:outline-none focus:ring-0; +} + +.tune-textarea { + @extend .tune-input; + @apply no-scrollbar rounded-3xl px-3; + + &.disabled { + @apply cursor-not-allowed; + } +} + +.tune-textarea-json { + @apply no-scrollbar overflow-x-scroll whitespace-pre; + + &.disabled { + @apply cursor-not-allowed; + } +} + +.tune-switch { + @apply border-transparent; + + &.switched-on-bg { + @apply bg-green; + } + &.switched-off-bg { + @apply bg-skin-border; + } + + &.switched-on-text { + @apply text-green; + } + &.switched-off-text { + @apply text-skin-text; + } +} + +.tune-switch-button { + @apply bg-skin-bg; +} + +.tune-input-loading { + @apply rounded-r-full bg-skin-bg; +} + +.tune-button { + @apply flex h-[42px] cursor-pointer justify-center rounded-full border border-skin-border px-3 py-2 hover:border-skin-text disabled:cursor-not-allowed; + + &.primary { + @apply border-skin-primary bg-skin-primary text-white; + } + + &.disabled { + @apply border-skin-border bg-skin-bg text-skin-border; + } +} + +.tune-button-select { + @apply relative flex w-full justify-start truncate pl-3 pr-5 text-left text-base text-skin-link rounded-full; + + &.disabled { + @apply cursor-not-allowed border-skin-border; + } +} + +.tune-input-duration { + @apply rounded-full border border-skin-border px-3 text-base text-skin-link focus-within:border-skin-text; + &.disabled { + @apply cursor-not-allowed; + } +} + +.tune-input-duration-label { + @apply text-skin-text; +} + +.tune-select { + @apply text-left; + + &.disabled { + @apply cursor-not-allowed; + } +} + +.tune-listbox-button { + @apply rounded-full border border-skin-border text-base text-skin-link hover:border-skin-text; + + &.disabled { + @apply hover:border-skin-border; + } + + &.error { + @apply border-red; + } +} + +.tune-listbox-options { + @apply rounded-md border border-skin-border bg-skin-bg shadow-lg; +} + +.tune-listbox-item { + &.selected { + @apply text-skin-link; + } + &.disabled { + @apply text-skin-border; + } + &.active { + @apply bg-skin-border; + } +} + +.tune-listbox-placeholder { + @apply text-skin-text opacity-60; +} + +.tune-label { + @apply font-sans text-skin-text; +} + +.tune-sublabel { + @apply font-sans text-sm text-skin-text opacity-60; +} + +.tune-icon-hint { + @apply text-sm hover:text-skin-link; +} + +.tune-error-text { + @apply font-sans text-sm text-red; +} + +.tune-error-border { + @apply border-red; +} + +.tune-tag { + @apply rounded-md border border-skin-border bg-skin-border px-2 py-1 text-sm text-skin-text; +} + +.tune-menu-list { + @apply rounded-md border border-skin-border bg-skin-header-bg shadow-lg; +} + +.tune-menu-list-item { + @apply bg-skin-header-bg text-skin-text; + + &.active { + @apply bg-skin-border text-skin-link; + } +} + +.tune-popover { + @apply rounded-md border bg-skin-header-bg shadow-lg; +} + +.tune-modal-panel { + @apply rounded-md border border-skin-border bg-skin-bg p-4 sm:w-[440px]; +} + +.tune-modal-backdrop { + @apply bg-skin-border opacity-70; +} + +.tune-modal-title { + @apply text-center text-lg font-medium text-skin-text; +} + +.tune-input-checkbox { + @apply form-checkbox h-[20px] w-[20px] rounded-lg border-skin-text bg-skin-bg text-skin-primary focus:ring-0 focus:ring-offset-0 focus-visible:ring-offset-1 focus-visible:ring-offset-skin-text; +} + +.tune-input-radio { + @apply form-radio h-[20px] w-[20px] rounded-full border-skin-text bg-skin-bg text-skin-primary focus:ring-0 focus:ring-offset-0 focus-visible:ring-offset-1 focus-visible:ring-offset-skin-text; +} + +.tune-form-array-objects { + @apply rounded-xl border p-3; +} diff --git a/src/assets/icons/spinner.svg b/src/assets/icons/spinner.svg new file mode 100644 index 000000000..ccb5e4da3 --- /dev/null +++ b/src/assets/icons/spinner.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/BaseCalendar.vue b/src/components/BaseCalendar.vue index cf5536517..ef182ca01 100644 --- a/src/components/BaseCalendar.vue +++ b/src/components/BaseCalendar.vue @@ -102,7 +102,7 @@ function isSelectable(year, month, day) { v-if="isSelectable(year, month, day)" class="day border-b border-r bg-transparent text-skin-link hover:bg-skin-link hover:text-skin-bg" :class="{ - 'ring-1 ring-inset ring-primary': + 'ring-1 ring-inset ring-skin-primary': formatDate(year, month, day) === today, '!bg-skin-link !text-skin-bg': input.includes( formatDate(year, month, day) diff --git a/src/components/BaseIndicator.vue b/src/components/BaseIndicator.vue index fddf5171f..d5362a05f 100644 --- a/src/components/BaseIndicator.vue +++ b/src/components/BaseIndicator.vue @@ -1,3 +1,3 @@ diff --git a/src/components/BaseProgressBar.vue b/src/components/BaseProgressBar.vue index a6d9ec357..afdb0477b 100644 --- a/src/components/BaseProgressBar.vue +++ b/src/components/BaseProgressBar.vue @@ -7,7 +7,7 @@ defineProps<{ value: number }>();
diff --git a/src/components/BlockSpacesListItem.vue b/src/components/BlockSpacesListItem.vue index f0050a8d4..3ae114b4b 100644 --- a/src/components/BlockSpacesListItem.vue +++ b/src/components/BlockSpacesListItem.vue @@ -27,7 +27,7 @@ defineProps<{
diff --git a/src/components/ComboboxNetwork.vue b/src/components/ComboboxNetwork.vue index f667a9477..bbbc807e8 100644 --- a/src/components/ComboboxNetwork.vue +++ b/src/components/ComboboxNetwork.vue @@ -3,16 +3,22 @@ defineProps<{ network: string; hint?: string; disabled?: boolean; + error?: string; + showErrors?: boolean; }>(); const emit = defineEmits(['select']); const { filterNetworks } = useNetworksFilter(); +const { env } = useApp(); const networks = computed((): { id: string; name: string }[] => { const filteredNetworks = filterNetworks().map(_n => ({ id: _n.key, - name: _n.name + name: _n.name, + extras: { + hidden: env === 'production' ? _n.testnet : false + } })); return filteredNetworks; @@ -26,6 +32,8 @@ const networks = computed((): { id: string; name: string }[] => { :model-value="network" :hint="hint" :disabled="disabled" + :error="error" + :show-errors="showErrors" @update:model-value="value => emit('select', value)" >