@blogmcp/sdk 0.6.1 → 0.7.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/dist/consultations/channel-text.d.ts +118 -0
- package/dist/consultations/channel-text.js +40 -0
- package/dist/consultations/index.d.ts +28 -0
- package/dist/consultations/index.js +60 -0
- package/dist/consultations/messages.cs.d.ts +149 -0
- package/dist/consultations/messages.cs.js +143 -0
- package/dist/consultations/messages.d.ts +34 -0
- package/dist/consultations/messages.en.d.ts +143 -0
- package/dist/consultations/messages.en.js +141 -0
- package/dist/consultations/messages.js +48 -0
- package/dist/consultations/outcome.d.ts +121 -0
- package/dist/consultations/outcome.js +161 -0
- package/dist/consultations/public-config.d.ts +71 -0
- package/dist/consultations/public-config.js +104 -0
- package/dist/consultations/reader.d.ts +83 -0
- package/dist/consultations/reader.js +128 -0
- package/dist/consultations/routes.d.ts +214 -0
- package/dist/consultations/routes.js +149 -0
- package/dist/consultations/server/client-ip.d.ts +50 -0
- package/dist/consultations/server/client-ip.js +44 -0
- package/dist/consultations/server/contact.d.ts +23 -0
- package/dist/consultations/server/contact.js +138 -0
- package/dist/consultations/server/context.d.ts +246 -0
- package/dist/consultations/server/context.js +152 -0
- package/dist/consultations/server/cookie.d.ts +60 -0
- package/dist/consultations/server/cookie.js +57 -0
- package/dist/consultations/server/env.d.ts +20 -0
- package/dist/consultations/server/env.js +35 -0
- package/dist/consultations/server/http.d.ts +59 -0
- package/dist/consultations/server/http.js +64 -0
- package/dist/consultations/server/index.d.ts +37 -0
- package/dist/consultations/server/index.js +19 -0
- package/dist/consultations/server/origin.d.ts +39 -0
- package/dist/consultations/server/origin.js +31 -0
- package/dist/consultations/server/server.d.ts +106 -0
- package/dist/consultations/server/server.js +122 -0
- package/dist/consultations/server/session.d.ts +38 -0
- package/dist/consultations/server/session.js +210 -0
- package/dist/consultations/server/transport.d.ts +69 -0
- package/dist/consultations/server/transport.js +117 -0
- package/dist/consultations/server/turnstile.d.ts +44 -0
- package/dist/consultations/server/turnstile.js +31 -0
- package/dist/consultations/site.d.ts +100 -0
- package/dist/consultations/site.js +60 -0
- package/dist/consultations/submit-new.d.ts +103 -0
- package/dist/consultations/submit-new.js +72 -0
- package/dist/core/auth.d.ts +2 -2
- package/dist/core/client.d.ts +25 -4
- package/dist/core/client.js +35 -30
- package/dist/core/consultation-adapter.d.ts +2 -2
- package/dist/core/consultations.d.ts +1 -1
- package/dist/core/errors.d.ts +1 -1
- package/dist/core/errors.js +16 -15
- package/dist/core/index.d.ts +31 -31
- package/dist/core/index.js +35 -34
- package/dist/core/markdown.d.ts +1 -1
- package/dist/core/queries.d.ts +4 -1
- package/dist/core/queries.js +131 -86
- package/dist/core/review/format.d.ts +1 -1
- package/dist/core/review/index.d.ts +2 -2
- package/dist/core/seo.d.ts +1 -1
- package/dist/core/translations/cs.json.js +1 -1
- package/dist/core/translations/en.json.js +1 -1
- package/dist/core/types.d.ts +50 -1
- package/dist/core/view-model.d.ts +12 -2
- package/dist/core/view-model.js +40 -34
- package/dist/{packages/tripmap-core/node_modules → node_modules}/pmtiles/dist/esm/index.js +1 -1
- package/dist/nuxt/composables/useAsyncKb.d.ts +4 -4
- package/dist/nuxt/index.d.ts +1 -1
- package/dist/packages/tripmap-core/dist/engine.js +3 -3
- package/dist/packages/tripmap-core/dist/generated/maplibre-worker.bundle.js +1 -1
- package/dist/react/KbMdxContent.d.ts +1 -1
- package/dist/react/context.d.ts +4 -4
- package/dist/react/hooks/useImageRenderer.d.ts +1 -1
- package/dist/react/hooks/useKbClient.d.ts +1 -1
- package/dist/react/hooks/useKbContext.d.ts +1 -1
- package/dist/react/hooks/useKbI18n.d.ts +1 -1
- package/dist/react/hooks/useKbLanguage.d.ts +1 -1
- package/dist/react/hooks/useKbSearch.d.ts +1 -1
- package/dist/react/hooks/useMdxContent.d.ts +1 -1
- package/dist/react/index.d.ts +15 -15
- package/dist/react/provider.d.ts +2 -2
- package/dist/react/server/index.d.ts +2 -2
- package/dist/vue/components/KbAccessGate.vue.d.ts +4 -1
- package/dist/vue/components/KbAccessGate.vue.js +42 -32
- package/dist/vue/components/KbArticleCard.vue.d.ts +3 -1
- package/dist/vue/components/KbArticleCard.vue.js +67 -39
- package/dist/vue/composables/useArticles.d.ts +1 -1
- package/dist/vue/composables/useImageRenderer.d.ts +1 -1
- package/dist/vue/composables/useKbAuth.d.ts +1 -1
- package/dist/vue/composables/useKbClient.d.ts +1 -1
- package/dist/vue/composables/useKbComments.d.ts +1 -1
- package/dist/vue/composables/useKbI18n.d.ts +1 -1
- package/dist/vue/composables/useKbLanguage.d.ts +1 -1
- package/dist/vue/composables/useNavigation.d.ts +1 -1
- package/dist/vue/composables/useSearch.d.ts +1 -1
- package/dist/vue/composables/useTags.d.ts +1 -1
- package/dist/vue/index.d.ts +19 -19
- package/dist/vue/plugin.d.ts +4 -4
- package/package.json +15 -5
- package/src/consultations/channel-text.ts +168 -0
- package/src/consultations/index.ts +87 -0
- package/src/consultations/messages.cs.ts +175 -0
- package/src/consultations/messages.en.ts +171 -0
- package/src/consultations/messages.ts +91 -0
- package/src/consultations/outcome.ts +278 -0
- package/src/consultations/public-config.ts +246 -0
- package/src/consultations/reader.ts +281 -0
- package/src/consultations/routes.ts +341 -0
- package/src/consultations/server/client-ip.ts +106 -0
- package/src/consultations/server/contact.ts +267 -0
- package/src/consultations/server/context.ts +403 -0
- package/src/consultations/server/cookie.ts +129 -0
- package/src/consultations/server/env.ts +66 -0
- package/src/consultations/server/http.ts +148 -0
- package/src/consultations/server/index.ts +55 -0
- package/src/consultations/server/origin.ts +71 -0
- package/src/consultations/server/server.ts +322 -0
- package/src/consultations/server/session.ts +414 -0
- package/src/consultations/server/transport.ts +196 -0
- package/src/consultations/server/turnstile.ts +98 -0
- package/src/consultations/site.ts +183 -0
- package/src/consultations/submit-new.ts +266 -0
- package/src/core/auth.ts +1 -1
- package/src/core/client.ts +32 -1
- package/src/core/errors.ts +5 -2
- package/src/core/index.ts +3 -0
- package/src/core/queries.ts +56 -0
- package/src/core/translations/cs.json +2 -1
- package/src/core/translations/en.json +2 -1
- package/src/core/types.ts +51 -0
- package/src/core/view-model.ts +18 -0
- package/src/vue/components/KbAccessGate.vue +14 -1
- package/src/vue/components/KbArticleCard.vue +25 -0
- /package/dist/{packages/tripmap-core/node_modules → node_modules}/maplibre-gl/dist/maplibre-gl-shared.js +0 -0
- /package/dist/{packages/tripmap-core/node_modules → node_modules}/maplibre-gl/dist/maplibre-gl.js +0 -0
package/src/core/queries.ts
CHANGED
|
@@ -28,6 +28,32 @@ export const ACCESSIBLE_ARTICLES = `
|
|
|
28
28
|
}
|
|
29
29
|
`
|
|
30
30
|
|
|
31
|
+
// The same list plus the published premium/partners articles the caller may NOT open
|
|
32
|
+
// but the tenant shows (its locked-article preview is title or excerpt), flagged
|
|
33
|
+
// `locked` and carrying their tiers. A document of its own, so the default list keeps
|
|
34
|
+
// validating against a KB API that predates the field.
|
|
35
|
+
export const ACCESSIBLE_ARTICLES_WITH_LOCKED = `
|
|
36
|
+
query AccessibleArticlesWithLocked($status: String, $tags: [String!], $tagMode: String, $limit: Int, $offset: Int) {
|
|
37
|
+
accessibleKbArticles(status: $status, tags: $tags, tagMode: $tagMode, limit: $limit, offset: $offset, includeLocked: true) {
|
|
38
|
+
articles {
|
|
39
|
+
id
|
|
40
|
+
filename
|
|
41
|
+
title
|
|
42
|
+
description
|
|
43
|
+
contentType
|
|
44
|
+
status
|
|
45
|
+
publishedAt
|
|
46
|
+
updatedAt
|
|
47
|
+
tags
|
|
48
|
+
featuredImageUrl
|
|
49
|
+
access
|
|
50
|
+
locked
|
|
51
|
+
}
|
|
52
|
+
totalCount
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
`
|
|
56
|
+
|
|
31
57
|
// Field selection shared by the by-filename and by-id article queries, so both
|
|
32
58
|
// lookups always return the identical ArticleWithTranslation shape.
|
|
33
59
|
const ARTICLE_WITH_TRANSLATION_FIELDS = `
|
|
@@ -82,6 +108,34 @@ export const ARTICLE_WITH_TRANSLATION_BY_ID = `
|
|
|
82
108
|
}
|
|
83
109
|
`
|
|
84
110
|
|
|
111
|
+
// What a reader who may NOT open a published article sees of it — or null (also for a
|
|
112
|
+
// reader who can open it, and whenever the tenant hides locked articles). Never the body.
|
|
113
|
+
const ARTICLE_PREVIEW_FIELDS = `
|
|
114
|
+
id
|
|
115
|
+
filename
|
|
116
|
+
title
|
|
117
|
+
description
|
|
118
|
+
languageCode
|
|
119
|
+
isFallback
|
|
120
|
+
publishedAt
|
|
121
|
+
featuredImageUrl
|
|
122
|
+
requiredAccess
|
|
123
|
+
mode
|
|
124
|
+
excerpt
|
|
125
|
+
`
|
|
126
|
+
|
|
127
|
+
export const ARTICLE_PREVIEW = `
|
|
128
|
+
query ArticlePreview($filename: String!, $languageCode: String!) {
|
|
129
|
+
articlePreview(filename: $filename, languageCode: $languageCode) {${ARTICLE_PREVIEW_FIELDS}}
|
|
130
|
+
}
|
|
131
|
+
`
|
|
132
|
+
|
|
133
|
+
export const ARTICLE_PREVIEW_BY_ID = `
|
|
134
|
+
query ArticlePreviewById($id: ID!, $languageCode: String!) {
|
|
135
|
+
articlePreviewById(id: $id, languageCode: $languageCode) {${ARTICLE_PREVIEW_FIELDS}}
|
|
136
|
+
}
|
|
137
|
+
`
|
|
138
|
+
|
|
85
139
|
export const ARTICLE_ALIAS_TARGET = `
|
|
86
140
|
query ArticleAliasTarget($filename: String!) {
|
|
87
141
|
articleAliasTarget(filename: $filename)
|
|
@@ -486,6 +540,8 @@ export const CONSULTATION_PUBLIC_CONFIG = `
|
|
|
486
540
|
query ConsultationPublicConfig($locale: String!) {
|
|
487
541
|
consultationPublicConfig(locale: $locale) {
|
|
488
542
|
enabled
|
|
543
|
+
readerSiteUrl
|
|
544
|
+
emailNotices
|
|
489
545
|
channels {
|
|
490
546
|
channel
|
|
491
547
|
mode
|
|
@@ -167,7 +167,8 @@
|
|
|
167
167
|
"levelPublic": "Veřejné",
|
|
168
168
|
"levelPremium": "Premium",
|
|
169
169
|
"levelPartners": "Partneři",
|
|
170
|
-
"levelInternal": "Interní"
|
|
170
|
+
"levelInternal": "Interní",
|
|
171
|
+
"lockedFor": "Jen pro čtenáře úrovně {level}"
|
|
171
172
|
},
|
|
172
173
|
"footer": {
|
|
173
174
|
"copyright": "© {year} Znalostní báze. Všechna práva vyhrazena."
|
|
@@ -167,7 +167,8 @@
|
|
|
167
167
|
"levelPublic": "Public",
|
|
168
168
|
"levelPremium": "Premium",
|
|
169
169
|
"levelPartners": "Partners",
|
|
170
|
-
"levelInternal": "Internal"
|
|
170
|
+
"levelInternal": "Internal",
|
|
171
|
+
"lockedFor": "Only for {level} readers"
|
|
171
172
|
},
|
|
172
173
|
"footer": {
|
|
173
174
|
"copyright": "© {year} Knowledge Base. All rights reserved."
|
package/src/core/types.ts
CHANGED
|
@@ -44,6 +44,44 @@ export interface Article {
|
|
|
44
44
|
sourceLanguageCode?: string
|
|
45
45
|
featuredImageUrl?: string | null
|
|
46
46
|
tags?: string[]
|
|
47
|
+
/** Only from `articles.list({ includeLocked: true })`: the article's access tiers. */
|
|
48
|
+
access?: string[]
|
|
49
|
+
/**
|
|
50
|
+
* Only from `articles.list({ includeLocked: true })`: true when the caller may not open
|
|
51
|
+
* this article — it is listed because the tenant shows locked articles. Link it to the
|
|
52
|
+
* article page, which shows `articles.getPreview` instead of the article.
|
|
53
|
+
*/
|
|
54
|
+
locked?: boolean
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** What a locked article shows to a reader without access (the tenant's choice). */
|
|
58
|
+
export type LockedPreviewMode = 'title' | 'excerpt'
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* What a reader who may NOT open a published premium or partners article sees of it
|
|
62
|
+
* (`articles.getPreview`). Never the article body.
|
|
63
|
+
*/
|
|
64
|
+
export interface ArticlePreview {
|
|
65
|
+
id: string
|
|
66
|
+
filename: string
|
|
67
|
+
/** In `languageCode`. */
|
|
68
|
+
title: string
|
|
69
|
+
description: string | null
|
|
70
|
+
/** The language of title, description and excerpt (the source language as a fallback). */
|
|
71
|
+
languageCode: string
|
|
72
|
+
isFallback: boolean
|
|
73
|
+
publishedAt: string | null
|
|
74
|
+
/** Only when the image itself is public. */
|
|
75
|
+
featuredImageUrl: string | null
|
|
76
|
+
/** The lowest tier that opens the article. */
|
|
77
|
+
requiredAccess: 'premium' | 'partners'
|
|
78
|
+
mode: LockedPreviewMode
|
|
79
|
+
/**
|
|
80
|
+
* `excerpt` mode: the first words of the text, plain text — paragraphs separated by a
|
|
81
|
+
* blank line, ending with an ellipsis, never more than half the text. Render as text,
|
|
82
|
+
* never as HTML or Markdown. Null in `title` mode.
|
|
83
|
+
*/
|
|
84
|
+
excerpt: string | null
|
|
47
85
|
}
|
|
48
86
|
|
|
49
87
|
export interface ArticleWithTranslation {
|
|
@@ -347,6 +385,19 @@ export interface ConsultationChannelConfig {
|
|
|
347
385
|
|
|
348
386
|
export interface ConsultationPublicConfig {
|
|
349
387
|
enabled: boolean
|
|
388
|
+
/**
|
|
389
|
+
* The reader site the KB sends readers to (its links in notice e-mails), in
|
|
390
|
+
* canonical form (no trailing slash); null when none is set. A blog serves
|
|
391
|
+
* the reader pages only when this is the blog itself
|
|
392
|
+
* (`readerSiteStatus` in `@blogmcp/sdk/consultations`). Needs a KB with F4.
|
|
393
|
+
*/
|
|
394
|
+
readerSiteUrl: string | null
|
|
395
|
+
/**
|
|
396
|
+
* Answers reach readers by e-mail: the tenant's adapter sends them, or the KB
|
|
397
|
+
* has a mail transport. False: hide the anonymous contact form and the
|
|
398
|
+
* new-link page — nobody would ever be told about an answer.
|
|
399
|
+
*/
|
|
400
|
+
emailNotices: boolean
|
|
350
401
|
channels: ConsultationChannelConfig[]
|
|
351
402
|
}
|
|
352
403
|
|
package/src/core/view-model.ts
CHANGED
|
@@ -52,6 +52,18 @@ export function resolveArticleAccessLevel(
|
|
|
52
52
|
return ACCESS_LEVEL_ORDER[maxIndex] ?? 'public'
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
/**
|
|
56
|
+
* The lowest tier that opens a locked article (premium before partners) — what a locked
|
|
57
|
+
* card asks the reader for. Mirrors the KB API's rule; null when a public reader can open
|
|
58
|
+
* it or nobody outside the team can.
|
|
59
|
+
*/
|
|
60
|
+
export function lockedRequiredAccess(access: string[] | null | undefined): 'premium' | 'partners' | null {
|
|
61
|
+
if (!access || access.includes('public')) return null
|
|
62
|
+
if (access.includes('premium')) return 'premium'
|
|
63
|
+
if (access.includes('partners')) return 'partners'
|
|
64
|
+
return null
|
|
65
|
+
}
|
|
66
|
+
|
|
55
67
|
/** Render-ready view model for an article card / list item. */
|
|
56
68
|
export interface ArticleListItemVM {
|
|
57
69
|
slug: string
|
|
@@ -66,6 +78,10 @@ export interface ArticleListItemVM {
|
|
|
66
78
|
/** Localized human date, or null when no date is available. */
|
|
67
79
|
formattedDate: string | null
|
|
68
80
|
tags: { label: string; slug: string; href: string }[]
|
|
81
|
+
/** The reader may not open the article (listed with `includeLocked`): show a lock. */
|
|
82
|
+
locked: boolean
|
|
83
|
+
/** For a locked article, the tier that opens it; null otherwise. */
|
|
84
|
+
requiredAccess: 'premium' | 'partners' | null
|
|
69
85
|
}
|
|
70
86
|
|
|
71
87
|
export interface BuildArticleListItemOptions {
|
|
@@ -94,5 +110,7 @@ export function buildArticleListItem(opts: BuildArticleListItemOptions): Article
|
|
|
94
110
|
slug: tag,
|
|
95
111
|
href: localizedHref(`/topics/${tag}`, locale, config),
|
|
96
112
|
})),
|
|
113
|
+
locked: article.locked === true,
|
|
114
|
+
requiredAccess: article.locked === true ? lockedRequiredAccess(article.access) : null,
|
|
97
115
|
}
|
|
98
116
|
}
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Blocks content access for insufficient access levels.
|
|
6
6
|
* Provides state via slot props for custom rendering.
|
|
7
|
+
*
|
|
8
|
+
* Feed it `articles.getPreview(...)` to show what the tenant lets a reader without access
|
|
9
|
+
* see — the title and description, and in excerpt mode the first words of the article
|
|
10
|
+
* (plain text: rendered as text paragraphs, never as HTML).
|
|
7
11
|
*/
|
|
8
12
|
|
|
9
13
|
import { computed } from 'vue'
|
|
@@ -12,7 +16,7 @@ import { useKbAuth } from '../composables/useKbAuth'
|
|
|
12
16
|
import { useKbI18n } from '../composables/useKbI18n'
|
|
13
17
|
|
|
14
18
|
const props = defineProps<{
|
|
15
|
-
article: { title: string; description?: string | null }
|
|
19
|
+
article: { title: string; description?: string | null; excerpt?: string | null }
|
|
16
20
|
requiredLevel: AccessLevel
|
|
17
21
|
}>()
|
|
18
22
|
|
|
@@ -27,6 +31,11 @@ const t = useKbI18n()
|
|
|
27
31
|
|
|
28
32
|
const levelLabel = computed(() => t(`accessGate.level${capitalize(props.requiredLevel)}`))
|
|
29
33
|
|
|
34
|
+
/** The excerpt's paragraphs (separated by a blank line in the preview). */
|
|
35
|
+
const excerptParagraphs = computed(() =>
|
|
36
|
+
(props.article.excerpt ?? '').split(/\n\s*\n/).map((p) => p.trim()).filter(Boolean),
|
|
37
|
+
)
|
|
38
|
+
|
|
30
39
|
function capitalize(s: string): string {
|
|
31
40
|
return s.charAt(0).toUpperCase() + s.slice(1)
|
|
32
41
|
}
|
|
@@ -38,6 +47,7 @@ function capitalize(s: string): string {
|
|
|
38
47
|
:required-level="requiredLevel"
|
|
39
48
|
:level-label="levelLabel"
|
|
40
49
|
:is-authenticated="isAuthenticated"
|
|
50
|
+
:excerpt-paragraphs="excerptParagraphs"
|
|
41
51
|
>
|
|
42
52
|
<!-- Default rendering -->
|
|
43
53
|
<div
|
|
@@ -51,6 +61,9 @@ function capitalize(s: string): string {
|
|
|
51
61
|
</div>
|
|
52
62
|
<h2 class="mt-6 text-2xl font-bold text-gray-900">{{ article.title }}</h2>
|
|
53
63
|
<p v-if="article.description" class="mt-2 text-gray-600">{{ article.description }}</p>
|
|
64
|
+
<div v-if="excerptParagraphs.length" data-testid="access-gate-excerpt" class="mt-6 space-y-3 text-left text-gray-700">
|
|
65
|
+
<p v-for="(paragraph, index) in excerptParagraphs" :key="index">{{ paragraph }}</p>
|
|
66
|
+
</div>
|
|
54
67
|
<p class="mt-6 text-gray-600">
|
|
55
68
|
<template v-if="!isAuthenticated">
|
|
56
69
|
{{ t('accessGate.signInToAccess', { level: levelLabel }) }}
|
|
@@ -5,10 +5,15 @@
|
|
|
5
5
|
* Provides article data and computed properties via slot props.
|
|
6
6
|
* Consumer controls rendering via the default slot.
|
|
7
7
|
* Falls back to a basic pre-styled card if no slot is provided.
|
|
8
|
+
*
|
|
9
|
+
* A locked article (from `articles.list({ includeLocked: true })`) carries a lock and the
|
|
10
|
+
* tier that opens it; its link still goes to the article page, which shows the gate.
|
|
8
11
|
*/
|
|
9
12
|
|
|
10
13
|
import { computed } from 'vue'
|
|
11
14
|
import type { Article } from '../../core/types'
|
|
15
|
+
import { lockedRequiredAccess } from '../../core/view-model'
|
|
16
|
+
import { useKbI18n } from '../composables/useKbI18n'
|
|
12
17
|
|
|
13
18
|
const props = withDefaults(defineProps<{
|
|
14
19
|
article: Article
|
|
@@ -31,6 +36,13 @@ const articleUrl = computed(() => `/articles/${slug.value}`)
|
|
|
31
36
|
|
|
32
37
|
const tags = computed(() => props.article.tags || [])
|
|
33
38
|
|
|
39
|
+
const t = useKbI18n()
|
|
40
|
+
const locked = computed(() => props.article.locked === true)
|
|
41
|
+
const requiredAccess = computed(() => (locked.value ? lockedRequiredAccess(props.article.access) : null))
|
|
42
|
+
const lockedLabel = computed(() =>
|
|
43
|
+
requiredAccess.value ? t(`accessGate.level${requiredAccess.value === 'premium' ? 'Premium' : 'Partners'}`) : null,
|
|
44
|
+
)
|
|
45
|
+
|
|
34
46
|
function formatDate(dateString: string): string {
|
|
35
47
|
const loc = props.locale === 'cs' ? 'cs-CZ' : 'en-US'
|
|
36
48
|
return new Date(dateString).toLocaleDateString(loc, {
|
|
@@ -55,6 +67,8 @@ const displayDate = computed(() => {
|
|
|
55
67
|
:display-date="displayDate"
|
|
56
68
|
:featured="featured"
|
|
57
69
|
:format-date="formatDate"
|
|
70
|
+
:locked="locked"
|
|
71
|
+
:required-access="requiredAccess"
|
|
58
72
|
>
|
|
59
73
|
<!-- Default rendering (basic card) -->
|
|
60
74
|
<article
|
|
@@ -85,6 +99,17 @@ const displayDate = computed(() => {
|
|
|
85
99
|
{{ tag }}
|
|
86
100
|
</span>
|
|
87
101
|
</div>
|
|
102
|
+
<span
|
|
103
|
+
v-if="locked"
|
|
104
|
+
data-testid="article-card-locked"
|
|
105
|
+
class="mb-2 inline-flex w-fit items-center gap-1 rounded-full bg-amber-50 px-2.5 py-0.5 text-xs font-medium text-amber-700"
|
|
106
|
+
:aria-label="t('accessGate.lockedFor', { level: lockedLabel ?? '' })"
|
|
107
|
+
>
|
|
108
|
+
<svg class="h-3.5 w-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
|
109
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
|
|
110
|
+
</svg>
|
|
111
|
+
{{ lockedLabel }}
|
|
112
|
+
</span>
|
|
88
113
|
<h3 :class="['font-semibold text-gray-900', featured ? 'text-xl md:text-2xl' : 'text-lg']">
|
|
89
114
|
<a :href="articleUrl" class="after:absolute after:inset-0">
|
|
90
115
|
{{ article.title }}
|
|
File without changes
|
/package/dist/{packages/tripmap-core/node_modules → node_modules}/maplibre-gl/dist/maplibre-gl.js
RENAMED
|
File without changes
|