qarpeo 0.1.7 → 0.1.9
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/LICENSE +21 -21
- package/README.md +102 -102
- package/dist/module.mjs +30 -14
- package/dist/runtime/app/components/BlobImage.vue +100 -100
- package/dist/runtime/app/components/CMSBlocks.vue +93 -93
- package/dist/runtime/app/components/CMSContent.vue +23 -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 +79 -79
- package/dist/runtime/app/components/CMSVersionBanner.vue +49 -49
- package/dist/runtime/app/components/CMSVersionSwitcher.vue +140 -140
- package/dist/runtime/app/components/ContentRenderer.vue +80 -80
- package/dist/runtime/app/components/FileUpload.vue +196 -196
- package/dist/runtime/app/components/ImpersonationBanner.vue +57 -57
- package/dist/runtime/app/components/QarpeoWelcome.vue +84 -0
- 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/pages/cms.vue +2249 -2249
- package/dist/runtime/app/pages/devtools/overview.vue +390 -390
- package/dist/runtime/app/pages/devtools/settings.vue +560 -560
- package/dist/runtime/app/pages/devtools.vue +165 -165
- package/dist/runtime/app/public/sw-notifications.mjs +52 -52
- package/dist/runtime/server/utils/cms.mjs +92 -13
- package/dist/runtime/types/auth-globals.d.ts +14 -14
- package/dist/runtime/types/imports.d.ts +58 -58
- package/package.json +3 -3
- package/dist/dev/env.d.ts +0 -12
- package/dist/dev/wrangler.d.ts +0 -18
- package/dist/module.d.ts +0 -17
- package/dist/runtime/ai.d.ts +0 -25
- package/dist/runtime/analytics.d.ts +0 -24
- package/dist/runtime/app/composables/analytics.d.ts +0 -125
- package/dist/runtime/app/composables/api-tokens.d.ts +0 -49
- package/dist/runtime/app/composables/auth.d.ts +0 -58
- package/dist/runtime/app/composables/chat.d.ts +0 -69
- package/dist/runtime/app/composables/cms-preview.d.ts +0 -33
- package/dist/runtime/app/composables/cms.d.ts +0 -307
- package/dist/runtime/app/composables/docs-version.d.ts +0 -35
- package/dist/runtime/app/composables/impersonation.d.ts +0 -14
- package/dist/runtime/app/composables/notifications.d.ts +0 -35
- package/dist/runtime/app/composables/organization.d.ts +0 -127
- package/dist/runtime/app/composables/passkey.d.ts +0 -6
- package/dist/runtime/app/composables/passwordless.d.ts +0 -7
- package/dist/runtime/app/composables/payments.d.ts +0 -43
- package/dist/runtime/app/composables/realtime.d.ts +0 -96
- package/dist/runtime/app/composables/site.d.ts +0 -35
- package/dist/runtime/app/composables/storage.d.ts +0 -60
- package/dist/runtime/app/composables/tenant.d.ts +0 -82
- package/dist/runtime/app/composables/turnstile.d.ts +0 -3
- package/dist/runtime/app/composables/two-factor.d.ts +0 -12
- package/dist/runtime/app/middleware/auth.global.d.ts +0 -2
- package/dist/runtime/app/plugins/seo.d.ts +0 -2
- package/dist/runtime/app/plugins/shortcuts.client.d.ts +0 -6
- package/dist/runtime/auth.d.ts +0 -25
- package/dist/runtime/bindings.d.ts +0 -27
- package/dist/runtime/blob.d.ts +0 -26
- package/dist/runtime/bots.d.ts +0 -1
- package/dist/runtime/browser.d.ts +0 -21
- package/dist/runtime/cache.d.ts +0 -19
- package/dist/runtime/cms.d.ts +0 -2
- package/dist/runtime/db.d.ts +0 -21
- package/dist/runtime/drizzle.d.ts +0 -11
- package/dist/runtime/email.d.ts +0 -51
- package/dist/runtime/hyperdrive.d.ts +0 -21
- package/dist/runtime/index.d.ts +0 -22
- package/dist/runtime/kv.d.ts +0 -16
- package/dist/runtime/payments.d.ts +0 -2
- package/dist/runtime/queue.d.ts +0 -21
- package/dist/runtime/rag.d.ts +0 -1
- package/dist/runtime/ratelimit.d.ts +0 -21
- package/dist/runtime/realtime.d.ts +0 -6
- package/dist/runtime/server/db/cms-schema.d.ts +0 -651
- package/dist/runtime/server/durable-objects/agent.d.ts +0 -14
- package/dist/runtime/server/durable-objects/room.d.ts +0 -34
- package/dist/runtime/server/middleware/auth.d.ts +0 -2
- package/dist/runtime/server/middleware/devtools.d.ts +0 -2
- package/dist/runtime/server/middleware/ratelimit.d.ts +0 -2
- package/dist/runtime/server/middleware/tenancy.d.ts +0 -6
- package/dist/runtime/server/middleware/tracker.d.ts +0 -7
- package/dist/runtime/server/plugins/agents.d.ts +0 -7
- package/dist/runtime/server/plugins/cms.d.ts +0 -8
- package/dist/runtime/server/plugins/dev-logs.d.ts +0 -1
- package/dist/runtime/server/plugins/dev-proxy.d.ts +0 -3
- package/dist/runtime/server/plugins/env.d.ts +0 -6
- package/dist/runtime/server/plugins/queue.d.ts +0 -6
- package/dist/runtime/server/routes/__qarpeo/agents/chat.post.d.ts +0 -20
- package/dist/runtime/server/routes/__qarpeo/agents/clear.post.d.ts +0 -7
- package/dist/runtime/server/routes/__qarpeo/agents/create.post.d.ts +0 -17
- package/dist/runtime/server/routes/__qarpeo/agents/history.get.d.ts +0 -15
- package/dist/runtime/server/routes/__qarpeo/agents/list.get.d.ts +0 -5
- package/dist/runtime/server/routes/__qarpeo/analytics/events.get.d.ts +0 -64
- package/dist/runtime/server/routes/__qarpeo/analytics/summary.get.d.ts +0 -30
- package/dist/runtime/server/routes/__qarpeo/auth/revoke-session.post.d.ts +0 -6
- package/dist/runtime/server/routes/__qarpeo/auth/sessions.get.d.ts +0 -6
- package/dist/runtime/server/routes/__qarpeo/auth/users.get.d.ts +0 -7
- package/dist/runtime/server/routes/__qarpeo/blob/files.get.d.ts +0 -22
- package/dist/runtime/server/routes/__qarpeo/db/query.post.d.ts +0 -23
- package/dist/runtime/server/routes/__qarpeo/db/tables.get.d.ts +0 -31
- package/dist/runtime/server/routes/__qarpeo/kv/delete.post.d.ts +0 -11
- package/dist/runtime/server/routes/__qarpeo/kv/get.get.d.ts +0 -11
- package/dist/runtime/server/routes/__qarpeo/kv/keys.get.d.ts +0 -8
- package/dist/runtime/server/routes/__qarpeo/kv/set.post.d.ts +0 -14
- package/dist/runtime/server/routes/__qarpeo/logs.delete.d.ts +0 -5
- package/dist/runtime/server/routes/__qarpeo/logs.get.d.ts +0 -5
- package/dist/runtime/server/routes/__qarpeo/logs.post.d.ts +0 -6
- package/dist/runtime/server/routes/__qarpeo/mail/bounce.post.d.ts +0 -5
- package/dist/runtime/server/routes/__qarpeo/mail/clear.post.d.ts +0 -4
- package/dist/runtime/server/routes/__qarpeo/mail/inbox.get.d.ts +0 -5
- package/dist/runtime/server/routes/__qarpeo/mail/send-test.post.d.ts +0 -4
- package/dist/runtime/server/routes/__qarpeo/mail/track/click/[id].get.d.ts +0 -2
- package/dist/runtime/server/routes/__qarpeo/mail/track/open/[id].get.d.ts +0 -2
- package/dist/runtime/server/routes/__qarpeo/overview/health.get.d.ts +0 -8
- package/dist/runtime/server/routes/__qarpeo/overview.get.d.ts +0 -32
- package/dist/runtime/server/routes/__qarpeo/settings/reset-dev-data.post.d.ts +0 -11
- package/dist/runtime/server/routes/__qarpeo/settings.get.d.ts +0 -124
- package/dist/runtime/server/routes/__qarpeo/tenants/create.post.d.ts +0 -7
- package/dist/runtime/server/routes/__qarpeo/tenants/domain-add.post.d.ts +0 -6
- package/dist/runtime/server/routes/__qarpeo/tenants/domain-delete.post.d.ts +0 -7
- package/dist/runtime/server/routes/__qarpeo/tenants/domain-verify.post.d.ts +0 -9
- package/dist/runtime/server/routes/__qarpeo/tenants/list.get.d.ts +0 -15
- package/dist/runtime/server/routes/agents/[agent]/chat.post.d.ts +0 -2
- package/dist/runtime/server/routes/agents/[agent]/clear.post.d.ts +0 -4
- package/dist/runtime/server/routes/agents/[agent]/history.get.d.ts +0 -4
- package/dist/runtime/server/routes/analytics/events.get.d.ts +0 -3
- package/dist/runtime/server/routes/analytics/pageviews.get.d.ts +0 -3
- package/dist/runtime/server/routes/analytics/summary.get.d.ts +0 -6
- package/dist/runtime/server/routes/atom.xml.get.d.ts +0 -2
- package/dist/runtime/server/routes/auth/2fa/disable.post.d.ts +0 -4
- package/dist/runtime/server/routes/auth/2fa/setup.post.d.ts +0 -6
- package/dist/runtime/server/routes/auth/2fa/verify.post.d.ts +0 -6
- package/dist/runtime/server/routes/auth/[provider]/callback.d.ts +0 -1
- package/dist/runtime/server/routes/auth/[provider].d.ts +0 -3
- package/dist/runtime/server/routes/auth/account.delete.d.ts +0 -5
- package/dist/runtime/server/routes/auth/impersonate/start.post.d.ts +0 -5
- package/dist/runtime/server/routes/auth/impersonate/stop.post.d.ts +0 -5
- package/dist/runtime/server/routes/auth/logout-all.post.d.ts +0 -4
- package/dist/runtime/server/routes/auth/logout-others.post.d.ts +0 -4
- package/dist/runtime/server/routes/auth/logout.post.d.ts +0 -4
- package/dist/runtime/server/routes/auth/magic-link/send.post.d.ts +0 -10
- package/dist/runtime/server/routes/auth/magic-link/verify.get.d.ts +0 -2
- package/dist/runtime/server/routes/auth/organization/create.post.d.ts +0 -5
- package/dist/runtime/server/routes/auth/organization/invite.post.d.ts +0 -9
- package/dist/runtime/server/routes/auth/organization/join.post.d.ts +0 -6
- package/dist/runtime/server/routes/auth/organization/list.get.d.ts +0 -5
- package/dist/runtime/server/routes/auth/organization/members/[id].delete.d.ts +0 -4
- package/dist/runtime/server/routes/auth/organization/members/index.get.d.ts +0 -6
- package/dist/runtime/server/routes/auth/organization/mfa.post.d.ts +0 -6
- package/dist/runtime/server/routes/auth/organization/sso/[id].delete.d.ts +0 -4
- package/dist/runtime/server/routes/auth/organization/sso/index.get.d.ts +0 -2
- package/dist/runtime/server/routes/auth/organization/sso/index.post.d.ts +0 -5
- package/dist/runtime/server/routes/auth/organization/switch.post.d.ts +0 -6
- package/dist/runtime/server/routes/auth/otp/send.post.d.ts +0 -10
- package/dist/runtime/server/routes/auth/otp/verify.post.d.ts +0 -6
- package/dist/runtime/server/routes/auth/sessions/[id].delete.d.ts +0 -5
- package/dist/runtime/server/routes/auth/sessions.get.d.ts +0 -2
- package/dist/runtime/server/routes/auth/sso/login.get.d.ts +0 -2
- package/dist/runtime/server/routes/auth/sso/oidc/callback.get.d.ts +0 -2
- package/dist/runtime/server/routes/auth/sso/saml/acs.post.d.ts +0 -2
- package/dist/runtime/server/routes/auth/tokens/[id].delete.d.ts +0 -4
- package/dist/runtime/server/routes/auth/tokens/create.post.d.ts +0 -9
- package/dist/runtime/server/routes/auth/tokens/index.get.d.ts +0 -9
- package/dist/runtime/server/routes/auth/turnstile/verify.post.d.ts +0 -2
- package/dist/runtime/server/routes/auth/user.get.d.ts +0 -2
- package/dist/runtime/server/routes/auth/webauthn/login/options.post.d.ts +0 -2
- package/dist/runtime/server/routes/auth/webauthn/login/verify.post.d.ts +0 -6
- package/dist/runtime/server/routes/auth/webauthn/register/options.post.d.ts +0 -2
- package/dist/runtime/server/routes/auth/webauthn/register/verify.post.d.ts +0 -5
- package/dist/runtime/server/routes/cms/[collection]/[id]/preview-token.post.d.ts +0 -8
- package/dist/runtime/server/routes/cms/[collection]/[id]/publish.post.d.ts +0 -6
- package/dist/runtime/server/routes/cms/[collection]/[id]/review.post.d.ts +0 -6
- package/dist/runtime/server/routes/cms/[collection]/[id].delete.d.ts +0 -4
- package/dist/runtime/server/routes/cms/[collection]/[id].put.d.ts +0 -4
- package/dist/runtime/server/routes/cms/[collection]/[slug].get.d.ts +0 -4
- package/dist/runtime/server/routes/cms/[collection]/atom.xml.get.d.ts +0 -2
- package/dist/runtime/server/routes/cms/[collection]/by-path.get.d.ts +0 -8
- package/dist/runtime/server/routes/cms/[collection]/feed.xml.get.d.ts +0 -2
- package/dist/runtime/server/routes/cms/[collection]/index.get.d.ts +0 -7
- package/dist/runtime/server/routes/cms/[collection]/index.post.d.ts +0 -4
- package/dist/runtime/server/routes/cms/[collection]/references.get.d.ts +0 -19
- package/dist/runtime/server/routes/cms/[collection]/surroundings.get.d.ts +0 -10
- package/dist/runtime/server/routes/cms/collections/[id].delete.d.ts +0 -4
- package/dist/runtime/server/routes/cms/collections/[id].put.d.ts +0 -4
- package/dist/runtime/server/routes/cms/collections/index.get.d.ts +0 -4
- package/dist/runtime/server/routes/cms/collections/index.post.d.ts +0 -4
- package/dist/runtime/server/routes/cms/components/index.get.d.ts +0 -17
- package/dist/runtime/server/routes/cms/deploy.post.d.ts +0 -4
- package/dist/runtime/server/routes/cms/export.post.d.ts +0 -10
- package/dist/runtime/server/routes/cms/navigation.get.d.ts +0 -8
- package/dist/runtime/server/routes/cms/preview/disable.get.d.ts +0 -9
- package/dist/runtime/server/routes/cms/preview/enable.get.d.ts +0 -14
- package/dist/runtime/server/routes/cms/publish-scheduled.post.d.ts +0 -11
- package/dist/runtime/server/routes/cms/search.get.d.ts +0 -13
- package/dist/runtime/server/routes/cms/sync.post.d.ts +0 -7
- package/dist/runtime/server/routes/cms/webhooks/[provider].post.d.ts +0 -150
- package/dist/runtime/server/routes/docs/search.get.d.ts +0 -15
- package/dist/runtime/server/routes/feed.xml.get.d.ts +0 -2
- package/dist/runtime/server/routes/mail/bounce.post.d.ts +0 -14
- package/dist/runtime/server/routes/mail/inbox/[id].get.d.ts +0 -2
- package/dist/runtime/server/routes/mail/inbox.get.d.ts +0 -4
- package/dist/runtime/server/routes/mail/suppressions/[email].delete.d.ts +0 -11
- package/dist/runtime/server/routes/mail/suppressions/index.get.d.ts +0 -12
- package/dist/runtime/server/routes/mail/suppressions/index.post.d.ts +0 -10
- package/dist/runtime/server/routes/mail/unsubscribe.d.ts +0 -13
- package/dist/runtime/server/routes/mail/webhooks.post.d.ts +0 -12
- package/dist/runtime/server/routes/notifications/[id]/read.post.d.ts +0 -4
- package/dist/runtime/server/routes/notifications/[id].delete.d.ts +0 -4
- package/dist/runtime/server/routes/notifications/[id].get.d.ts +0 -2
- package/dist/runtime/server/routes/notifications/index.get.d.ts +0 -6
- package/dist/runtime/server/routes/notifications/push/subscribe.post.d.ts +0 -4
- package/dist/runtime/server/routes/notifications/push/unsubscribe.post.d.ts +0 -4
- package/dist/runtime/server/routes/notifications/read-all.post.d.ts +0 -4
- package/dist/runtime/server/routes/payments/cancel.post.d.ts +0 -7
- package/dist/runtime/server/routes/payments/change-plan.post.d.ts +0 -7
- package/dist/runtime/server/routes/payments/checkout.post.d.ts +0 -9
- package/dist/runtime/server/routes/payments/pause.post.d.ts +0 -7
- package/dist/runtime/server/routes/payments/portal.post.d.ts +0 -5
- package/dist/runtime/server/routes/payments/subscription.get.d.ts +0 -6
- package/dist/runtime/server/routes/payments/usage.get.d.ts +0 -12
- package/dist/runtime/server/routes/payments/usage.post.d.ts +0 -6
- package/dist/runtime/server/routes/payments/webhook.post.d.ts +0 -14
- package/dist/runtime/server/routes/realtime/broadcast.post.d.ts +0 -4
- package/dist/runtime/server/routes/realtime/history.delete.d.ts +0 -13
- package/dist/runtime/server/routes/realtime/history.get.d.ts +0 -16
- package/dist/runtime/server/routes/realtime/presence.get.d.ts +0 -6
- package/dist/runtime/server/routes/realtime/state.get.d.ts +0 -5
- package/dist/runtime/server/routes/realtime/state.post.d.ts +0 -6
- package/dist/runtime/server/routes/realtime/ws.get.d.ts +0 -2
- package/dist/runtime/server/routes/robots.txt.get.d.ts +0 -2
- package/dist/runtime/server/routes/rss.xml.get.d.ts +0 -2
- package/dist/runtime/server/routes/sitemap.xml.get.d.ts +0 -2
- package/dist/runtime/server/routes/storage/file/[...key].delete.d.ts +0 -4
- package/dist/runtime/server/routes/storage/file/[...key].get.d.ts +0 -2
- package/dist/runtime/server/routes/storage/files.get.d.ts +0 -14
- package/dist/runtime/server/routes/storage/presigned.post.d.ts +0 -8
- package/dist/runtime/server/routes/storage/sign.post.d.ts +0 -6
- package/dist/runtime/server/routes/storage/upload.post.d.ts +0 -22
- package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/index.delete.d.ts +0 -8
- package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/verify.post.d.ts +0 -8
- package/dist/runtime/server/routes/tenants/[tenant]/domains/index.get.d.ts +0 -8
- package/dist/runtime/server/routes/tenants/[tenant]/domains/index.post.d.ts +0 -8
- package/dist/runtime/server/routes/tenants/current.get.d.ts +0 -8
- package/dist/runtime/server/tasks/cms/publish.d.ts +0 -4
- package/dist/runtime/server/utils/agent-store.d.ts +0 -24
- package/dist/runtime/server/utils/agents-registry-fallback.d.ts +0 -1
- package/dist/runtime/server/utils/ai.d.ts +0 -119
- package/dist/runtime/server/utils/analytics-query.d.ts +0 -109
- package/dist/runtime/server/utils/auth.d.ts +0 -60
- package/dist/runtime/server/utils/blob-store.d.ts +0 -13
- package/dist/runtime/server/utils/bots.d.ts +0 -21
- package/dist/runtime/server/utils/cache.d.ts +0 -33
- package/dist/runtime/server/utils/cms-events.d.ts +0 -17
- package/dist/runtime/server/utils/cms-filter.d.ts +0 -3
- package/dist/runtime/server/utils/cms.d.ts +0 -287
- package/dist/runtime/server/utils/config.d.ts +0 -27
- package/dist/runtime/server/utils/context.d.ts +0 -13
- package/dist/runtime/server/utils/crypto.d.ts +0 -16
- package/dist/runtime/server/utils/dev-logs.d.ts +0 -21
- package/dist/runtime/server/utils/dev-proxy.d.ts +0 -1
- package/dist/runtime/server/utils/domains.d.ts +0 -46
- package/dist/runtime/server/utils/drizzle.d.ts +0 -10
- package/dist/runtime/server/utils/email-templates.d.ts +0 -44
- package/dist/runtime/server/utils/feed.d.ts +0 -42
- package/dist/runtime/server/utils/impersonation.d.ts +0 -67
- package/dist/runtime/server/utils/jobs.d.ts +0 -70
- package/dist/runtime/server/utils/kv-store.d.ts +0 -9
- package/dist/runtime/server/utils/mail-suppression.d.ts +0 -62
- package/dist/runtime/server/utils/mail.d.ts +0 -90
- package/dist/runtime/server/utils/notifications.d.ts +0 -51
- package/dist/runtime/server/utils/organization.d.ts +0 -54
- package/dist/runtime/server/utils/passwordless.d.ts +0 -48
- package/dist/runtime/server/utils/payments.d.ts +0 -121
- package/dist/runtime/server/utils/queue-fallback.d.ts +0 -2
- package/dist/runtime/server/utils/queue.d.ts +0 -4
- package/dist/runtime/server/utils/rag.d.ts +0 -25
- package/dist/runtime/server/utils/ratelimit.d.ts +0 -45
- package/dist/runtime/server/utils/realtime.d.ts +0 -110
- package/dist/runtime/server/utils/schema-fallback.d.ts +0 -3
- package/dist/runtime/server/utils/session.d.ts +0 -72
- package/dist/runtime/server/utils/sso.d.ts +0 -49
- package/dist/runtime/server/utils/storage.d.ts +0 -111
- package/dist/runtime/server/utils/tenant.d.ts +0 -44
- package/dist/runtime/server/utils/totp.d.ts +0 -33
- package/dist/runtime/server/utils/tracker.d.ts +0 -72
- package/dist/runtime/server/utils/turnstile.d.ts +0 -17
- package/dist/runtime/server/utils/vapid.d.ts +0 -35
- package/dist/runtime/storage.d.ts +0 -1
- package/dist/runtime/types/ai.d.ts +0 -68
- package/dist/runtime/types/analytics.d.ts +0 -30
- package/dist/runtime/types/auth.d.ts +0 -153
- package/dist/runtime/types/browser.d.ts +0 -29
- package/dist/runtime/types/d1.d.ts +0 -44
- package/dist/runtime/types/drizzle.d.ts +0 -13
- package/dist/runtime/types/durable-object.d.ts +0 -51
- package/dist/runtime/types/email.d.ts +0 -66
- package/dist/runtime/types/hyperdrive.d.ts +0 -18
- package/dist/runtime/types/index.d.ts +0 -156
- package/dist/runtime/types/queue.d.ts +0 -67
- package/dist/runtime/types/r2.d.ts +0 -108
- package/dist/runtime/types/ratelimit.d.ts +0 -21
- package/dist/runtime/types/vectorize.d.ts +0 -74
- package/dist/runtime/vectorize.d.ts +0 -21
- package/dist/types.d.ts +0 -2752
- package/dist/utils/agents.d.ts +0 -8
- package/dist/utils/auth-schema.d.ts +0 -11
- package/dist/utils/bindings.d.ts +0 -16
- package/dist/utils/cms-scan.d.ts +0 -36
- package/dist/utils/cms-schema.d.ts +0 -1
- package/dist/utils/cms-sources.d.ts +0 -67
- package/dist/utils/drizzle.d.ts +0 -42
- package/dist/utils/jobs.d.ts +0 -8
- package/dist/utils/local-db.d.ts +0 -28
- package/dist/utils/notifications-schema.d.ts +0 -15
- package/dist/utils/payments-schema.d.ts +0 -11
- package/dist/utils/pkg.d.ts +0 -15
- package/dist/utils/queue.d.ts +0 -8
- package/dist/utils/tenants-schema.d.ts +0 -11
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed, shallowRef, watchEffect } from "vue"
|
|
3
|
-
import { MarkdownDocument } from "@comark/vue"
|
|
4
|
-
import { isMarkdownDocument } from "comark/utils"
|
|
5
|
-
import { createSerializedMarkdownParser } from "comark"
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* `<ContentRenderer>` — Renders a CMS content value (Comark AST, raw markdown string, or page object).
|
|
9
|
-
* Pre-parsed server ASTs are rendered instantly with zero client-side Shiki overhead.
|
|
10
|
-
*/
|
|
11
|
-
const props = withDefaults(defineProps<{
|
|
12
|
-
value?: object | string | null
|
|
13
|
-
excerpt?: boolean
|
|
14
|
-
tag?: string | boolean
|
|
15
|
-
as?: string | boolean
|
|
16
|
-
class?: string | any[] | Record<string, boolean>
|
|
17
|
-
unwrap?: boolean | string | any[]
|
|
18
|
-
components?: Record<string, any>
|
|
19
|
-
plugins?: any[]
|
|
20
|
-
}>(), {
|
|
21
|
-
value: null,
|
|
22
|
-
excerpt: false,
|
|
23
|
-
tag: "div",
|
|
24
|
-
class: "",
|
|
25
|
-
unwrap: false,
|
|
26
|
-
components: () => ({}),
|
|
27
|
-
plugins: () => [],
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
const resolvedValue = computed(() => {
|
|
31
|
-
const val = props.value as any
|
|
32
|
-
if (!val) return ""
|
|
33
|
-
if (isMarkdownDocument(val)) return val
|
|
34
|
-
if (isMarkdownDocument(val.body)) return val.body
|
|
35
|
-
if (typeof val.contentMd === "string" && val.contentMd) return val.contentMd
|
|
36
|
-
if (typeof val.body === "string" && val.body) return val.body
|
|
37
|
-
if (typeof val.body?.value === "string") return val.body.value
|
|
38
|
-
if (typeof val.body?.content === "string") return val.body.content
|
|
39
|
-
return ""
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
// Lazily-created parser (avoids importing Shiki on the client)
|
|
43
|
-
let _parser: ReturnType<typeof createSerializedMarkdownParser> | null = null
|
|
44
|
-
function getParser() {
|
|
45
|
-
if (!_parser) {
|
|
46
|
-
_parser = createSerializedMarkdownParser({ plugins: (props.plugins as any[]) || [] })
|
|
47
|
-
}
|
|
48
|
-
return _parser
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const parsedDoc = shallowRef<any>(null)
|
|
52
|
-
|
|
53
|
-
watchEffect(() => {
|
|
54
|
-
const content = resolvedValue.value
|
|
55
|
-
if (typeof content === "string" && content) {
|
|
56
|
-
const raw = props.excerpt ? content.split("<!-- more -->")[0] : content
|
|
57
|
-
getParser()(raw.trim(), { streaming: false }).then((doc) => {
|
|
58
|
-
parsedDoc.value = doc
|
|
59
|
-
})
|
|
60
|
-
} else {
|
|
61
|
-
parsedDoc.value = null
|
|
62
|
-
}
|
|
63
|
-
})
|
|
64
|
-
</script>
|
|
65
|
-
|
|
66
|
-
<template>
|
|
67
|
-
<slot v-if="!resolvedValue" name="empty" />
|
|
68
|
-
<MarkdownDocument
|
|
69
|
-
v-else-if="isMarkdownDocument(resolvedValue)"
|
|
70
|
-
:value="(resolvedValue as any)"
|
|
71
|
-
:components="components"
|
|
72
|
-
:class="class"
|
|
73
|
-
/>
|
|
74
|
-
<MarkdownDocument
|
|
75
|
-
v-else
|
|
76
|
-
:value="parsedDoc ?? { nodes: [], frontmatter: {}, meta: {} }"
|
|
77
|
-
:components="components"
|
|
78
|
-
:class="class"
|
|
79
|
-
/>
|
|
80
|
-
</template>
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { computed, shallowRef, watchEffect } from "vue"
|
|
3
|
+
import { MarkdownDocument } from "@comark/vue"
|
|
4
|
+
import { isMarkdownDocument } from "comark/utils"
|
|
5
|
+
import { createSerializedMarkdownParser } from "comark"
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* `<ContentRenderer>` — Renders a CMS content value (Comark AST, raw markdown string, or page object).
|
|
9
|
+
* Pre-parsed server ASTs are rendered instantly with zero client-side Shiki overhead.
|
|
10
|
+
*/
|
|
11
|
+
const props = withDefaults(defineProps<{
|
|
12
|
+
value?: object | string | null
|
|
13
|
+
excerpt?: boolean
|
|
14
|
+
tag?: string | boolean
|
|
15
|
+
as?: string | boolean
|
|
16
|
+
class?: string | any[] | Record<string, boolean>
|
|
17
|
+
unwrap?: boolean | string | any[]
|
|
18
|
+
components?: Record<string, any>
|
|
19
|
+
plugins?: any[]
|
|
20
|
+
}>(), {
|
|
21
|
+
value: null,
|
|
22
|
+
excerpt: false,
|
|
23
|
+
tag: "div",
|
|
24
|
+
class: "",
|
|
25
|
+
unwrap: false,
|
|
26
|
+
components: () => ({}),
|
|
27
|
+
plugins: () => [],
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
const resolvedValue = computed(() => {
|
|
31
|
+
const val = props.value as any
|
|
32
|
+
if (!val) return ""
|
|
33
|
+
if (isMarkdownDocument(val)) return val
|
|
34
|
+
if (isMarkdownDocument(val.body)) return val.body
|
|
35
|
+
if (typeof val.contentMd === "string" && val.contentMd) return val.contentMd
|
|
36
|
+
if (typeof val.body === "string" && val.body) return val.body
|
|
37
|
+
if (typeof val.body?.value === "string") return val.body.value
|
|
38
|
+
if (typeof val.body?.content === "string") return val.body.content
|
|
39
|
+
return ""
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
// Lazily-created parser (avoids importing Shiki on the client)
|
|
43
|
+
let _parser: ReturnType<typeof createSerializedMarkdownParser> | null = null
|
|
44
|
+
function getParser() {
|
|
45
|
+
if (!_parser) {
|
|
46
|
+
_parser = createSerializedMarkdownParser({ plugins: (props.plugins as any[]) || [] })
|
|
47
|
+
}
|
|
48
|
+
return _parser
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const parsedDoc = shallowRef<any>(null)
|
|
52
|
+
|
|
53
|
+
watchEffect(() => {
|
|
54
|
+
const content = resolvedValue.value
|
|
55
|
+
if (typeof content === "string" && content) {
|
|
56
|
+
const raw = props.excerpt ? content.split("<!-- more -->")[0] : content
|
|
57
|
+
getParser()(raw.trim(), { streaming: false }).then((doc) => {
|
|
58
|
+
parsedDoc.value = doc
|
|
59
|
+
})
|
|
60
|
+
} else {
|
|
61
|
+
parsedDoc.value = null
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<template>
|
|
67
|
+
<slot v-if="!resolvedValue" name="empty" />
|
|
68
|
+
<MarkdownDocument
|
|
69
|
+
v-else-if="isMarkdownDocument(resolvedValue)"
|
|
70
|
+
:value="(resolvedValue as any)"
|
|
71
|
+
:components="components"
|
|
72
|
+
:class="class"
|
|
73
|
+
/>
|
|
74
|
+
<MarkdownDocument
|
|
75
|
+
v-else
|
|
76
|
+
:value="parsedDoc ?? { nodes: [], frontmatter: {}, meta: {} }"
|
|
77
|
+
:components="components"
|
|
78
|
+
:class="class"
|
|
79
|
+
/>
|
|
80
|
+
</template>
|
|
@@ -1,196 +1,196 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { ref, computed } from "vue"
|
|
3
|
-
import { useUpload, type UploadedFile } from "../composables/storage"
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* `<FileUpload>` — Drag-and-drop file upload dropzone with progress and v-model support.
|
|
7
|
-
* Supports custom slot for full UI control or uses a built-in dropzone UI.
|
|
8
|
-
*/
|
|
9
|
-
const props = withDefaults(defineProps<{
|
|
10
|
-
/** File types accepted (e.g. "image/*", ".pdf,.docx"). */
|
|
11
|
-
accept?: string
|
|
12
|
-
/** Allow multiple file selection. */
|
|
13
|
-
multiple?: boolean
|
|
14
|
-
/** Maximum file size allowed in bytes. */
|
|
15
|
-
maxSize?: number
|
|
16
|
-
/** Whether the dropzone is disabled. */
|
|
17
|
-
disabled?: boolean
|
|
18
|
-
/** Automatically trigger upload immediately on file selection. */
|
|
19
|
-
autoUpload?: boolean
|
|
20
|
-
/** Uploaded file(s) v-model. */
|
|
21
|
-
modelValue?: UploadedFile | UploadedFile[] | null
|
|
22
|
-
/** Use presigned direct-to-R2 upload ticket. */
|
|
23
|
-
presigned?: boolean
|
|
24
|
-
/** Additional CSS class for the wrapper container. */
|
|
25
|
-
dropzoneClass?: string
|
|
26
|
-
}>(), {
|
|
27
|
-
multiple: false,
|
|
28
|
-
disabled: false,
|
|
29
|
-
autoUpload: true,
|
|
30
|
-
modelValue: null,
|
|
31
|
-
presigned: false,
|
|
32
|
-
dropzoneClass: "",
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
const emit = defineEmits<{
|
|
36
|
-
"update:modelValue": [value: UploadedFile | UploadedFile[] | null]
|
|
37
|
-
change: [files: File | File[]]
|
|
38
|
-
upload: [files: File[]]
|
|
39
|
-
success: [result: UploadedFile | UploadedFile[]]
|
|
40
|
-
error: [err: Error]
|
|
41
|
-
progress: [percent: number]
|
|
42
|
-
}>()
|
|
43
|
-
|
|
44
|
-
const inputRef = ref<HTMLInputElement | null>(null)
|
|
45
|
-
const isDragging = ref(false)
|
|
46
|
-
const clientError = ref<string | null>(null)
|
|
47
|
-
|
|
48
|
-
const { isUploading, progress, error, upload, uploadMultiple, reset } = useUpload()
|
|
49
|
-
|
|
50
|
-
function open() {
|
|
51
|
-
if (props.disabled || isUploading.value) return
|
|
52
|
-
inputRef.value?.click()
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function clear() {
|
|
56
|
-
reset()
|
|
57
|
-
clientError.value = null
|
|
58
|
-
if (inputRef.value) inputRef.value.value = ""
|
|
59
|
-
emit("update:modelValue", props.multiple ? [] : null)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
async function processFiles(files: FileList | File[]) {
|
|
63
|
-
clientError.value = null
|
|
64
|
-
const fileList = Array.from(files)
|
|
65
|
-
if (fileList.length === 0) return
|
|
66
|
-
|
|
67
|
-
if (props.maxSize) {
|
|
68
|
-
const oversized = fileList.find((f) => f.size > props.maxSize!)
|
|
69
|
-
if (oversized) {
|
|
70
|
-
const maxMb = (props.maxSize / (1024 * 1024)).toFixed(1)
|
|
71
|
-
const msg = `File "${oversized.name}" exceeds maximum size of ${maxMb}MB`
|
|
72
|
-
clientError.value = msg
|
|
73
|
-
emit("error", new Error(msg))
|
|
74
|
-
return
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
emit("change", props.multiple ? fileList : fileList[0]!)
|
|
79
|
-
if (!props.autoUpload) return
|
|
80
|
-
emit("upload", fileList)
|
|
81
|
-
|
|
82
|
-
try {
|
|
83
|
-
if (props.multiple) {
|
|
84
|
-
const results = await uploadMultiple(fileList)
|
|
85
|
-
emit("update:modelValue", results)
|
|
86
|
-
emit("success", results)
|
|
87
|
-
} else {
|
|
88
|
-
const result = await upload(fileList[0]!, { presigned: props.presigned })
|
|
89
|
-
emit("update:modelValue", result)
|
|
90
|
-
emit("success", result)
|
|
91
|
-
}
|
|
92
|
-
} catch (err: any) {
|
|
93
|
-
clientError.value = err?.message || "Upload failed"
|
|
94
|
-
emit("error", err)
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function onDrop(event: DragEvent) {
|
|
99
|
-
event.preventDefault()
|
|
100
|
-
isDragging.value = false
|
|
101
|
-
if (props.disabled || isUploading.value) return
|
|
102
|
-
if (event.dataTransfer?.files) processFiles(event.dataTransfer.files)
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function onDragOver(event: DragEvent) {
|
|
106
|
-
event.preventDefault()
|
|
107
|
-
if (!props.disabled && !isUploading.value) isDragging.value = true
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function onDragLeave(event: DragEvent) {
|
|
111
|
-
event.preventDefault()
|
|
112
|
-
isDragging.value = false
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function onInputChange(event: Event) {
|
|
116
|
-
const target = event.target as HTMLInputElement
|
|
117
|
-
if (target.files) processFiles(target.files)
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
const displayError = computed(() => clientError.value || error.value?.message || null)
|
|
121
|
-
</script>
|
|
122
|
-
|
|
123
|
-
<template>
|
|
124
|
-
<!-- Custom slot: users take full UI control -->
|
|
125
|
-
<div
|
|
126
|
-
v-if="$slots.default"
|
|
127
|
-
:class="['qarpeo-file-upload', dropzoneClass]"
|
|
128
|
-
@drop="onDrop"
|
|
129
|
-
@dragover="onDragOver"
|
|
130
|
-
@dragleave="onDragLeave"
|
|
131
|
-
>
|
|
132
|
-
<input
|
|
133
|
-
ref="inputRef"
|
|
134
|
-
type="file"
|
|
135
|
-
:accept="accept"
|
|
136
|
-
:multiple="multiple"
|
|
137
|
-
class="hidden"
|
|
138
|
-
@change="onInputChange"
|
|
139
|
-
/>
|
|
140
|
-
<slot
|
|
141
|
-
:is-dragging="isDragging"
|
|
142
|
-
:is-uploading="isUploading"
|
|
143
|
-
:progress="progress"
|
|
144
|
-
:error="displayError"
|
|
145
|
-
:open="open"
|
|
146
|
-
:clear="clear"
|
|
147
|
-
/>
|
|
148
|
-
</div>
|
|
149
|
-
|
|
150
|
-
<!-- Built-in dropzone UI -->
|
|
151
|
-
<div
|
|
152
|
-
v-else
|
|
153
|
-
class="qarpeo-file-upload-wrapper"
|
|
154
|
-
@drop="onDrop"
|
|
155
|
-
@dragover="onDragOver"
|
|
156
|
-
@dragleave="onDragLeave"
|
|
157
|
-
>
|
|
158
|
-
<input
|
|
159
|
-
ref="inputRef"
|
|
160
|
-
type="file"
|
|
161
|
-
:accept="accept"
|
|
162
|
-
:multiple="multiple"
|
|
163
|
-
class="hidden"
|
|
164
|
-
@change="onInputChange"
|
|
165
|
-
/>
|
|
166
|
-
<div
|
|
167
|
-
:class="[
|
|
168
|
-
'rounded-lg border-2 border-dashed p-6 text-center transition-colors duration-200',
|
|
169
|
-
isDragging
|
|
170
|
-
? 'border-primary-500 bg-primary-50/50 dark:bg-primary-950/20'
|
|
171
|
-
: 'border-gray-300 dark:border-gray-700',
|
|
172
|
-
disabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer',
|
|
173
|
-
dropzoneClass,
|
|
174
|
-
]"
|
|
175
|
-
@click="open"
|
|
176
|
-
>
|
|
177
|
-
<!-- Uploading state -->
|
|
178
|
-
<div v-if="isUploading" class="space-y-2">
|
|
179
|
-
<p class="text-sm text-gray-500">Uploading... {{ progress }}%</p>
|
|
180
|
-
<UProgress :value="progress" size="xs" />
|
|
181
|
-
</div>
|
|
182
|
-
|
|
183
|
-
<!-- Idle / drag state -->
|
|
184
|
-
<div v-else class="space-y-1">
|
|
185
|
-
<UIcon name="i-lucide-upload-cloud" class="size-8 mx-auto text-gray-400" />
|
|
186
|
-
<p class="text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
187
|
-
{{ isDragging ? "Drop files to upload" : "Click or drag files here to upload" }}
|
|
188
|
-
</p>
|
|
189
|
-
<p v-if="accept" class="text-xs text-gray-400">Accepted: {{ accept }}</p>
|
|
190
|
-
</div>
|
|
191
|
-
|
|
192
|
-
<!-- Error -->
|
|
193
|
-
<p v-if="displayError" class="mt-2 text-xs text-red-500">{{ displayError }}</p>
|
|
194
|
-
</div>
|
|
195
|
-
</div>
|
|
196
|
-
</template>
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { ref, computed } from "vue"
|
|
3
|
+
import { useUpload, type UploadedFile } from "../composables/storage"
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* `<FileUpload>` — Drag-and-drop file upload dropzone with progress and v-model support.
|
|
7
|
+
* Supports custom slot for full UI control or uses a built-in dropzone UI.
|
|
8
|
+
*/
|
|
9
|
+
const props = withDefaults(defineProps<{
|
|
10
|
+
/** File types accepted (e.g. "image/*", ".pdf,.docx"). */
|
|
11
|
+
accept?: string
|
|
12
|
+
/** Allow multiple file selection. */
|
|
13
|
+
multiple?: boolean
|
|
14
|
+
/** Maximum file size allowed in bytes. */
|
|
15
|
+
maxSize?: number
|
|
16
|
+
/** Whether the dropzone is disabled. */
|
|
17
|
+
disabled?: boolean
|
|
18
|
+
/** Automatically trigger upload immediately on file selection. */
|
|
19
|
+
autoUpload?: boolean
|
|
20
|
+
/** Uploaded file(s) v-model. */
|
|
21
|
+
modelValue?: UploadedFile | UploadedFile[] | null
|
|
22
|
+
/** Use presigned direct-to-R2 upload ticket. */
|
|
23
|
+
presigned?: boolean
|
|
24
|
+
/** Additional CSS class for the wrapper container. */
|
|
25
|
+
dropzoneClass?: string
|
|
26
|
+
}>(), {
|
|
27
|
+
multiple: false,
|
|
28
|
+
disabled: false,
|
|
29
|
+
autoUpload: true,
|
|
30
|
+
modelValue: null,
|
|
31
|
+
presigned: false,
|
|
32
|
+
dropzoneClass: "",
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
const emit = defineEmits<{
|
|
36
|
+
"update:modelValue": [value: UploadedFile | UploadedFile[] | null]
|
|
37
|
+
change: [files: File | File[]]
|
|
38
|
+
upload: [files: File[]]
|
|
39
|
+
success: [result: UploadedFile | UploadedFile[]]
|
|
40
|
+
error: [err: Error]
|
|
41
|
+
progress: [percent: number]
|
|
42
|
+
}>()
|
|
43
|
+
|
|
44
|
+
const inputRef = ref<HTMLInputElement | null>(null)
|
|
45
|
+
const isDragging = ref(false)
|
|
46
|
+
const clientError = ref<string | null>(null)
|
|
47
|
+
|
|
48
|
+
const { isUploading, progress, error, upload, uploadMultiple, reset } = useUpload()
|
|
49
|
+
|
|
50
|
+
function open() {
|
|
51
|
+
if (props.disabled || isUploading.value) return
|
|
52
|
+
inputRef.value?.click()
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function clear() {
|
|
56
|
+
reset()
|
|
57
|
+
clientError.value = null
|
|
58
|
+
if (inputRef.value) inputRef.value.value = ""
|
|
59
|
+
emit("update:modelValue", props.multiple ? [] : null)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function processFiles(files: FileList | File[]) {
|
|
63
|
+
clientError.value = null
|
|
64
|
+
const fileList = Array.from(files)
|
|
65
|
+
if (fileList.length === 0) return
|
|
66
|
+
|
|
67
|
+
if (props.maxSize) {
|
|
68
|
+
const oversized = fileList.find((f) => f.size > props.maxSize!)
|
|
69
|
+
if (oversized) {
|
|
70
|
+
const maxMb = (props.maxSize / (1024 * 1024)).toFixed(1)
|
|
71
|
+
const msg = `File "${oversized.name}" exceeds maximum size of ${maxMb}MB`
|
|
72
|
+
clientError.value = msg
|
|
73
|
+
emit("error", new Error(msg))
|
|
74
|
+
return
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
emit("change", props.multiple ? fileList : fileList[0]!)
|
|
79
|
+
if (!props.autoUpload) return
|
|
80
|
+
emit("upload", fileList)
|
|
81
|
+
|
|
82
|
+
try {
|
|
83
|
+
if (props.multiple) {
|
|
84
|
+
const results = await uploadMultiple(fileList)
|
|
85
|
+
emit("update:modelValue", results)
|
|
86
|
+
emit("success", results)
|
|
87
|
+
} else {
|
|
88
|
+
const result = await upload(fileList[0]!, { presigned: props.presigned })
|
|
89
|
+
emit("update:modelValue", result)
|
|
90
|
+
emit("success", result)
|
|
91
|
+
}
|
|
92
|
+
} catch (err: any) {
|
|
93
|
+
clientError.value = err?.message || "Upload failed"
|
|
94
|
+
emit("error", err)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function onDrop(event: DragEvent) {
|
|
99
|
+
event.preventDefault()
|
|
100
|
+
isDragging.value = false
|
|
101
|
+
if (props.disabled || isUploading.value) return
|
|
102
|
+
if (event.dataTransfer?.files) processFiles(event.dataTransfer.files)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function onDragOver(event: DragEvent) {
|
|
106
|
+
event.preventDefault()
|
|
107
|
+
if (!props.disabled && !isUploading.value) isDragging.value = true
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function onDragLeave(event: DragEvent) {
|
|
111
|
+
event.preventDefault()
|
|
112
|
+
isDragging.value = false
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function onInputChange(event: Event) {
|
|
116
|
+
const target = event.target as HTMLInputElement
|
|
117
|
+
if (target.files) processFiles(target.files)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const displayError = computed(() => clientError.value || error.value?.message || null)
|
|
121
|
+
</script>
|
|
122
|
+
|
|
123
|
+
<template>
|
|
124
|
+
<!-- Custom slot: users take full UI control -->
|
|
125
|
+
<div
|
|
126
|
+
v-if="$slots.default"
|
|
127
|
+
:class="['qarpeo-file-upload', dropzoneClass]"
|
|
128
|
+
@drop="onDrop"
|
|
129
|
+
@dragover="onDragOver"
|
|
130
|
+
@dragleave="onDragLeave"
|
|
131
|
+
>
|
|
132
|
+
<input
|
|
133
|
+
ref="inputRef"
|
|
134
|
+
type="file"
|
|
135
|
+
:accept="accept"
|
|
136
|
+
:multiple="multiple"
|
|
137
|
+
class="hidden"
|
|
138
|
+
@change="onInputChange"
|
|
139
|
+
/>
|
|
140
|
+
<slot
|
|
141
|
+
:is-dragging="isDragging"
|
|
142
|
+
:is-uploading="isUploading"
|
|
143
|
+
:progress="progress"
|
|
144
|
+
:error="displayError"
|
|
145
|
+
:open="open"
|
|
146
|
+
:clear="clear"
|
|
147
|
+
/>
|
|
148
|
+
</div>
|
|
149
|
+
|
|
150
|
+
<!-- Built-in dropzone UI -->
|
|
151
|
+
<div
|
|
152
|
+
v-else
|
|
153
|
+
class="qarpeo-file-upload-wrapper"
|
|
154
|
+
@drop="onDrop"
|
|
155
|
+
@dragover="onDragOver"
|
|
156
|
+
@dragleave="onDragLeave"
|
|
157
|
+
>
|
|
158
|
+
<input
|
|
159
|
+
ref="inputRef"
|
|
160
|
+
type="file"
|
|
161
|
+
:accept="accept"
|
|
162
|
+
:multiple="multiple"
|
|
163
|
+
class="hidden"
|
|
164
|
+
@change="onInputChange"
|
|
165
|
+
/>
|
|
166
|
+
<div
|
|
167
|
+
:class="[
|
|
168
|
+
'rounded-lg border-2 border-dashed p-6 text-center transition-colors duration-200',
|
|
169
|
+
isDragging
|
|
170
|
+
? 'border-primary-500 bg-primary-50/50 dark:bg-primary-950/20'
|
|
171
|
+
: 'border-gray-300 dark:border-gray-700',
|
|
172
|
+
disabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer',
|
|
173
|
+
dropzoneClass,
|
|
174
|
+
]"
|
|
175
|
+
@click="open"
|
|
176
|
+
>
|
|
177
|
+
<!-- Uploading state -->
|
|
178
|
+
<div v-if="isUploading" class="space-y-2">
|
|
179
|
+
<p class="text-sm text-gray-500">Uploading... {{ progress }}%</p>
|
|
180
|
+
<UProgress :value="progress" size="xs" />
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
<!-- Idle / drag state -->
|
|
184
|
+
<div v-else class="space-y-1">
|
|
185
|
+
<UIcon name="i-lucide-upload-cloud" class="size-8 mx-auto text-gray-400" />
|
|
186
|
+
<p class="text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
187
|
+
{{ isDragging ? "Drop files to upload" : "Click or drag files here to upload" }}
|
|
188
|
+
</p>
|
|
189
|
+
<p v-if="accept" class="text-xs text-gray-400">Accepted: {{ accept }}</p>
|
|
190
|
+
</div>
|
|
191
|
+
|
|
192
|
+
<!-- Error -->
|
|
193
|
+
<p v-if="displayError" class="mt-2 text-xs text-red-500">{{ displayError }}</p>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
</template>
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed } from "vue"
|
|
3
|
-
import { useUserSession } from "../composables/auth"
|
|
4
|
-
import type { QarpeoUser, QarpeoSession } from "../../types/auth"
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* `<ImpersonationBanner>` Renders a dismissible banner when an admin is actively impersonating a
|
|
8
|
-
* user. Shows who is being impersonated and provides a "Stop Impersonating" button.
|
|
9
|
-
* Auto-hides when not in an impersonation session.
|
|
10
|
-
* @emits stopped — when impersonation is stopped successfully
|
|
11
|
-
*/
|
|
12
|
-
const emit = defineEmits<{ stopped: [] }>()
|
|
13
|
-
|
|
14
|
-
const { session, fetch: refreshSession } = useUserSession()
|
|
15
|
-
|
|
16
|
-
const isImpersonating = computed(() => Boolean((session.value as QarpeoSession | null)?.impersonator))
|
|
17
|
-
const impersonator = computed<QarpeoUser | null>(
|
|
18
|
-
() => ((session.value as QarpeoSession | null)?.impersonator as QarpeoUser) || null,
|
|
19
|
-
)
|
|
20
|
-
const impersonated = computed<QarpeoUser | null>(() => {
|
|
21
|
-
if (!isImpersonating.value) return null
|
|
22
|
-
return ((session.value as QarpeoSession | null)?.user as QarpeoUser) || null
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
async function stopImpersonating() {
|
|
26
|
-
try {
|
|
27
|
-
await $fetch("/api/auth/impersonate/stop", { method: "POST", credentials: "include" })
|
|
28
|
-
await refreshSession()
|
|
29
|
-
emit("stopped")
|
|
30
|
-
} catch {}
|
|
31
|
-
}
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<template>
|
|
35
|
-
<Teleport to="body">
|
|
36
|
-
<div
|
|
37
|
-
v-if="isImpersonating"
|
|
38
|
-
class="fixed top-0 left-0 right-0 z-[9999] flex items-center justify-between gap-4 bg-amber-700 text-white px-4 py-2 text-sm font-sans"
|
|
39
|
-
>
|
|
40
|
-
<span>
|
|
41
|
-
⚠ Admin
|
|
42
|
-
<strong>{{ impersonator?.email || impersonator?.name || "Unknown" }}</strong>
|
|
43
|
-
is impersonating
|
|
44
|
-
<strong>{{ impersonated?.email || impersonated?.name || "Unknown" }}</strong>
|
|
45
|
-
</span>
|
|
46
|
-
<UButton
|
|
47
|
-
color="neutral"
|
|
48
|
-
variant="outline"
|
|
49
|
-
size="xs"
|
|
50
|
-
class="border-white/50 text-white hover:bg-white/20"
|
|
51
|
-
@click="stopImpersonating"
|
|
52
|
-
>
|
|
53
|
-
Stop Impersonating
|
|
54
|
-
</UButton>
|
|
55
|
-
</div>
|
|
56
|
-
</Teleport>
|
|
57
|
-
</template>
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { computed } from "vue"
|
|
3
|
+
import { useUserSession } from "../composables/auth"
|
|
4
|
+
import type { QarpeoUser, QarpeoSession } from "../../types/auth"
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* `<ImpersonationBanner>` Renders a dismissible banner when an admin is actively impersonating a
|
|
8
|
+
* user. Shows who is being impersonated and provides a "Stop Impersonating" button.
|
|
9
|
+
* Auto-hides when not in an impersonation session.
|
|
10
|
+
* @emits stopped — when impersonation is stopped successfully
|
|
11
|
+
*/
|
|
12
|
+
const emit = defineEmits<{ stopped: [] }>()
|
|
13
|
+
|
|
14
|
+
const { session, fetch: refreshSession } = useUserSession()
|
|
15
|
+
|
|
16
|
+
const isImpersonating = computed(() => Boolean((session.value as QarpeoSession | null)?.impersonator))
|
|
17
|
+
const impersonator = computed<QarpeoUser | null>(
|
|
18
|
+
() => ((session.value as QarpeoSession | null)?.impersonator as QarpeoUser) || null,
|
|
19
|
+
)
|
|
20
|
+
const impersonated = computed<QarpeoUser | null>(() => {
|
|
21
|
+
if (!isImpersonating.value) return null
|
|
22
|
+
return ((session.value as QarpeoSession | null)?.user as QarpeoUser) || null
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
async function stopImpersonating() {
|
|
26
|
+
try {
|
|
27
|
+
await $fetch("/api/auth/impersonate/stop", { method: "POST", credentials: "include" })
|
|
28
|
+
await refreshSession()
|
|
29
|
+
emit("stopped")
|
|
30
|
+
} catch {}
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template>
|
|
35
|
+
<Teleport to="body">
|
|
36
|
+
<div
|
|
37
|
+
v-if="isImpersonating"
|
|
38
|
+
class="fixed top-0 left-0 right-0 z-[9999] flex items-center justify-between gap-4 bg-amber-700 text-white px-4 py-2 text-sm font-sans"
|
|
39
|
+
>
|
|
40
|
+
<span>
|
|
41
|
+
⚠ Admin
|
|
42
|
+
<strong>{{ impersonator?.email || impersonator?.name || "Unknown" }}</strong>
|
|
43
|
+
is impersonating
|
|
44
|
+
<strong>{{ impersonated?.email || impersonated?.name || "Unknown" }}</strong>
|
|
45
|
+
</span>
|
|
46
|
+
<UButton
|
|
47
|
+
color="neutral"
|
|
48
|
+
variant="outline"
|
|
49
|
+
size="xs"
|
|
50
|
+
class="border-white/50 text-white hover:bg-white/20"
|
|
51
|
+
@click="stopImpersonating"
|
|
52
|
+
>
|
|
53
|
+
Stop Impersonating
|
|
54
|
+
</UButton>
|
|
55
|
+
</div>
|
|
56
|
+
</Teleport>
|
|
57
|
+
</template>
|