nuxtseo-shared 0.1.8 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/content.d.mts +37 -37
  2. package/dist/content.d.ts +75 -0
  3. package/dist/content.mjs +31 -55
  4. package/dist/devtools.d.mts +10 -10
  5. package/dist/devtools.d.ts +14 -0
  6. package/dist/devtools.mjs +43 -37
  7. package/dist/i18n.d.mts +19 -19
  8. package/dist/i18n.d.ts +44 -0
  9. package/dist/i18n.mjs +117 -105
  10. package/dist/kit.d.mts +29 -14
  11. package/dist/kit.d.ts +57 -0
  12. package/dist/kit.mjs +105 -77
  13. package/dist/module.d.mts +4 -13
  14. package/dist/module.d.ts +5 -0
  15. package/dist/module.json +12 -0
  16. package/dist/module.mjs +31 -32
  17. package/dist/pro.d.mts +2 -16
  18. package/dist/pro.d.ts +3 -0
  19. package/dist/pro.mjs +66 -68
  20. package/dist/runtime/pure.d.ts +0 -0
  21. package/dist/runtime/pure.js +36 -0
  22. package/dist/runtime/server/kit.d.ts +0 -0
  23. package/dist/runtime/server/kit.js +22 -0
  24. package/dist/telemetry.d.mts +4 -4
  25. package/dist/telemetry.d.ts +11 -0
  26. package/dist/telemetry.mjs +58 -45
  27. package/dist/types.d.mts +7 -0
  28. package/package.json +23 -21
  29. package/src/runtime/pure.ts +57 -0
  30. package/src/runtime/server/kit.ts +26 -0
  31. package/dist/index.d.mts +0 -3
  32. package/dist/index.mjs +0 -3
  33. package/dist/layer-devtools/app.config.ts +0 -27
  34. package/dist/layer-devtools/assets/css/global.css +0 -593
  35. package/dist/layer-devtools/components/DevtoolsAlert.vue +0 -101
  36. package/dist/layer-devtools/components/DevtoolsCopyButton.vue +0 -20
  37. package/dist/layer-devtools/components/DevtoolsDocs.vue +0 -11
  38. package/dist/layer-devtools/components/DevtoolsEmptyState.vue +0 -105
  39. package/dist/layer-devtools/components/DevtoolsError.vue +0 -78
  40. package/dist/layer-devtools/components/DevtoolsKeyValue.vue +0 -109
  41. package/dist/layer-devtools/components/DevtoolsLayout.vue +0 -219
  42. package/dist/layer-devtools/components/DevtoolsLoading.vue +0 -8
  43. package/dist/layer-devtools/components/DevtoolsMetric.vue +0 -96
  44. package/dist/layer-devtools/components/DevtoolsPanel.vue +0 -76
  45. package/dist/layer-devtools/components/DevtoolsProductionError.vue +0 -41
  46. package/dist/layer-devtools/components/DevtoolsSnippet.vue +0 -51
  47. package/dist/layer-devtools/components/DevtoolsToolbar.vue +0 -42
  48. package/dist/layer-devtools/components/NuxtSeoLogo.vue +0 -77
  49. package/dist/layer-devtools/components/OCodeBlock.vue +0 -23
  50. package/dist/layer-devtools/components/OSectionBlock.vue +0 -139
  51. package/dist/layer-devtools/composables/clipboard.ts +0 -21
  52. package/dist/layer-devtools/composables/rpc.ts +0 -39
  53. package/dist/layer-devtools/composables/shiki.ts +0 -46
  54. package/dist/layer-devtools/composables/state.ts +0 -33
  55. package/dist/layer-devtools/nuxt.config.ts +0 -26
