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