rimelight-components 2.1.18 → 2.1.19
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 +13 -8
- package/dist/runtime/components/app/Footer.vue +12 -7
- package/dist/runtime/components/app/Footer.vue.d.ts +13 -8
- package/dist/runtime/components/app/Header.d.vue.ts +19 -14
- package/dist/runtime/components/app/Header.vue +15 -10
- package/dist/runtime/components/app/Header.vue.d.ts +19 -14
- package/dist/runtime/components/app/HeaderLayer.d.vue.ts +8 -4
- package/dist/runtime/components/app/HeaderLayer.vue +13 -10
- package/dist/runtime/components/app/HeaderLayer.vue.d.ts +8 -4
- package/dist/runtime/components/app/Image.d.vue.ts +13 -1
- package/dist/runtime/components/app/Image.vue +10 -7
- package/dist/runtime/components/app/Image.vue.d.ts +13 -1
- package/dist/runtime/components/app/Logo.d.vue.ts +13 -1
- package/dist/runtime/components/app/Logo.vue +8 -4
- package/dist/runtime/components/app/Logo.vue.d.ts +13 -1
- package/dist/runtime/components/app/NewsletterSignup.d.vue.ts +13 -1
- package/dist/runtime/components/app/NewsletterSignup.vue +9 -4
- package/dist/runtime/components/app/NewsletterSignup.vue.d.ts +13 -1
- package/dist/runtime/components/app/ScrollToTop.d.vue.ts +17 -4
- package/dist/runtime/components/app/ScrollToTop.vue +20 -12
- package/dist/runtime/components/app/ScrollToTop.vue.d.ts +17 -4
- package/dist/runtime/components/blocks/Block.d.vue.ts +8 -4
- package/dist/runtime/components/blocks/Block.vue +9 -5
- package/dist/runtime/components/blocks/Block.vue.d.ts +8 -4
- package/dist/runtime/components/blocks/BlockEditRenderer.d.vue.ts +13 -1
- package/dist/runtime/components/blocks/BlockEditRenderer.vue +8 -4
- package/dist/runtime/components/blocks/BlockEditRenderer.vue.d.ts +13 -1
- package/dist/runtime/components/blocks/BlockEditor.d.vue.ts +13 -4
- package/dist/runtime/components/blocks/BlockEditor.vue +9 -4
- package/dist/runtime/components/blocks/BlockEditor.vue.d.ts +13 -4
- package/dist/runtime/components/blocks/BlockViewRenderer.d.vue.ts +13 -1
- package/dist/runtime/components/blocks/BlockViewRenderer.vue +8 -4
- package/dist/runtime/components/blocks/BlockViewRenderer.vue.d.ts +13 -1
- package/dist/runtime/components/blocks/TextRenderer.d.vue.ts +13 -1
- package/dist/runtime/components/blocks/TextRenderer.vue +12 -6
- package/dist/runtime/components/blocks/TextRenderer.vue.d.ts +13 -1
- package/dist/runtime/components/blocks/editor/CalloutBlockEditor.d.vue.ts +13 -1
- package/dist/runtime/components/blocks/editor/CalloutBlockEditor.vue +11 -5
- package/dist/runtime/components/blocks/editor/CalloutBlockEditor.vue.d.ts +13 -1
- package/dist/runtime/components/blocks/editor/CardBlockEditor.d.vue.ts +13 -1
- package/dist/runtime/components/blocks/editor/CardBlockEditor.vue +7 -3
- package/dist/runtime/components/blocks/editor/CardBlockEditor.vue.d.ts +13 -1
- package/dist/runtime/components/blocks/editor/ImageBlockEditor.d.vue.ts +21 -5
- package/dist/runtime/components/blocks/editor/ImageBlockEditor.vue +11 -7
- package/dist/runtime/components/blocks/editor/ImageBlockEditor.vue.d.ts +21 -5
- package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.d.vue.ts +13 -1
- package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.vue +12 -8
- package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.vue.d.ts +13 -1
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.d.vue.ts +15 -1
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.vue +9 -5
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.vue.d.ts +15 -1
- package/dist/runtime/components/blocks/editor/TestBlockEditor.d.vue.ts +13 -1
- package/dist/runtime/components/blocks/editor/TestBlockEditor.vue +7 -3
- package/dist/runtime/components/blocks/editor/TestBlockEditor.vue.d.ts +13 -1
- package/dist/runtime/components/blocks/renderer/CalloutBlockRenderer.d.vue.ts +13 -1
- package/dist/runtime/components/blocks/renderer/CalloutBlockRenderer.vue +11 -5
- package/dist/runtime/components/blocks/renderer/CalloutBlockRenderer.vue.d.ts +13 -1
- package/dist/runtime/components/blocks/renderer/CardBlockRenderer.d.vue.ts +13 -1
- package/dist/runtime/components/blocks/renderer/CardBlockRenderer.vue +7 -3
- package/dist/runtime/components/blocks/renderer/CardBlockRenderer.vue.d.ts +13 -1
- package/dist/runtime/components/blocks/renderer/ImageBlockRenderer.d.vue.ts +15 -1
- package/dist/runtime/components/blocks/renderer/ImageBlockRenderer.vue +9 -5
- package/dist/runtime/components/blocks/renderer/ImageBlockRenderer.vue.d.ts +15 -1
- package/dist/runtime/components/blocks/renderer/ParagraphBlockRenderer.d.vue.ts +13 -1
- package/dist/runtime/components/blocks/renderer/ParagraphBlockRenderer.vue +9 -3
- package/dist/runtime/components/blocks/renderer/ParagraphBlockRenderer.vue.d.ts +13 -1
- package/dist/runtime/components/blocks/renderer/SectionBlockRenderer.d.vue.ts +13 -1
- package/dist/runtime/components/blocks/renderer/SectionBlockRenderer.vue +11 -5
- package/dist/runtime/components/blocks/renderer/SectionBlockRenderer.vue.d.ts +13 -1
- package/dist/runtime/components/blocks/renderer/TestBlockRenderer.d.vue.ts +13 -1
- package/dist/runtime/components/blocks/renderer/TestBlockRenderer.vue +9 -3
- package/dist/runtime/components/blocks/renderer/TestBlockRenderer.vue.d.ts +13 -1
- package/dist/runtime/components/cards/TeamCard.d.vue.ts +11 -4
- package/dist/runtime/components/cards/TeamCard.vue +12 -8
- package/dist/runtime/components/cards/TeamCard.vue.d.ts +11 -4
- package/dist/runtime/components/content/Callout.d.vue.ts +8 -4
- package/dist/runtime/components/content/Callout.vue +11 -7
- package/dist/runtime/components/content/Callout.vue.d.ts +8 -4
- package/dist/runtime/components/content/Section.d.vue.ts +14 -10
- package/dist/runtime/components/content/Section.vue +14 -9
- package/dist/runtime/components/content/Section.vue.d.ts +14 -10
- package/dist/runtime/components/content/Test.d.vue.ts +7 -4
- package/dist/runtime/components/content/Test.vue +8 -4
- package/dist/runtime/components/content/Test.vue.d.ts +7 -4
- package/dist/runtime/components/nodes/LinkNode.d.vue.ts +13 -1
- package/dist/runtime/components/nodes/LinkNode.vue +8 -4
- package/dist/runtime/components/nodes/LinkNode.vue.d.ts +13 -1
- package/dist/runtime/components/nodes/TextNode.d.vue.ts +13 -1
- package/dist/runtime/components/nodes/TextNode.vue +8 -4
- package/dist/runtime/components/nodes/TextNode.vue.d.ts +13 -1
- package/dist/runtime/components/page/PageEditor.d.vue.ts +32 -5
- package/dist/runtime/components/page/PageEditor.vue +36 -24
- package/dist/runtime/components/page/PageEditor.vue.d.ts +32 -5
- package/dist/runtime/components/page/PageMention.d.vue.ts +16 -1
- package/dist/runtime/components/page/PageMention.vue +11 -7
- package/dist/runtime/components/page/PageMention.vue.d.ts +16 -1
- package/dist/runtime/components/page/PagePropertiesEditor.d.vue.ts +23 -1
- package/dist/runtime/components/page/PagePropertiesEditor.vue +83 -79
- package/dist/runtime/components/page/PagePropertiesEditor.vue.d.ts +23 -1
- package/dist/runtime/components/page/PagePropertiesRenderer.d.vue.ts +31 -1
- package/dist/runtime/components/page/PagePropertiesRenderer.vue +36 -32
- package/dist/runtime/components/page/PagePropertiesRenderer.vue.d.ts +31 -1
- package/dist/runtime/components/page/PageRenderer.d.vue.ts +23 -1
- package/dist/runtime/components/page/PageRenderer.vue +21 -17
- package/dist/runtime/components/page/PageRenderer.vue.d.ts +23 -1
- package/dist/runtime/components/page/PageSurround.d.vue.ts +21 -1
- package/dist/runtime/components/page/PageSurround.vue +25 -20
- package/dist/runtime/components/page/PageSurround.vue.d.ts +21 -1
- package/dist/runtime/components/page/PageTOC.d.vue.ts +10 -4
- package/dist/runtime/components/page/PageTOC.vue +10 -6
- package/dist/runtime/components/page/PageTOC.vue.d.ts +10 -4
- package/dist/runtime/components/page/modals/CreatePageModal.d.vue.ts +12 -4
- package/dist/runtime/components/page/modals/CreatePageModal.vue +13 -9
- package/dist/runtime/components/page/modals/CreatePageModal.vue.d.ts +12 -4
- package/dist/runtime/components/page/modals/DeletePageModal.d.vue.ts +14 -7
- package/dist/runtime/components/page/modals/DeletePageModal.vue +13 -9
- package/dist/runtime/components/page/modals/DeletePageModal.vue.d.ts +14 -7
- package/dist/runtime/components/swatches/ColorSwatch.d.vue.ts +19 -1
- package/dist/runtime/components/swatches/ColorSwatch.vue +29 -17
- package/dist/runtime/components/swatches/ColorSwatch.vue.d.ts +19 -1
- package/dist/runtime/components/swatches/FontSwatch.d.vue.ts +18 -1
- package/dist/runtime/components/swatches/FontSwatch.vue +16 -12
- package/dist/runtime/components/swatches/FontSwatch.vue.d.ts +18 -1
- package/dist/runtime/components/swatches/ImageSwatch.d.vue.ts +18 -1
- package/dist/runtime/components/swatches/ImageSwatch.vue +16 -12
- package/dist/runtime/components/swatches/ImageSwatch.vue.d.ts +18 -1
- package/dist/runtime/components/utilities/Placeholder.d.vue.ts +8 -4
- package/dist/runtime/components/utilities/Placeholder.vue +9 -4
- package/dist/runtime/components/utilities/Placeholder.vue.d.ts +8 -4
- package/dist/runtime/composables/index.d.ts +1 -0
- package/dist/runtime/composables/index.js +1 -0
- package/dist/runtime/composables/index.mjs +1 -0
- package/dist/runtime/composables/useRC.d.ts +3 -0
- package/dist/runtime/composables/useRC.js +14 -0
- package/dist/runtime/composables/useRC.mjs +14 -0
- package/dist/runtime/types/app.config.d.ts +6 -0
- package/dist/runtime/types/schemas.d.ts +2 -2
- package/dist/runtime/types/tv.d.ts +66 -0
- package/dist/runtime/types/tv.js +0 -0
- package/dist/runtime/types/tv.mjs +0 -0
- package/dist/runtime/utils/index.d.ts +1 -0
- package/dist/runtime/utils/index.js +1 -0
- package/dist/runtime/utils/index.mjs +1 -0
- package/dist/runtime/utils/tv.d.ts +1 -0
- package/dist/runtime/utils/tv.js +4 -0
- package/dist/runtime/utils/tv.mjs +4 -0
- package/package.json +1 -1
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import { useI18n } from "vue-i18n";
|
|
4
|
-
import { usePageRegistry, useInfobox } from "../../composables";
|
|
4
|
+
import { usePageRegistry, useInfobox, useRC } 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 "
|
|
9
|
-
const
|
|
8
|
+
import { tv } from "../../utils/tv";
|
|
9
|
+
const { rc: rcProp } = defineProps({
|
|
10
|
+
rc: { type: Object, required: false }
|
|
11
|
+
});
|
|
12
|
+
const page = defineModel({ type: null, ...{ required: true } });
|
|
10
13
|
const emit = defineEmits([]);
|
|
14
|
+
const slots = defineSlots();
|
|
15
|
+
const { rc } = useRC("PagePropertiesEditor", rcProp);
|
|
11
16
|
const pagePropertiesEditorStyles = tv({
|
|
12
17
|
slots: {
|
|
13
18
|
aside: "flex flex-col gap-md",
|
|
@@ -36,7 +41,6 @@ const {
|
|
|
36
41
|
field,
|
|
37
42
|
links
|
|
38
43
|
} = pagePropertiesEditorStyles();
|
|
39
|
-
const page = defineModel({ type: null, ...{ required: true } });
|
|
40
44
|
const { getTypeLabelKey } = usePageRegistry();
|
|
41
45
|
const { isFieldVisible, shouldRenderGroup, getSortedFields, getSortedGroups } = useInfobox(page.value.properties);
|
|
42
46
|
const { locale, t } = useI18n();
|
|
@@ -61,7 +65,7 @@ const updateTextArray = (schema, vals) => {
|
|
|
61
65
|
</script>
|
|
62
66
|
|
|
63
67
|
<template>
|
|
64
|
-
<aside :class="aside()">
|
|
68
|
+
<aside :class="aside({ class: rc.aside })">
|
|
65
69
|
<UCard
|
|
66
70
|
variant="soft"
|
|
67
71
|
:ui="{ root: 'divide-none', header: 'bg-accented text-center', body: 'p-0 sm:p-0 bg-muted' }"
|
|
@@ -72,7 +76,7 @@ const updateTextArray = (schema, vals) => {
|
|
|
72
76
|
v-if="page.icon?.src"
|
|
73
77
|
:src="page.icon?.src"
|
|
74
78
|
:alt="page.icon?.alt"
|
|
75
|
-
:class="icon()"
|
|
79
|
+
:class="icon({ class: rc.icon })"
|
|
76
80
|
/>
|
|
77
81
|
|
|
78
82
|
<UInput
|
|
@@ -81,12 +85,12 @@ const updateTextArray = (schema, vals) => {
|
|
|
81
85
|
placeholder="Enter page title..."
|
|
82
86
|
size="xl"
|
|
83
87
|
:ui="{ base: 'text-center font-bold text-lg' }"
|
|
84
|
-
:class="titleInput()"
|
|
88
|
+
:class="titleInput({ class: rc.titleInput })"
|
|
85
89
|
/>
|
|
86
90
|
|
|
87
|
-
<span :class="type()">{{ t(getTypeLabelKey(page.type)) }}</span>
|
|
91
|
+
<span :class="type({ class: rc.type })">{{ t(getTypeLabelKey(page.type)) }}</span>
|
|
88
92
|
|
|
89
|
-
<div v-if="page.tags?.length" :class="tags()">
|
|
93
|
+
<div v-if="page.tags?.length" :class="tags({ class: rc.tags })">
|
|
90
94
|
<UBadge
|
|
91
95
|
v-for="tag in page.tags"
|
|
92
96
|
:key="tag[locale]"
|
|
@@ -106,10 +110,10 @@ const updateTextArray = (schema, vals) => {
|
|
|
106
110
|
variant="link"
|
|
107
111
|
size="xs"
|
|
108
112
|
color="neutral"
|
|
109
|
-
:class="tabs()"
|
|
113
|
+
:class="tabs({ class: rc.tabs })"
|
|
110
114
|
>
|
|
111
115
|
<template #content="{ item }">
|
|
112
|
-
<RCImage :src="item.img.src" :alt="item.img.alt" :class="image()" />
|
|
116
|
+
<RCImage :src="item.img.src" :alt="item.img.alt" :class="image({ class: rc.image })" />
|
|
113
117
|
</template>
|
|
114
118
|
</UTabs>
|
|
115
119
|
|
|
@@ -117,7 +121,7 @@ const updateTextArray = (schema, vals) => {
|
|
|
117
121
|
<RCImage
|
|
118
122
|
:src="page.images[0].src"
|
|
119
123
|
:alt="page.images[0].alt"
|
|
120
|
-
:class="image()"
|
|
124
|
+
:class="image({ class: rc.image })"
|
|
121
125
|
/>
|
|
122
126
|
</div>
|
|
123
127
|
</div>
|
|
@@ -136,92 +140,92 @@ const updateTextArray = (schema, vals) => {
|
|
|
136
140
|
trailingIcon: 'group-data-[state=open]:rotate-180 transition-transform duration-200'
|
|
137
141
|
}"
|
|
138
142
|
block
|
|
139
|
-
:class="groupButton()"
|
|
143
|
+
:class="groupButton({ class: rc.groupButton })"
|
|
140
144
|
/>
|
|
141
145
|
</template>
|
|
142
146
|
|
|
143
147
|
<template #content>
|
|
144
148
|
<ClientOnly>
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
149
|
+
<dl :class="details({ class: rc.details })">
|
|
150
|
+
<template v-for="[fieldKey, schema] in getSortedFields(group.fields)" :key="fieldKey">
|
|
151
|
+
<UFormField
|
|
152
|
+
v-if="isFieldVisible(schema, false)"
|
|
153
|
+
:label="getLocalizedContent(schema.label, locale)"
|
|
154
|
+
:name="fieldKey"
|
|
155
|
+
>
|
|
156
|
+
<UInput
|
|
157
|
+
v-if="schema.type === 'text'"
|
|
158
|
+
v-model="schema.value.en"
|
|
159
|
+
variant="subtle"
|
|
160
|
+
placeholder="Type here..."
|
|
161
|
+
:class="field({ class: rc.field })"
|
|
162
|
+
/>
|
|
159
163
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
164
|
+
<UInput
|
|
165
|
+
v-else-if="schema.type === 'number'"
|
|
166
|
+
v-model.number="schema.value"
|
|
167
|
+
type="number"
|
|
168
|
+
variant="subtle"
|
|
169
|
+
:class="field({ class: rc.field })"
|
|
170
|
+
/>
|
|
167
171
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
172
|
+
<USelect
|
|
173
|
+
v-else-if="schema.type === 'enum'"
|
|
174
|
+
v-model="schema.value"
|
|
175
|
+
:items="schema.options || []"
|
|
176
|
+
variant="subtle"
|
|
177
|
+
:class="field({ class: rc.field })"
|
|
178
|
+
/>
|
|
175
179
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
180
|
+
<UInputMenu
|
|
181
|
+
v-else-if="schema.type === 'text-array'"
|
|
182
|
+
:model-value="schema.value.map((v) => v.en)"
|
|
183
|
+
@update:model-value="(vals) => updateTextArray(schema, vals)"
|
|
184
|
+
multiple
|
|
185
|
+
creatable
|
|
186
|
+
variant="subtle"
|
|
187
|
+
placeholder="Add item..."
|
|
188
|
+
:class="field({ class: rc.field })"
|
|
189
|
+
/>
|
|
186
190
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
191
|
+
<UInput
|
|
192
|
+
v-else-if="schema.type === 'page'"
|
|
193
|
+
v-model="schema.value"
|
|
194
|
+
icon="lucide:link-2"
|
|
195
|
+
variant="subtle"
|
|
196
|
+
:placeholder="`Select ${schema.allowedPageTypes?.join('/')}`"
|
|
197
|
+
:class="field({ class: rc.field })"
|
|
198
|
+
/>
|
|
195
199
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
200
|
+
<USelectMenu
|
|
201
|
+
v-else-if="schema.type === 'page-array'"
|
|
202
|
+
v-model="schema.value"
|
|
203
|
+
icon="lucide:link-2"
|
|
204
|
+
variant="subtle"
|
|
205
|
+
:placeholder="`Select ${schema.allowedPageTypes?.join('/')}`"
|
|
206
|
+
:class="field({ class: rc.field })"
|
|
207
|
+
/>
|
|
208
|
+
</UFormField>
|
|
209
|
+
</template>
|
|
210
|
+
</dl>
|
|
207
211
|
</ClientOnly>
|
|
208
212
|
</template>
|
|
209
213
|
</UCollapsible>
|
|
210
214
|
</template>
|
|
211
215
|
</template>
|
|
212
216
|
</UCard>
|
|
213
|
-
<div :class="links()">
|
|
217
|
+
<div :class="links({ class: rc.links })">
|
|
214
218
|
<h6>Links</h6>
|
|
215
219
|
<UButton
|
|
216
|
-
v-for="(
|
|
220
|
+
v-for="(linkItem, index) in page.links"
|
|
217
221
|
:key="index"
|
|
218
|
-
:label="
|
|
219
|
-
:icon="
|
|
220
|
-
:to="
|
|
221
|
-
:target="
|
|
222
|
-
:external="!!
|
|
223
|
-
:variant="
|
|
224
|
-
:color="
|
|
222
|
+
:label="linkItem.label"
|
|
223
|
+
:icon="linkItem.icon"
|
|
224
|
+
:to="linkItem.to"
|
|
225
|
+
:target="linkItem.to ? '_blank' : void 0"
|
|
226
|
+
:external="!!linkItem.to"
|
|
227
|
+
:variant="linkItem.variant || 'link'"
|
|
228
|
+
:color="linkItem.color || 'neutral'"
|
|
225
229
|
size="sm"
|
|
226
230
|
:ui="{ base: 'pl-0' }"
|
|
227
231
|
/>
|
|
@@ -1,14 +1,30 @@
|
|
|
1
1
|
import { type Page } from "../../types/index.js";
|
|
2
2
|
export interface PagePropertiesEditorProps {
|
|
3
|
+
rc?: {
|
|
4
|
+
aside?: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
titleInput?: string;
|
|
7
|
+
type?: string;
|
|
8
|
+
tags?: string;
|
|
9
|
+
tabs?: string;
|
|
10
|
+
image?: string;
|
|
11
|
+
groupButton?: string;
|
|
12
|
+
details?: string;
|
|
13
|
+
field?: string;
|
|
14
|
+
links?: string;
|
|
15
|
+
};
|
|
3
16
|
}
|
|
4
17
|
type __VLS_Props = PagePropertiesEditorProps;
|
|
5
18
|
export interface PagePropertiesEditorEmits {
|
|
6
19
|
}
|
|
20
|
+
export interface PagePropertiesEditorSlots {
|
|
21
|
+
}
|
|
22
|
+
type __VLS_Slots = PagePropertiesEditorSlots;
|
|
7
23
|
type __VLS_ModelProps = {
|
|
8
24
|
modelValue: Page;
|
|
9
25
|
};
|
|
10
26
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
11
|
-
declare const
|
|
27
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
28
|
"update:modelValue": (value: {
|
|
13
29
|
type: "Default";
|
|
14
30
|
properties: import("../../types/index.js").BasePageProperties;
|
|
@@ -19,5 +35,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
19
35
|
properties: import("../../types/index.js").BasePageProperties;
|
|
20
36
|
} & import("../../types/index.js").BasePage) => any) | undefined;
|
|
21
37
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
38
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
22
39
|
declare const _default: typeof __VLS_export;
|
|
23
40
|
export default _default;
|
|
41
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
42
|
+
new (): {
|
|
43
|
+
$slots: S;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -1,14 +1,38 @@
|
|
|
1
1
|
import { type Page } from '../../types/index.js';
|
|
2
2
|
export interface PagePropertiesRendererProps {
|
|
3
|
+
rc?: {
|
|
4
|
+
aside?: string;
|
|
5
|
+
actions?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
type?: string;
|
|
9
|
+
tags?: string;
|
|
10
|
+
tabs?: string;
|
|
11
|
+
image?: string;
|
|
12
|
+
groupButton?: string;
|
|
13
|
+
details?: string;
|
|
14
|
+
field?: string;
|
|
15
|
+
fieldLabel?: string;
|
|
16
|
+
fieldValue?: string;
|
|
17
|
+
list?: string;
|
|
18
|
+
listItem?: string;
|
|
19
|
+
pageArrayList?: string;
|
|
20
|
+
pageArrayItem?: string;
|
|
21
|
+
pageArrayBullet?: string;
|
|
22
|
+
links?: string;
|
|
23
|
+
};
|
|
3
24
|
}
|
|
4
25
|
type __VLS_Props = PagePropertiesRendererProps;
|
|
5
26
|
export interface PagePropertiesRendererEmits {
|
|
6
27
|
}
|
|
28
|
+
export interface PagePropertiesRendererSlots {
|
|
29
|
+
}
|
|
30
|
+
type __VLS_Slots = PagePropertiesRendererSlots;
|
|
7
31
|
type __VLS_ModelProps = {
|
|
8
32
|
modelValue: Page;
|
|
9
33
|
};
|
|
10
34
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
11
|
-
declare const
|
|
35
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
36
|
"update:modelValue": (value: {
|
|
13
37
|
type: "Default";
|
|
14
38
|
properties: import("../../types/index.js").BasePageProperties;
|
|
@@ -19,5 +43,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
19
43
|
properties: import("../../types/index.js").BasePageProperties;
|
|
20
44
|
} & import("../../types/index.js").BasePage) => any) | undefined;
|
|
21
45
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
46
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
22
47
|
declare const _default: typeof __VLS_export;
|
|
23
48
|
export default _default;
|
|
49
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
50
|
+
new (): {
|
|
51
|
+
$slots: S;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import { getLocalizedContent } from "../../utils";
|
|
4
|
-
import { usePageRegistry, useInfobox } from "../../composables";
|
|
4
|
+
import { usePageRegistry, useInfobox, useRC } from "../../composables";
|
|
5
5
|
import { useToast } from "@nuxt/ui/composables";
|
|
6
6
|
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 "
|
|
11
|
-
const
|
|
10
|
+
import { tv } from "../../utils/tv";
|
|
11
|
+
const { rc: rcProp } = defineProps({
|
|
12
|
+
rc: { type: Object, required: false }
|
|
13
|
+
});
|
|
14
|
+
const page = defineModel({ type: null, ...{ required: true } });
|
|
12
15
|
const emit = defineEmits([]);
|
|
16
|
+
const slots = defineSlots();
|
|
17
|
+
const { rc } = useRC("PagePropertiesRenderer", rcProp);
|
|
13
18
|
const pagePropertiesRendererStyles = tv({
|
|
14
19
|
slots: {
|
|
15
20
|
aside: "flex flex-col gap-md",
|
|
@@ -54,7 +59,6 @@ const {
|
|
|
54
59
|
pageArrayBullet,
|
|
55
60
|
links
|
|
56
61
|
} = pagePropertiesRendererStyles();
|
|
57
|
-
const page = defineModel({ type: null, ...{ required: true } });
|
|
58
62
|
const { getTypeLabelKey } = usePageRegistry();
|
|
59
63
|
const { isFieldVisible, shouldRenderGroup, getSortedFields, getSortedGroups } = useInfobox(page.value.properties);
|
|
60
64
|
const { t, locale } = useI18n();
|
|
@@ -109,8 +113,8 @@ const imageTabs = computed(() => {
|
|
|
109
113
|
</script>
|
|
110
114
|
|
|
111
115
|
<template>
|
|
112
|
-
<aside :class="aside()">
|
|
113
|
-
<div :class="actions()">
|
|
116
|
+
<aside :class="aside({ class: rc.aside })">
|
|
117
|
+
<div :class="actions({ class: rc.actions })">
|
|
114
118
|
<UButton variant="soft" color="neutral" icon="lucide:share" size="sm" @click="sharePage()" />
|
|
115
119
|
<UButton variant="soft" color="neutral" icon="lucide:link" size="sm" @click="copyLink()" />
|
|
116
120
|
</div>
|
|
@@ -124,16 +128,16 @@ const imageTabs = computed(() => {
|
|
|
124
128
|
v-if="page.icon?.src"
|
|
125
129
|
:src="page.icon?.src"
|
|
126
130
|
:alt="page.icon?.alt"
|
|
127
|
-
:class="icon()"
|
|
131
|
+
:class="icon({ class: rc.icon })"
|
|
128
132
|
/>
|
|
129
133
|
|
|
130
|
-
<h3 :class="titleClass()">
|
|
134
|
+
<h3 :class="titleClass({ class: rc.title })">
|
|
131
135
|
{{ getLocalizedContent(page.title, locale) }}
|
|
132
136
|
</h3>
|
|
133
137
|
|
|
134
|
-
<span :class="type()">{{ t(getTypeLabelKey(page.type)) }}</span>
|
|
138
|
+
<span :class="type({ class: rc.type })">{{ t(getTypeLabelKey(page.type)) }}</span>
|
|
135
139
|
|
|
136
|
-
<div v-if="page.tags?.length" :class="tags()">
|
|
140
|
+
<div v-if="page.tags?.length" :class="tags({ class: rc.tags })">
|
|
137
141
|
<UBadge
|
|
138
142
|
v-for="tag in page.tags"
|
|
139
143
|
:key="tag[locale]"
|
|
@@ -153,17 +157,17 @@ const imageTabs = computed(() => {
|
|
|
153
157
|
variant="link"
|
|
154
158
|
size="xs"
|
|
155
159
|
color="neutral"
|
|
156
|
-
:class="tabs()"
|
|
160
|
+
:class="tabs({ class: rc.tabs })"
|
|
157
161
|
>
|
|
158
162
|
<template #content="{ item }">
|
|
159
|
-
<RCImage :src="item.img.src" :alt="item.img.alt" :class="image()" />
|
|
163
|
+
<RCImage :src="item.img.src" :alt="item.img.alt" :class="image({ class: rc.image })" />
|
|
160
164
|
</template>
|
|
161
165
|
</UTabs>
|
|
162
166
|
|
|
163
167
|
<div v-else-if="page.images[0]">
|
|
164
168
|
<RCImage :src="page.images[0].src"
|
|
165
169
|
:alt="page.images[0].alt"
|
|
166
|
-
:class="image()" />
|
|
170
|
+
:class="image({ class: rc.image })" />
|
|
167
171
|
</div>
|
|
168
172
|
</div>
|
|
169
173
|
</div>
|
|
@@ -181,34 +185,34 @@ const imageTabs = computed(() => {
|
|
|
181
185
|
trailingIcon: 'group-data-[state=open]:rotate-180 transition-transform duration-200'
|
|
182
186
|
}"
|
|
183
187
|
block
|
|
184
|
-
:class="groupButton()"
|
|
188
|
+
:class="groupButton({ class: rc.groupButton })"
|
|
185
189
|
/>
|
|
186
190
|
</template>
|
|
187
191
|
|
|
188
192
|
<template #content>
|
|
189
|
-
<dl :class="details()">
|
|
193
|
+
<dl :class="details({ class: rc.details })">
|
|
190
194
|
<template
|
|
191
195
|
v-for="[fieldKey, schema] in getSortedFields(group.fields)"
|
|
192
196
|
:key="fieldKey"
|
|
193
197
|
>
|
|
194
198
|
<div
|
|
195
199
|
v-if="isFieldVisible(schema, true)"
|
|
196
|
-
:class="field()"
|
|
200
|
+
:class="field({ class: rc.field })"
|
|
197
201
|
>
|
|
198
|
-
<dt :class="fieldLabel()">
|
|
202
|
+
<dt :class="fieldLabel({ class: rc.fieldLabel })">
|
|
199
203
|
{{ getLocalizedContent(schema.label, locale) }}
|
|
200
204
|
</dt>
|
|
201
205
|
|
|
202
|
-
<dd :class="fieldValue()">
|
|
206
|
+
<dd :class="fieldValue({ class: rc.fieldValue })">
|
|
203
207
|
<span v-if="schema.type === 'text'">
|
|
204
208
|
{{ getLocalizedContent(schema.value, locale) }}
|
|
205
209
|
</span>
|
|
206
210
|
<ul
|
|
207
211
|
v-else-if="schema.type === 'text-array'"
|
|
208
|
-
:class="list()"
|
|
212
|
+
:class="list({ class: rc.list })"
|
|
209
213
|
>
|
|
210
214
|
<li v-for="(item, index) in schema.value" :key="index">
|
|
211
|
-
<span :class="listItem()">
|
|
215
|
+
<span :class="listItem({ class: rc.listItem })">
|
|
212
216
|
{{ getLocalizedContent(item, locale) }}
|
|
213
217
|
</span>
|
|
214
218
|
</li>
|
|
@@ -220,11 +224,11 @@ const imageTabs = computed(() => {
|
|
|
220
224
|
|
|
221
225
|
<ul
|
|
222
226
|
v-else-if="schema.type === 'page-array' && Array.isArray(schema.value)"
|
|
223
|
-
:class="pageArrayList()"
|
|
227
|
+
:class="pageArrayList({ class: rc.pageArrayList })"
|
|
224
228
|
>
|
|
225
|
-
<li v-for="id in schema.value" :key="id" :class="pageArrayItem()">
|
|
229
|
+
<li v-for="id in schema.value" :key="id" :class="pageArrayItem({ class: rc.pageArrayItem })">
|
|
226
230
|
<span
|
|
227
|
-
:class="pageArrayBullet()"
|
|
231
|
+
:class="pageArrayBullet({ class: rc.pageArrayBullet })"
|
|
228
232
|
aria-hidden="true"
|
|
229
233
|
/>
|
|
230
234
|
|
|
@@ -244,18 +248,18 @@ const imageTabs = computed(() => {
|
|
|
244
248
|
</template>
|
|
245
249
|
</template>
|
|
246
250
|
</UCard>
|
|
247
|
-
<div :class="links()">
|
|
251
|
+
<div :class="links({ class: rc.links })">
|
|
248
252
|
<h6>Links</h6>
|
|
249
253
|
<UButton
|
|
250
|
-
v-for="(
|
|
254
|
+
v-for="(linkItem, index) in page.links"
|
|
251
255
|
:key="index"
|
|
252
|
-
:label="
|
|
253
|
-
:icon="
|
|
254
|
-
:to="
|
|
255
|
-
:target="
|
|
256
|
-
:external="!!
|
|
257
|
-
:variant="
|
|
258
|
-
:color="
|
|
256
|
+
:label="linkItem.label"
|
|
257
|
+
:icon="linkItem.icon"
|
|
258
|
+
:to="linkItem.to"
|
|
259
|
+
:target="linkItem.to ? '_blank' : void 0"
|
|
260
|
+
:external="!!linkItem.to"
|
|
261
|
+
:variant="linkItem.variant || 'link'"
|
|
262
|
+
:color="linkItem.color || 'neutral'"
|
|
259
263
|
size="sm"
|
|
260
264
|
:ui="{ base: 'pl-0' }"
|
|
261
265
|
/>
|
|
@@ -1,14 +1,38 @@
|
|
|
1
1
|
import { type Page } from '../../types/index.js';
|
|
2
2
|
export interface PagePropertiesRendererProps {
|
|
3
|
+
rc?: {
|
|
4
|
+
aside?: string;
|
|
5
|
+
actions?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
type?: string;
|
|
9
|
+
tags?: string;
|
|
10
|
+
tabs?: string;
|
|
11
|
+
image?: string;
|
|
12
|
+
groupButton?: string;
|
|
13
|
+
details?: string;
|
|
14
|
+
field?: string;
|
|
15
|
+
fieldLabel?: string;
|
|
16
|
+
fieldValue?: string;
|
|
17
|
+
list?: string;
|
|
18
|
+
listItem?: string;
|
|
19
|
+
pageArrayList?: string;
|
|
20
|
+
pageArrayItem?: string;
|
|
21
|
+
pageArrayBullet?: string;
|
|
22
|
+
links?: string;
|
|
23
|
+
};
|
|
3
24
|
}
|
|
4
25
|
type __VLS_Props = PagePropertiesRendererProps;
|
|
5
26
|
export interface PagePropertiesRendererEmits {
|
|
6
27
|
}
|
|
28
|
+
export interface PagePropertiesRendererSlots {
|
|
29
|
+
}
|
|
30
|
+
type __VLS_Slots = PagePropertiesRendererSlots;
|
|
7
31
|
type __VLS_ModelProps = {
|
|
8
32
|
modelValue: Page;
|
|
9
33
|
};
|
|
10
34
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
11
|
-
declare const
|
|
35
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
36
|
"update:modelValue": (value: {
|
|
13
37
|
type: "Default";
|
|
14
38
|
properties: import("../../types/index.js").BasePageProperties;
|
|
@@ -19,5 +43,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
19
43
|
properties: import("../../types/index.js").BasePageProperties;
|
|
20
44
|
} & import("../../types/index.js").BasePage) => any) | undefined;
|
|
21
45
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
46
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
22
47
|
declare const _default: typeof __VLS_export;
|
|
23
48
|
export default _default;
|
|
49
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
50
|
+
new (): {
|
|
51
|
+
$slots: S;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
@@ -4,15 +4,31 @@ export interface PageRendererProps {
|
|
|
4
4
|
surround?: PageSurround | null;
|
|
5
5
|
surroundStatus?: 'idle' | 'pending' | 'success' | 'error';
|
|
6
6
|
resolvePage: (id: string) => Promise<Pick<Page, 'title' | 'icon' | 'slug'>>;
|
|
7
|
+
rc?: {
|
|
8
|
+
container?: string;
|
|
9
|
+
grid?: string;
|
|
10
|
+
toc?: string;
|
|
11
|
+
properties?: string;
|
|
12
|
+
contentWrapper?: string;
|
|
13
|
+
banner?: string;
|
|
14
|
+
icon?: string;
|
|
15
|
+
title?: string;
|
|
16
|
+
surroundSkeleton?: string;
|
|
17
|
+
skeleton?: string;
|
|
18
|
+
metadata?: string;
|
|
19
|
+
};
|
|
7
20
|
}
|
|
8
21
|
type __VLS_Props = PageRendererProps;
|
|
9
22
|
export interface PageRendererEmits {
|
|
10
23
|
}
|
|
24
|
+
export interface PageRendererSlots {
|
|
25
|
+
}
|
|
26
|
+
type __VLS_Slots = PageRendererSlots;
|
|
11
27
|
type __VLS_ModelProps = {
|
|
12
28
|
modelValue: Page;
|
|
13
29
|
};
|
|
14
30
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
15
|
-
declare const
|
|
31
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
32
|
"update:modelValue": (value: {
|
|
17
33
|
type: "Default";
|
|
18
34
|
properties: import("../../types/index.js").BasePageProperties;
|
|
@@ -23,5 +39,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
23
39
|
properties: import("../../types/index.js").BasePageProperties;
|
|
24
40
|
} & import("../../types/index.js").BasePage) => any) | undefined;
|
|
25
41
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
42
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
26
43
|
declare const _default: typeof __VLS_export;
|
|
27
44
|
export default _default;
|
|
45
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
46
|
+
new (): {
|
|
47
|
+
$slots: S;
|
|
48
|
+
};
|
|
49
|
+
};
|