diff --git a/components/modules/blob/DataInspector.vue b/components/modules/blob/DataInspector.vue index 6a5582ce..eaf984b8 100644 --- a/components/modules/blob/DataInspector.vue +++ b/components/modules/blob/DataInspector.vue @@ -1,7 +1,6 @@ diff --git a/components/modules/blob/HexViewer.vue b/components/modules/blob/HexViewer.vue index 3356c29a..9afa82d3 100644 --- a/components/modules/blob/HexViewer.vue +++ b/components/modules/blob/HexViewer.vue @@ -1,7 +1,4 @@ diff --git a/nuxt.config.ts b/nuxt.config.ts index 3017c927..69d0558e 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -5,148 +5,148 @@ import topLevelAwait from "vite-plugin-top-level-await" import path from "path" export default defineNuxtConfig({ - modules: ["nuxt-simple-sitemap", "@pinia/nuxt", "nuxt-og-image"], + modules: ["@pinia/nuxt", "nuxt-og-image", "@nuxtjs/sitemap"], - site: { - url: "https://celenium.io", + site: { + url: "https://celenium.io", }, - sitemap: { - xsl: false, + sitemap: { + xsl: false, }, - routeRules: { - "/node": { - ssr: false, - }, - "/": { - sitemap: { - changefreq: "daily", - priority: 1, - }, - }, - "/blocks": { - sitemap: { - changefreq: "daily", - priority: 0.9, - }, - }, - "/namespaces": { - sitemap: { - changefreq: "daily", - priority: 0.8, - }, - }, - "/txs": { - sitemap: { - changefreq: "daily", - priority: 0.7, - }, - }, - "/addresses": { - sitemap: { - changefreq: "daily", - priority: 0.6, - }, - }, - "/gas": { - sitemap: { - changefreq: "daily", - priority: 0.5, - }, - }, - "/namespaces/treemap": { - sitemap: { - changefreq: "weekly", - priority: 0.4, - }, - }, + routeRules: { + "/node": { + ssr: false, + }, + "/": { + sitemap: { + changefreq: "daily", + priority: 1, + }, + }, + "/blocks": { + sitemap: { + changefreq: "daily", + priority: 0.9, + }, + }, + "/namespaces": { + sitemap: { + changefreq: "daily", + priority: 0.8, + }, + }, + "/txs": { + sitemap: { + changefreq: "daily", + priority: 0.7, + }, + }, + "/addresses": { + sitemap: { + changefreq: "daily", + priority: 0.6, + }, + }, + "/gas": { + sitemap: { + changefreq: "daily", + priority: 0.5, + }, + }, + "/namespaces/treemap": { + sitemap: { + changefreq: "weekly", + priority: 0.4, + }, + }, }, - runtimeConfig: { - public: { - AMP: process.env.AMP, - }, + runtimeConfig: { + public: { + AMP: process.env.AMP, + }, }, - app: { - head: { - htmlAttrs: { - lang: "en", - }, - meta: [ - { name: "viewport", content: "width=device-width, initial-scale=1, maximum-scale=1" }, - { - name: "lang", - content: "en", - }, - ], - link: [ - { - id: "favicon", - rel: "icon", - type: "image/png", - }, - { - rel: "preconnect", - href: "https://fonts.googleapis.com", - }, - { - rel: "preconnect", - href: "https://fonts.gstatic.com", - crossorigin: "anonymous", - }, - { - rel: "preload", - as: "style", - href: "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap", - onload: "this.onload=null;this.rel='stylesheet'", - }, - { - rel: "preload", - as: "style", - href: "https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@700&display=swap", - onload: "this.onload=null;this.rel='stylesheet'", - }, - { - rel: "preload", - as: "style", - href: "https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&display=swap", - onload: "this.onload=null;this.rel='stylesheet'", - }, - ], - }, + app: { + head: { + htmlAttrs: { + lang: "en", + }, + meta: [ + { name: "viewport", content: "width=device-width, initial-scale=1, maximum-scale=1" }, + { + name: "lang", + content: "en", + }, + ], + link: [ + { + id: "favicon", + rel: "icon", + type: "image/png", + }, + { + rel: "preconnect", + href: "https://fonts.googleapis.com", + }, + { + rel: "preconnect", + href: "https://fonts.gstatic.com", + crossorigin: "anonymous", + }, + { + rel: "preload", + as: "style", + href: "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap", + onload: "this.onload=null;this.rel='stylesheet'", + }, + { + rel: "preload", + as: "style", + href: "https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@700&display=swap", + onload: "this.onload=null;this.rel='stylesheet'", + }, + { + rel: "preload", + as: "style", + href: "https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&display=swap", + onload: "this.onload=null;this.rel='stylesheet'", + }, + ], + }, }, - css: ["@/assets/styles/base.scss", "@/assets/styles/flex.scss", "@/assets/styles/text.scss"], + css: ["@/assets/styles/base.scss", "@/assets/styles/flex.scss", "@/assets/styles/text.scss"], - pinia: { - autoImports: ["defineStore"], + pinia: { + autoImports: ["defineStore"], }, - ogImage: { - fonts: ["Inter:400", "Inter:600", "IBM+Plex+Mono:400"], + ogImage: { + fonts: ["Inter:400", "Inter:600", "IBM+Plex+Mono:400"], }, - devtools: { - enabled: false, + devtools: { + enabled: false, }, - vite: { - define: { - global: "globalThis", - }, - resolve: { - alias: { - "unenv/runtime/node/buffer/index/": path.resolve(__dirname, "./node_modules/buffer/index"), - }, - }, - plugins: [wasm(), topLevelAwait(), nodePolyfills()], - worker: { - format: "es", - plugins: () => [wasm(), topLevelAwait()], - }, + vite: { + define: { + global: "globalThis", + }, + resolve: { + alias: { + "unenv/runtime/node/buffer/index/": path.resolve(__dirname, "./node_modules/buffer/index"), + }, + }, + plugins: [wasm(), topLevelAwait(), nodePolyfills()], + worker: { + format: "es", + plugins: () => [wasm(), topLevelAwait()], + }, }, - compatibilityDate: "2025-04-02", -}) \ No newline at end of file + compatibilityDate: "2025-04-02", +}) diff --git a/package.json b/package.json index c25ede42..39704dff 100644 --- a/package.json +++ b/package.json @@ -14,13 +14,15 @@ }, "devDependencies": { "@nuxt/devtools": "latest", + "@nuxtjs/sitemap": "7.2.10", + "@unhead/vue": "^2.0.0-rc.1", "cross-env": "^7.0.3", - "nuxt": "3.12.4", - "nuxt-og-image": "3.0.0-rc.52", - "nuxt-simple-sitemap": "^4.2.0", + "nuxt": "3.16.2", + "nuxt-og-image": "5.1.1", "sass": "1.66.1", "sass-loader": "13.3.2", "unenv": "^1.9.0", + "unstorage": "^1.0.0", "vite-plugin-top-level-await": "^1.4.4", "vite-plugin-wasm": "^3.3.0" }, @@ -29,7 +31,7 @@ "@codemirror/lang-json": "^6.0.1", "@keplr-wallet/cosmos": "^0.12.70", "@openzeppelin/merkle-tree": "^1.0.6", - "@pinia/nuxt": "0.4.11", + "@pinia/nuxt": "0.11.0", "@sentry/vue": "^8.50.0", "@vueuse/core": "^10.9.0", "buffer": "^6.0.3", @@ -39,13 +41,11 @@ "d3-geo": "^3.1.1", "d3-hierarchy": "^3.1.2", "focus-trap": "7.5.2", - "iconv-lite": "^0.6.3", "js-sha256": "^0.11.0", "lean-qr": "^2.3.2", "long": "^5.2.3", "luxon": "3.4.3", - "nuxt-site-config": "^2.1.2", - "pinia": "2.1.6", + "pinia": "3.0.2", "protobufjs": "^7.2.6", "qrcode": "^1.5.3", "uuid": "9.0.1", diff --git a/pages/blob.vue b/pages/blob.vue index 94c817eb..e6a35dda 100644 --- a/pages/blob.vue +++ b/pages/blob.vue @@ -99,34 +99,26 @@ cacheStore.current.blob = { height, } -onMounted(() => { - if (!supportedContentTypeForPreview.includes(blob.value?.content_type)) cards.value.preview = false - - innerWidth.value = window.innerWidth - if (innerWidth.value <= 1020) { - currTab.value = "metadata" - cards.value.raw = false - } -}) - const init = async (fromCache = false) => { const { hash, height, commitment } = fromCache ? cacheStore.current.blob : route.query if (!hash || !height || !commitment) { router.push("/") return } - - const rawMetadata = await fetchBlobMetadata({ - hash: hash.replaceAll(" ", "+"), - height: parseInt(height), - commitment: commitment.replaceAll(" ", "+"), - metadata: true, - }) - const rawBlob = await fetchBlobByMetadata({ - hash: hash.replaceAll(" ", "+"), - height: parseInt(height), - commitment: commitment.replaceAll(" ", "+"), - }) + + const [rawMetadata, rawBlob] = await Promise.all([ + fetchBlobMetadata({ + hash: hash.replaceAll(" ", "+"), + height: parseInt(height), + commitment: commitment.replaceAll(" ", "+"), + metadata: true, + }), + fetchBlobByMetadata({ + hash: hash.replaceAll(" ", "+"), + height: parseInt(height), + commitment: commitment.replaceAll(" ", "+"), + }), + ]) if (!rawBlob.data.value || !rawMetadata.data.value) { router.push("/") @@ -152,12 +144,23 @@ const init = async (fromCache = false) => { }) l2BlockscoutUrl.value = data?.value?.l2BlockscoutUrl } + init() +onMounted(async () => { + if (!supportedContentTypeForPreview.includes(blob.value?.content_type)) cards.value.preview = false + + innerWidth.value = window.innerWidth + if (innerWidth.value <= 1020) { + currTab.value = "metadata" + cards.value.raw = false + } +}) + watch( () => cacheStore.current.blob, - () => { - init(true) + async () => { + await init(true) router.replace({ query: { @@ -205,7 +208,7 @@ const handleViewProof = async () => { } else { cacheStore.current.proof = data.value } - + cacheStore.current._target = "proof" modalsStore.open("rawData") } @@ -264,18 +267,16 @@ const handleCopy = (text) => {