Skip to content

Commit 4268ef6

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 544cd2a + 1c6f5e4 commit 4268ef6

File tree

5 files changed

+29
-92
lines changed

5 files changed

+29
-92
lines changed

client/app.vue

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
import { onDevtoolsClientConnected } from '@nuxt/devtools-kit/iframe-client'
33
import { registry } from '../src/registry'
44
import { devtools, getScriptSize, humanFriendlyTimestamp, reactive, ref, urlToOrigin } from '#imports'
5-
import { loadShiki } from '~/composables/shiki'
65
import { msToHumanReadable } from '~/utils/formatting'
76
87
const scriptRegistry = registry(s => s)
9-
await loadShiki()
108
119
const scripts = ref({})
1210
const scriptSizes = reactive<Record<string, string>>({})
@@ -73,7 +71,7 @@ function viewDocs(docs: string) {
7371

7472
<template>
7573
<div class="relative n-bg-base flex flex-col">
76-
<header class="sticky top-0 z-2 px-4 pt-4">
74+
<header class="sticky top-0 z-2 px-4 pt-4 bg-background/80 backdrop-blur-lg">
7775
<div class="flex justify-between items-start" mb2>
7876
<div class="flex space-x-5">
7977
<h1 text-xl flex items-center gap-2>
@@ -155,9 +153,9 @@ function viewDocs(docs: string) {
155153
</div>
156154
</div>
157155
</header>
158-
<div class="flex-row flex p4 h-full" style="min-height: calc(100vh - 64px);">
156+
<div class="flex-row flex h-full" style="min-height: calc(100vh - 64px);">
159157
<main class="mx-auto flex flex-col w-full bg-white dark:bg-black dark:bg-dark-700 bg-light-200 ">
160-
<div v-if="tab === 'scripts'" class="h-full relative max-h-full">
158+
<div v-if="tab === 'scripts'" class="h-full relative max-h-full p-4">
161159
<div v-if="!Object.keys(scripts || {}).length">
162160
<div>No scripts loaded.</div>
163161
</div>
@@ -237,12 +235,12 @@ function viewDocs(docs: string) {
237235
{{ event.status }}
238236
</div>
239237
</template>
240-
<template v-else-if="event.type === 'fn-call' && event.args">
241-
<OCodeBlock :code="`${event.fn}(${event.args?.map(a => JSON.stringify(a, null, 2)).join(', ') || ''})`" lang="javascript" />
242-
</template>
243-
<template v-else-if="event.type === 'fn-call' && !event.args">
244-
<OCodeBlock :code="`QUEUED ${event.fn}`" lang="javascript" />
245-
</template>
238+
<div v-else-if="event.type === 'fn-call' && event.args" class="px-2 py-[2px] bg-gray-100 text-gray-700 rounded-lg font-mono">
239+
{{ `${event.fn}(${event.args?.map((a: any) => JSON.stringify(a, null, 2)).join(', ') || ''})` }}
240+
</div>
241+
<div v-else-if="event.type === 'fn-call' && !event.args" class="px-2 py-[2px] bg-gray-100 text-gray-700 rounded-lg font-mono">
242+
QUEUED {{ event.fn }}
243+
</div>
246244
</div>
247245
</div>
248246
</OSectionBlock>

client/components/OCodeBlock.vue

Lines changed: 0 additions & 34 deletions
This file was deleted.

client/composables/shiki.ts

Lines changed: 0 additions & 33 deletions
This file was deleted.

playground/pages/third-parties/google-adsense/nuxt-scripts.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,17 @@ watch(() => route.query.format, (newFormat) => {
6767
>
6868
<template #awaitingLoad>
6969
<div class="text-white text-xl">
70-
...waiting
70+
...waiting to Ads
7171
</div>
7272
</template>
7373
<template #loading>
7474
<div class="text-white text-xl">
75-
...loading
75+
...Loading Ads
76+
</div>
77+
</template>
78+
<template #error>
79+
<div class="text-white text-xl">
80+
...Ad-Blocker detected
7681
</div>
7782
</template>
7883
</ScriptGoogleAdsense>

src/runtime/components/ScriptGoogleAdsense.vue

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,20 @@ const rootAttrs = computed(() => {
7474
</script>
7575

7676
<template>
77-
<ins
78-
ref="rootEl"
79-
class="adsbygoogle"
80-
style="display: block;"
81-
:data-ad-client="addClient"
82-
:data-ad-slot="dataAdSlot"
83-
:data-ad-format="dataAdFormat"
84-
:data-ad-layout="dataAdLayout"
85-
:data-full-width-responsive="dataFullWidthResponsive"
86-
v-bind="rootAttrs"
87-
>
77+
<div>
78+
<ins
79+
ref="rootEl"
80+
class="adsbygoogle"
81+
style="display: block;"
82+
:data-ad-client="addClient"
83+
:data-ad-slot="dataAdSlot"
84+
:data-ad-format="dataAdFormat"
85+
:data-ad-layout="dataAdLayout"
86+
:data-full-width-responsive="dataFullWidthResponsive"
87+
v-bind="rootAttrs"
88+
/>
8889
<slot v-if="status === 'awaitingLoad'" name="awaitingLoad" />
8990
<slot v-else-if="status === 'loading'" name="loading" />
9091
<slot v-else-if="status === 'error'" name="error" />
91-
</ins>
92+
</div>
9293
</template>

0 commit comments

Comments
 (0)