@@ -1,105 +0,0 @@
1
- <script setup lang="ts">
2
- const {
3
- icon = 'carbon:search',
4
- title,
5
- description,
6
- variant = 'default',
7
- } = defineProps<{
8
- icon?: string
9
- title: string
10
- description?: string
11
- variant?: 'default' | 'error'
12
- }>()
13
- </script>
14
-
15
- <template>
16
- <div class="devtools-empty">
17
- <div class="devtools-empty-icon" :class="`devtools-empty-icon-${variant}`">
18
- <UIcon :name="icon" class="w-8 h-8" />
19
- </div>
20
- <h2 class="devtools-empty-title">
21
- {{ title }}
22
- </h2>
23
- <p v-if="description || $slots.description" class="devtools-empty-description">
24
- <slot name="description">
25
- {{ description }}
26
- </slot>
27
- </p>
28
- <div v-if="$slots.default" class="devtools-empty-actions">
29
- <slot />
30
- </div>
31
- </div>
32
- </template>
33
-
34
- <style scoped>
35
- .devtools-empty {
36
- display: flex;
37
- flex-direction: column;
38
- align-items: center;
39
- text-align: center;
40
- max-width: 32rem;
41
- margin: 0 auto;
42
- }
43
-
44
- .devtools-empty-icon {
45
- display: inline-flex;
46
- align-items: center;
47
- justify-content: center;
48
- width: 4rem;
49
- height: 4rem;
50
- border-radius: var(--radius-lg);
51
- margin-bottom: 1.5rem;
52
- }
53
-
54
- .devtools-empty-icon-default {
55
- background: oklch(65% 0.2 145 / 0.12);
56
- color: var(--seo-green);
57
- }
58
-
59
- .dark .devtools-empty-icon-default {
60
- background: oklch(65% 0.2 145 / 0.15);
61
- }
62
-
63
- .devtools-empty-icon-error {
64
- background: oklch(55% 0.2 25 / 0.12);
65
- color: oklch(55% 0.2 25);
66
- }
67
-
68
- .dark .devtools-empty-icon-error {
69
- background: oklch(55% 0.2 25 / 0.15);
70
- color: oklch(75% 0.15 25);
71
- }
72
-
73
- .devtools-empty-title {
74
- font-size: 1.125rem;
75
- font-weight: 600;
76
- color: var(--color-text);
77
- margin-bottom: 0.75rem;
78
- }
79
-
80
- @media (min-width: 640px) {
81
- .devtools-empty-title {
82
- font-size: 1.25rem;
83
- }
84
- }
85
-
86
- .devtools-empty-description {
87
- font-size: 0.875rem;
88
- color: var(--color-text-muted);
89
- margin-bottom: 1.25rem;
90
- line-height: 1.5;
91
- }
92
-
93
- @media (min-width: 640px) {
94
- .devtools-empty-description {
95
- font-size: 1rem;
96
- }
97
- }
98
-
99
- .devtools-empty-actions {
100
- display: flex;
101
- flex-direction: column;
102
- align-items: center;
103
- gap: 0.75rem;
104
- }
105
- </style>
@@ -1,78 +0,0 @@
1
- <script setup lang="ts">
2
- const { icon = 'carbon:warning', title = 'Something went wrong' } = defineProps<{
3
- icon?: string
4
- title?: string
5
- error?: string | Error | null
6
- }>()
7
- </script>
8
-
9
- <template>
10
- <div class="devtools-error">
11
- <div class="devtools-error-icon-wrap">
12
- <UIcon :name="icon" class="devtools-error-icon" />
13
- </div>
14
- <p class="devtools-error-title">
15
- {{ title }}
16
- </p>
17
- <p v-if="error" class="devtools-error-message">
18
- {{ typeof error === 'string' ? error : error.message }}
19
- </p>
20
- <div v-if="$slots.default" class="devtools-error-actions">
21
- <slot />
22
- </div>
23
- </div>
24
- </template>
25
-
26
- <style scoped>
27
- .devtools-error {
28
- display: flex;
29
- flex-direction: column;
30
- align-items: center;
31
- justify-content: center;
32
- gap: 0.75rem;
33
- padding: 3rem 1.5rem;
34
- text-align: center;
35
- }
36
-
37
- .devtools-error-icon-wrap {
38
- display: flex;
39
- align-items: center;
40
- justify-content: center;
41
- width: 3rem;
42
- height: 3rem;
43
- border-radius: var(--radius-lg);
44
- background: oklch(65% 0.15 25 / 0.1);
45
- }
46
-
47
- .dark .devtools-error-icon-wrap {
48
- background: oklch(45% 0.1 25 / 0.15);
49
- }
50
-
51
- .devtools-error-icon {
52
- font-size: 1.5rem;
53
- color: oklch(60% 0.18 25);
54
- }
55
-
56
- .dark .devtools-error-icon {
57
- color: oklch(70% 0.15 25);
58
- }
59
-
60
- .devtools-error-title {
61
- font-size: 0.875rem;
62
- font-weight: 600;
63
- color: var(--color-text);
64
- }
65
-
66
- .devtools-error-message {
67
- font-size: 0.75rem;
68
- color: var(--color-text-muted);
69
- max-width: 20rem;
70
- line-height: 1.5;
71
- }
72
-
73
- .devtools-error-actions {
74
- display: flex;
75
- gap: 0.5rem;
76
- margin-top: 0.25rem;
77
- }
78
- </style>
@@ -1,109 +0,0 @@
1
- <script setup lang="ts">
2
- export interface KeyValueItem {
3
- key: string
4
- value: string | number | boolean | undefined
5
- copyable?: boolean
6
- mono?: boolean
7
- link?: string
8
- }
9
-
10
- const { items, striped = false } = defineProps<{
11
- items: KeyValueItem[]
12
- striped?: boolean
13
- }>()
14
- </script>
15
-
16
- <template>
17
- <div class="divide-y divide-[var(--color-border-subtle)]">
18
- <div
19
- v-for="item in items"
20
- :key="item.key"
21
- class="devtools-kv-row group"
22
- :class="{ 'devtools-kv-striped': striped }"
23
- >
24
- <span class="devtools-kv-key">{{ item.key }}</span>
25
- <div class="devtools-kv-value-wrap">
26
- <a
27
- v-if="item.link"
28
- :href="item.link"
29
- target="_blank"
30
- rel="noopener"
31
- class="link-external text-sm"
32
- >
33
- {{ item.value }}
34
- </a>
35
- <span
36
- v-else
37
- class="devtools-kv-value"
38
- :class="{
39
- 'font-mono': item.mono !== false,
40
- 'devtools-kv-true': item.value === true,
41
- 'devtools-kv-false': item.value === false,
42
- 'devtools-kv-empty': item.value === undefined || item.value === '',
43
- }"
44
- >
45
- {{ item.value === undefined || item.value === '' ? '(empty)' : item.value }}
46
- </span>
47
- <DevtoolsCopyButton
48
- v-if="item.copyable && item.value !== undefined && item.value !== ''"
49
- :text="String(item.value)"
50
- class="opacity-0 group-hover:opacity-100 transition-opacity"
51
- />
52
- </div>
53
- </div>
54
- </div>
55
- </template>
56
-
57
- <style scoped>
58
- .devtools-kv-row {
59
- display: flex;
60
- align-items: center;
61
- justify-content: space-between;
62
- gap: 1rem;
63
- padding: 0.625rem 1.25rem;
64
- transition: background-color 150ms ease;
65
- }
66
-
67
- .devtools-kv-row:hover {
68
- background: var(--color-surface-sunken);
69
- }
70
-
71
- .devtools-kv-striped:nth-child(even) {
72
- background: oklch(from var(--color-surface-sunken) l c h / 0.5);
73
- }
74
-
75
- .devtools-kv-key {
76
- font-size: 0.8125rem;
77
- font-family: var(--font-mono);
78
- color: var(--color-text-muted);
79
- flex-shrink: 0;
80
- }
81
-
82
- .devtools-kv-value-wrap {
83
- display: flex;
84
- align-items: center;
85
- gap: 0.5rem;
86
- min-width: 0;
87
- }
88
-
89
- .devtools-kv-value {
90
- font-size: 0.8125rem;
91
- text-align: right;
92
- overflow: hidden;
93
- text-overflow: ellipsis;
94
- white-space: nowrap;
95
- }
96
-
97
- .devtools-kv-true {
98
- color: var(--seo-green);
99
- }
100
-
101
- .devtools-kv-false {
102
- color: oklch(65% 0.15 25);
103
- }
104
-
105
- .devtools-kv-empty {
106
- color: var(--color-text-subtle);
107
- font-style: italic;
108
- }
109
- </style>
@@ -1,219 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed } from 'vue'
3
- import { colorMode } from '../composables/rpc'
4
- import { hasProductionUrl, isProductionMode, previewSource, productionUrl } from '../composables/state'
5
-
6
- export interface DevtoolsNavItem {
7
- value: string
8
- to?: string
9
- icon: string
10
- label: string
11
- devOnly?: boolean
12
- }
13
-
14
- const {
15
- title,
16
- icon,
17
- version,
18
- navItems,
19
- githubUrl,
20
- loading = false,
21
- } = defineProps<{
22
- title: string
23
- icon: string
24
- version?: string
25
- navItems: DevtoolsNavItem[]
26
- githubUrl: string
27
- loading?: boolean
28
- }>()
29
-
30
- const emit = defineEmits<{
31
- refresh: []
32
- }>()
33
-
34
- const activeTab = defineModel<string>('activeTab')
35
-
36
- const isDark = computed(() => colorMode.value === 'dark')
37
-
38
- useHead({
39
- title: `Nuxt ${title}`,
40
- htmlAttrs: {
41
- class: () => isDark.value ? 'dark' : '',
42
- },
43
- })
44
-
45
- const filteredNavItems = computed(() =>
46
- isProductionMode.value
47
- ? navItems.filter(item => !item.devOnly)
48
- : navItems,
49
- )
50
-
51
- const productionHostname = computed(() => {
52
- try {
53
- return new URL(productionUrl.value).hostname
54
- }
55
- catch {
56
- return productionUrl.value
57
- }
58
- })
59
-
60
- const isRouteNav = computed(() => navItems.some(item => item.to))
61
- </script>
62
-
63
- <template>
64
- <UApp>
65
- <div class="relative bg-base flex flex-col min-h-screen">
66
- <div class="gradient-bg" />
67
-
68
- <header class="devtools-header glass sticky top-0 z-50">
69
- <div class="devtools-header-content">
70
- <!-- Logo & Brand -->
71
- <div class="flex items-center gap-3 sm:gap-4">
72
- <a
73
- href="https://nuxtseo.com"
74
- target="_blank"
75
- rel="noopener"
76
- aria-label="Nuxt SEO"
77
- class="flex items-center opacity-90 hover:opacity-100 transition-opacity"
78
- >
79
- <NuxtSeoLogo class="h-6 sm:h-7" />
80
- </a>
81
-
82
- <div class="devtools-divider" />
83
-
84
- <div class="flex items-center gap-2">
85
- <div class="devtools-brand-icon" aria-hidden="true">
86
- <UIcon :name="icon" class="text-base sm:text-lg" />
87
- </div>
88
- <h1 class="text-sm sm:text-base font-semibold tracking-tight text-[var(--color-text)]">
89
- {{ title }}
90
- </h1>
91
- <UBadge
92
- v-if="version"
93
- class="font-mono text-[10px] sm:text-xs hidden sm:inline-flex"
94
- >
95
- {{ version }}
96
- </UBadge>
97
- </div>
98
- </div>
99
-
100
- <!-- Navigation -->
101
- <nav class="flex items-center gap-1 sm:gap-2">
102
- <!-- Nav Tabs -->
103
- <div class="devtools-nav-tabs">
104
- <template v-if="isRouteNav">
105
- <NuxtLink
106
- v-for="item of filteredNavItems"
107
- :key="item.value"
108
- :to="item.to"
109
- class="devtools-nav-tab"
110
- :class="[
111
- activeTab === item.value ? 'active' : '',
112
- loading ? 'opacity-50 pointer-events-none' : '',
113
- ]"
114
- >
115
- <UTooltip :text="item.label">
116
- <div class="devtools-nav-tab-inner">
117
- <UIcon
118
- :name="item.icon"
119
- class="text-base sm:text-lg"
120
- :class="activeTab === item.value ? 'text-[var(--seo-green)]' : ''"
121
- />
122
- <span class="devtools-nav-label">{{ item.label }}</span>
123
- </div>
124
- </UTooltip>
125
- </NuxtLink>
126
- </template>
127
- <template v-else>
128
- <button
129
- v-for="item of filteredNavItems"
130
- :key="item.value"
131
- type="button"
132
- class="devtools-nav-tab"
133
- :class="[
134
- activeTab === item.value ? 'active' : '',
135
- loading ? 'opacity-50 pointer-events-none' : '',
136
- ]"
137
- @click="activeTab = item.value"
138
- >
139
- <UTooltip :text="item.label">
140
- <div class="devtools-nav-tab-inner">
141
- <UIcon
142
- :name="item.icon"
143
- class="text-base sm:text-lg"
144
- :class="activeTab === item.value ? 'text-[var(--seo-green)]' : ''"
145
- />
146
- <span class="devtools-nav-label">{{ item.label }}</span>
147
- </div>
148
- </UTooltip>
149
- </button>
150
- </template>
151
- </div>
152
-
153
- <!-- Preview source toggle -->
154
- <div v-if="hasProductionUrl" class="devtools-preview-toggle">
155
- <button
156
- type="button"
157
- class="devtools-preview-btn"
158
- :class="{ active: previewSource === 'local' }"
159
- @click="previewSource = 'local'"
160
- >
161
- <UIcon name="carbon:laptop" class="w-3.5 h-3.5" aria-hidden="true" />
162
- <span class="hidden sm:inline">Local</span>
163
- </button>
164
- <button
165
- type="button"
166
- class="devtools-preview-btn"
167
- :class="{ active: previewSource === 'production' }"
168
- @click="previewSource = 'production'"
169
- >
170
- <UIcon name="carbon:cloud" class="w-3.5 h-3.5" aria-hidden="true" />
171
- <span class="hidden sm:inline">Production</span>
172
- </button>
173
- </div>
174
-
175
- <!-- Production URL indicator -->
176
- <UTooltip v-if="isProductionMode" :text="productionUrl">
177
- <span class="devtools-production-badge">
178
- <span class="devtools-production-dot" />
179
- <span class="hidden sm:inline text-xs">{{ productionHostname }}</span>
180
- </span>
181
- </UTooltip>
182
-
183
- <!-- Actions -->
184
- <div class="flex items-center gap-1">
185
- <slot name="actions" />
186
-
187
- <UTooltip text="Refresh">
188
- <UButton
189
- icon="carbon:reset"
190
- aria-label="Refresh"
191
- class="devtools-nav-action"
192
- @click="emit('refresh')"
193
- />
194
- </UTooltip>
195
-
196
- <UTooltip text="GitHub">
197
- <UButton
198
- icon="simple-icons:github"
199
- aria-label="GitHub"
200
- :to="githubUrl"
201
- target="_blank"
202
- class="devtools-nav-action hidden sm:flex"
203
- />
204
- </UTooltip>
205
- </div>
206
- </nav>
207
- </div>
208
- </header>
209
-
210
- <!-- Main Content -->
211
- <div class="devtools-main">
212
- <main class="mx-auto flex flex-col w-full max-w-7xl">
213
- <DevtoolsLoading v-if="loading" />
214
- <slot v-else />
215
- </main>
216
- </div>
217
- </div>
218
- </UApp>
219
- </template>
@@ -1,8 +0,0 @@
1
- <template>
2
- <div class="flex items-center justify-center py-20">
3
- <UIcon
4
- name="carbon:circle-dash"
5
- class="animate-spin text-3xl text-[var(--color-text-muted)]"
6
- />
7
- </div>
8
- </template>
@@ -1,96 +0,0 @@
1
- <script setup lang="ts">
2
- const {
3
- label,
4
- value,
5
- icon,
6
- variant = 'default',
7
- } = defineProps<{
8
- label?: string
9
- value: string | number
10
- icon?: string
11
- variant?: 'default' | 'success' | 'warning' | 'danger' | 'info'
12
- }>()
13
- </script>
14
-
15
- <template>
16
- <div class="devtools-metric" :class="`devtools-metric-${variant}`">
17
- <UIcon v-if="icon" :name="icon" class="devtools-metric-icon" aria-hidden="true" />
18
- <span class="devtools-metric-value">{{ value }}</span>
19
- <span v-if="label" class="devtools-metric-label">{{ label }}</span>
20
- </div>
21
- </template>
22
-
23
- <style scoped>
24
- .devtools-metric {
25
- display: inline-flex;
26
- align-items: center;
27
- gap: 0.375rem;
28
- padding: 0.25rem 0.625rem;
29
- font-size: 0.75rem;
30
- font-weight: 500;
31
- border-radius: var(--radius-sm);
32
- font-variant-numeric: tabular-nums;
33
- }
34
-
35
- .devtools-metric-icon {
36
- font-size: 0.875rem;
37
- flex-shrink: 0;
38
- }
39
-
40
- .devtools-metric-value {
41
- font-family: var(--font-mono);
42
- font-weight: 600;
43
- }
44
-
45
- .devtools-metric-label {
46
- color: inherit;
47
- opacity: 0.7;
48
- }
49
-
50
- /* Variants */
51
- .devtools-metric-default {
52
- background: var(--color-surface-sunken);
53
- border: 1px solid var(--color-border-subtle);
54
- color: var(--color-text);
55
- }
56
-
57
- .devtools-metric-success {
58
- background: oklch(75% 0.15 145 / 0.12);
59
- color: oklch(50% 0.15 145);
60
- }
61
-
62
- .dark .devtools-metric-success {
63
- background: oklch(50% 0.15 145 / 0.15);
64
- color: oklch(75% 0.18 145);
65
- }
66
-
67
- .devtools-metric-warning {
68
- background: oklch(80% 0.12 85 / 0.12);
69
- color: oklch(55% 0.15 85);
70
- }
71
-
72
- .dark .devtools-metric-warning {
73
- background: oklch(55% 0.12 85 / 0.15);
74
- color: oklch(75% 0.15 85);
75
- }
76
-
77
- .devtools-metric-danger {
78
- background: oklch(65% 0.12 25 / 0.1);
79
- color: oklch(55% 0.15 25);
80
- }
81
-
82
- .dark .devtools-metric-danger {
83
- background: oklch(45% 0.1 25 / 0.15);
84
- color: oklch(70% 0.12 25);
85
- }
86
-
87
- .devtools-metric-info {
88
- background: oklch(85% 0.08 200 / 0.1);
89
- color: oklch(50% 0.12 200);
90
- }
91
-
92
- .dark .devtools-metric-info {
93
- background: oklch(35% 0.08 200 / 0.15);
94
- color: oklch(70% 0.1 200);
95
- }
96
- </style>
@@ -1,76 +0,0 @@
1
- <script setup lang="ts">
2
- const {
3
- title,
4
- } = defineProps<{
5
- title?: string
6
- }>()
7
-
8
- defineEmits<{
9
- close: []
10
- }>()
11
- </script>
12
-
13
- <template>
14
- <div class="devtools-panel">
15
- <div v-if="title || $slots.header" class="devtools-panel-header">
16
- <slot name="header">
17
- <span class="devtools-panel-title">{{ title }}</span>
18
- </slot>
19
- <div class="devtools-panel-actions">
20
- <slot name="actions" />
21
- <UButton
22
- icon="carbon:close"
23
- aria-label="Close panel"
24
- @click="$emit('close')"
25
- />
26
- </div>
27
- </div>
28
- <div class="devtools-panel-content">
29
- <slot />
30
- </div>
31
- </div>
32
- </template>
33
-
34
- <style scoped>
35
- .devtools-panel {
36
- display: flex;
37
- flex-direction: column;
38
- border-radius: var(--radius-lg);
39
- border: 1px solid var(--color-border);
40
- background: var(--color-surface-elevated);
41
- box-shadow: 0 8px 32px oklch(0% 0 0 / 0.12);
42
- overflow: hidden;
43
- }
44
-
45
- .dark .devtools-panel {
46
- box-shadow: 0 8px 32px oklch(0% 0 0 / 0.4);
47
- }
48
-
49
- .devtools-panel-header {
50
- display: flex;
51
- align-items: center;
52
- justify-content: space-between;
53
- padding: 0.625rem 0.75rem;
54
- border-bottom: 1px solid var(--color-border);
55
- background: var(--color-surface-sunken);
56
- }
57
-
58
- .devtools-panel-title {
59
- font-size: 0.75rem;
60
- font-weight: 600;
61
- color: var(--color-text);
62
- text-transform: uppercase;
63
- letter-spacing: 0.03em;
64
- }
65
-
66
- .devtools-panel-actions {
67
- display: flex;
68
- align-items: center;
69
- gap: 0.25rem;
70
- }
71
-
72
- .devtools-panel-content {
73
- flex: 1;
74
- overflow: auto;
75
- }
76
- </style>