qarpeo 0.1.18 → 0.1.21
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.
- package/README.md +96 -96
- package/dist/chunks/auth-schema.mjs +3 -1
- package/dist/chunks/wrangler.mjs +22 -3
- package/dist/cli/index.mjs +448 -221
- package/dist/fate/index.d.ts +29 -22
- package/dist/fate/index.mjs +1 -3
- package/dist/module.d.ts +1 -1
- package/dist/module.mjs +103 -82
- package/dist/runtime/ai.d.ts +2 -2
- package/dist/runtime/app/components/BlobImage.vue +119 -107
- package/dist/runtime/app/components/CMSBlocks.vue +104 -93
- package/dist/runtime/app/components/CMSContent.vue +24 -23
- package/dist/runtime/app/components/CMSImage.vue +49 -49
- package/dist/runtime/app/components/CMSLocaleSwitcher.vue +110 -110
- package/dist/runtime/app/components/CMSPreviewBanner.vue +83 -79
- package/dist/runtime/app/components/CMSVersionBanner.vue +53 -49
- package/dist/runtime/app/components/CMSVersionSwitcher.vue +140 -140
- package/dist/runtime/app/components/ContentRenderer.vue +83 -80
- package/dist/runtime/app/components/FileUpload.vue +200 -196
- package/dist/runtime/app/components/ImpersonationBanner.vue +61 -57
- package/dist/runtime/app/components/QarpeoWelcome.vue +84 -84
- package/dist/runtime/app/components/SignedIn.vue +13 -13
- package/dist/runtime/app/components/SignedOut.vue +13 -13
- package/dist/runtime/app/components/shiki.css +34 -34
- package/dist/runtime/app/composables/ai.d.ts +22 -22
- package/dist/runtime/app/composables/ai.mjs +3 -7
- package/dist/runtime/app/composables/analytics.mjs +1 -1
- package/dist/runtime/app/composables/api-tokens.mjs +1 -1
- package/dist/runtime/app/composables/auth.d.ts +6 -7
- package/dist/runtime/app/composables/auth.mjs +6 -3
- package/dist/runtime/app/composables/chat.mjs +3 -7
- package/dist/runtime/app/composables/cms-preview.d.ts +3 -3
- package/dist/runtime/app/composables/cms-preview.mjs +1 -1
- package/dist/runtime/app/composables/cms.d.ts +3 -5
- package/dist/runtime/app/composables/cms.mjs +2 -2
- package/dist/runtime/app/composables/docs-version.d.ts +8 -7
- package/dist/runtime/app/composables/docs-version.mjs +3 -3
- package/dist/runtime/app/composables/impersonation.mjs +1 -1
- package/dist/runtime/app/composables/notifications.d.ts +5 -5
- package/dist/runtime/app/composables/notifications.mjs +4 -5
- package/dist/runtime/app/composables/organization.mjs +1 -1
- package/dist/runtime/app/composables/passkey.mjs +1 -1
- package/dist/runtime/app/composables/passwordless.mjs +1 -1
- package/dist/runtime/app/composables/payments.d.ts +2 -1
- package/dist/runtime/app/composables/payments.mjs +1 -1
- package/dist/runtime/app/composables/realtime.d.ts +13 -13
- package/dist/runtime/app/composables/realtime.mjs +2 -2
- package/dist/runtime/app/composables/resumable-upload.d.ts +11 -11
- package/dist/runtime/app/composables/resumable-upload.mjs +1 -1
- package/dist/runtime/app/composables/site.mjs +1 -1
- package/dist/runtime/app/composables/storage.d.ts +151 -11
- package/dist/runtime/app/composables/storage.mjs +291 -33
- package/dist/runtime/app/composables/turnstile.mjs +1 -1
- package/dist/runtime/app/composables/two-factor.mjs +1 -1
- package/dist/runtime/app/pages/devtools/agents.vue +716 -716
- package/dist/runtime/app/pages/devtools/analytics.vue +616 -616
- package/dist/runtime/app/pages/devtools/auth.vue +381 -350
- package/dist/runtime/app/pages/devtools/blob.vue +743 -744
- package/dist/runtime/app/pages/devtools/db.vue +545 -545
- package/dist/runtime/app/pages/devtools/domains.vue +771 -771
- package/dist/runtime/app/pages/devtools/kv.vue +827 -828
- package/dist/runtime/app/pages/devtools/logs.vue +649 -653
- package/dist/runtime/app/pages/devtools/mail.vue +388 -388
- package/dist/runtime/app/pages/devtools/overview.vue +391 -389
- package/dist/runtime/app/pages/devtools/realtime.vue +89 -27
- package/dist/runtime/app/pages/devtools/security.vue +20 -5
- package/dist/runtime/app/pages/devtools/settings.vue +559 -559
- package/dist/runtime/app/pages/devtools/tasks.vue +26 -10
- package/dist/runtime/app/pages/devtools.vue +176 -176
- package/dist/runtime/app/plugins/seo.mjs +1 -1
- package/dist/runtime/app/plugins/shortcuts.client.d.ts +1 -4
- package/dist/runtime/app/public/sw-notifications.mjs +47 -52
- package/dist/runtime/blob.mjs +11 -4
- package/dist/runtime/browser.d.ts +1 -1
- package/dist/runtime/browser.mjs +12 -2
- package/dist/runtime/cache.d.ts +2 -1
- package/dist/runtime/kv.mjs +4 -1
- package/dist/runtime/providers/qarpeo.d.ts +3 -3
- package/dist/runtime/server/durable-objects/agent.mjs +1 -1
- package/dist/runtime/server/durable-objects/room.d.ts +2 -2
- package/dist/runtime/server/durable-objects/room.mjs +5 -5
- package/dist/runtime/server/middleware/devtools.mjs +6 -2
- package/dist/runtime/server/plugins/cms.d.ts +4 -2
- package/dist/runtime/server/plugins/dev-proxy.mjs +1 -1
- package/dist/runtime/server/routes/__qarpeo/agents/chat.post.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/agents/chat.post.mjs +4 -1
- package/dist/runtime/server/routes/__qarpeo/analytics/events.get.d.ts +1 -4
- package/dist/runtime/server/routes/__qarpeo/analytics/summary.get.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/analytics/summary.get.mjs +5 -1
- package/dist/runtime/server/routes/__qarpeo/db/tables.get.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/db/tables.get.mjs +1 -1
- package/dist/runtime/server/routes/__qarpeo/logs.get.d.ts +4 -1
- package/dist/runtime/server/routes/__qarpeo/mail/track/click/[id].get.mjs +1 -1
- package/dist/runtime/server/routes/__qarpeo/mail/track/open/[id].get.mjs +2 -2
- package/dist/runtime/server/routes/__qarpeo/overview.get.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/realtime/broadcast.post.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/realtime/broadcast.post.mjs +1 -1
- package/dist/runtime/server/routes/__qarpeo/realtime/clear.post.d.ts +1 -4
- package/dist/runtime/server/routes/__qarpeo/realtime/clear.post.mjs +1 -1
- package/dist/runtime/server/routes/__qarpeo/realtime/disconnect.post.d.ts +1 -4
- package/dist/runtime/server/routes/__qarpeo/realtime/disconnect.post.mjs +1 -1
- package/dist/runtime/server/routes/__qarpeo/realtime/room.get.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/realtime/rooms.get.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/security/analytics.get.d.ts +2 -2
- package/dist/runtime/server/routes/__qarpeo/security/ban.post.d.ts +1 -4
- package/dist/runtime/server/routes/__qarpeo/security/clear.post.d.ts +1 -4
- package/dist/runtime/server/routes/__qarpeo/security/unban.post.d.ts +1 -4
- package/dist/runtime/server/routes/__qarpeo/settings.get.mjs +1 -1
- package/dist/runtime/server/routes/__qarpeo/tasks/run.post.mjs +3 -1
- package/dist/runtime/server/routes/agents/[agent]/chat.post.mjs +8 -2
- package/dist/runtime/server/routes/agents/[agent]/clear.post.mjs +8 -2
- package/dist/runtime/server/routes/agents/[agent]/history.get.mjs +8 -2
- package/dist/runtime/server/routes/ai/embed.post.d.ts +1 -4
- package/dist/runtime/server/routes/ai/search.post.d.ts +2 -2
- package/dist/runtime/server/routes/auth/account.delete.mjs +1 -1
- package/dist/runtime/server/routes/auth/handler.mjs +6 -1
- package/dist/runtime/server/routes/auth/magic-link/verify.get.mjs +1 -1
- package/dist/runtime/server/routes/auth/organization/members/[id].delete.mjs +7 -1
- package/dist/runtime/server/routes/auth/otp/verify.post.mjs +1 -1
- package/dist/runtime/server/routes/auth/sso/login.get.mjs +7 -1
- package/dist/runtime/server/routes/auth/sso/oidc/callback.get.mjs +8 -2
- package/dist/runtime/server/routes/auth/sso/saml/acs.post.mjs +7 -2
- package/dist/runtime/server/routes/auth/webauthn/login/options.post.mjs +1 -1
- package/dist/runtime/server/routes/auth/webauthn/login/verify.post.mjs +7 -2
- package/dist/runtime/server/routes/auth/webauthn/register/options.post.mjs +6 -1
- package/dist/runtime/server/routes/auth/webauthn/register/verify.post.mjs +6 -1
- package/dist/runtime/server/routes/browser/crawl.post.d.ts +1 -2
- package/dist/runtime/server/routes/browser/invoice.post.d.ts +1 -2
- package/dist/runtime/server/routes/browser/og-image.post.d.ts +2 -2
- package/dist/runtime/server/routes/browser/pdf.post.d.ts +1 -2
- package/dist/runtime/server/routes/browser/pdf.post.mjs +6 -1
- package/dist/runtime/server/routes/browser/screenshot.post.d.ts +2 -2
- package/dist/runtime/server/routes/browser/screenshot.post.mjs +5 -1
- package/dist/runtime/server/routes/cms/components/index.get.d.ts +2 -2
- package/dist/runtime/server/routes/cms/preview/disable.get.d.ts +4 -3
- package/dist/runtime/server/routes/cms/preview/enable.get.d.ts +8 -8
- package/dist/runtime/server/routes/cms/search.get.mjs +1 -1
- package/dist/runtime/server/routes/cms/webhooks/[provider].post.d.ts +7 -7
- package/dist/runtime/server/routes/cms/webhooks/[provider].post.mjs +9 -2
- package/dist/runtime/server/routes/docs/search.get.d.ts +9 -9
- package/dist/runtime/server/routes/fate.mjs +5 -8
- package/dist/runtime/server/routes/mail/bounce.post.d.ts +2 -2
- package/dist/runtime/server/routes/mail/unsubscribe.d.ts +2 -2
- package/dist/runtime/server/routes/mail/webhooks.post.d.ts +2 -2
- package/dist/runtime/server/routes/mail/webhooks.post.mjs +7 -1
- package/dist/runtime/server/routes/payments/usage.get.d.ts +8 -8
- package/dist/runtime/server/routes/payments/usage.post.d.ts +2 -2
- package/dist/runtime/server/routes/realtime/history.delete.d.ts +4 -3
- package/dist/runtime/server/routes/realtime/history.get.d.ts +7 -6
- package/dist/runtime/server/routes/realtime/ws.get.mjs +6 -1
- package/dist/runtime/server/routes/robots.txt.get.mjs +1 -1
- package/dist/runtime/server/routes/sitemap.xml.get.mjs +2 -1
- package/dist/runtime/server/routes/storage/multipart/abort.post.d.ts +2 -2
- package/dist/runtime/server/routes/storage/multipart/complete.post.d.ts +2 -2
- package/dist/runtime/server/routes/storage/multipart/complete.post.mjs +2 -2
- package/dist/runtime/server/routes/storage/multipart/create.post.d.ts +2 -2
- package/dist/runtime/server/routes/storage/multipart/create.post.mjs +7 -3
- package/dist/runtime/server/routes/storage/multipart/part.put.d.ts +2 -2
- package/dist/runtime/server/routes/storage/multipart/part.put.mjs +1 -1
- package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/index.delete.mjs +2 -4
- package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/verify.post.mjs +2 -4
- package/dist/runtime/server/routes/tenants/[tenant]/domains/index.get.mjs +1 -1
- package/dist/runtime/server/routes/tenants/[tenant]/domains/index.post.mjs +2 -4
- package/dist/runtime/server/tasks/cms/publish.mjs +1 -1
- package/dist/runtime/server/utils/ai.d.ts +9 -9
- package/dist/runtime/server/utils/ai.mjs +3 -3
- package/dist/runtime/server/utils/auth.d.ts +12 -16
- package/dist/runtime/server/utils/auth.mjs +15 -9
- package/dist/runtime/server/utils/bots.mjs +21 -7
- package/dist/runtime/server/utils/browser-utils.d.ts +44 -41
- package/dist/runtime/server/utils/browser-utils.mjs +14 -4
- package/dist/runtime/server/utils/cache.d.ts +5 -5
- package/dist/runtime/server/utils/cms/common.d.ts +26 -0
- package/dist/runtime/server/utils/cms/common.mjs +68 -0
- package/dist/runtime/server/utils/cms/git.d.ts +24 -0
- package/dist/runtime/server/utils/cms/git.mjs +240 -0
- package/dist/runtime/server/utils/cms/markdown.d.ts +22 -0
- package/dist/runtime/server/utils/cms/markdown.mjs +92 -0
- package/dist/runtime/server/utils/cms/path.d.ts +51 -0
- package/dist/runtime/server/utils/cms/path.mjs +127 -0
- package/dist/runtime/server/utils/cms/search.d.ts +22 -0
- package/dist/runtime/server/utils/cms/search.mjs +221 -0
- package/dist/runtime/server/utils/cms-events.d.ts +1 -1
- package/dist/runtime/server/utils/cms-events.mjs +2 -2
- package/dist/runtime/server/utils/cms-filter.mjs +2 -2
- package/dist/runtime/server/utils/cms.d.ts +17 -149
- package/dist/runtime/server/utils/cms.mjs +52 -761
- package/dist/runtime/server/utils/config.d.ts +5 -4
- package/dist/runtime/server/utils/domains.mjs +7 -4
- package/dist/runtime/server/utils/email-templates.d.ts +10 -7
- package/dist/runtime/server/utils/email-templates.mjs +20 -5
- package/dist/runtime/server/utils/feed.d.ts +2 -2
- package/dist/runtime/server/utils/feed.mjs +3 -1
- package/dist/runtime/server/utils/mail-suppression.d.ts +8 -24
- package/dist/runtime/server/utils/mail-suppression.mjs +2 -2
- package/dist/runtime/server/utils/mail.d.ts +7 -8
- package/dist/runtime/server/utils/mail.mjs +17 -12
- package/dist/runtime/server/utils/multipart-store.d.ts +2 -2
- package/dist/runtime/server/utils/notifications.d.ts +9 -23
- package/dist/runtime/server/utils/organization.mjs +4 -12
- package/dist/runtime/server/utils/passwordless.mjs +1 -1
- package/dist/runtime/server/utils/payments.d.ts +2 -6
- package/dist/runtime/server/utils/payments.mjs +1 -1
- package/dist/runtime/server/utils/queue.d.ts +21 -31
- package/dist/runtime/server/utils/rag.d.ts +4 -4
- package/dist/runtime/server/utils/rag.mjs +8 -8
- package/dist/runtime/server/utils/realtime-store.d.ts +2 -2
- package/dist/runtime/server/utils/realtime.d.ts +26 -28
- package/dist/runtime/server/utils/scheduled-task.d.ts +1 -3
- package/dist/runtime/server/utils/security-store.d.ts +2 -2
- package/dist/runtime/server/utils/session.d.ts +9 -11
- package/dist/runtime/server/utils/sso.d.ts +9 -15
- package/dist/runtime/server/utils/sso.mjs +4 -8
- package/dist/runtime/server/utils/storage.d.ts +19 -2
- package/dist/runtime/server/utils/storage.mjs +36 -7
- package/dist/runtime/server/utils/tenant.mjs +3 -1
- package/dist/runtime/server/utils/turnstile.d.ts +3 -5
- package/dist/runtime/server/utils/vapid.d.ts +5 -8
- package/dist/runtime/server/utils/vapid.mjs +26 -13
- package/dist/runtime/service.d.ts +13 -13
- package/dist/runtime/service.mjs +4 -2
- package/dist/runtime/test-utils.d.ts +20 -30
- package/dist/runtime/test-utils.mjs +5 -4
- package/dist/runtime/types/auth-globals.d.ts +14 -14
- package/dist/runtime/types/imports.d.ts +82 -82
- package/dist/runtime/types/index.d.ts +2 -2
- package/dist/runtime/types/r2.d.ts +5 -0
- package/dist/runtime/types/service.d.ts +11 -18
- package/dist/types.d.ts +100 -107
- package/dist/utils/auth-schema.d.ts +2 -2
- package/dist/utils/cms-sources.d.ts +3 -3
- package/dist/utils/local-db.d.ts +3 -3
- package/dist/utils/notifications-schema.d.ts +1 -3
- package/dist/utils/pkg.d.ts +7 -0
- package/dist/utils/queue.d.ts +3 -3
- package/dist/utils/tasks.d.ts +3 -2
- package/package.json +11 -8
|
@@ -1,140 +1,140 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed } from "vue"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
:
|
|
76
|
-
:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
>
|
|
115
|
-
<UButton
|
|
116
|
-
:size="size"
|
|
117
|
-
:color="color"
|
|
118
|
-
variant="subtle"
|
|
119
|
-
class="font-mono cursor-pointer"
|
|
120
|
-
trailing-icon="i-lucide-chevron-down"
|
|
121
|
-
:class="props.class"
|
|
122
|
-
:label="currentLabel"
|
|
123
|
-
/>
|
|
124
|
-
</UDropdownMenu>
|
|
125
|
-
</template>
|
|
126
|
-
|
|
127
|
-
<!-- Single version or loading fallback: interactive Nuxt UI UButton linking to release notes -->
|
|
128
|
-
<UButton
|
|
129
|
-
v-else
|
|
130
|
-
:label="currentLabel"
|
|
131
|
-
:aria-label="`Open ${currentLabel} release notes on GitHub`"
|
|
132
|
-
variant="subtle"
|
|
133
|
-
:size="size"
|
|
134
|
-
:color="color"
|
|
135
|
-
:to="releaseNotesUrl"
|
|
136
|
-
target="_blank"
|
|
137
|
-
class="font-semibold text-xs cursor-pointer hover:bg-primary/10 active:bg-primary/10 transition-colors"
|
|
138
|
-
:class="props.class"
|
|
139
|
-
/>
|
|
140
|
-
</template>
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { computed } from "vue"
|
|
3
|
+
|
|
4
|
+
import { useDocsVersion } from "../composables/docs-version"
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* `<CMSVersionSwitcher>` / `<DocsVersionSwitcher>` — Polished Nuxt UI component for switching
|
|
8
|
+
* between documentation versions. Preserves the active subpath when switching.
|
|
9
|
+
*/
|
|
10
|
+
const props = withDefaults(
|
|
11
|
+
defineProps<{
|
|
12
|
+
variant?: "dropdown" | "select" | "buttons" | "badge"
|
|
13
|
+
size?: "xs" | "sm" | "md"
|
|
14
|
+
color?: "primary" | "neutral" | "secondary"
|
|
15
|
+
class?: string
|
|
16
|
+
repo?: string
|
|
17
|
+
}>(),
|
|
18
|
+
{
|
|
19
|
+
variant: "dropdown",
|
|
20
|
+
size: "xs",
|
|
21
|
+
color: "primary",
|
|
22
|
+
class: "",
|
|
23
|
+
repo: "qarpeo/qarpeo",
|
|
24
|
+
},
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
const { currentVersion, versions, switchVersion } = useDocsVersion()
|
|
28
|
+
|
|
29
|
+
const currentLabel = computed(() => {
|
|
30
|
+
const item = versions.value?.find((v) => v.id === currentVersion.value)
|
|
31
|
+
if (item?.label) return item.label
|
|
32
|
+
return currentVersion.value === "latest" ? "latest" : currentVersion.value
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
const releaseNotesUrl = computed(() => {
|
|
36
|
+
const raw = currentVersion.value === "latest" ? currentLabel.value : currentVersion.value
|
|
37
|
+
const clean = (raw || "").replace(/^v/, "").trim()
|
|
38
|
+
if (clean && /^\d+\.\d+/.test(clean)) {
|
|
39
|
+
return `https://github.com/${props.repo}/releases/tag/v${clean}`
|
|
40
|
+
}
|
|
41
|
+
return `https://github.com/${props.repo}/releases`
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const dropdownItems = computed(() => [
|
|
45
|
+
(versions.value || []).map((v) => ({
|
|
46
|
+
label: v.label,
|
|
47
|
+
icon: v.id === currentVersion.value ? "i-lucide-check" : undefined,
|
|
48
|
+
badge: v.isLatest ? "latest" : v.isArchived ? "legacy" : undefined,
|
|
49
|
+
onSelect: () => switchVersion(v.id),
|
|
50
|
+
})),
|
|
51
|
+
])
|
|
52
|
+
|
|
53
|
+
const selectItems = computed(() =>
|
|
54
|
+
(versions.value || []).map((v) => ({
|
|
55
|
+
label: v.label + (v.isArchived ? " (legacy)" : ""),
|
|
56
|
+
value: v.id,
|
|
57
|
+
})),
|
|
58
|
+
)
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<template>
|
|
62
|
+
<template v-if="versions && versions.length > 1">
|
|
63
|
+
<!-- Buttons variant -->
|
|
64
|
+
<div
|
|
65
|
+
v-if="variant === 'buttons'"
|
|
66
|
+
:class="[
|
|
67
|
+
'inline-flex items-center gap-1 rounded-lg border border-gray-200 dark:border-gray-800 p-1 bg-gray-50/50 dark:bg-gray-900/50 text-xs font-medium',
|
|
68
|
+
props.class,
|
|
69
|
+
]"
|
|
70
|
+
role="group"
|
|
71
|
+
aria-label="Documentation version switcher"
|
|
72
|
+
>
|
|
73
|
+
<UButton
|
|
74
|
+
v-for="v in versions"
|
|
75
|
+
:key="v.id"
|
|
76
|
+
:size="size"
|
|
77
|
+
variant="ghost"
|
|
78
|
+
:color="color"
|
|
79
|
+
:label="v.label"
|
|
80
|
+
:class="[
|
|
81
|
+
'flex items-center gap-1.5 transition-colors',
|
|
82
|
+
v.id === currentVersion
|
|
83
|
+
? 'bg-white dark:bg-gray-800 text-gray-900 dark:text-white shadow-xs font-semibold'
|
|
84
|
+
: 'text-gray-600 dark:text-gray-400',
|
|
85
|
+
]"
|
|
86
|
+
@click="switchVersion(v.id)"
|
|
87
|
+
>
|
|
88
|
+
<template v-if="v.isLatest" #trailing>
|
|
89
|
+
<UBadge
|
|
90
|
+
size="xs"
|
|
91
|
+
:color="color"
|
|
92
|
+
variant="subtle"
|
|
93
|
+
class="text-[10px] font-semibold"
|
|
94
|
+
label="latest"
|
|
95
|
+
/>
|
|
96
|
+
</template>
|
|
97
|
+
</UButton>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<!-- Select variant: Nuxt UI USelect -->
|
|
101
|
+
<USelect
|
|
102
|
+
v-else-if="variant === 'select'"
|
|
103
|
+
:model-value="currentVersion"
|
|
104
|
+
:items="selectItems"
|
|
105
|
+
:size="size"
|
|
106
|
+
:color="color"
|
|
107
|
+
variant="subtle"
|
|
108
|
+
class="font-mono"
|
|
109
|
+
:class="props.class"
|
|
110
|
+
@update:model-value="switchVersion($event)"
|
|
111
|
+
/>
|
|
112
|
+
|
|
113
|
+
<!-- Dropdown variant (DEFAULT): Nuxt UI UDropdownMenu with subtle button trigger -->
|
|
114
|
+
<UDropdownMenu v-else :items="dropdownItems" :content="{ align: 'start' }">
|
|
115
|
+
<UButton
|
|
116
|
+
:size="size"
|
|
117
|
+
:color="color"
|
|
118
|
+
variant="subtle"
|
|
119
|
+
class="font-mono cursor-pointer"
|
|
120
|
+
trailing-icon="i-lucide-chevron-down"
|
|
121
|
+
:class="props.class"
|
|
122
|
+
:label="currentLabel"
|
|
123
|
+
/>
|
|
124
|
+
</UDropdownMenu>
|
|
125
|
+
</template>
|
|
126
|
+
|
|
127
|
+
<!-- Single version or loading fallback: interactive Nuxt UI UButton linking to release notes -->
|
|
128
|
+
<UButton
|
|
129
|
+
v-else
|
|
130
|
+
:label="currentLabel"
|
|
131
|
+
:aria-label="`Open ${currentLabel} release notes on GitHub`"
|
|
132
|
+
variant="subtle"
|
|
133
|
+
:size="size"
|
|
134
|
+
:color="color"
|
|
135
|
+
:to="releaseNotesUrl"
|
|
136
|
+
target="_blank"
|
|
137
|
+
class="font-semibold text-xs cursor-pointer hover:bg-primary/10 active:bg-primary/10 transition-colors"
|
|
138
|
+
:class="props.class"
|
|
139
|
+
/>
|
|
140
|
+
</template>
|
|
@@ -1,80 +1,83 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { isMarkdownDocument } from "comark/utils"
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* `<ContentRenderer>` — Renders a CMS content value (Comark AST, raw markdown string, or page
|
|
9
|
-
* Pre-parsed server ASTs are rendered instantly with zero client-side Shiki overhead.
|
|
10
|
-
*/
|
|
11
|
-
const props = withDefaults(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (
|
|
36
|
-
if (
|
|
37
|
-
if (
|
|
38
|
-
if (typeof val.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { MarkdownDocument } from "@comark/vue"
|
|
3
|
+
import { createSerializedMarkdownParser } from "comark"
|
|
4
|
+
import { isMarkdownDocument } from "comark/utils"
|
|
5
|
+
import { computed, shallowRef, watchEffect } from "vue"
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* `<ContentRenderer>` — Renders a CMS content value (Comark AST, raw markdown string, or page
|
|
9
|
+
* object). Pre-parsed server ASTs are rendered instantly with zero client-side Shiki overhead.
|
|
10
|
+
*/
|
|
11
|
+
const props = withDefaults(
|
|
12
|
+
defineProps<{
|
|
13
|
+
value?: object | string | null
|
|
14
|
+
excerpt?: boolean
|
|
15
|
+
tag?: string | boolean
|
|
16
|
+
as?: string | boolean
|
|
17
|
+
class?: string | any[] | Record<string, boolean>
|
|
18
|
+
unwrap?: boolean | string | any[]
|
|
19
|
+
components?: Record<string, any>
|
|
20
|
+
plugins?: any[]
|
|
21
|
+
}>(),
|
|
22
|
+
{
|
|
23
|
+
value: null,
|
|
24
|
+
excerpt: false,
|
|
25
|
+
tag: "div",
|
|
26
|
+
class: "",
|
|
27
|
+
unwrap: false,
|
|
28
|
+
components: () => ({}),
|
|
29
|
+
plugins: () => [],
|
|
30
|
+
},
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
const resolvedValue = computed(() => {
|
|
34
|
+
const val = props.value as any
|
|
35
|
+
if (!val) return ""
|
|
36
|
+
if (isMarkdownDocument(val)) return val
|
|
37
|
+
if (isMarkdownDocument(val.body)) return val.body
|
|
38
|
+
if (typeof val.contentMd === "string" && val.contentMd) return val.contentMd
|
|
39
|
+
if (typeof val.body === "string" && val.body) return val.body
|
|
40
|
+
if (typeof val.body?.value === "string") return val.body.value
|
|
41
|
+
if (typeof val.body?.content === "string") return val.body.content
|
|
42
|
+
return ""
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
// Lazily-created parser (avoids importing Shiki on the client)
|
|
46
|
+
let _parser: ReturnType<typeof createSerializedMarkdownParser> | null = null
|
|
47
|
+
function getParser() {
|
|
48
|
+
if (!_parser) {
|
|
49
|
+
_parser = createSerializedMarkdownParser({ plugins: (props.plugins as any[]) || [] })
|
|
50
|
+
}
|
|
51
|
+
return _parser
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const parsedDoc = shallowRef<any>(null)
|
|
55
|
+
|
|
56
|
+
watchEffect(() => {
|
|
57
|
+
const content = resolvedValue.value
|
|
58
|
+
if (typeof content === "string" && content) {
|
|
59
|
+
const raw = props.excerpt ? content.split("<!-- more -->")[0] : content
|
|
60
|
+
getParser()(raw.trim(), { streaming: false }).then((doc) => {
|
|
61
|
+
parsedDoc.value = doc
|
|
62
|
+
})
|
|
63
|
+
} else {
|
|
64
|
+
parsedDoc.value = null
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<template>
|
|
70
|
+
<slot v-if="!resolvedValue" name="empty" />
|
|
71
|
+
<MarkdownDocument
|
|
72
|
+
v-else-if="isMarkdownDocument(resolvedValue)"
|
|
73
|
+
:value="resolvedValue as any"
|
|
74
|
+
:components="components"
|
|
75
|
+
:class="class"
|
|
76
|
+
/>
|
|
77
|
+
<MarkdownDocument
|
|
78
|
+
v-else
|
|
79
|
+
:value="parsedDoc ?? { nodes: [], frontmatter: {}, meta: {} }"
|
|
80
|
+
:components="components"
|
|
81
|
+
:class="class"
|
|
82
|
+
/>
|
|
83
|
+
</template>
|