rimelight-components 2.0.98 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -45
- package/dist/module.json +1 -1
- package/dist/module.mjs +8 -7
- package/dist/runtime/app.config.d.ts +4 -2
- package/dist/runtime/components/app/ScrollToTop.vue +1 -3
- package/dist/runtime/components/blocks/Block.vue +1 -3
- package/dist/runtime/components/blocks/TextRenderer.vue +3 -5
- package/dist/runtime/components/blocks/editor/ImageBlockEditor.vue +2 -6
- package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.vue +6 -7
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.d.vue.ts +1 -1
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.vue +21 -24
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.vue.d.ts +1 -1
- package/dist/runtime/components/blocks/renderer/SectionBlockRenderer.vue +1 -6
- package/dist/runtime/components/blocks/renderer/TestBlockRenderer.vue +1 -1
- package/dist/runtime/components/content/Callout.vue +1 -4
- package/dist/runtime/components/content/Section.vue +8 -10
- package/dist/runtime/components/page/PageEditor.d.vue.ts +2 -2
- package/dist/runtime/components/page/PageEditor.vue +64 -26
- package/dist/runtime/components/page/PageEditor.vue.d.ts +2 -2
- package/dist/runtime/components/page/PageMention.d.vue.ts +6 -0
- package/dist/runtime/components/page/PageMention.vue +42 -0
- package/dist/runtime/components/page/PageMention.vue.d.ts +6 -0
- package/dist/runtime/components/page/PagePropertiesEditor.d.vue.ts +1 -1
- package/dist/runtime/components/page/PagePropertiesEditor.vue +23 -37
- package/dist/runtime/components/page/PagePropertiesEditor.vue.d.ts +1 -1
- package/dist/runtime/components/page/PagePropertiesRenderer.d.vue.ts +12 -2
- package/dist/runtime/components/page/PagePropertiesRenderer.vue +215 -78
- package/dist/runtime/components/page/PagePropertiesRenderer.vue.d.ts +12 -2
- package/dist/runtime/components/page/PageRenderer.d.vue.ts +25 -0
- package/dist/runtime/components/page/PageRenderer.vue +123 -0
- package/dist/runtime/components/page/PageRenderer.vue.d.ts +25 -0
- package/dist/runtime/components/page/PageSurround.vue +9 -9
- package/dist/runtime/components/{blocks/TOC.d.vue.ts → page/PageTOC.d.vue.ts} +5 -8
- package/dist/runtime/components/page/PageTOC.vue +107 -0
- package/dist/runtime/components/{blocks/TOC.vue.d.ts → page/PageTOC.vue.d.ts} +5 -8
- package/dist/runtime/components/swatches/ColorSwatch.vue +1 -4
- package/dist/runtime/composables/index.d.ts +1 -0
- package/dist/runtime/composables/index.js +1 -0
- package/dist/runtime/composables/useBlockEditor.d.ts +173 -517
- package/dist/runtime/composables/usePageEditor.js +7 -3
- package/dist/runtime/composables/usePageRegistry.d.ts +33 -0
- package/dist/runtime/composables/usePageRegistry.js +16 -0
- package/dist/runtime/types/blocks.d.ts +1 -3
- package/dist/runtime/types/pages.d.ts +18 -9
- package/dist/runtime/types/schemas.d.ts +6 -0
- package/dist/runtime/types/schemas.js +3 -1
- package/dist/runtime/utils/page.d.ts +17 -3
- package/dist/runtime/utils/richTextHelpers.js +9 -1
- package/package.json +17 -17
- package/dist/runtime/components/blocks/TOC.vue +0 -95
- package/dist/runtime/components/nodes/MentionNode.d.vue.ts +0 -8
- package/dist/runtime/components/nodes/MentionNode.vue +0 -22
- package/dist/runtime/components/nodes/MentionNode.vue.d.ts +0 -8
package/README.md
CHANGED
|
@@ -51,56 +51,55 @@ Thank you for considering contributing to Rimelight Components. Here are a few w
|
|
|
51
51
|
|
|
52
52
|
## Local Development
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
54
|
+
```bash [bun]
|
|
55
|
+
# Install dependencies
|
|
56
|
+
bun install
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
```bash [bun]
|
|
60
|
+
# Generate type stubs
|
|
61
|
+
bun dev:prepare
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
```bash [bun]
|
|
65
|
+
# Develop with the playground
|
|
66
|
+
bun dev
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
```bash [bun]
|
|
70
|
+
# Build the playground
|
|
71
|
+
bun dev:build
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```bash [bun]
|
|
75
|
+
# Run Typecheck
|
|
76
|
+
bun typecheck
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
```bash [bun]
|
|
80
|
+
# Run Oxlint
|
|
81
|
+
bun lint
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```bash [bun]
|
|
85
|
+
# Run Prettier
|
|
86
|
+
bun format
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
```bash [bun]
|
|
90
|
+
# Run Vitest
|
|
91
|
+
npm run test
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
```bash [bun]
|
|
95
|
+
# Release new version
|
|
96
|
+
bun release
|
|
97
|
+
```
|
|
98
98
|
|
|
99
99
|
Learn more in the [development guide](https://ui.nuxt.com/docs/getting-started/contribution#local-development).
|
|
100
100
|
|
|
101
101
|
## Sponshorship
|
|
102
102
|
|
|
103
|
-
|
|
104
103
|
## License
|
|
105
104
|
|
|
106
105
|
Licensed under the [MIT license](https://github.com/nuxt/ui/blob/v4/LICENSE.md).
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { readdirSync } from 'node:fs';
|
|
|
4
4
|
import { basename } from 'node:path';
|
|
5
5
|
|
|
6
6
|
const name = "rimelight-components";
|
|
7
|
-
const version = "2.
|
|
7
|
+
const version = "2.1.1";
|
|
8
8
|
const homepage = "https://rimelight.com/tools/rimelight-components";
|
|
9
9
|
|
|
10
10
|
const defaultOptions = {
|
|
@@ -197,20 +197,21 @@ const module$1 = defineNuxtModule().with({
|
|
|
197
197
|
addImportsDir(resolve("./runtime/composables"));
|
|
198
198
|
addImportsDir(resolve("./runtime/types"));
|
|
199
199
|
addImportsDir(resolve("./runtime/utils"));
|
|
200
|
+
addServerImportsDir(resolve("./runtime/composables"));
|
|
200
201
|
addServerImportsDir(resolve("./runtime/types"));
|
|
201
202
|
addServerImportsDir(resolve("./runtime/utils"));
|
|
202
|
-
const blockRendererFiles = readdirSync(
|
|
203
|
-
|
|
204
|
-
)
|
|
203
|
+
const blockRendererFiles = readdirSync(resolve("./runtime/components/blocks/renderer")).filter(
|
|
204
|
+
(name2) => name2.endsWith(".vue")
|
|
205
|
+
);
|
|
205
206
|
const blockRendererNames = blockRendererFiles.map((file) => {
|
|
206
207
|
const baseName = basename(file, ".vue");
|
|
207
208
|
return baseName.replace(/Renderer$/, "");
|
|
208
209
|
});
|
|
209
210
|
const blockRendererTemplate = addBlockMapTemplates(blockRendererNames);
|
|
210
211
|
nuxt.options.alias["#build/rimelight-block-renderer-map"] = blockRendererTemplate.dst;
|
|
211
|
-
const blockEditorFiles = readdirSync(
|
|
212
|
-
|
|
213
|
-
)
|
|
212
|
+
const blockEditorFiles = readdirSync(resolve("./runtime/components/blocks/editor")).filter(
|
|
213
|
+
(name2) => name2.endsWith(".vue")
|
|
214
|
+
);
|
|
214
215
|
const blockEditorNames = blockEditorFiles.map((file) => {
|
|
215
216
|
const baseName = basename(file, ".vue");
|
|
216
217
|
return baseName.replace(/Editor$/, "");
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
declare module
|
|
2
|
-
import type { AppConfig } from
|
|
1
|
+
declare module "#build/app.config" {
|
|
2
|
+
import type { AppConfig } from "@nuxt/schema"
|
|
3
|
+
import type { PageType, PageDefinition } from "~/src/runtime/types"
|
|
3
4
|
|
|
4
5
|
interface RimelightComponentsConfig {
|
|
6
|
+
pageDefinitions?: Partial<Record<PageType, PageDefinition>>
|
|
5
7
|
[key: string]: any
|
|
6
8
|
}
|
|
7
9
|
|
|
@@ -81,9 +81,7 @@ const durationInSeconds = computed(() => `${props.duration}s`);
|
|
|
81
81
|
class="gauge-primary-stroke opacity-100"
|
|
82
82
|
/>
|
|
83
83
|
</svg>
|
|
84
|
-
<div
|
|
85
|
-
class="absolute inset-0 flex items-center justify-center text-center"
|
|
86
|
-
>
|
|
84
|
+
<div class="absolute inset-0 flex items-center justify-center text-center">
|
|
87
85
|
<UIcon name="lucide:arrow-up" class="size-6 text-white" />
|
|
88
86
|
</div>
|
|
89
87
|
</div>
|
|
@@ -55,9 +55,7 @@ const items = ref([
|
|
|
55
55
|
|
|
56
56
|
<template>
|
|
57
57
|
<div class="group relative pl-12 flex flex-row gap-xs">
|
|
58
|
-
<div
|
|
59
|
-
class="top-0 left-0 z-10 opacity-0 transition-opacity group-hover:opacity-100"
|
|
60
|
-
>
|
|
58
|
+
<div class="top-0 left-0 z-10 opacity-0 transition-opacity group-hover:opacity-100">
|
|
61
59
|
<UDropdownMenu :items="items">
|
|
62
60
|
<UButton icon="lucide:grip-vertical" variant="ghost" color="neutral" />
|
|
63
61
|
</UDropdownMenu>
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "../../types";
|
|
4
4
|
import TextNode from "../nodes/TextNode.vue";
|
|
5
5
|
import LinkNode from "../nodes/LinkNode.vue";
|
|
6
|
-
import
|
|
6
|
+
import PageMention from "../page/PageMention.vue";
|
|
7
7
|
defineOptions({
|
|
8
8
|
name: "TextRenderer"
|
|
9
9
|
});
|
|
@@ -17,7 +17,7 @@ const getTag = (item) => {
|
|
|
17
17
|
case "link":
|
|
18
18
|
return LinkNode;
|
|
19
19
|
case "mention":
|
|
20
|
-
return
|
|
20
|
+
return PageMention;
|
|
21
21
|
default:
|
|
22
22
|
return TextNode;
|
|
23
23
|
}
|
|
@@ -41,9 +41,7 @@ const getProps = (item) => {
|
|
|
41
41
|
case "mention": {
|
|
42
42
|
const mentionProps = item.props;
|
|
43
43
|
return {
|
|
44
|
-
|
|
45
|
-
target: mentionProps.target,
|
|
46
|
-
content: mentionProps.content
|
|
44
|
+
pageId: mentionProps.pageId
|
|
47
45
|
};
|
|
48
46
|
}
|
|
49
47
|
default:
|
|
@@ -90,9 +90,7 @@ watch(fileToUpload, (newFile) => {
|
|
|
90
90
|
<template #default>
|
|
91
91
|
<span class="text-xs text-muted">Alt</span>
|
|
92
92
|
</template>
|
|
93
|
-
<template #content>
|
|
94
|
-
The text description for the image used by screen readers.
|
|
95
|
-
</template>
|
|
93
|
+
<template #content> The text description for the image used by screen readers. </template>
|
|
96
94
|
</UTooltip>
|
|
97
95
|
</template>
|
|
98
96
|
</UInput>
|
|
@@ -109,9 +107,7 @@ watch(fileToUpload, (newFile) => {
|
|
|
109
107
|
<template #default>
|
|
110
108
|
<span class="text-xs text-muted">Caption</span>
|
|
111
109
|
</template>
|
|
112
|
-
<template #content>
|
|
113
|
-
The text description for the image used by screen readers.
|
|
114
|
-
</template>
|
|
110
|
+
<template #content> The text description for the image used by screen readers. </template>
|
|
115
111
|
</UTooltip>
|
|
116
112
|
</template>
|
|
117
113
|
</UTextarea>
|
|
@@ -45,15 +45,14 @@ onMounted(() => {
|
|
|
45
45
|
</script>
|
|
46
46
|
|
|
47
47
|
<template>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
<div
|
|
49
|
+
ref="editorRef"
|
|
50
|
+
contenteditable="true"
|
|
51
|
+
@blur="commitContentOnBlur"
|
|
52
|
+
:class="[
|
|
53
53
|
'p-2 outline-none min-h-6',
|
|
54
54
|
'focus:ring-2 focus:ring-blue-500 rounded-md transition duration-150',
|
|
55
55
|
'text-base'
|
|
56
56
|
]"
|
|
57
|
-
|
|
58
|
-
</div>
|
|
57
|
+
></div>
|
|
59
58
|
</template>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { inject, ref, computed, watch } from "vue";
|
|
3
|
+
import {} from "../../../types";
|
|
4
|
+
import {} from "@nuxt/ui/components/Select.vue";
|
|
3
5
|
const { level, title, description, children, id } = defineProps({
|
|
4
6
|
level: { type: Number, required: true },
|
|
5
7
|
title: { type: String, required: true },
|
|
@@ -66,32 +68,27 @@ watch(
|
|
|
66
68
|
|
|
67
69
|
<template>
|
|
68
70
|
<div class="flex flex-col gap-sm">
|
|
69
|
-
<RCSection
|
|
70
|
-
:level="localLevel"
|
|
71
|
-
:title="localTitle"
|
|
72
|
-
:description="description"
|
|
73
|
-
is-editing
|
|
74
|
-
>
|
|
71
|
+
<RCSection :level="localLevel" :title="localTitle" :description="description" is-editing>
|
|
75
72
|
<template #title>
|
|
76
73
|
<div class="flex flex-row gap-xs">
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
74
|
+
<USelect
|
|
75
|
+
v-model="localLevel"
|
|
76
|
+
:items="levelItems"
|
|
77
|
+
value-key="value"
|
|
78
|
+
label-key="label"
|
|
79
|
+
variant="ghost"
|
|
80
|
+
placeholder="Select Heading Level"
|
|
81
|
+
size="sm"
|
|
82
|
+
color="neutral"
|
|
83
|
+
/>
|
|
84
|
+
<UInput
|
|
85
|
+
:model-value="localTitle"
|
|
86
|
+
variant="ghost"
|
|
87
|
+
placeholder="Section Title..."
|
|
88
|
+
@input="updateLocalTitle"
|
|
89
|
+
@blur="commitTitleOnBlur"
|
|
90
|
+
class="w-full"
|
|
91
|
+
/>
|
|
95
92
|
</div>
|
|
96
93
|
</template>
|
|
97
94
|
<template #description>
|
|
@@ -12,12 +12,7 @@ const hasChildren = computed(() => children && children.length > 0);
|
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<template>
|
|
15
|
-
<RCSection
|
|
16
|
-
:level="level"
|
|
17
|
-
:title="title"
|
|
18
|
-
:description="description"
|
|
19
|
-
:id="headingId"
|
|
20
|
-
>
|
|
15
|
+
<RCSection :level="level" :title="title" :description="description" :id="headingId">
|
|
21
16
|
<RCBlockViewRenderer v-if="hasChildren" :blocks="children" />
|
|
22
17
|
</RCSection>
|
|
23
18
|
</template>
|
|
@@ -39,10 +39,7 @@ const tooltip = computed(() => config.value.tooltip);
|
|
|
39
39
|
</template>
|
|
40
40
|
<template #close>
|
|
41
41
|
<UTooltip v-if="tooltip" :text="t(tooltip)">
|
|
42
|
-
<UIcon
|
|
43
|
-
name="lucide:circle-question-mark"
|
|
44
|
-
class="pointer-events-auto size-5"
|
|
45
|
-
/>
|
|
42
|
+
<UIcon name="lucide:circle-question-mark" class="pointer-events-auto size-5" />
|
|
46
43
|
</UTooltip>
|
|
47
44
|
</template>
|
|
48
45
|
</UAlert>
|
|
@@ -115,28 +115,26 @@ const fullSectionUrl = computed(() => {
|
|
|
115
115
|
|
|
116
116
|
<template>
|
|
117
117
|
<section :id="sectionId" :class="sectionSlot()" v-bind="$attrs">
|
|
118
|
-
<component
|
|
119
|
-
:id="sectionId"
|
|
120
|
-
:is="`h${level}`"
|
|
121
|
-
:class="headingSlot()"
|
|
122
|
-
>
|
|
118
|
+
<component :id="sectionId" :is="`h${level}`" :class="headingSlot()">
|
|
123
119
|
<NuxtLink
|
|
124
120
|
v-if="!isEditing"
|
|
125
121
|
:href="`#${sectionId}`"
|
|
126
122
|
:class="linkSlot()"
|
|
127
|
-
class="group lg:-ms-2 lg:ps-2"
|
|
123
|
+
class="group relative lg:-ms-2 lg:ps-2 inline-block w-full"
|
|
128
124
|
>
|
|
129
125
|
<ClientOnly>
|
|
130
126
|
<UButton
|
|
131
127
|
variant="soft"
|
|
132
128
|
color="primary"
|
|
133
|
-
|
|
129
|
+
icon="i-lucide-link"
|
|
134
130
|
:to="`#${sectionId}`"
|
|
135
|
-
class="absolute top-1 -ms-8 hidden rounded-md p-1 opacity-0 transition group-hover:opacity-100 group-focus:opacity-100 lg:flex"
|
|
136
|
-
@click="copyToClipboard(fullSectionUrl)"
|
|
131
|
+
class="absolute top-1/2 -translate-y-1/2 -ms-8 hidden rounded-md p-1 opacity-0 transition group-hover:opacity-100 group-focus:opacity-100 lg:flex"
|
|
132
|
+
@click.prevent="copyToClipboard(fullSectionUrl)"
|
|
137
133
|
/>
|
|
138
134
|
<template #fallback>
|
|
139
|
-
<div
|
|
135
|
+
<div
|
|
136
|
+
class="absolute top-1/2 -translate-y-1/2 -ms-8 w-6 h-6 rounded-md p-1 opacity-0 transition lg:flex"
|
|
137
|
+
/>
|
|
140
138
|
</template>
|
|
141
139
|
</ClientOnly>
|
|
142
140
|
<slot name="title">{{ title }}</slot>
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ref, computed, useTemplateRef } from "vue";
|
|
3
3
|
import { usePageEditor } from "../../composables";
|
|
4
|
+
import { getLocalizedContent } from "../../utils";
|
|
4
5
|
const page = defineModel({ type: null, ...{ required: true } });
|
|
5
6
|
const { undo, redo, canUndo, canRedo, captureSnapshot } = usePageEditor(page);
|
|
7
|
+
const { isSaving } = defineProps({
|
|
8
|
+
isSaving: { type: Boolean, required: true }
|
|
9
|
+
});
|
|
6
10
|
const emit = defineEmits(["save"]);
|
|
7
11
|
const handleSave = () => {
|
|
8
12
|
const dataToPersist = JSON.parse(JSON.stringify(page.value));
|
|
@@ -14,9 +18,6 @@ defineExpose({
|
|
|
14
18
|
canUndo,
|
|
15
19
|
canRedo
|
|
16
20
|
});
|
|
17
|
-
defineProps({
|
|
18
|
-
isSaving: { type: Boolean, required: true }
|
|
19
|
-
});
|
|
20
21
|
const editorRef = useTemplateRef("editor");
|
|
21
22
|
const showPreview = ref(false);
|
|
22
23
|
const editorPanelClass = computed(() => ({
|
|
@@ -71,33 +72,70 @@ const editorPanelClass = computed(() => ({
|
|
|
71
72
|
</div>
|
|
72
73
|
</template>
|
|
73
74
|
</UHeader>
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
<UContainer
|
|
76
|
+
class="mt-24 grid gap-xl"
|
|
77
|
+
:class="showPreview ? 'grid-cols-2 max-w-full' : 'grid-cols-1'"
|
|
78
|
+
>
|
|
79
|
+
<div :class="editorPanelClass" class="grid grid-cols-1 lg:grid-cols-4 gap-8">
|
|
80
|
+
<UPageAside class="order-1 lg:order-2 lg:col-span-1">
|
|
81
|
+
<RCPagePropertiesEditor v-model="page" />
|
|
82
|
+
</UPageAside>
|
|
83
|
+
<div class="order-2 lg:order-1 lg:col-span-3">
|
|
84
|
+
<UPageHeader
|
|
85
|
+
:title="getLocalizedContent(page.title, 'en')"
|
|
86
|
+
:description="getLocalizedContent(page.description, 'en') ?? ''"
|
|
87
|
+
/>
|
|
79
88
|
<RCBlockEditor
|
|
80
89
|
ref="editor"
|
|
81
90
|
v-model="page.blocks"
|
|
82
91
|
:class="editorPanelClass"
|
|
83
92
|
@mutation="captureSnapshot"
|
|
84
93
|
/>
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
94
|
+
<div class="flex flex-col gap-xs text-xs">
|
|
95
|
+
<h6>Metadata</h6>
|
|
96
|
+
<span>Page ID: {{ page.id }}</span>
|
|
97
|
+
<span
|
|
98
|
+
>Created At:
|
|
99
|
+
<NuxtTime
|
|
100
|
+
:datetime="page.created_at ?? ''"
|
|
101
|
+
year="numeric"
|
|
102
|
+
month="numeric"
|
|
103
|
+
day="numeric"
|
|
104
|
+
hour="numeric"
|
|
105
|
+
minute="numeric"
|
|
106
|
+
second="numeric"
|
|
107
|
+
time-zone-name="short"
|
|
108
|
+
/></span>
|
|
109
|
+
<span
|
|
110
|
+
>Posted At:
|
|
111
|
+
<NuxtTime
|
|
112
|
+
:datetime="page.created_at ?? ''"
|
|
113
|
+
year="numeric"
|
|
114
|
+
month="numeric"
|
|
115
|
+
day="numeric"
|
|
116
|
+
hour="numeric"
|
|
117
|
+
minute="numeric"
|
|
118
|
+
second="numeric"
|
|
119
|
+
time-zone-name="short"
|
|
120
|
+
/></span>
|
|
121
|
+
<span
|
|
122
|
+
>Updated At:
|
|
123
|
+
<NuxtTime
|
|
124
|
+
:datetime="page.created_at ?? ''"
|
|
125
|
+
year="numeric"
|
|
126
|
+
month="numeric"
|
|
127
|
+
day="numeric"
|
|
128
|
+
hour="numeric"
|
|
129
|
+
minute="numeric"
|
|
130
|
+
second="numeric"
|
|
131
|
+
time-zone-name="short"
|
|
132
|
+
/></span>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
<div class="flex flex-row gap-xl">
|
|
137
|
+
<USeparator orientation="vertical" />
|
|
138
|
+
<RCPageRenderer v-if="showPreview" v-model="page" />
|
|
139
|
+
</div>
|
|
140
|
+
</UContainer>
|
|
103
141
|
</template>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
interface PageMentionProps {
|
|
2
|
+
pageId: string;
|
|
3
|
+
}
|
|
4
|
+
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
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { inject } from "vue";
|
|
3
|
+
import { getLocalizedContent } from "../../utils";
|
|
4
|
+
import { useI18n } from "vue-i18n";
|
|
5
|
+
import {} from "../../types";
|
|
6
|
+
import { useAsyncData } from "#imports";
|
|
7
|
+
const { pageId } = defineProps({
|
|
8
|
+
pageId: { type: String, required: true }
|
|
9
|
+
});
|
|
10
|
+
const { locale } = useI18n();
|
|
11
|
+
const resolver = inject("page-resolver");
|
|
12
|
+
const { data: linkedPage, status } = await useAsyncData(`page-mention-${pageId}`, async () => {
|
|
13
|
+
if (!resolver) {
|
|
14
|
+
console.warn("RCPageMention: No page resolver provided in RCPageRenderer");
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
return await resolver(pageId);
|
|
18
|
+
}, {
|
|
19
|
+
lazy: true,
|
|
20
|
+
server: false,
|
|
21
|
+
watch: [() => pageId]
|
|
22
|
+
});
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<NuxtLink
|
|
27
|
+
v-if="linkedPage"
|
|
28
|
+
:to="`/${linkedPage.slug}`"
|
|
29
|
+
class="inline-flex items-baseline gap-1 align-middle hover:text-primary transition-colors font-medium text-inherit"
|
|
30
|
+
>
|
|
31
|
+
<NuxtImg
|
|
32
|
+
v-if="linkedPage.icon?.src"
|
|
33
|
+
:src="linkedPage.icon.src"
|
|
34
|
+
:alt="linkedPage.icon.alt"
|
|
35
|
+
class="w-4 h-4 rounded-full object-cover shrink-0"
|
|
36
|
+
/>
|
|
37
|
+
<span class="truncate font-medium">
|
|
38
|
+
{{ getLocalizedContent(linkedPage.title, locale) }}
|
|
39
|
+
</span>
|
|
40
|
+
</NuxtLink>
|
|
41
|
+
<USkeleton v-else-if="status === 'pending'" class="h-3 w-24" />
|
|
42
|
+
</template>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
interface PageMentionProps {
|
|
2
|
+
pageId: string;
|
|
3
|
+
}
|
|
4
|
+
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
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|