qarpeo 0.1.34 → 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.
- package/README.md +114 -26
- package/dist/apps/cms.d.ts +4 -0
- package/dist/apps/comments.d.ts +4 -0
- package/dist/apps/payments.d.ts +4 -0
- package/dist/apps/store.d.ts +4 -0
- package/dist/chunks/auth-schema.mjs +169 -30
- package/dist/chunks/tools.mjs +1680 -0
- package/dist/cli/index.mjs +1256 -221
- package/dist/core/aliases.d.ts +5 -0
- package/dist/core/context.d.ts +10 -0
- package/dist/core/cross-drive.d.ts +2 -0
- package/dist/core/d1-migrate.d.ts +4 -0
- package/dist/core/devtools.d.ts +4 -0
- package/dist/core/nitro.d.ts +4 -0
- package/dist/core/schema.d.ts +4 -0
- package/dist/core/server-utils.d.ts +4 -0
- package/dist/core/wrangler.d.ts +4 -0
- package/dist/dev/wrangler.d.ts +1 -0
- package/dist/fate/index.d.ts +8 -8
- package/dist/features/agents.d.ts +4 -0
- package/dist/features/auth.d.ts +4 -0
- package/dist/features/bots.d.ts +4 -0
- package/dist/features/fate.d.ts +4 -0
- package/dist/features/mail.d.ts +4 -0
- package/dist/features/mcp.d.ts +4 -0
- package/dist/features/multitenant.d.ts +4 -0
- package/dist/features/notifications.d.ts +4 -0
- package/dist/features/realtime.d.ts +4 -0
- package/dist/module.d.ts +10 -2
- package/dist/module.mjs +6313 -5114
- package/dist/primitives/ai.d.ts +4 -0
- package/dist/primitives/analytics.d.ts +4 -0
- package/dist/primitives/blob.d.ts +4 -0
- package/dist/primitives/browser.d.ts +4 -0
- package/dist/primitives/cache.d.ts +4 -0
- package/dist/primitives/d1.d.ts +4 -0
- package/dist/primitives/do.d.ts +4 -0
- package/dist/primitives/email.d.ts +4 -0
- package/dist/primitives/hyperdrive.d.ts +4 -0
- package/dist/primitives/kv.d.ts +4 -0
- package/dist/primitives/queue.d.ts +4 -0
- package/dist/primitives/ratelimit.d.ts +4 -0
- package/dist/primitives/vectorize.d.ts +4 -0
- package/dist/primitives/workflows.d.ts +4 -0
- package/dist/runtime/ai.d.ts +3 -3
- package/dist/runtime/ai.mjs +8 -1
- package/dist/runtime/app/components/RealtimeCursors.vue +2 -2
- package/dist/runtime/app/composables/ai.d.ts +56 -29
- package/dist/runtime/app/composables/analytics.d.ts +26 -106
- package/dist/runtime/app/composables/api-tokens.d.ts +31 -34
- package/dist/runtime/app/composables/auth.d.ts +147 -51
- package/dist/runtime/app/composables/auth.mjs +0 -7
- package/dist/runtime/app/composables/chat.d.ts +38 -35
- package/dist/runtime/app/composables/cms-preview.d.ts +30 -25
- package/dist/runtime/app/composables/cms.d.ts +57 -282
- package/dist/runtime/app/composables/cms.mjs +0 -35
- package/dist/runtime/app/composables/comments.d.ts +32 -5
- package/dist/runtime/app/composables/comments.mjs +29 -1
- package/dist/runtime/app/composables/docs-version.d.ts +25 -28
- package/dist/runtime/app/composables/impersonation.d.ts +22 -5
- package/dist/runtime/app/composables/organization.d.ts +38 -91
- package/dist/runtime/app/composables/passkey.d.ts +22 -6
- package/dist/runtime/app/composables/passwordless.d.ts +24 -7
- package/dist/runtime/app/composables/payments.d.ts +50 -34
- package/dist/runtime/app/composables/payments.mjs +1 -0
- package/dist/runtime/app/composables/sse.d.ts +76 -0
- package/dist/runtime/app/composables/sse.mjs +152 -0
- package/dist/runtime/app/composables/storage.d.ts +53 -65
- package/dist/runtime/app/composables/storage.mjs +17 -0
- package/dist/runtime/app/composables/store.d.ts +198 -0
- package/dist/runtime/app/composables/store.mjs +414 -0
- package/dist/runtime/app/composables/tenant.d.ts +31 -72
- package/dist/runtime/app/composables/turnstile.d.ts +16 -3
- package/dist/runtime/app/composables/two-factor.d.ts +23 -6
- package/dist/runtime/app/pages/devtools/notifications.vue +30 -27
- package/dist/runtime/app/pages/devtools/realtime.vue +19 -31
- package/dist/runtime/app/pages/devtools.vue +0 -7
- package/dist/runtime/auth.d.ts +9 -9
- package/dist/runtime/blob.d.ts +10 -1
- package/dist/runtime/blob.mjs +83 -0
- package/dist/runtime/cache.d.ts +48 -0
- package/dist/runtime/cache.mjs +92 -0
- package/dist/runtime/comments.d.ts +4 -0
- package/dist/runtime/comments.mjs +2 -0
- package/dist/runtime/db.d.ts +21 -1
- package/dist/runtime/db.mjs +54 -0
- package/dist/runtime/drizzle.d.ts +4 -2
- package/dist/runtime/drizzle.mjs +68 -1
- package/dist/runtime/durable-object.d.ts +2 -0
- package/dist/runtime/durable-object.mjs +2 -0
- package/dist/runtime/email.d.ts +1 -1
- package/dist/runtime/email.mjs +1 -1
- package/dist/runtime/kv.mjs +50 -1
- package/dist/runtime/mcp.d.ts +2 -0
- package/dist/runtime/mcp.mjs +2 -0
- package/dist/runtime/queue.d.ts +12 -2
- package/dist/runtime/queue.mjs +19 -1
- package/dist/runtime/ratelimit.d.ts +1 -0
- package/dist/runtime/ratelimit.mjs +7 -0
- package/dist/runtime/schema.d.ts +313 -0
- package/dist/runtime/schema.mjs +259 -0
- package/dist/runtime/server/db/cms-schema.d.ts +1225 -171
- package/dist/runtime/server/db/cms-schema.mjs +69 -70
- package/dist/runtime/server/db/store-schema.d.ts +4344 -0
- package/dist/runtime/server/db/store-schema.mjs +266 -0
- package/dist/runtime/server/durable-objects/agent.mjs +35 -0
- package/dist/runtime/server/durable-objects/room.mjs +0 -1
- package/dist/runtime/server/middleware/ratelimit.mjs +10 -8
- package/dist/runtime/server/plugins/comments.d.ts +7 -0
- package/dist/runtime/server/plugins/comments.mjs +7 -0
- package/dist/runtime/server/plugins/email-inbound.d.ts +5 -0
- package/dist/runtime/server/plugins/email-inbound.mjs +17 -0
- package/dist/runtime/server/plugins/store.d.ts +7 -0
- package/dist/runtime/server/plugins/store.mjs +7 -0
- package/dist/runtime/server/routes/__qarpeo/db/tables.get.mjs +2 -2
- package/dist/runtime/server/routes/atom.xml.get.mjs +3 -1
- package/dist/runtime/server/routes/auth/2fa/disable.post.mjs +13 -2
- package/dist/runtime/server/routes/auth/2fa/setup.post.mjs +9 -3
- package/dist/runtime/server/routes/auth/2fa/verify.post.mjs +11 -3
- package/dist/runtime/server/routes/auth/account.delete.mjs +2 -1
- package/dist/runtime/server/routes/auth/audit-logs.get.mjs +1 -1
- package/dist/runtime/server/routes/auth/magic-link/send.post.d.ts +1 -9
- package/dist/runtime/server/routes/auth/magic-link/send.post.mjs +8 -0
- package/dist/runtime/server/routes/auth/organization/sso/[id].delete.mjs +1 -1
- package/dist/runtime/server/routes/auth/organization/sso/index.get.mjs +1 -1
- package/dist/runtime/server/routes/auth/organization/sso/index.post.mjs +1 -1
- package/dist/runtime/server/routes/auth/otp/send.post.d.ts +1 -9
- package/dist/runtime/server/routes/auth/otp/send.post.mjs +8 -0
- package/dist/runtime/server/routes/auth/sso/login.get.mjs +3 -3
- package/dist/runtime/server/routes/auth/sso/oidc/callback.get.mjs +1 -1
- package/dist/runtime/server/routes/auth/sso/saml/acs.post.mjs +2 -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 +1 -1
- package/dist/runtime/server/routes/auth/webauthn/register/options.post.mjs +2 -2
- package/dist/runtime/server/routes/auth/webauthn/register/verify.post.mjs +1 -1
- package/dist/runtime/server/routes/cms/[collection]/[id]/preview-token.post.mjs +1 -1
- package/dist/runtime/server/routes/cms/[collection]/atom.xml.get.mjs +3 -1
- package/dist/runtime/server/routes/cms/[collection]/feed.xml.get.mjs +3 -1
- package/dist/runtime/server/routes/cms/bookmarks/[id].delete.mjs +1 -1
- package/dist/runtime/server/routes/cms/bookmarks/check.post.mjs +1 -1
- package/dist/runtime/server/routes/cms/bookmarks/index.get.mjs +1 -1
- package/dist/runtime/server/routes/cms/bookmarks/index.post.mjs +1 -1
- package/dist/runtime/server/routes/cms/deploy.post.mjs +1 -1
- package/dist/runtime/server/routes/cms/export.post.mjs +4 -3
- package/dist/runtime/server/routes/cms/search.get.mjs +7 -5
- package/dist/runtime/server/routes/cms/sync.post.mjs +2 -1
- package/dist/runtime/server/routes/comments/[id]/react.post.mjs +1 -2
- package/dist/runtime/server/routes/comments/[id]/report.post.d.ts +1 -1
- package/dist/runtime/server/routes/comments/[id]/report.post.mjs +0 -2
- package/dist/runtime/server/routes/comments/[id].delete.mjs +8 -4
- package/dist/runtime/server/routes/comments/[id].get.d.ts +1 -1
- package/dist/runtime/server/routes/comments/[id].get.mjs +1 -2
- package/dist/runtime/server/routes/comments/[id].patch.d.ts +1 -1
- package/dist/runtime/server/routes/comments/[id].patch.mjs +6 -3
- package/dist/runtime/server/routes/comments/batch.post.d.ts +2 -0
- package/dist/runtime/server/routes/comments/batch.post.mjs +33 -0
- package/dist/runtime/server/routes/comments/index.get.d.ts +1 -1
- package/dist/runtime/server/routes/comments/index.get.mjs +6 -4
- package/dist/runtime/server/routes/comments/index.post.d.ts +1 -1
- package/dist/runtime/server/routes/comments/index.post.mjs +6 -2
- package/dist/runtime/server/routes/feed.xml.get.mjs +3 -1
- package/dist/runtime/server/routes/sitemap.xml.get.mjs +3 -1
- package/dist/runtime/server/routes/storage/presigned-r2.post.d.ts +17 -0
- package/dist/runtime/server/routes/storage/presigned-r2.post.mjs +29 -0
- package/dist/runtime/server/routes/store/cart/index.delete.d.ts +6 -0
- package/dist/runtime/server/routes/store/cart/index.delete.mjs +11 -0
- package/dist/runtime/server/routes/store/cart/index.get.d.ts +5 -0
- package/dist/runtime/server/routes/store/cart/index.get.mjs +14 -0
- package/dist/runtime/server/routes/store/cart/items/[id].delete.d.ts +6 -0
- package/dist/runtime/server/routes/store/cart/items/[id].delete.mjs +25 -0
- package/dist/runtime/server/routes/store/cart/items/[id].patch.d.ts +6 -0
- package/dist/runtime/server/routes/store/cart/items/[id].patch.mjs +29 -0
- package/dist/runtime/server/routes/store/cart/items.post.d.ts +6 -0
- package/dist/runtime/server/routes/store/cart/items.post.mjs +36 -0
- package/dist/runtime/server/routes/store/categories/index.get.d.ts +2 -0
- package/dist/runtime/server/routes/store/categories/index.get.mjs +8 -0
- package/dist/runtime/server/routes/store/checkout.post.d.ts +6 -0
- package/dist/runtime/server/routes/store/checkout.post.mjs +21 -0
- package/dist/runtime/server/routes/store/coupons/apply.post.d.ts +7 -0
- package/dist/runtime/server/routes/store/coupons/apply.post.mjs +18 -0
- package/dist/runtime/server/routes/store/currencies.get.d.ts +15 -0
- package/dist/runtime/server/routes/store/currencies.get.mjs +13 -0
- package/dist/runtime/server/routes/store/orders/[id].get.d.ts +2 -0
- package/dist/runtime/server/routes/store/orders/[id].get.mjs +26 -0
- package/dist/runtime/server/routes/store/orders/download/[token].get.d.ts +7 -0
- package/dist/runtime/server/routes/store/orders/download/[token].get.mjs +57 -0
- package/dist/runtime/server/routes/store/orders/index.get.d.ts +5 -0
- package/dist/runtime/server/routes/store/orders/index.get.mjs +30 -0
- package/dist/runtime/server/routes/store/products/[slug].get.d.ts +2 -0
- package/dist/runtime/server/routes/store/products/[slug].get.mjs +18 -0
- package/dist/runtime/server/routes/store/products/index.get.d.ts +5 -0
- package/dist/runtime/server/routes/store/products/index.get.mjs +33 -0
- package/dist/runtime/server/routes/store/tax/calculate.post.d.ts +9 -0
- package/dist/runtime/server/routes/store/tax/calculate.post.mjs +18 -0
- package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/index.delete.mjs +14 -1
- package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/verify.post.mjs +14 -1
- package/dist/runtime/server/routes/tenants/[tenant]/domains/index.get.mjs +24 -1
- package/dist/runtime/server/routes/tenants/[tenant]/domains/index.post.mjs +6 -0
- package/dist/runtime/server/utils/ai.d.ts +146 -21
- package/dist/runtime/server/utils/ai.mjs +406 -11
- package/dist/runtime/server/utils/analytics-query.d.ts +13 -58
- package/dist/runtime/server/utils/audit.d.ts +5 -4
- package/dist/runtime/server/utils/audit.mjs +25 -14
- package/dist/runtime/server/utils/auth.d.ts +29 -12
- package/dist/runtime/server/utils/auth.mjs +88 -70
- package/dist/runtime/server/utils/bots.d.ts +20 -4
- package/dist/runtime/server/utils/bots.mjs +7 -3
- package/dist/runtime/server/utils/browser-utils.d.ts +23 -23
- package/dist/runtime/server/utils/cache.d.ts +31 -10
- package/dist/runtime/server/utils/cache.mjs +130 -53
- package/dist/runtime/server/utils/cms/collections.d.ts +23 -0
- package/dist/runtime/server/utils/cms/collections.mjs +143 -0
- package/dist/runtime/server/utils/cms/common.d.ts +9 -0
- package/dist/runtime/server/utils/cms/common.mjs +28 -0
- package/dist/runtime/server/utils/cms/git.mjs +2 -2
- package/dist/runtime/server/utils/cms/navigation.d.ts +46 -0
- package/dist/runtime/server/utils/cms/navigation.mjs +683 -0
- package/dist/runtime/server/utils/cms/preview.d.ts +11 -0
- package/dist/runtime/server/utils/cms/preview.mjs +50 -0
- package/dist/runtime/server/utils/cms/search.d.ts +1 -1
- package/dist/runtime/server/utils/cms/search.mjs +11 -7
- package/dist/runtime/server/utils/cms/sync.d.ts +34 -0
- package/dist/runtime/server/utils/cms/sync.mjs +1082 -0
- package/dist/runtime/server/utils/cms/taxonomy.d.ts +103 -0
- package/dist/runtime/server/utils/cms/taxonomy.mjs +348 -0
- package/dist/runtime/server/utils/cms.d.ts +13 -249
- package/dist/runtime/server/utils/cms.mjs +108 -2350
- package/dist/runtime/server/utils/comments-filter.d.ts +45 -0
- package/dist/runtime/server/utils/comments-filter.mjs +541 -0
- package/dist/runtime/server/utils/comments.d.ts +71 -0
- package/dist/runtime/server/utils/comments.mjs +137 -61
- package/dist/runtime/server/utils/config.d.ts +4 -3
- package/dist/runtime/server/utils/config.mjs +7 -6
- package/dist/runtime/server/utils/context.d.ts +14 -0
- package/dist/runtime/server/utils/context.mjs +2 -2
- package/dist/runtime/server/utils/crypto.d.ts +44 -5
- package/dist/runtime/server/utils/crypto.mjs +18 -0
- package/dist/runtime/server/utils/domains.mjs +9 -5
- package/dist/runtime/server/utils/drizzle.d.ts +35 -3
- package/dist/runtime/server/utils/drizzle.mjs +115 -6
- package/dist/runtime/server/utils/durable-object.d.ts +106 -0
- package/dist/runtime/server/utils/durable-object.mjs +628 -0
- package/dist/runtime/server/utils/email-inbound.d.ts +29 -0
- package/dist/runtime/server/utils/email-inbound.mjs +76 -0
- package/dist/runtime/server/utils/impersonation.d.ts +32 -2
- package/dist/runtime/server/utils/impersonation.mjs +16 -13
- package/dist/runtime/server/utils/lock.d.ts +71 -0
- package/dist/runtime/server/utils/lock.mjs +139 -0
- package/dist/runtime/server/utils/mail-suppression.mjs +7 -7
- package/dist/runtime/server/utils/mail.d.ts +30 -19
- package/dist/runtime/server/utils/mcp.d.ts +44 -0
- package/dist/runtime/server/utils/mcp.mjs +308 -0
- package/dist/runtime/server/utils/notifications.d.ts +72 -7
- package/dist/runtime/server/utils/notifications.mjs +67 -55
- package/dist/runtime/server/utils/oauth.d.ts +27 -4
- package/dist/runtime/server/utils/organization.d.ts +63 -7
- package/dist/runtime/server/utils/organization.mjs +26 -21
- package/dist/runtime/server/utils/passwordless.d.ts +62 -33
- package/dist/runtime/server/utils/payments.d.ts +51 -12
- package/dist/runtime/server/utils/payments.mjs +472 -282
- package/dist/runtime/server/utils/queue.d.ts +106 -13
- package/dist/runtime/server/utils/queue.mjs +313 -28
- package/dist/runtime/server/utils/rag.d.ts +42 -14
- package/dist/runtime/server/utils/rag.mjs +169 -4
- package/dist/runtime/server/utils/ratelimit.d.ts +34 -5
- package/dist/runtime/server/utils/ratelimit.mjs +95 -14
- package/dist/runtime/server/utils/realtime.d.ts +68 -52
- package/dist/runtime/server/utils/scheduled-task.d.ts +42 -1
- package/dist/runtime/server/utils/scheduled-task.mjs +29 -0
- package/dist/runtime/server/utils/schema-fallback.d.ts +1 -1
- package/dist/runtime/server/utils/schema-fallback.mjs +1 -1
- package/dist/runtime/server/utils/session.d.ts +84 -10
- package/dist/runtime/server/utils/session.mjs +12 -10
- package/dist/runtime/server/utils/sse.d.ts +75 -0
- package/dist/runtime/server/utils/sse.mjs +147 -0
- package/dist/runtime/server/utils/sso.d.ts +1 -1
- package/dist/runtime/server/utils/storage.d.ts +53 -4
- package/dist/runtime/server/utils/storage.mjs +15 -11
- package/dist/runtime/server/utils/store-localization.d.ts +51 -0
- package/dist/runtime/server/utils/store-localization.mjs +417 -0
- package/dist/runtime/server/utils/store.d.ts +207 -0
- package/dist/runtime/server/utils/store.mjs +2227 -0
- package/dist/runtime/server/utils/table-names.d.ts +51 -0
- package/dist/runtime/server/utils/table-names.mjs +69 -0
- package/dist/runtime/server/utils/tenant.d.ts +26 -2
- package/dist/runtime/server/utils/tenant.mjs +16 -12
- package/dist/runtime/server/utils/tools-registry-fallback.d.ts +1 -0
- package/dist/runtime/server/utils/tools-registry-fallback.mjs +1 -0
- package/dist/runtime/server/utils/totp.d.ts +45 -2
- package/dist/runtime/server/utils/tracker.d.ts +10 -11
- package/dist/runtime/server/utils/turnstile.d.ts +16 -1
- package/dist/runtime/server/utils/workflows.d.ts +92 -0
- package/dist/runtime/server/utils/workflows.mjs +299 -0
- package/dist/runtime/server.d.ts +8 -1
- package/dist/runtime/server.mjs +8 -5
- package/dist/runtime/service.d.ts +10 -10
- package/dist/runtime/storage.d.ts +1 -0
- package/dist/runtime/storage.mjs +1 -0
- package/dist/runtime/store.d.ts +4 -0
- package/dist/runtime/store.mjs +2 -0
- package/dist/runtime/test-utils.d.ts +11 -10
- package/dist/runtime/test-utils.mjs +64 -4
- package/dist/runtime/types/ai.d.ts +21 -2
- package/dist/runtime/types/d1.d.ts +17 -0
- package/dist/runtime/types/drizzle.d.ts +2 -2
- package/dist/runtime/types/durable-object.d.ts +62 -2
- package/dist/runtime/types/email.d.ts +46 -0
- package/dist/runtime/types/imports.d.ts +6 -1
- package/dist/runtime/types/index.d.ts +58 -0
- package/dist/runtime/types/index.mjs +3 -0
- package/dist/runtime/types/mcp.d.ts +83 -0
- package/dist/runtime/types/mcp.mjs +0 -0
- package/dist/runtime/types/queue.d.ts +36 -0
- package/dist/runtime/types/r2.d.ts +41 -0
- package/dist/runtime/types/store.d.ts +313 -0
- package/dist/runtime/types/store.mjs +0 -0
- package/dist/runtime/types/workflows.d.ts +98 -0
- package/dist/runtime/types/workflows.mjs +0 -0
- package/dist/runtime/workflows.d.ts +5 -0
- package/dist/runtime/workflows.mjs +2 -0
- package/dist/types/ai.d.ts +721 -0
- package/dist/types/cms.d.ts +710 -0
- package/dist/types.d.ts +430 -1292
- package/dist/utils/auth-schema.d.ts +3 -2
- package/dist/utils/bots.d.ts +20 -0
- package/dist/utils/comments-schema.d.ts +5 -4
- package/dist/utils/drizzle.d.ts +83 -3
- package/dist/utils/durable-objects.d.ts +10 -0
- package/dist/utils/email-inbound.d.ts +10 -0
- package/dist/utils/local-db.d.ts +1 -3
- package/dist/utils/mcp.d.ts +24 -0
- package/dist/utils/notifications-schema.d.ts +5 -4
- package/dist/utils/payments-schema.d.ts +4 -3
- package/dist/utils/store-schema.d.ts +14 -0
- package/dist/utils/table-names.d.ts +1 -0
- package/dist/utils/tenants-schema.d.ts +4 -3
- package/dist/utils/tools.d.ts +20 -0
- package/dist/utils/workflows.d.ts +8 -0
- package/package.json +34 -4
- package/dist/chunks/wrangler.mjs +0 -897
- package/dist/runtime/app/components/AuthRegister.vue +0 -306
- package/dist/runtime/app/components/AuthSessionsList.vue +0 -137
- package/dist/runtime/app/components/AuthSignIn.vue +0 -298
- package/dist/runtime/app/components/CMSBookmarkButton.vue +0 -59
- package/dist/runtime/app/components/CMSImage.vue +0 -47
- package/dist/runtime/app/components/CMSLocaleSwitcher.vue +0 -110
- package/dist/runtime/app/components/CMSNewsletter.vue +0 -81
- package/dist/runtime/app/components/CMSPreviewBanner.vue +0 -83
- package/dist/runtime/app/components/CMSTableOfContents.vue +0 -84
- package/dist/runtime/app/components/CMSVersionBanner.vue +0 -53
- package/dist/runtime/app/components/CMSVersionSwitcher.vue +0 -140
- package/dist/runtime/app/components/Comments.vue +0 -411
- package/dist/runtime/app/components/FileUpload.vue +0 -200
- package/dist/runtime/app/components/ImpersonationBanner.vue +0 -61
- package/dist/runtime/app/components/NotificationBell.vue +0 -263
- package/dist/runtime/app/components/NotificationList.vue +0 -205
- package/dist/runtime/app/components/NotificationPrompt.vue +0 -133
- package/dist/runtime/app/components/PricingGated.vue +0 -81
- package/dist/runtime/app/components/PricingTable.vue +0 -274
- package/dist/runtime/app/components/RealtimeChat.vue +0 -164
- package/dist/runtime/app/components/RealtimePresence.vue +0 -129
- package/dist/runtime/app/components/RealtimeStatus.vue +0 -79
- package/dist/runtime/app/components/SubscriptionCard.vue +0 -207
- package/dist/runtime/app/components/UserProfile.vue +0 -558
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref, onMounted, onUnmounted } from "vue"
|
|
3
|
-
|
|
4
|
-
export interface TOCLink {
|
|
5
|
-
id: string
|
|
6
|
-
text: string
|
|
7
|
-
depth: number
|
|
8
|
-
children?: TOCLink[]
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const props = withDefaults(
|
|
12
|
-
defineProps<{
|
|
13
|
-
links: TOCLink[]
|
|
14
|
-
title?: string
|
|
15
|
-
}>(),
|
|
16
|
-
{
|
|
17
|
-
title: "Table of Contents",
|
|
18
|
-
},
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
const activeId = ref<string>("")
|
|
22
|
-
let observer: IntersectionObserver | null = null
|
|
23
|
-
|
|
24
|
-
onMounted(() => {
|
|
25
|
-
if (typeof window === "undefined" || !("IntersectionObserver" in window)) return
|
|
26
|
-
|
|
27
|
-
observer = new IntersectionObserver(
|
|
28
|
-
(entries) => {
|
|
29
|
-
for (const entry of entries) {
|
|
30
|
-
if (entry.isIntersecting) {
|
|
31
|
-
activeId.value = entry.target.id
|
|
32
|
-
break
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
{ rootMargin: "0px 0px -60% 0px" },
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
for (const link of props.links) {
|
|
40
|
-
const el = document.querySelector(`[id="${link.id}"]`)
|
|
41
|
-
if (el) observer.observe(el)
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
onUnmounted(() => {
|
|
46
|
-
observer?.disconnect()
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
function scrollTo(id: string) {
|
|
50
|
-
const el = document.querySelector(`#${id}`)
|
|
51
|
-
if (el) {
|
|
52
|
-
el.scrollIntoView({ behavior: "smooth" })
|
|
53
|
-
activeId.value = id
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
</script>
|
|
57
|
-
|
|
58
|
-
<template>
|
|
59
|
-
<nav v-if="links && links.length > 0" class="qarpeo-toc space-y-2">
|
|
60
|
-
<p class="text-xs font-bold uppercase tracking-wider text-neutral-400">
|
|
61
|
-
{{ title }}
|
|
62
|
-
</p>
|
|
63
|
-
<ul class="space-y-1.5 text-xs">
|
|
64
|
-
<li
|
|
65
|
-
v-for="link in links"
|
|
66
|
-
:key="link.id"
|
|
67
|
-
:style="{ paddingLeft: `${(link.depth - 2) * 12}px` }"
|
|
68
|
-
>
|
|
69
|
-
<a
|
|
70
|
-
:href="`#${link.id}`"
|
|
71
|
-
class="block transition hover:text-neutral-900 dark:hover:text-white"
|
|
72
|
-
:class="
|
|
73
|
-
activeId === link.id
|
|
74
|
-
? 'font-semibold text-primary-600 dark:text-primary-400'
|
|
75
|
-
: 'text-neutral-500 dark:text-neutral-400'
|
|
76
|
-
"
|
|
77
|
-
@click.prevent="scrollTo(link.id)"
|
|
78
|
-
>
|
|
79
|
-
{{ link.text }}
|
|
80
|
-
</a>
|
|
81
|
-
</li>
|
|
82
|
-
</ul>
|
|
83
|
-
</nav>
|
|
84
|
-
</template>
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed } from "vue"
|
|
3
|
-
|
|
4
|
-
import { useDocsVersion } from "../composables/docs-version"
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* `<CMSVersionBanner>` / `<DocsVersionBanner>` — Warning banner displayed when a reader is viewing
|
|
8
|
-
* an archived or legacy documentation version. Provides a one-click link to the equivalent page in
|
|
9
|
-
* the latest version.
|
|
10
|
-
*/
|
|
11
|
-
withDefaults(
|
|
12
|
-
defineProps<{
|
|
13
|
-
class?: string
|
|
14
|
-
}>(),
|
|
15
|
-
{
|
|
16
|
-
class: "",
|
|
17
|
-
},
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
const { isLatest, activeVersionItem, getVersionPath } = useDocsVersion()
|
|
21
|
-
const latestUrl = computed(() => getVersionPath("latest"))
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
<template>
|
|
25
|
-
<div
|
|
26
|
-
v-if="!isLatest"
|
|
27
|
-
:class="[
|
|
28
|
-
'rounded-lg border border-amber-300/80 dark:border-amber-700/60 bg-amber-50/90 dark:bg-amber-950/30 p-3.5 text-xs text-amber-900 dark:text-amber-200 mb-6 flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2 shadow-xs',
|
|
29
|
-
$props.class,
|
|
30
|
-
]"
|
|
31
|
-
role="alert"
|
|
32
|
-
aria-live="polite"
|
|
33
|
-
>
|
|
34
|
-
<div class="flex items-center gap-2">
|
|
35
|
-
<span class="text-base leading-none">⚠️</span>
|
|
36
|
-
<span>
|
|
37
|
-
You are viewing archived documentation for
|
|
38
|
-
<strong class="font-semibold">{{ activeVersionItem.label }}</strong>. This version may be
|
|
39
|
-
outdated.
|
|
40
|
-
</span>
|
|
41
|
-
</div>
|
|
42
|
-
<UButton
|
|
43
|
-
:to="latestUrl"
|
|
44
|
-
size="xs"
|
|
45
|
-
color="warning"
|
|
46
|
-
variant="subtle"
|
|
47
|
-
class="shrink-0"
|
|
48
|
-
trailing-icon="i-lucide-arrow-right"
|
|
49
|
-
>
|
|
50
|
-
Switch to latest version
|
|
51
|
-
</UButton>
|
|
52
|
-
</div>
|
|
53
|
-
</template>
|
|
@@ -1,140 +0,0 @@
|
|
|
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,411 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, ref } from "vue"
|
|
3
|
-
|
|
4
|
-
import { useComments, type CommentItem } from "../composables/comments"
|
|
5
|
-
|
|
6
|
-
const props = withDefaults(
|
|
7
|
-
defineProps<{
|
|
8
|
-
/** Universal Resource Name of target (e.g. "urn:cms:blog:my-post" or "urn:product:123") */
|
|
9
|
-
targetUrn?: string
|
|
10
|
-
/** Optional CMS entry identifier alias (resolves to urn:cms:entry:<id>) */
|
|
11
|
-
entryId?: string
|
|
12
|
-
title?: string
|
|
13
|
-
allowReplies?: boolean
|
|
14
|
-
allowReactions?: boolean
|
|
15
|
-
reactions?: string[]
|
|
16
|
-
allowReports?: boolean
|
|
17
|
-
placeholder?: string
|
|
18
|
-
}>(),
|
|
19
|
-
{
|
|
20
|
-
title: "Discussion",
|
|
21
|
-
allowReplies: true,
|
|
22
|
-
allowReactions: true,
|
|
23
|
-
reactions: () => ["like", "heart", "fire"],
|
|
24
|
-
allowReports: true,
|
|
25
|
-
placeholder: "Share your thoughts or ask a question...",
|
|
26
|
-
},
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
const resolvedUrn = computed(() => {
|
|
30
|
-
if (props.targetUrn) return props.targetUrn
|
|
31
|
-
if (props.entryId) {
|
|
32
|
-
return props.entryId.startsWith("urn:") ? props.entryId : `urn:cms:entry:${props.entryId}`
|
|
33
|
-
}
|
|
34
|
-
return ""
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
const { comments, loading, error, postComment, deleteComment, reportComment, react } =
|
|
38
|
-
useComments(() => resolvedUrn.value)
|
|
39
|
-
|
|
40
|
-
const authorName = ref("")
|
|
41
|
-
const authorEmail = ref("")
|
|
42
|
-
const newContent = ref("")
|
|
43
|
-
const replyToId = ref<string | null>(null)
|
|
44
|
-
const replyContent = ref("")
|
|
45
|
-
const replyAuthorName = ref("")
|
|
46
|
-
const submitting = ref(false)
|
|
47
|
-
const reportingId = ref<string | null>(null)
|
|
48
|
-
const reportReason = ref<"spam" | "harassment" | "off-topic" | "misinformation" | "other">("spam")
|
|
49
|
-
const reportNote = ref("")
|
|
50
|
-
|
|
51
|
-
const reactionIcons: Record<string, string> = {
|
|
52
|
-
like: "👍",
|
|
53
|
-
heart: "❤️",
|
|
54
|
-
fire: "🔥",
|
|
55
|
-
unicorn: "🦄",
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
async function handleRootSubmit() {
|
|
59
|
-
if (!newContent.value.trim() || !authorName.value.trim()) return
|
|
60
|
-
submitting.value = true
|
|
61
|
-
try {
|
|
62
|
-
await postComment({
|
|
63
|
-
content: newContent.value.trim(),
|
|
64
|
-
authorName: authorName.value.trim(),
|
|
65
|
-
authorEmail: authorEmail.value.trim() || undefined,
|
|
66
|
-
})
|
|
67
|
-
newContent.value = ""
|
|
68
|
-
} finally {
|
|
69
|
-
submitting.value = false
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
async function handleReplySubmit(parentId: string) {
|
|
74
|
-
if (!replyContent.value.trim() || !replyAuthorName.value.trim()) return
|
|
75
|
-
submitting.value = true
|
|
76
|
-
try {
|
|
77
|
-
await postComment({
|
|
78
|
-
parentId,
|
|
79
|
-
content: replyContent.value.trim(),
|
|
80
|
-
authorName: replyAuthorName.value.trim(),
|
|
81
|
-
})
|
|
82
|
-
replyContent.value = ""
|
|
83
|
-
replyToId.value = null
|
|
84
|
-
} finally {
|
|
85
|
-
submitting.value = false
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
async function submitReport(commentId: string) {
|
|
90
|
-
await reportComment(commentId, reportReason.value, reportNote.value || undefined)
|
|
91
|
-
reportingId.value = null
|
|
92
|
-
reportNote.value = ""
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function formatDate(ms: number): string {
|
|
96
|
-
if (!ms) return ""
|
|
97
|
-
return new Date(ms).toLocaleDateString(undefined, {
|
|
98
|
-
year: "numeric",
|
|
99
|
-
month: "short",
|
|
100
|
-
day: "numeric",
|
|
101
|
-
})
|
|
102
|
-
}
|
|
103
|
-
</script>
|
|
104
|
-
|
|
105
|
-
<template>
|
|
106
|
-
<section class="qarpeo-comments space-y-6">
|
|
107
|
-
<div class="flex items-center justify-between border-b pb-3 dark:border-neutral-800">
|
|
108
|
-
<h3 class="text-lg font-bold text-neutral-900 dark:text-neutral-100">
|
|
109
|
-
{{ title }}
|
|
110
|
-
<span class="ml-1 text-sm font-normal text-neutral-500">({{ comments.length }})</span>
|
|
111
|
-
</h3>
|
|
112
|
-
</div>
|
|
113
|
-
|
|
114
|
-
<!-- Main Comment Form -->
|
|
115
|
-
<form
|
|
116
|
-
class="space-y-3 rounded-xl border border-neutral-200 bg-neutral-50/50 p-4 dark:border-neutral-800 dark:bg-neutral-900/50"
|
|
117
|
-
@submit.prevent="handleRootSubmit"
|
|
118
|
-
>
|
|
119
|
-
<div class="grid grid-cols-1 gap-3 sm:grid-cols-2">
|
|
120
|
-
<input
|
|
121
|
-
v-model="authorName"
|
|
122
|
-
type="text"
|
|
123
|
-
placeholder="Your name *"
|
|
124
|
-
required
|
|
125
|
-
class="w-full rounded-lg border border-neutral-300 bg-white px-3 py-2 text-sm outline-none focus:border-neutral-900 focus:ring-1 focus:ring-neutral-900 dark:border-neutral-700 dark:bg-neutral-800 dark:text-neutral-100"
|
|
126
|
-
/>
|
|
127
|
-
<input
|
|
128
|
-
v-model="authorEmail"
|
|
129
|
-
type="email"
|
|
130
|
-
placeholder="Your email (optional)"
|
|
131
|
-
class="w-full rounded-lg border border-neutral-300 bg-white px-3 py-2 text-sm outline-none focus:border-neutral-900 focus:ring-1 focus:ring-neutral-900 dark:border-neutral-700 dark:bg-neutral-800 dark:text-neutral-100"
|
|
132
|
-
/>
|
|
133
|
-
</div>
|
|
134
|
-
|
|
135
|
-
<textarea
|
|
136
|
-
v-model="newContent"
|
|
137
|
-
rows="3"
|
|
138
|
-
:placeholder="placeholder"
|
|
139
|
-
required
|
|
140
|
-
class="w-full rounded-lg border border-neutral-300 bg-white p-3 text-sm outline-none focus:border-neutral-900 focus:ring-1 focus:ring-neutral-900 dark:border-neutral-700 dark:bg-neutral-800 dark:text-neutral-100"
|
|
141
|
-
/>
|
|
142
|
-
|
|
143
|
-
<div class="flex items-center justify-between">
|
|
144
|
-
<span v-if="error" class="text-xs text-red-500">
|
|
145
|
-
{{ error.message || "Failed to post comment" }}
|
|
146
|
-
</span>
|
|
147
|
-
<span v-else />
|
|
148
|
-
|
|
149
|
-
<button
|
|
150
|
-
type="submit"
|
|
151
|
-
:disabled="submitting || !newContent.trim() || !authorName.trim()"
|
|
152
|
-
class="rounded-lg bg-neutral-900 px-4 py-2 text-xs font-semibold text-white transition hover:bg-neutral-800 disabled:opacity-50 dark:bg-white dark:text-neutral-900 dark:hover:bg-neutral-200"
|
|
153
|
-
>
|
|
154
|
-
{{ submitting ? "Posting..." : "Post Comment" }}
|
|
155
|
-
</button>
|
|
156
|
-
</div>
|
|
157
|
-
</form>
|
|
158
|
-
|
|
159
|
-
<!-- Comments List -->
|
|
160
|
-
<div v-if="loading && comments.length === 0" class="py-6 text-center text-sm text-neutral-500">
|
|
161
|
-
Loading comments...
|
|
162
|
-
</div>
|
|
163
|
-
|
|
164
|
-
<div v-else-if="comments.length === 0" class="py-6 text-center text-sm text-neutral-500">
|
|
165
|
-
No comments yet. Be the first to start the conversation!
|
|
166
|
-
</div>
|
|
167
|
-
|
|
168
|
-
<div v-else class="space-y-4">
|
|
169
|
-
<!-- Recursive or flattened tree renderer -->
|
|
170
|
-
<template v-for="comment in comments" :key="comment.id">
|
|
171
|
-
<div
|
|
172
|
-
class="space-y-3 rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900"
|
|
173
|
-
>
|
|
174
|
-
<!-- Comment Header -->
|
|
175
|
-
<div class="flex items-center justify-between">
|
|
176
|
-
<div class="flex items-center gap-2.5">
|
|
177
|
-
<img
|
|
178
|
-
v-if="comment.authorAvatar"
|
|
179
|
-
:src="comment.authorAvatar"
|
|
180
|
-
alt="Avatar"
|
|
181
|
-
class="h-8 w-8 rounded-full"
|
|
182
|
-
/>
|
|
183
|
-
<div
|
|
184
|
-
v-else
|
|
185
|
-
class="flex h-8 w-8 items-center justify-center rounded-full bg-neutral-200 text-xs font-bold text-neutral-700 dark:bg-neutral-700 dark:text-neutral-200"
|
|
186
|
-
>
|
|
187
|
-
{{ (comment.authorName || "A")[0]?.toUpperCase() }}
|
|
188
|
-
</div>
|
|
189
|
-
<div>
|
|
190
|
-
<p class="text-sm font-semibold text-neutral-900 dark:text-neutral-100">
|
|
191
|
-
{{ comment.authorName }}
|
|
192
|
-
</p>
|
|
193
|
-
<p class="text-xs text-neutral-500">
|
|
194
|
-
{{ formatDate(comment.createdAt) }}
|
|
195
|
-
</p>
|
|
196
|
-
</div>
|
|
197
|
-
</div>
|
|
198
|
-
|
|
199
|
-
<!-- Actions Menu -->
|
|
200
|
-
<div class="flex items-center gap-2">
|
|
201
|
-
<button
|
|
202
|
-
v-if="allowReports && comment.status !== 'deleted'"
|
|
203
|
-
type="button"
|
|
204
|
-
class="text-xs text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-300"
|
|
205
|
-
@click="reportingId = reportingId === comment.id ? null : comment.id"
|
|
206
|
-
>
|
|
207
|
-
Report
|
|
208
|
-
</button>
|
|
209
|
-
<button
|
|
210
|
-
type="button"
|
|
211
|
-
class="text-xs text-neutral-400 hover:text-red-600"
|
|
212
|
-
@click="deleteComment(comment.id)"
|
|
213
|
-
>
|
|
214
|
-
Delete
|
|
215
|
-
</button>
|
|
216
|
-
</div>
|
|
217
|
-
</div>
|
|
218
|
-
|
|
219
|
-
<!-- Report Dropdown/Modal inline -->
|
|
220
|
-
<div
|
|
221
|
-
v-if="reportingId === comment.id"
|
|
222
|
-
class="space-y-2 rounded-lg border border-red-200 bg-red-50 p-3 dark:border-red-900/50 dark:bg-red-950/30"
|
|
223
|
-
>
|
|
224
|
-
<p class="text-xs font-semibold text-red-800 dark:text-red-300">
|
|
225
|
-
Report this comment
|
|
226
|
-
</p>
|
|
227
|
-
<div class="flex flex-wrap gap-2">
|
|
228
|
-
<label
|
|
229
|
-
v-for="r in ['spam', 'harassment', 'off-topic', 'misinformation', 'other'] as const"
|
|
230
|
-
:key="r"
|
|
231
|
-
class="flex items-center gap-1 text-xs"
|
|
232
|
-
>
|
|
233
|
-
<input v-model="reportReason" type="radio" :value="r" />
|
|
234
|
-
<span class="capitalize">{{ r }}</span>
|
|
235
|
-
</label>
|
|
236
|
-
</div>
|
|
237
|
-
<input
|
|
238
|
-
v-model="reportNote"
|
|
239
|
-
type="text"
|
|
240
|
-
placeholder="Additional details (optional)"
|
|
241
|
-
class="w-full rounded border border-red-300 bg-white px-2 py-1 text-xs outline-none dark:border-red-800 dark:bg-neutral-900"
|
|
242
|
-
/>
|
|
243
|
-
<div class="flex justify-end gap-2">
|
|
244
|
-
<button
|
|
245
|
-
type="button"
|
|
246
|
-
class="text-xs text-neutral-600 dark:text-neutral-400"
|
|
247
|
-
@click="reportingId = null"
|
|
248
|
-
>
|
|
249
|
-
Cancel
|
|
250
|
-
</button>
|
|
251
|
-
<button
|
|
252
|
-
type="button"
|
|
253
|
-
class="rounded bg-red-600 px-2.5 py-1 text-xs font-semibold text-white"
|
|
254
|
-
@click="submitReport(comment.id)"
|
|
255
|
-
>
|
|
256
|
-
Submit Report
|
|
257
|
-
</button>
|
|
258
|
-
</div>
|
|
259
|
-
</div>
|
|
260
|
-
|
|
261
|
-
<!-- Comment Body -->
|
|
262
|
-
<p
|
|
263
|
-
class="text-sm leading-relaxed"
|
|
264
|
-
:class="
|
|
265
|
-
comment.status === 'deleted'
|
|
266
|
-
? 'italic text-neutral-400'
|
|
267
|
-
: 'text-neutral-800 dark:text-neutral-200'
|
|
268
|
-
"
|
|
269
|
-
>
|
|
270
|
-
{{ comment.content }}
|
|
271
|
-
</p>
|
|
272
|
-
|
|
273
|
-
<!-- Reactions & Reply Button -->
|
|
274
|
-
<div class="flex flex-wrap items-center justify-between gap-2 pt-1">
|
|
275
|
-
<!-- Reactions -->
|
|
276
|
-
<div v-if="allowReactions && comment.status !== 'deleted'" class="flex flex-wrap items-center gap-1.5">
|
|
277
|
-
<button
|
|
278
|
-
v-for="rx in reactions"
|
|
279
|
-
:key="rx"
|
|
280
|
-
type="button"
|
|
281
|
-
class="flex items-center gap-1 rounded-full border border-neutral-200 bg-neutral-50 px-2.5 py-1 text-xs transition hover:bg-neutral-100 dark:border-neutral-700 dark:bg-neutral-800 dark:hover:bg-neutral-700"
|
|
282
|
-
@click="react(comment.id, rx)"
|
|
283
|
-
>
|
|
284
|
-
<span>{{ reactionIcons[rx] || rx }}</span>
|
|
285
|
-
<span v-if="comment.reactionCounts?.[rx]" class="font-medium text-neutral-700 dark:text-neutral-300">
|
|
286
|
-
{{ comment.reactionCounts[rx] }}
|
|
287
|
-
</span>
|
|
288
|
-
</button>
|
|
289
|
-
</div>
|
|
290
|
-
<div v-else />
|
|
291
|
-
|
|
292
|
-
<!-- Reply Button -->
|
|
293
|
-
<button
|
|
294
|
-
v-if="allowReplies && comment.status !== 'deleted'"
|
|
295
|
-
type="button"
|
|
296
|
-
class="text-xs font-medium text-neutral-600 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100"
|
|
297
|
-
@click="replyToId = replyToId === comment.id ? null : comment.id"
|
|
298
|
-
>
|
|
299
|
-
{{ replyToId === comment.id ? "Cancel Reply" : "Reply" }}
|
|
300
|
-
</button>
|
|
301
|
-
</div>
|
|
302
|
-
|
|
303
|
-
<!-- Inline Reply Box -->
|
|
304
|
-
<div
|
|
305
|
-
v-if="replyToId === comment.id"
|
|
306
|
-
class="mt-3 space-y-2 rounded-lg border border-neutral-200 bg-neutral-50 p-3 dark:border-neutral-800 dark:bg-neutral-900"
|
|
307
|
-
>
|
|
308
|
-
<input
|
|
309
|
-
v-model="replyAuthorName"
|
|
310
|
-
type="text"
|
|
311
|
-
placeholder="Your name *"
|
|
312
|
-
required
|
|
313
|
-
class="w-full rounded border border-neutral-300 bg-white px-2 py-1 text-xs outline-none focus:border-neutral-900 dark:border-neutral-700 dark:bg-neutral-800"
|
|
314
|
-
/>
|
|
315
|
-
<textarea
|
|
316
|
-
v-model="replyContent"
|
|
317
|
-
rows="2"
|
|
318
|
-
placeholder="Write your reply..."
|
|
319
|
-
class="w-full rounded border border-neutral-300 bg-white p-2 text-xs outline-none focus:border-neutral-900 dark:border-neutral-700 dark:bg-neutral-800"
|
|
320
|
-
/>
|
|
321
|
-
<div class="flex justify-end">
|
|
322
|
-
<button
|
|
323
|
-
type="button"
|
|
324
|
-
:disabled="submitting || !replyContent.trim() || !replyAuthorName.trim()"
|
|
325
|
-
class="rounded bg-neutral-900 px-3 py-1.5 text-xs font-semibold text-white disabled:opacity-50 dark:bg-white dark:text-neutral-900"
|
|
326
|
-
@click="handleReplySubmit(comment.id)"
|
|
327
|
-
>
|
|
328
|
-
{{ submitting ? "Posting..." : "Post Reply" }}
|
|
329
|
-
</button>
|
|
330
|
-
</div>
|
|
331
|
-
</div>
|
|
332
|
-
|
|
333
|
-
<!-- Nested Replies (Level 1+) -->
|
|
334
|
-
<div
|
|
335
|
-
v-if="comment.replies && comment.replies.length > 0"
|
|
336
|
-
class="mt-3 space-y-3 border-l-2 border-neutral-200 pl-4 dark:border-neutral-800"
|
|
337
|
-
>
|
|
338
|
-
<div
|
|
339
|
-
v-for="reply in comment.replies"
|
|
340
|
-
:key="reply.id"
|
|
341
|
-
class="space-y-2 rounded-lg border border-neutral-100 bg-neutral-50/50 p-3 dark:border-neutral-800/60 dark:bg-neutral-900/30"
|
|
342
|
-
>
|
|
343
|
-
<div class="flex items-center justify-between">
|
|
344
|
-
<div class="flex items-center gap-2">
|
|
345
|
-
<img
|
|
346
|
-
v-if="reply.authorAvatar"
|
|
347
|
-
:src="reply.authorAvatar"
|
|
348
|
-
alt="Avatar"
|
|
349
|
-
class="h-6 w-6 rounded-full"
|
|
350
|
-
/>
|
|
351
|
-
<div
|
|
352
|
-
v-else
|
|
353
|
-
class="flex h-6 w-6 items-center justify-center rounded-full bg-neutral-200 text-[10px] font-bold text-neutral-700 dark:bg-neutral-700 dark:text-neutral-200"
|
|
354
|
-
>
|
|
355
|
-
{{ (reply.authorName || "A")[0]?.toUpperCase() }}
|
|
356
|
-
</div>
|
|
357
|
-
<div>
|
|
358
|
-
<p class="text-xs font-semibold text-neutral-900 dark:text-neutral-100">
|
|
359
|
-
{{ reply.authorName }}
|
|
360
|
-
</p>
|
|
361
|
-
<p class="text-[10px] text-neutral-500">
|
|
362
|
-
{{ formatDate(reply.createdAt) }}
|
|
363
|
-
</p>
|
|
364
|
-
</div>
|
|
365
|
-
</div>
|
|
366
|
-
|
|
367
|
-
<button
|
|
368
|
-
type="button"
|
|
369
|
-
class="text-[11px] text-neutral-400 hover:text-red-600"
|
|
370
|
-
@click="deleteComment(reply.id)"
|
|
371
|
-
>
|
|
372
|
-
Delete
|
|
373
|
-
</button>
|
|
374
|
-
</div>
|
|
375
|
-
|
|
376
|
-
<p
|
|
377
|
-
class="text-xs leading-relaxed"
|
|
378
|
-
:class="
|
|
379
|
-
reply.status === 'deleted'
|
|
380
|
-
? 'italic text-neutral-400'
|
|
381
|
-
: 'text-neutral-700 dark:text-neutral-300'
|
|
382
|
-
"
|
|
383
|
-
>
|
|
384
|
-
{{ reply.content }}
|
|
385
|
-
</p>
|
|
386
|
-
|
|
387
|
-
<!-- Reply Reactions -->
|
|
388
|
-
<div
|
|
389
|
-
v-if="allowReactions && reply.status !== 'deleted'"
|
|
390
|
-
class="flex flex-wrap items-center gap-1 pt-1"
|
|
391
|
-
>
|
|
392
|
-
<button
|
|
393
|
-
v-for="rx in reactions"
|
|
394
|
-
:key="rx"
|
|
395
|
-
type="button"
|
|
396
|
-
class="flex items-center gap-1 rounded-full border border-neutral-200 bg-white px-2 py-0.5 text-[11px] transition hover:bg-neutral-100 dark:border-neutral-700 dark:bg-neutral-800"
|
|
397
|
-
@click="react(reply.id, rx)"
|
|
398
|
-
>
|
|
399
|
-
<span>{{ reactionIcons[rx] || rx }}</span>
|
|
400
|
-
<span v-if="reply.reactionCounts?.[rx]" class="font-medium text-neutral-700 dark:text-neutral-300">
|
|
401
|
-
{{ reply.reactionCounts[rx] }}
|
|
402
|
-
</span>
|
|
403
|
-
</button>
|
|
404
|
-
</div>
|
|
405
|
-
</div>
|
|
406
|
-
</div>
|
|
407
|
-
</div>
|
|
408
|
-
</template>
|
|
409
|
-
</div>
|
|
410
|
-
</section>
|
|
411
|
-
</template>
|