rimelight-components 2.1.17 → 2.1.18
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/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/app/Footer.d.vue.ts +5 -1
- package/dist/runtime/components/app/Footer.vue +20 -12
- package/dist/runtime/components/app/Footer.vue.d.ts +5 -1
- package/dist/runtime/components/app/Header.d.vue.ts +5 -1
- package/dist/runtime/components/app/Header.vue +4 -2
- package/dist/runtime/components/app/Header.vue.d.ts +5 -1
- package/dist/runtime/components/app/HeaderLayer.d.vue.ts +5 -3
- package/dist/runtime/components/app/HeaderLayer.vue +11 -2
- package/dist/runtime/components/app/HeaderLayer.vue.d.ts +5 -3
- package/dist/runtime/components/app/Image.d.vue.ts +6 -4
- package/dist/runtime/components/app/Image.vue +27 -12
- package/dist/runtime/components/app/Image.vue.d.ts +6 -4
- package/dist/runtime/components/app/Logo.d.vue.ts +5 -3
- package/dist/runtime/components/app/Logo.vue +9 -1
- package/dist/runtime/components/app/Logo.vue.d.ts +5 -3
- package/dist/runtime/components/app/NewsletterSignup.d.vue.ts +5 -3
- package/dist/runtime/components/app/NewsletterSignup.vue +9 -1
- package/dist/runtime/components/app/NewsletterSignup.vue.d.ts +5 -3
- package/dist/runtime/components/app/ScrollToTop.d.vue.ts +4 -2
- package/dist/runtime/components/app/ScrollToTop.vue +17 -9
- package/dist/runtime/components/app/ScrollToTop.vue.d.ts +4 -2
- package/dist/runtime/components/blocks/Block.d.vue.ts +5 -3
- package/dist/runtime/components/blocks/Block.vue +16 -7
- package/dist/runtime/components/blocks/Block.vue.d.ts +5 -3
- package/dist/runtime/components/blocks/BlockEditRenderer.d.vue.ts +5 -3
- package/dist/runtime/components/blocks/BlockEditRenderer.vue +9 -1
- package/dist/runtime/components/blocks/BlockEditRenderer.vue.d.ts +5 -3
- package/dist/runtime/components/blocks/BlockEditor.vue +4 -33
- package/dist/runtime/components/blocks/BlockViewRenderer.d.vue.ts +5 -3
- package/dist/runtime/components/blocks/BlockViewRenderer.vue +9 -1
- package/dist/runtime/components/blocks/BlockViewRenderer.vue.d.ts +5 -3
- package/dist/runtime/components/blocks/TextRenderer.d.vue.ts +5 -3
- package/dist/runtime/components/blocks/TextRenderer.vue +8 -0
- package/dist/runtime/components/blocks/TextRenderer.vue.d.ts +5 -3
- package/dist/runtime/components/blocks/editor/CalloutBlockEditor.d.vue.ts +5 -1
- package/dist/runtime/components/blocks/editor/CalloutBlockEditor.vue +8 -0
- package/dist/runtime/components/blocks/editor/CalloutBlockEditor.vue.d.ts +5 -1
- package/dist/runtime/components/blocks/editor/CardBlockEditor.d.vue.ts +5 -1
- package/dist/runtime/components/blocks/editor/CardBlockEditor.vue +9 -1
- package/dist/runtime/components/blocks/editor/CardBlockEditor.vue.d.ts +5 -1
- package/dist/runtime/components/blocks/editor/ImageBlockEditor.d.vue.ts +11 -3
- package/dist/runtime/components/blocks/editor/ImageBlockEditor.vue +21 -9
- package/dist/runtime/components/blocks/editor/ImageBlockEditor.vue.d.ts +11 -3
- package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.d.vue.ts +5 -3
- package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.vue +11 -7
- package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.vue.d.ts +5 -3
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.d.vue.ts +5 -3
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.vue +15 -5
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.vue.d.ts +5 -3
- package/dist/runtime/components/blocks/editor/TestBlockEditor.d.vue.ts +5 -3
- package/dist/runtime/components/blocks/editor/TestBlockEditor.vue +11 -3
- package/dist/runtime/components/blocks/editor/TestBlockEditor.vue.d.ts +5 -3
- package/dist/runtime/components/blocks/renderer/CalloutBlockRenderer.d.vue.ts +5 -1
- package/dist/runtime/components/blocks/renderer/CalloutBlockRenderer.vue +8 -0
- package/dist/runtime/components/blocks/renderer/CalloutBlockRenderer.vue.d.ts +5 -1
- package/dist/runtime/components/blocks/renderer/CardBlockRenderer.d.vue.ts +5 -1
- package/dist/runtime/components/blocks/renderer/CardBlockRenderer.vue +9 -1
- package/dist/runtime/components/blocks/renderer/CardBlockRenderer.vue.d.ts +5 -1
- package/dist/runtime/components/blocks/renderer/ImageBlockRenderer.d.vue.ts +5 -1
- package/dist/runtime/components/blocks/renderer/ImageBlockRenderer.vue +13 -3
- package/dist/runtime/components/blocks/renderer/ImageBlockRenderer.vue.d.ts +5 -1
- package/dist/runtime/components/blocks/renderer/ParagraphBlockRenderer.d.vue.ts +5 -1
- package/dist/runtime/components/blocks/renderer/ParagraphBlockRenderer.vue +8 -0
- package/dist/runtime/components/blocks/renderer/ParagraphBlockRenderer.vue.d.ts +5 -1
- package/dist/runtime/components/blocks/renderer/SectionBlockRenderer.d.vue.ts +5 -1
- package/dist/runtime/components/blocks/renderer/SectionBlockRenderer.vue +8 -0
- package/dist/runtime/components/blocks/renderer/SectionBlockRenderer.vue.d.ts +5 -1
- package/dist/runtime/components/blocks/renderer/TestBlockRenderer.d.vue.ts +5 -1
- package/dist/runtime/components/blocks/renderer/TestBlockRenderer.vue +8 -0
- package/dist/runtime/components/blocks/renderer/TestBlockRenderer.vue.d.ts +5 -1
- package/dist/runtime/components/cards/TeamCard.d.vue.ts +5 -3
- package/dist/runtime/components/cards/TeamCard.vue +24 -6
- package/dist/runtime/components/cards/TeamCard.vue.d.ts +5 -3
- package/dist/runtime/components/content/Callout.d.vue.ts +5 -3
- package/dist/runtime/components/content/Callout.vue +11 -2
- package/dist/runtime/components/content/Callout.vue.d.ts +5 -3
- package/dist/runtime/components/content/Section.d.vue.ts +5 -3
- package/dist/runtime/components/content/Section.vue +87 -86
- package/dist/runtime/components/content/Section.vue.d.ts +5 -3
- package/dist/runtime/components/content/Test.d.vue.ts +5 -3
- package/dist/runtime/components/content/Test.vue +9 -1
- package/dist/runtime/components/content/Test.vue.d.ts +5 -3
- package/dist/runtime/components/nodes/LinkNode.d.vue.ts +5 -3
- package/dist/runtime/components/nodes/LinkNode.vue +11 -1
- package/dist/runtime/components/nodes/LinkNode.vue.d.ts +5 -3
- package/dist/runtime/components/nodes/TextNode.d.vue.ts +5 -3
- package/dist/runtime/components/nodes/TextNode.vue +9 -1
- package/dist/runtime/components/nodes/TextNode.vue.d.ts +5 -3
- package/dist/runtime/components/page/PageEditor.d.vue.ts +4 -1
- package/dist/runtime/components/page/PageEditor.vue +65 -28
- package/dist/runtime/components/page/PageEditor.vue.d.ts +4 -1
- package/dist/runtime/components/page/PageMention.d.vue.ts +3 -1
- package/dist/runtime/components/page/PageMention.vue +15 -4
- package/dist/runtime/components/page/PageMention.vue.d.ts +3 -1
- package/dist/runtime/components/page/PagePropertiesEditor.d.vue.ts +8 -2
- package/dist/runtime/components/page/PagePropertiesEditor.vue +50 -17
- package/dist/runtime/components/page/PagePropertiesEditor.vue.d.ts +8 -2
- package/dist/runtime/components/page/PagePropertiesRenderer.d.vue.ts +8 -2
- package/dist/runtime/components/page/PagePropertiesRenderer.vue +67 -20
- package/dist/runtime/components/page/PagePropertiesRenderer.vue.d.ts +8 -2
- package/dist/runtime/components/page/PageRenderer.d.vue.ts +3 -1
- package/dist/runtime/components/page/PageRenderer.vue +50 -16
- package/dist/runtime/components/page/PageRenderer.vue.d.ts +3 -1
- package/dist/runtime/components/page/PageSurround.d.vue.ts +5 -3
- package/dist/runtime/components/page/PageSurround.vue +54 -24
- package/dist/runtime/components/page/PageSurround.vue.d.ts +5 -3
- package/dist/runtime/components/page/PageTOC.d.vue.ts +5 -3
- package/dist/runtime/components/page/PageTOC.vue +17 -7
- package/dist/runtime/components/page/PageTOC.vue.d.ts +5 -3
- package/dist/runtime/components/page/modals/CreatePageModal.vue +27 -21
- package/dist/runtime/components/page/modals/DeletePageModal.vue +23 -6
- package/dist/runtime/components/swatches/ColorSwatch.d.vue.ts +5 -3
- package/dist/runtime/components/swatches/ColorSwatch.vue +25 -11
- package/dist/runtime/components/swatches/ColorSwatch.vue.d.ts +5 -3
- package/dist/runtime/components/swatches/FontSwatch.d.vue.ts +5 -3
- package/dist/runtime/components/swatches/FontSwatch.vue +23 -10
- package/dist/runtime/components/swatches/FontSwatch.vue.d.ts +5 -3
- package/dist/runtime/components/swatches/ImageSwatch.d.vue.ts +5 -3
- package/dist/runtime/components/swatches/ImageSwatch.vue +23 -10
- package/dist/runtime/components/swatches/ImageSwatch.vue.d.ts +5 -3
- package/dist/runtime/components/utilities/Placeholder.d.vue.ts +5 -1
- package/dist/runtime/components/utilities/Placeholder.vue +14 -5
- package/dist/runtime/components/utilities/Placeholder.vue.d.ts +5 -1
- package/package.json +1 -1
|
@@ -4,9 +4,20 @@ import { getLocalizedContent } from "../../utils";
|
|
|
4
4
|
import { useI18n } from "vue-i18n";
|
|
5
5
|
import {} from "../../types";
|
|
6
6
|
import { useAsyncData } from "#imports";
|
|
7
|
+
import { tv } from "tailwind-variants";
|
|
7
8
|
const { pageId } = defineProps({
|
|
8
9
|
pageId: { type: String, required: true }
|
|
9
10
|
});
|
|
11
|
+
const emit = defineEmits([]);
|
|
12
|
+
const pageMentionStyles = tv({
|
|
13
|
+
slots: {
|
|
14
|
+
link: "inline-flex items-baseline gap-1 align-middle hover:text-primary transition-colors font-medium text-inherit",
|
|
15
|
+
icon: "w-4 h-4 rounded-full object-cover shrink-0",
|
|
16
|
+
text: "truncate font-medium",
|
|
17
|
+
skeleton: "h-3 w-24"
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const { link, icon, text, skeleton } = pageMentionStyles();
|
|
10
21
|
const { locale } = useI18n();
|
|
11
22
|
const resolver = inject("page-resolver");
|
|
12
23
|
const { data: linkedPage, status } = await useAsyncData(`page-mention-${pageId}`, async () => {
|
|
@@ -26,17 +37,17 @@ const { data: linkedPage, status } = await useAsyncData(`page-mention-${pageId}`
|
|
|
26
37
|
<NuxtLink
|
|
27
38
|
v-if="linkedPage"
|
|
28
39
|
:to="`/${linkedPage.slug}`"
|
|
29
|
-
class="
|
|
40
|
+
:class="link()"
|
|
30
41
|
>
|
|
31
42
|
<NuxtImg
|
|
32
43
|
v-if="linkedPage.icon?.src"
|
|
33
44
|
:src="linkedPage.icon.src"
|
|
34
45
|
:alt="linkedPage.icon.alt"
|
|
35
|
-
class="
|
|
46
|
+
:class="icon()"
|
|
36
47
|
/>
|
|
37
|
-
<span class="
|
|
48
|
+
<span :class="text()">
|
|
38
49
|
{{ getLocalizedContent(linkedPage.title, locale) }}
|
|
39
50
|
</span>
|
|
40
51
|
</NuxtLink>
|
|
41
|
-
<USkeleton v-else-if="status === 'pending'" class="
|
|
52
|
+
<USkeleton v-else-if="status === 'pending'" :class="skeleton()" />
|
|
42
53
|
</template>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
interface PageMentionProps {
|
|
1
|
+
export interface PageMentionProps {
|
|
2
2
|
pageId: string;
|
|
3
3
|
}
|
|
4
|
+
export interface PageMentionEmits {
|
|
5
|
+
}
|
|
4
6
|
declare const __VLS_export: import("vue").DefineComponent<PageMentionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PageMentionProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
7
|
declare const _default: typeof __VLS_export;
|
|
6
8
|
export default _default;
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { type Page } from "../../types/index.js";
|
|
2
|
+
export interface PagePropertiesEditorProps {
|
|
3
|
+
}
|
|
4
|
+
type __VLS_Props = PagePropertiesEditorProps;
|
|
5
|
+
export interface PagePropertiesEditorEmits {
|
|
6
|
+
}
|
|
2
7
|
type __VLS_ModelProps = {
|
|
3
8
|
modelValue: Page;
|
|
4
9
|
};
|
|
5
|
-
|
|
10
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
12
|
"update:modelValue": (value: {
|
|
7
13
|
type: "Default";
|
|
8
14
|
properties: import("../../types/index.js").BasePageProperties;
|
|
9
15
|
} & import("../../types/index.js").BasePage) => any;
|
|
10
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
11
17
|
"onUpdate:modelValue"?: ((value: {
|
|
12
18
|
type: "Default";
|
|
13
19
|
properties: import("../../types/index.js").BasePageProperties;
|
|
@@ -5,6 +5,37 @@ import { usePageRegistry, useInfobox } from "../../composables";
|
|
|
5
5
|
import { getLocalizedContent } from "../../utils";
|
|
6
6
|
import {} from "@nuxt/ui/components/Tabs.vue";
|
|
7
7
|
import {} from "../../types";
|
|
8
|
+
import { tv } from "tailwind-variants";
|
|
9
|
+
const props = defineProps({});
|
|
10
|
+
const emit = defineEmits([]);
|
|
11
|
+
const pagePropertiesEditorStyles = tv({
|
|
12
|
+
slots: {
|
|
13
|
+
aside: "flex flex-col gap-md",
|
|
14
|
+
icon: "rounded-full w-12 h-12 object-cover",
|
|
15
|
+
titleInput: "w-full",
|
|
16
|
+
type: "text-sm",
|
|
17
|
+
tags: "flex flex-row flex-wrap gap-xs",
|
|
18
|
+
tabs: "w-full",
|
|
19
|
+
image: "w-full object-cover",
|
|
20
|
+
groupButton: "group rounded-none bg-elevated text-default",
|
|
21
|
+
details: "p-sm flex flex-col gap-xs",
|
|
22
|
+
field: "w-full",
|
|
23
|
+
links: "flex flex-col gap-xs"
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const {
|
|
27
|
+
aside,
|
|
28
|
+
icon,
|
|
29
|
+
titleInput,
|
|
30
|
+
type,
|
|
31
|
+
tags,
|
|
32
|
+
tabs,
|
|
33
|
+
image,
|
|
34
|
+
groupButton,
|
|
35
|
+
details,
|
|
36
|
+
field,
|
|
37
|
+
links
|
|
38
|
+
} = pagePropertiesEditorStyles();
|
|
8
39
|
const page = defineModel({ type: null, ...{ required: true } });
|
|
9
40
|
const { getTypeLabelKey } = usePageRegistry();
|
|
10
41
|
const { isFieldVisible, shouldRenderGroup, getSortedFields, getSortedGroups } = useInfobox(page.value.properties);
|
|
@@ -30,7 +61,7 @@ const updateTextArray = (schema, vals) => {
|
|
|
30
61
|
</script>
|
|
31
62
|
|
|
32
63
|
<template>
|
|
33
|
-
<aside class="
|
|
64
|
+
<aside :class="aside()">
|
|
34
65
|
<UCard
|
|
35
66
|
variant="soft"
|
|
36
67
|
:ui="{ root: 'divide-none', header: 'bg-accented text-center', body: 'p-0 sm:p-0 bg-muted' }"
|
|
@@ -41,7 +72,7 @@ const updateTextArray = (schema, vals) => {
|
|
|
41
72
|
v-if="page.icon?.src"
|
|
42
73
|
:src="page.icon?.src"
|
|
43
74
|
:alt="page.icon?.alt"
|
|
44
|
-
class="
|
|
75
|
+
:class="icon()"
|
|
45
76
|
/>
|
|
46
77
|
|
|
47
78
|
<UInput
|
|
@@ -50,12 +81,12 @@ const updateTextArray = (schema, vals) => {
|
|
|
50
81
|
placeholder="Enter page title..."
|
|
51
82
|
size="xl"
|
|
52
83
|
:ui="{ base: 'text-center font-bold text-lg' }"
|
|
53
|
-
class="
|
|
84
|
+
:class="titleInput()"
|
|
54
85
|
/>
|
|
55
86
|
|
|
56
|
-
<span class="
|
|
87
|
+
<span :class="type()">{{ t(getTypeLabelKey(page.type)) }}</span>
|
|
57
88
|
|
|
58
|
-
<div v-if="page.tags?.length" class="
|
|
89
|
+
<div v-if="page.tags?.length" :class="tags()">
|
|
59
90
|
<UBadge
|
|
60
91
|
v-for="tag in page.tags"
|
|
61
92
|
:key="tag[locale]"
|
|
@@ -75,10 +106,10 @@ const updateTextArray = (schema, vals) => {
|
|
|
75
106
|
variant="link"
|
|
76
107
|
size="xs"
|
|
77
108
|
color="neutral"
|
|
78
|
-
class="
|
|
109
|
+
:class="tabs()"
|
|
79
110
|
>
|
|
80
111
|
<template #content="{ item }">
|
|
81
|
-
<RCImage :src="item.img.src" :alt="item.img.alt" class="
|
|
112
|
+
<RCImage :src="item.img.src" :alt="item.img.alt" :class="image()" />
|
|
82
113
|
</template>
|
|
83
114
|
</UTabs>
|
|
84
115
|
|
|
@@ -86,7 +117,7 @@ const updateTextArray = (schema, vals) => {
|
|
|
86
117
|
<RCImage
|
|
87
118
|
:src="page.images[0].src"
|
|
88
119
|
:alt="page.images[0].alt"
|
|
89
|
-
class="
|
|
120
|
+
:class="image()"
|
|
90
121
|
/>
|
|
91
122
|
</div>
|
|
92
123
|
</div>
|
|
@@ -105,12 +136,13 @@ const updateTextArray = (schema, vals) => {
|
|
|
105
136
|
trailingIcon: 'group-data-[state=open]:rotate-180 transition-transform duration-200'
|
|
106
137
|
}"
|
|
107
138
|
block
|
|
108
|
-
class="
|
|
139
|
+
:class="groupButton()"
|
|
109
140
|
/>
|
|
110
141
|
</template>
|
|
111
142
|
|
|
112
143
|
<template #content>
|
|
113
|
-
<
|
|
144
|
+
<ClientOnly>
|
|
145
|
+
<dl :class="details()">
|
|
114
146
|
<template v-for="[fieldKey, schema] in getSortedFields(group.fields)" :key="fieldKey">
|
|
115
147
|
<UFormField
|
|
116
148
|
v-if="isFieldVisible(schema, false)"
|
|
@@ -122,7 +154,7 @@ const updateTextArray = (schema, vals) => {
|
|
|
122
154
|
v-model="schema.value.en"
|
|
123
155
|
variant="subtle"
|
|
124
156
|
placeholder="Type here..."
|
|
125
|
-
class="
|
|
157
|
+
:class="field()"
|
|
126
158
|
/>
|
|
127
159
|
|
|
128
160
|
<UInput
|
|
@@ -130,7 +162,7 @@ const updateTextArray = (schema, vals) => {
|
|
|
130
162
|
v-model.number="schema.value"
|
|
131
163
|
type="number"
|
|
132
164
|
variant="subtle"
|
|
133
|
-
class="
|
|
165
|
+
:class="field()"
|
|
134
166
|
/>
|
|
135
167
|
|
|
136
168
|
<USelect
|
|
@@ -138,7 +170,7 @@ const updateTextArray = (schema, vals) => {
|
|
|
138
170
|
v-model="schema.value"
|
|
139
171
|
:items="schema.options || []"
|
|
140
172
|
variant="subtle"
|
|
141
|
-
class="
|
|
173
|
+
:class="field()"
|
|
142
174
|
/>
|
|
143
175
|
|
|
144
176
|
<UInputMenu
|
|
@@ -149,7 +181,7 @@ const updateTextArray = (schema, vals) => {
|
|
|
149
181
|
creatable
|
|
150
182
|
variant="subtle"
|
|
151
183
|
placeholder="Add item..."
|
|
152
|
-
class="
|
|
184
|
+
:class="field()"
|
|
153
185
|
/>
|
|
154
186
|
|
|
155
187
|
<UInput
|
|
@@ -158,7 +190,7 @@ const updateTextArray = (schema, vals) => {
|
|
|
158
190
|
icon="lucide:link-2"
|
|
159
191
|
variant="subtle"
|
|
160
192
|
:placeholder="`Select ${schema.allowedPageTypes?.join('/')}`"
|
|
161
|
-
class="
|
|
193
|
+
:class="field()"
|
|
162
194
|
/>
|
|
163
195
|
|
|
164
196
|
<USelectMenu
|
|
@@ -167,17 +199,18 @@ const updateTextArray = (schema, vals) => {
|
|
|
167
199
|
icon="lucide:link-2"
|
|
168
200
|
variant="subtle"
|
|
169
201
|
:placeholder="`Select ${schema.allowedPageTypes?.join('/')}`"
|
|
170
|
-
class="
|
|
202
|
+
:class="field()"
|
|
171
203
|
/>
|
|
172
204
|
</UFormField>
|
|
173
205
|
</template>
|
|
174
206
|
</dl>
|
|
207
|
+
</ClientOnly>
|
|
175
208
|
</template>
|
|
176
209
|
</UCollapsible>
|
|
177
210
|
</template>
|
|
178
211
|
</template>
|
|
179
212
|
</UCard>
|
|
180
|
-
<div class="
|
|
213
|
+
<div :class="links()">
|
|
181
214
|
<h6>Links</h6>
|
|
182
215
|
<UButton
|
|
183
216
|
v-for="(link, index) in page.links"
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { type Page } from "../../types/index.js";
|
|
2
|
+
export interface PagePropertiesEditorProps {
|
|
3
|
+
}
|
|
4
|
+
type __VLS_Props = PagePropertiesEditorProps;
|
|
5
|
+
export interface PagePropertiesEditorEmits {
|
|
6
|
+
}
|
|
2
7
|
type __VLS_ModelProps = {
|
|
3
8
|
modelValue: Page;
|
|
4
9
|
};
|
|
5
|
-
|
|
10
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
12
|
"update:modelValue": (value: {
|
|
7
13
|
type: "Default";
|
|
8
14
|
properties: import("../../types/index.js").BasePageProperties;
|
|
9
15
|
} & import("../../types/index.js").BasePage) => any;
|
|
10
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
11
17
|
"onUpdate:modelValue"?: ((value: {
|
|
12
18
|
type: "Default";
|
|
13
19
|
properties: import("../../types/index.js").BasePageProperties;
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { type Page } from '../../types/index.js';
|
|
2
|
+
export interface PagePropertiesRendererProps {
|
|
3
|
+
}
|
|
4
|
+
type __VLS_Props = PagePropertiesRendererProps;
|
|
5
|
+
export interface PagePropertiesRendererEmits {
|
|
6
|
+
}
|
|
2
7
|
type __VLS_ModelProps = {
|
|
3
8
|
modelValue: Page;
|
|
4
9
|
};
|
|
5
|
-
|
|
10
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
12
|
"update:modelValue": (value: {
|
|
7
13
|
type: "Default";
|
|
8
14
|
properties: import("../../types/index.js").BasePageProperties;
|
|
9
15
|
} & import("../../types/index.js").BasePage) => any;
|
|
10
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
11
17
|
"onUpdate:modelValue"?: ((value: {
|
|
12
18
|
type: "Default";
|
|
13
19
|
properties: import("../../types/index.js").BasePageProperties;
|
|
@@ -7,6 +7,53 @@ import {} from "@nuxt/ui/components/Tabs.vue";
|
|
|
7
7
|
import { useI18n } from "vue-i18n";
|
|
8
8
|
import { useShare, useClipboard } from "@vueuse/core";
|
|
9
9
|
import {} from "../../types";
|
|
10
|
+
import { tv } from "tailwind-variants";
|
|
11
|
+
const props = defineProps({});
|
|
12
|
+
const emit = defineEmits([]);
|
|
13
|
+
const pagePropertiesRendererStyles = tv({
|
|
14
|
+
slots: {
|
|
15
|
+
aside: "flex flex-col gap-md",
|
|
16
|
+
actions: "flex flex-row flex-wrap gap-sm",
|
|
17
|
+
icon: "rounded-full w-12 h-12 object-cover",
|
|
18
|
+
title: "",
|
|
19
|
+
type: "text-sm",
|
|
20
|
+
tags: "flex flex-row flex-wrap gap-xs",
|
|
21
|
+
tabs: "w-full",
|
|
22
|
+
image: "w-full object-cover",
|
|
23
|
+
groupButton: "group rounded-none bg-elevated text-default",
|
|
24
|
+
details: "p-sm flex flex-col gap-xs",
|
|
25
|
+
field: "grid grid-cols-3 gap-xs items-baseline",
|
|
26
|
+
fieldLabel: "text-xs font-semibold text-dimmed",
|
|
27
|
+
fieldValue: "text-xs col-span-2",
|
|
28
|
+
list: "flex flex-wrap list-disc list-inside",
|
|
29
|
+
listItem: "font-medium",
|
|
30
|
+
pageArrayList: "flex flex-col gap-y-1",
|
|
31
|
+
pageArrayItem: "flex items-center gap-x-2",
|
|
32
|
+
pageArrayBullet: "w-1 h-1 rounded-full bg-inverted shrink-0",
|
|
33
|
+
links: "flex flex-col gap-xs"
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const {
|
|
37
|
+
aside,
|
|
38
|
+
actions,
|
|
39
|
+
icon,
|
|
40
|
+
title: titleClass,
|
|
41
|
+
type,
|
|
42
|
+
tags,
|
|
43
|
+
tabs,
|
|
44
|
+
image,
|
|
45
|
+
groupButton,
|
|
46
|
+
details,
|
|
47
|
+
field,
|
|
48
|
+
fieldLabel,
|
|
49
|
+
fieldValue,
|
|
50
|
+
list,
|
|
51
|
+
listItem,
|
|
52
|
+
pageArrayList,
|
|
53
|
+
pageArrayItem,
|
|
54
|
+
pageArrayBullet,
|
|
55
|
+
links
|
|
56
|
+
} = pagePropertiesRendererStyles();
|
|
10
57
|
const page = defineModel({ type: null, ...{ required: true } });
|
|
11
58
|
const { getTypeLabelKey } = usePageRegistry();
|
|
12
59
|
const { isFieldVisible, shouldRenderGroup, getSortedFields, getSortedGroups } = useInfobox(page.value.properties);
|
|
@@ -62,8 +109,8 @@ const imageTabs = computed(() => {
|
|
|
62
109
|
</script>
|
|
63
110
|
|
|
64
111
|
<template>
|
|
65
|
-
<aside class="
|
|
66
|
-
<div class="
|
|
112
|
+
<aside :class="aside()">
|
|
113
|
+
<div :class="actions()">
|
|
67
114
|
<UButton variant="soft" color="neutral" icon="lucide:share" size="sm" @click="sharePage()" />
|
|
68
115
|
<UButton variant="soft" color="neutral" icon="lucide:link" size="sm" @click="copyLink()" />
|
|
69
116
|
</div>
|
|
@@ -77,16 +124,16 @@ const imageTabs = computed(() => {
|
|
|
77
124
|
v-if="page.icon?.src"
|
|
78
125
|
:src="page.icon?.src"
|
|
79
126
|
:alt="page.icon?.alt"
|
|
80
|
-
class="
|
|
127
|
+
:class="icon()"
|
|
81
128
|
/>
|
|
82
129
|
|
|
83
|
-
<h3>
|
|
130
|
+
<h3 :class="titleClass()">
|
|
84
131
|
{{ getLocalizedContent(page.title, locale) }}
|
|
85
132
|
</h3>
|
|
86
133
|
|
|
87
|
-
<span class="
|
|
134
|
+
<span :class="type()">{{ t(getTypeLabelKey(page.type)) }}</span>
|
|
88
135
|
|
|
89
|
-
<div v-if="page.tags?.length" class="
|
|
136
|
+
<div v-if="page.tags?.length" :class="tags()">
|
|
90
137
|
<UBadge
|
|
91
138
|
v-for="tag in page.tags"
|
|
92
139
|
:key="tag[locale]"
|
|
@@ -106,17 +153,17 @@ const imageTabs = computed(() => {
|
|
|
106
153
|
variant="link"
|
|
107
154
|
size="xs"
|
|
108
155
|
color="neutral"
|
|
109
|
-
class="
|
|
156
|
+
:class="tabs()"
|
|
110
157
|
>
|
|
111
158
|
<template #content="{ item }">
|
|
112
|
-
<RCImage :src="item.img.src" :alt="item.img.alt" class="
|
|
159
|
+
<RCImage :src="item.img.src" :alt="item.img.alt" :class="image()" />
|
|
113
160
|
</template>
|
|
114
161
|
</UTabs>
|
|
115
162
|
|
|
116
163
|
<div v-else-if="page.images[0]">
|
|
117
164
|
<RCImage :src="page.images[0].src"
|
|
118
165
|
:alt="page.images[0].alt"
|
|
119
|
-
class="
|
|
166
|
+
:class="image()" />
|
|
120
167
|
</div>
|
|
121
168
|
</div>
|
|
122
169
|
</div>
|
|
@@ -134,34 +181,34 @@ const imageTabs = computed(() => {
|
|
|
134
181
|
trailingIcon: 'group-data-[state=open]:rotate-180 transition-transform duration-200'
|
|
135
182
|
}"
|
|
136
183
|
block
|
|
137
|
-
class="
|
|
184
|
+
:class="groupButton()"
|
|
138
185
|
/>
|
|
139
186
|
</template>
|
|
140
187
|
|
|
141
188
|
<template #content>
|
|
142
|
-
<dl class="
|
|
189
|
+
<dl :class="details()">
|
|
143
190
|
<template
|
|
144
191
|
v-for="[fieldKey, schema] in getSortedFields(group.fields)"
|
|
145
192
|
:key="fieldKey"
|
|
146
193
|
>
|
|
147
194
|
<div
|
|
148
195
|
v-if="isFieldVisible(schema, true)"
|
|
149
|
-
class="
|
|
196
|
+
:class="field()"
|
|
150
197
|
>
|
|
151
|
-
<dt class="
|
|
198
|
+
<dt :class="fieldLabel()">
|
|
152
199
|
{{ getLocalizedContent(schema.label, locale) }}
|
|
153
200
|
</dt>
|
|
154
201
|
|
|
155
|
-
<dd class="
|
|
202
|
+
<dd :class="fieldValue()">
|
|
156
203
|
<span v-if="schema.type === 'text'">
|
|
157
204
|
{{ getLocalizedContent(schema.value, locale) }}
|
|
158
205
|
</span>
|
|
159
206
|
<ul
|
|
160
207
|
v-else-if="schema.type === 'text-array'"
|
|
161
|
-
class="
|
|
208
|
+
:class="list()"
|
|
162
209
|
>
|
|
163
210
|
<li v-for="(item, index) in schema.value" :key="index">
|
|
164
|
-
<span class="
|
|
211
|
+
<span :class="listItem()">
|
|
165
212
|
{{ getLocalizedContent(item, locale) }}
|
|
166
213
|
</span>
|
|
167
214
|
</li>
|
|
@@ -173,11 +220,11 @@ const imageTabs = computed(() => {
|
|
|
173
220
|
|
|
174
221
|
<ul
|
|
175
222
|
v-else-if="schema.type === 'page-array' && Array.isArray(schema.value)"
|
|
176
|
-
class="
|
|
223
|
+
:class="pageArrayList()"
|
|
177
224
|
>
|
|
178
|
-
<li v-for="id in schema.value" :key="id" class="
|
|
225
|
+
<li v-for="id in schema.value" :key="id" :class="pageArrayItem()">
|
|
179
226
|
<span
|
|
180
|
-
class="
|
|
227
|
+
:class="pageArrayBullet()"
|
|
181
228
|
aria-hidden="true"
|
|
182
229
|
/>
|
|
183
230
|
|
|
@@ -197,7 +244,7 @@ const imageTabs = computed(() => {
|
|
|
197
244
|
</template>
|
|
198
245
|
</template>
|
|
199
246
|
</UCard>
|
|
200
|
-
<div class="
|
|
247
|
+
<div :class="links()">
|
|
201
248
|
<h6>Links</h6>
|
|
202
249
|
<UButton
|
|
203
250
|
v-for="(link, index) in page.links"
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { type Page } from '../../types/index.js';
|
|
2
|
+
export interface PagePropertiesRendererProps {
|
|
3
|
+
}
|
|
4
|
+
type __VLS_Props = PagePropertiesRendererProps;
|
|
5
|
+
export interface PagePropertiesRendererEmits {
|
|
6
|
+
}
|
|
2
7
|
type __VLS_ModelProps = {
|
|
3
8
|
modelValue: Page;
|
|
4
9
|
};
|
|
5
|
-
|
|
10
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
12
|
"update:modelValue": (value: {
|
|
7
13
|
type: "Default";
|
|
8
14
|
properties: import("../../types/index.js").BasePageProperties;
|
|
9
15
|
} & import("../../types/index.js").BasePage) => any;
|
|
10
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
11
17
|
"onUpdate:modelValue"?: ((value: {
|
|
12
18
|
type: "Default";
|
|
13
19
|
properties: import("../../types/index.js").BasePageProperties;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { type Page, type PageSurround } from "../../types/index.js";
|
|
2
|
-
interface PageRendererProps {
|
|
2
|
+
export interface PageRendererProps {
|
|
3
3
|
useSurround?: boolean;
|
|
4
4
|
surround?: PageSurround | null;
|
|
5
5
|
surroundStatus?: 'idle' | 'pending' | 'success' | 'error';
|
|
6
6
|
resolvePage: (id: string) => Promise<Pick<Page, 'title' | 'icon' | 'slug'>>;
|
|
7
7
|
}
|
|
8
8
|
type __VLS_Props = PageRendererProps;
|
|
9
|
+
export interface PageRendererEmits {
|
|
10
|
+
}
|
|
9
11
|
type __VLS_ModelProps = {
|
|
10
12
|
modelValue: Page;
|
|
11
13
|
};
|
|
@@ -4,16 +4,50 @@ import {} from "../../types";
|
|
|
4
4
|
import { getLocalizedContent } from "../../utils";
|
|
5
5
|
import { useI18n } from "vue-i18n";
|
|
6
6
|
import { usePageRegistry } from "../../composables";
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import { tv } from "tailwind-variants";
|
|
8
|
+
const {
|
|
9
|
+
useSurround = false,
|
|
10
|
+
surroundStatus = "idle",
|
|
11
|
+
surround = null,
|
|
12
|
+
resolvePage
|
|
13
|
+
} = defineProps({
|
|
11
14
|
useSurround: { type: Boolean, required: false },
|
|
12
15
|
surround: { type: [Object, null], required: false },
|
|
13
16
|
surroundStatus: { type: String, required: false },
|
|
14
17
|
resolvePage: { type: Function, required: true }
|
|
15
18
|
});
|
|
16
19
|
const emit = defineEmits([]);
|
|
20
|
+
const pageRendererStyles = tv({
|
|
21
|
+
slots: {
|
|
22
|
+
container: "flex flex-col py-16",
|
|
23
|
+
grid: "grid grid-cols-1 lg:grid-cols-24 gap-xl items-start",
|
|
24
|
+
toc: "hidden lg:flex lg:col-span-4 sticky top-16",
|
|
25
|
+
properties: "order-1 lg:order-2 lg:col-span-6",
|
|
26
|
+
contentWrapper: "order-2 lg:order-1 lg:col-span-14 flex flex-col gap-xl",
|
|
27
|
+
banner: "rounded-xl w-full object-cover",
|
|
28
|
+
icon: "rounded-full w-12 h-12 object-cover",
|
|
29
|
+
title: "",
|
|
30
|
+
surroundSkeleton: "grid grid-cols-1 gap-md sm:grid-cols-2",
|
|
31
|
+
skeleton: "h-48 w-full rounded-xl",
|
|
32
|
+
metadata: "flex flex-col gap-xs text-xs text-dimmed p-xl"
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
const {
|
|
36
|
+
container,
|
|
37
|
+
grid,
|
|
38
|
+
toc,
|
|
39
|
+
properties,
|
|
40
|
+
contentWrapper,
|
|
41
|
+
banner,
|
|
42
|
+
icon,
|
|
43
|
+
title: titleClass,
|
|
44
|
+
surroundSkeleton,
|
|
45
|
+
skeleton,
|
|
46
|
+
metadata
|
|
47
|
+
} = pageRendererStyles();
|
|
48
|
+
const { getTypeLabelKey } = usePageRegistry();
|
|
49
|
+
const page = defineModel({ type: null, ...{ required: true } });
|
|
50
|
+
const { t, locale } = useI18n();
|
|
17
51
|
provide("page-resolver", resolvePage);
|
|
18
52
|
const previousPage = computed(() => surround?.previous);
|
|
19
53
|
const nextPage = computed(() => surround?.next);
|
|
@@ -21,22 +55,22 @@ const hasSurround = computed(() => !!(surround?.previous || surround?.next));
|
|
|
21
55
|
</script>
|
|
22
56
|
|
|
23
57
|
<template>
|
|
24
|
-
<UContainer class="
|
|
25
|
-
<div class="grid
|
|
58
|
+
<UContainer :class="container()">
|
|
59
|
+
<div :class="grid()">
|
|
26
60
|
<RCPageTOC
|
|
27
61
|
:page-blocks="page.blocks"
|
|
28
62
|
:levels="[2, 3, 4]"
|
|
29
|
-
class="
|
|
63
|
+
:class="toc()"
|
|
30
64
|
>
|
|
31
65
|
<template #bottom> </template>
|
|
32
66
|
</RCPageTOC>
|
|
33
|
-
<RCPagePropertiesRenderer v-model="page" class="
|
|
34
|
-
<div class="
|
|
67
|
+
<RCPagePropertiesRenderer v-model="page" :class="properties()" />
|
|
68
|
+
<div :class="contentWrapper()">
|
|
35
69
|
<RCImage
|
|
36
70
|
v-if="page.banner?.src"
|
|
37
71
|
:src="page.banner?.src"
|
|
38
72
|
:alt="page.banner?.alt"
|
|
39
|
-
class="
|
|
73
|
+
:class="banner()"
|
|
40
74
|
/>
|
|
41
75
|
<UPageHeader
|
|
42
76
|
:headline="t(getTypeLabelKey(page.type))"
|
|
@@ -49,17 +83,17 @@ const hasSurround = computed(() => !!(surround?.previous || surround?.next));
|
|
|
49
83
|
v-if="page.icon?.src"
|
|
50
84
|
:src="page.icon?.src"
|
|
51
85
|
:alt="page.icon?.alt"
|
|
52
|
-
class="
|
|
86
|
+
:class="icon()"
|
|
53
87
|
/>
|
|
54
|
-
<h1>{{ getLocalizedContent(page.title, locale) }}</h1>
|
|
88
|
+
<h1 :class="titleClass()">{{ getLocalizedContent(page.title, locale) }}</h1>
|
|
55
89
|
</div>
|
|
56
90
|
</template>
|
|
57
91
|
</UPageHeader>
|
|
58
92
|
<RCBlockViewRenderer :blocks="page.blocks" />
|
|
59
93
|
<template v-if="useSurround">
|
|
60
|
-
<div v-if="surroundStatus === 'pending'" class="
|
|
61
|
-
<USkeleton class="
|
|
62
|
-
<USkeleton class="
|
|
94
|
+
<div v-if="surroundStatus === 'pending'" :class="surroundSkeleton()">
|
|
95
|
+
<USkeleton :class="skeleton()" />
|
|
96
|
+
<USkeleton :class="skeleton()" />
|
|
63
97
|
</div>
|
|
64
98
|
|
|
65
99
|
<LazyRCPageSurround
|
|
@@ -76,7 +110,7 @@ const hasSurround = computed(() => !!(surround?.previous || surround?.next));
|
|
|
76
110
|
|
|
77
111
|
<USeparator />
|
|
78
112
|
|
|
79
|
-
<div class="
|
|
113
|
+
<div :class="metadata()">
|
|
80
114
|
<h6>Metadata</h6>
|
|
81
115
|
<span>Page ID: {{ page.id }}</span>
|
|
82
116
|
<span
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { type Page, type PageSurround } from "../../types/index.js";
|
|
2
|
-
interface PageRendererProps {
|
|
2
|
+
export interface PageRendererProps {
|
|
3
3
|
useSurround?: boolean;
|
|
4
4
|
surround?: PageSurround | null;
|
|
5
5
|
surroundStatus?: 'idle' | 'pending' | 'success' | 'error';
|
|
6
6
|
resolvePage: (id: string) => Promise<Pick<Page, 'title' | 'icon' | 'slug'>>;
|
|
7
7
|
}
|
|
8
8
|
type __VLS_Props = PageRendererProps;
|
|
9
|
+
export interface PageRendererEmits {
|
|
10
|
+
}
|
|
9
11
|
type __VLS_ModelProps = {
|
|
10
12
|
modelValue: Page;
|
|
11
13
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export interface PageSurroundProps {
|
|
2
2
|
pageType: string;
|
|
3
3
|
previousTitle?: string;
|
|
4
4
|
previousDescription?: string;
|
|
@@ -6,7 +6,9 @@ type __VLS_Props = {
|
|
|
6
6
|
nextTitle?: string;
|
|
7
7
|
nextDescription?: string;
|
|
8
8
|
nextTo?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
9
|
+
}
|
|
10
|
+
export interface PageSurroundEmits {
|
|
11
|
+
}
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<PageSurroundProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PageSurroundProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
13
|
declare const _default: typeof __VLS_export;
|
|
12
14
|
export default _default;
|