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.
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/app/Footer.d.vue.ts +18 -9
- package/dist/runtime/components/app/Footer.vue +25 -12
- package/dist/runtime/components/app/Footer.vue.d.ts +18 -9
- package/dist/runtime/components/app/Header.d.vue.ts +24 -15
- package/dist/runtime/components/app/Header.vue +18 -11
- package/dist/runtime/components/app/Header.vue.d.ts +24 -15
- package/dist/runtime/components/app/HeaderLayer.d.vue.ts +13 -7
- package/dist/runtime/components/app/HeaderLayer.vue +21 -9
- package/dist/runtime/components/app/HeaderLayer.vue.d.ts +13 -7
- package/dist/runtime/components/app/Image.d.vue.ts +18 -4
- package/dist/runtime/components/app/Image.vue +34 -16
- package/dist/runtime/components/app/Image.vue.d.ts +18 -4
- package/dist/runtime/components/app/Logo.d.vue.ts +17 -3
- package/dist/runtime/components/app/Logo.vue +16 -4
- package/dist/runtime/components/app/Logo.vue.d.ts +17 -3
- package/dist/runtime/components/app/NewsletterSignup.d.vue.ts +17 -3
- package/dist/runtime/components/app/NewsletterSignup.vue +16 -3
- package/dist/runtime/components/app/NewsletterSignup.vue.d.ts +17 -3
- package/dist/runtime/components/app/ScrollToTop.d.vue.ts +20 -5
- package/dist/runtime/components/app/ScrollToTop.vue +31 -15
- package/dist/runtime/components/app/ScrollToTop.vue.d.ts +20 -5
- package/dist/runtime/components/blocks/Block.d.vue.ts +13 -7
- package/dist/runtime/components/blocks/Block.vue +20 -7
- package/dist/runtime/components/blocks/Block.vue.d.ts +13 -7
- package/dist/runtime/components/blocks/BlockEditRenderer.d.vue.ts +17 -3
- package/dist/runtime/components/blocks/BlockEditRenderer.vue +15 -3
- package/dist/runtime/components/blocks/BlockEditRenderer.vue.d.ts +17 -3
- package/dist/runtime/components/blocks/BlockEditor.d.vue.ts +13 -4
- package/dist/runtime/components/blocks/BlockEditor.vue +11 -35
- package/dist/runtime/components/blocks/BlockEditor.vue.d.ts +13 -4
- package/dist/runtime/components/blocks/BlockViewRenderer.d.vue.ts +17 -3
- package/dist/runtime/components/blocks/BlockViewRenderer.vue +15 -3
- package/dist/runtime/components/blocks/BlockViewRenderer.vue.d.ts +17 -3
- package/dist/runtime/components/blocks/TextRenderer.d.vue.ts +17 -3
- package/dist/runtime/components/blocks/TextRenderer.vue +19 -5
- package/dist/runtime/components/blocks/TextRenderer.vue.d.ts +17 -3
- package/dist/runtime/components/blocks/editor/CalloutBlockEditor.d.vue.ts +17 -1
- package/dist/runtime/components/blocks/editor/CalloutBlockEditor.vue +18 -4
- package/dist/runtime/components/blocks/editor/CalloutBlockEditor.vue.d.ts +17 -1
- package/dist/runtime/components/blocks/editor/CardBlockEditor.d.vue.ts +17 -1
- package/dist/runtime/components/blocks/editor/CardBlockEditor.vue +14 -2
- package/dist/runtime/components/blocks/editor/CardBlockEditor.vue.d.ts +17 -1
- package/dist/runtime/components/blocks/editor/ImageBlockEditor.d.vue.ts +27 -3
- package/dist/runtime/components/blocks/editor/ImageBlockEditor.vue +25 -9
- package/dist/runtime/components/blocks/editor/ImageBlockEditor.vue.d.ts +27 -3
- package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.d.vue.ts +17 -3
- package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.vue +21 -13
- package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.vue.d.ts +17 -3
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.d.vue.ts +19 -3
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.vue +20 -6
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.vue.d.ts +19 -3
- package/dist/runtime/components/blocks/editor/TestBlockEditor.d.vue.ts +17 -3
- package/dist/runtime/components/blocks/editor/TestBlockEditor.vue +16 -4
- package/dist/runtime/components/blocks/editor/TestBlockEditor.vue.d.ts +17 -3
- package/dist/runtime/components/blocks/renderer/CalloutBlockRenderer.d.vue.ts +17 -1
- package/dist/runtime/components/blocks/renderer/CalloutBlockRenderer.vue +18 -4
- package/dist/runtime/components/blocks/renderer/CalloutBlockRenderer.vue.d.ts +17 -1
- package/dist/runtime/components/blocks/renderer/CardBlockRenderer.d.vue.ts +17 -1
- package/dist/runtime/components/blocks/renderer/CardBlockRenderer.vue +14 -2
- package/dist/runtime/components/blocks/renderer/CardBlockRenderer.vue.d.ts +17 -1
- package/dist/runtime/components/blocks/renderer/ImageBlockRenderer.d.vue.ts +19 -1
- package/dist/runtime/components/blocks/renderer/ImageBlockRenderer.vue +18 -4
- package/dist/runtime/components/blocks/renderer/ImageBlockRenderer.vue.d.ts +19 -1
- package/dist/runtime/components/blocks/renderer/ParagraphBlockRenderer.d.vue.ts +17 -1
- package/dist/runtime/components/blocks/renderer/ParagraphBlockRenderer.vue +16 -2
- package/dist/runtime/components/blocks/renderer/ParagraphBlockRenderer.vue.d.ts +17 -1
- package/dist/runtime/components/blocks/renderer/SectionBlockRenderer.d.vue.ts +17 -1
- package/dist/runtime/components/blocks/renderer/SectionBlockRenderer.vue +18 -4
- package/dist/runtime/components/blocks/renderer/SectionBlockRenderer.vue.d.ts +17 -1
- package/dist/runtime/components/blocks/renderer/TestBlockRenderer.d.vue.ts +17 -1
- package/dist/runtime/components/blocks/renderer/TestBlockRenderer.vue +16 -2
- package/dist/runtime/components/blocks/renderer/TestBlockRenderer.vue.d.ts +17 -1
- package/dist/runtime/components/cards/TeamCard.d.vue.ts +16 -7
- package/dist/runtime/components/cards/TeamCard.vue +29 -7
- package/dist/runtime/components/cards/TeamCard.vue.d.ts +16 -7
- package/dist/runtime/components/content/Callout.d.vue.ts +13 -7
- package/dist/runtime/components/content/Callout.vue +19 -6
- package/dist/runtime/components/content/Callout.vue.d.ts +13 -7
- package/dist/runtime/components/content/Section.d.vue.ts +19 -13
- package/dist/runtime/components/content/Section.vue +93 -87
- package/dist/runtime/components/content/Section.vue.d.ts +19 -13
- package/dist/runtime/components/content/Test.d.vue.ts +12 -7
- package/dist/runtime/components/content/Test.vue +15 -3
- package/dist/runtime/components/content/Test.vue.d.ts +12 -7
- package/dist/runtime/components/nodes/LinkNode.d.vue.ts +17 -3
- package/dist/runtime/components/nodes/LinkNode.vue +17 -3
- package/dist/runtime/components/nodes/LinkNode.vue.d.ts +17 -3
- package/dist/runtime/components/nodes/TextNode.d.vue.ts +17 -3
- package/dist/runtime/components/nodes/TextNode.vue +15 -3
- package/dist/runtime/components/nodes/TextNode.vue.d.ts +17 -3
- package/dist/runtime/components/page/PageEditor.d.vue.ts +35 -5
- package/dist/runtime/components/page/PageEditor.vue +80 -31
- package/dist/runtime/components/page/PageEditor.vue.d.ts +35 -5
- package/dist/runtime/components/page/PageMention.d.vue.ts +19 -2
- package/dist/runtime/components/page/PageMention.vue +21 -6
- package/dist/runtime/components/page/PageMention.vue.d.ts +19 -2
- package/dist/runtime/components/page/PagePropertiesEditor.d.vue.ts +30 -2
- package/dist/runtime/components/page/PagePropertiesEditor.vue +113 -76
- package/dist/runtime/components/page/PagePropertiesEditor.vue.d.ts +30 -2
- package/dist/runtime/components/page/PagePropertiesRenderer.d.vue.ts +38 -2
- package/dist/runtime/components/page/PagePropertiesRenderer.vue +80 -29
- package/dist/runtime/components/page/PagePropertiesRenderer.vue.d.ts +38 -2
- package/dist/runtime/components/page/PageRenderer.d.vue.ts +26 -2
- package/dist/runtime/components/page/PageRenderer.vue +56 -18
- package/dist/runtime/components/page/PageRenderer.vue.d.ts +26 -2
- package/dist/runtime/components/page/PageSurround.d.vue.ts +25 -3
- package/dist/runtime/components/page/PageSurround.vue +61 -26
- package/dist/runtime/components/page/PageSurround.vue.d.ts +25 -3
- package/dist/runtime/components/page/PageTOC.d.vue.ts +15 -7
- package/dist/runtime/components/page/PageTOC.vue +23 -9
- package/dist/runtime/components/page/PageTOC.vue.d.ts +15 -7
- package/dist/runtime/components/page/modals/CreatePageModal.d.vue.ts +12 -4
- package/dist/runtime/components/page/modals/CreatePageModal.vue +34 -24
- 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 +28 -7
- package/dist/runtime/components/page/modals/DeletePageModal.vue.d.ts +14 -7
- package/dist/runtime/components/swatches/ColorSwatch.d.vue.ts +23 -3
- package/dist/runtime/components/swatches/ColorSwatch.vue +41 -15
- package/dist/runtime/components/swatches/ColorSwatch.vue.d.ts +23 -3
- package/dist/runtime/components/swatches/FontSwatch.d.vue.ts +22 -3
- package/dist/runtime/components/swatches/FontSwatch.vue +29 -12
- package/dist/runtime/components/swatches/FontSwatch.vue.d.ts +22 -3
- package/dist/runtime/components/swatches/ImageSwatch.d.vue.ts +22 -3
- package/dist/runtime/components/swatches/ImageSwatch.vue +29 -12
- package/dist/runtime/components/swatches/ImageSwatch.vue.d.ts +22 -3
- package/dist/runtime/components/utilities/Placeholder.d.vue.ts +13 -5
- package/dist/runtime/components/utilities/Placeholder.vue +19 -5
- package/dist/runtime/components/utilities/Placeholder.vue.d.ts +13 -5
- 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,27 +1,49 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
|
|
2
|
+
import { tv } from "../../utils/tv";
|
|
3
|
+
import { useRC } from "../../composables/useRC";
|
|
4
|
+
const { src, alt, name, role, description, rc: rcProp } = defineProps({
|
|
3
5
|
src: { type: String, required: true },
|
|
4
6
|
alt: { type: String, required: true },
|
|
5
7
|
name: { type: String, required: true },
|
|
6
8
|
role: { type: String, required: true },
|
|
7
|
-
description: { type: String, required: true }
|
|
9
|
+
description: { type: String, required: true },
|
|
10
|
+
rc: { type: Object, required: false }
|
|
8
11
|
});
|
|
12
|
+
const emit = defineEmits([]);
|
|
13
|
+
const slots = defineSlots();
|
|
14
|
+
const { rc } = useRC("TeamCard", rcProp);
|
|
15
|
+
const teamCardStyles = tv({
|
|
16
|
+
slots: {
|
|
17
|
+
details: "flex flex-col gap-xs",
|
|
18
|
+
name: "text-xl font-bold",
|
|
19
|
+
role: "text-sm",
|
|
20
|
+
description: "text-md",
|
|
21
|
+
links: "flex flex-row gap-md"
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const {
|
|
25
|
+
details,
|
|
26
|
+
name: nameClass,
|
|
27
|
+
role: roleClass,
|
|
28
|
+
description: descriptionClass,
|
|
29
|
+
links
|
|
30
|
+
} = teamCardStyles();
|
|
9
31
|
</script>
|
|
10
32
|
|
|
11
33
|
<template>
|
|
12
34
|
<UCard>
|
|
13
35
|
<RCImage :src="src" :alt="alt" />
|
|
14
|
-
<div class="
|
|
15
|
-
<h3 class="
|
|
36
|
+
<div :class="details({ class: rc.details })">
|
|
37
|
+
<h3 :class="nameClass({ class: rc.name })">
|
|
16
38
|
{{ name }}
|
|
17
39
|
</h3>
|
|
18
|
-
<span class="
|
|
40
|
+
<span :class="roleClass({ class: rc.role })">{{ role }}</span>
|
|
19
41
|
</div>
|
|
20
|
-
<p class="
|
|
42
|
+
<p :class="descriptionClass({ class: rc.description })">
|
|
21
43
|
{{ description }}
|
|
22
44
|
</p>
|
|
23
45
|
<template #footer>
|
|
24
|
-
<div class="
|
|
46
|
+
<div :class="links({ class: rc.links })">
|
|
25
47
|
<slot name="links" />
|
|
26
48
|
</div>
|
|
27
49
|
</template>
|
|
@@ -1,15 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
export interface TeamCardProps {
|
|
2
2
|
src: string;
|
|
3
3
|
alt: string;
|
|
4
4
|
name: string;
|
|
5
5
|
role: string;
|
|
6
6
|
description: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
rc?: {
|
|
8
|
+
details?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
role?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
links?: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface TeamCardEmits {
|
|
16
|
+
}
|
|
17
|
+
export interface TeamCardSlots {
|
|
18
|
+
links: (props: {}) => any;
|
|
19
|
+
}
|
|
20
|
+
type __VLS_Slots = TeamCardSlots;
|
|
21
|
+
declare const __VLS_base: import("vue").DefineComponent<TeamCardProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TeamCardProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
22
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
23
|
declare const _default: typeof __VLS_export;
|
|
15
24
|
export default _default;
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
export type CalloutVariant = "info" | "success" | "warning" | "error" | "commentary" | "ideation" | "source";
|
|
2
|
-
|
|
2
|
+
export interface CalloutProps {
|
|
3
3
|
variant: CalloutVariant;
|
|
4
4
|
to?: string;
|
|
5
5
|
target?: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
6
|
+
rc?: {
|
|
7
|
+
icon?: string;
|
|
8
|
+
tooltipIcon?: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface CalloutEmits {
|
|
12
|
+
}
|
|
13
|
+
export interface CalloutSlots {
|
|
14
|
+
default: (props: {}) => any;
|
|
15
|
+
}
|
|
16
|
+
type __VLS_Slots = CalloutSlots;
|
|
17
|
+
declare const __VLS_base: import("vue").DefineComponent<CalloutProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CalloutProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
18
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
13
19
|
declare const _default: typeof __VLS_export;
|
|
14
20
|
export default _default;
|
|
@@ -2,13 +2,26 @@
|
|
|
2
2
|
import { useAppConfig } from "#imports";
|
|
3
3
|
import { computed } from "#imports";
|
|
4
4
|
import { useI18n } from "vue-i18n";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const { variant, to, target } = defineProps({
|
|
5
|
+
import { tv } from "../../utils/tv";
|
|
6
|
+
import { useRC } from "../../composables/useRC";
|
|
7
|
+
const { variant, to, target, rc: rcProp } = defineProps({
|
|
8
8
|
variant: { type: String, required: true },
|
|
9
9
|
to: { type: String, required: false },
|
|
10
|
-
target: { type: String, required: false }
|
|
10
|
+
target: { type: String, required: false },
|
|
11
|
+
rc: { type: Object, required: false }
|
|
12
|
+
});
|
|
13
|
+
const emit = defineEmits([]);
|
|
14
|
+
const slots = defineSlots();
|
|
15
|
+
const { rc } = useRC("Callout", rcProp);
|
|
16
|
+
const calloutStyles = tv({
|
|
17
|
+
slots: {
|
|
18
|
+
icon: "size-6",
|
|
19
|
+
tooltipIcon: "pointer-events-auto size-5"
|
|
20
|
+
}
|
|
11
21
|
});
|
|
22
|
+
const { icon: iconClass, tooltipIcon } = calloutStyles();
|
|
23
|
+
const { t } = useI18n();
|
|
24
|
+
const appConfig = useAppConfig();
|
|
12
25
|
const config = computed(() => {
|
|
13
26
|
return appConfig.rimelightComponents?.callouts?.[variant] ?? {
|
|
14
27
|
icon: "lucide:alert-circle",
|
|
@@ -32,14 +45,14 @@ const tooltip = computed(() => config.value.tooltip);
|
|
|
32
45
|
}"
|
|
33
46
|
>
|
|
34
47
|
<template #leading>
|
|
35
|
-
<UIcon :name="icon" class="
|
|
48
|
+
<UIcon :name="icon" :class="iconClass({ class: rc.icon })" />
|
|
36
49
|
</template>
|
|
37
50
|
<template #description>
|
|
38
51
|
<slot />
|
|
39
52
|
</template>
|
|
40
53
|
<template #close>
|
|
41
54
|
<UTooltip v-if="tooltip" :text="t(tooltip)">
|
|
42
|
-
<UIcon name="lucide:circle-question-mark" class="
|
|
55
|
+
<UIcon name="lucide:circle-question-mark" :class="tooltipIcon({ class: rc.tooltipIcon })" />
|
|
43
56
|
</UTooltip>
|
|
44
57
|
</template>
|
|
45
58
|
</UAlert>
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
export type CalloutVariant = "info" | "success" | "warning" | "error" | "commentary" | "ideation" | "source";
|
|
2
|
-
|
|
2
|
+
export interface CalloutProps {
|
|
3
3
|
variant: CalloutVariant;
|
|
4
4
|
to?: string;
|
|
5
5
|
target?: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
6
|
+
rc?: {
|
|
7
|
+
icon?: string;
|
|
8
|
+
tooltipIcon?: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface CalloutEmits {
|
|
12
|
+
}
|
|
13
|
+
export interface CalloutSlots {
|
|
14
|
+
default: (props: {}) => any;
|
|
15
|
+
}
|
|
16
|
+
type __VLS_Slots = CalloutSlots;
|
|
17
|
+
declare const __VLS_base: import("vue").DefineComponent<CalloutProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CalloutProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
18
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
13
19
|
declare const _default: typeof __VLS_export;
|
|
14
20
|
export default _default;
|
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
export type SectionLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
2
|
-
|
|
2
|
+
export interface SectionProps {
|
|
3
3
|
level?: SectionLevel;
|
|
4
4
|
title: string;
|
|
5
5
|
description?: string;
|
|
6
6
|
isEditing?: boolean;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
7
|
+
rc?: {
|
|
8
|
+
section?: string;
|
|
9
|
+
link?: string;
|
|
10
|
+
heading?: string;
|
|
11
|
+
descriptionText?: string;
|
|
12
|
+
separator?: string;
|
|
13
|
+
content?: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface SectionEmits {
|
|
17
|
+
}
|
|
18
|
+
export interface SectionSlots {
|
|
19
|
+
default: (props: {}) => any;
|
|
20
|
+
title: (props: {}) => any;
|
|
21
|
+
description: (props: {}) => any;
|
|
22
|
+
}
|
|
23
|
+
type __VLS_Slots = SectionSlots;
|
|
24
|
+
declare const __VLS_base: import("vue").DefineComponent<SectionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SectionProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
25
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
26
|
declare const _default: typeof __VLS_export;
|
|
21
27
|
export default _default;
|
|
@@ -3,108 +3,114 @@ import { useRoute } from "#imports";
|
|
|
3
3
|
import { computed } from "vue";
|
|
4
4
|
import { useClipboard } from "@vueuse/core";
|
|
5
5
|
import { useToast } from "@nuxt/ui/composables";
|
|
6
|
-
import { tv } from "
|
|
6
|
+
import { tv } from "../../utils/tv";
|
|
7
|
+
import { useRC } from "../../composables/useRC";
|
|
7
8
|
import { slugify } from "../../utils";
|
|
8
|
-
const {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
const sectionVariants = tv({
|
|
9
|
+
const {
|
|
10
|
+
level = 1,
|
|
11
|
+
title,
|
|
12
|
+
description,
|
|
13
|
+
isEditing = false,
|
|
14
|
+
rc: rcProp
|
|
15
|
+
} = defineProps({
|
|
16
|
+
level: { type: Number, required: false },
|
|
17
|
+
title: { type: String, required: true },
|
|
18
|
+
description: { type: String, required: false },
|
|
19
|
+
isEditing: { type: Boolean, required: false },
|
|
20
|
+
rc: { type: Object, required: false }
|
|
21
|
+
});
|
|
22
|
+
const emit = defineEmits([]);
|
|
23
|
+
const slots = defineSlots();
|
|
24
|
+
const { rc } = useRC("Section", rcProp);
|
|
25
|
+
const sectionStyles = tv({
|
|
28
26
|
slots: {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
section: "flex flex-col scroll-mt-24 w-full",
|
|
28
|
+
link: "",
|
|
29
|
+
heading: "font-bold w-full",
|
|
30
|
+
descriptionText: "text-muted",
|
|
31
|
+
separator: "py-2",
|
|
32
|
+
content: "flex flex-col gap-md mt-2"
|
|
35
33
|
},
|
|
36
34
|
variants: {
|
|
37
35
|
level: {
|
|
38
36
|
1: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
section: "gap-2",
|
|
38
|
+
link: "",
|
|
39
|
+
heading: "",
|
|
40
|
+
descriptionText: "text-2xl",
|
|
41
|
+
separator: "",
|
|
42
|
+
content: ""
|
|
45
43
|
},
|
|
46
44
|
2: {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
section: "gap-1.5",
|
|
46
|
+
link: "",
|
|
47
|
+
heading: "",
|
|
48
|
+
descriptionText: "text-xl",
|
|
49
|
+
separator: "",
|
|
50
|
+
content: ""
|
|
53
51
|
},
|
|
54
52
|
3: {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
section: "gap-1",
|
|
54
|
+
link: "",
|
|
55
|
+
heading: "",
|
|
56
|
+
descriptionText: "text-lg",
|
|
57
|
+
separator: "",
|
|
58
|
+
content: ""
|
|
61
59
|
},
|
|
62
60
|
4: {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
section: "gap-0.5",
|
|
62
|
+
link: "",
|
|
63
|
+
heading: "",
|
|
64
|
+
descriptionText: "text-md",
|
|
65
|
+
separator: "",
|
|
66
|
+
content: ""
|
|
69
67
|
},
|
|
70
68
|
5: {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
section: "gap-0.25",
|
|
70
|
+
link: "",
|
|
71
|
+
heading: "",
|
|
72
|
+
descriptionText: "text-sm",
|
|
73
|
+
separator: "",
|
|
74
|
+
content: ""
|
|
77
75
|
},
|
|
78
76
|
6: {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
77
|
+
section: "gap-0.125",
|
|
78
|
+
link: "",
|
|
79
|
+
heading: "",
|
|
80
|
+
descriptionText: "text-xs",
|
|
81
|
+
separator: "",
|
|
82
|
+
content: ""
|
|
85
83
|
}
|
|
86
84
|
}
|
|
87
85
|
}
|
|
88
86
|
});
|
|
89
87
|
const {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
88
|
+
section,
|
|
89
|
+
link,
|
|
90
|
+
heading,
|
|
91
|
+
descriptionText,
|
|
92
|
+
separator,
|
|
93
|
+
content
|
|
94
|
+
} = sectionStyles({ level });
|
|
95
|
+
const { copy } = useClipboard();
|
|
96
|
+
const toast = useToast();
|
|
97
|
+
const route = useRoute();
|
|
98
|
+
const copyToClipboard = async (text) => {
|
|
99
|
+
try {
|
|
100
|
+
await copy(`${text}`);
|
|
101
|
+
toast.add({
|
|
102
|
+
title: "Heading copied to clipboard!",
|
|
103
|
+
description: text,
|
|
104
|
+
color: "success"
|
|
105
|
+
});
|
|
106
|
+
} catch {
|
|
107
|
+
toast.add({
|
|
108
|
+
title: "Failed to copy heading to clipboard.",
|
|
109
|
+
description: "An unexpected error occurred. Please try again.",
|
|
110
|
+
color: "error"
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
};
|
|
108
114
|
const sectionId = computed(() => slugify(title));
|
|
109
115
|
const sectionHash = computed(() => `#${sectionId.value}`);
|
|
110
116
|
const fullSectionUrl = computed(() => {
|
|
@@ -114,12 +120,12 @@ const fullSectionUrl = computed(() => {
|
|
|
114
120
|
</script>
|
|
115
121
|
|
|
116
122
|
<template>
|
|
117
|
-
<section :id="sectionId" :class="
|
|
118
|
-
<component :id="sectionId" :is="`h${level}`" :class="
|
|
123
|
+
<section :id="sectionId" :class="section({ class: rc.section })" v-bind="$attrs">
|
|
124
|
+
<component :id="sectionId" :is="`h${level}`" :class="heading({ class: rc.heading })">
|
|
119
125
|
<NuxtLink
|
|
120
126
|
v-if="!isEditing"
|
|
121
127
|
:href="`#${sectionId}`"
|
|
122
|
-
:class="
|
|
128
|
+
:class="link({ class: rc.link })"
|
|
123
129
|
class="group relative lg:-ms-2 lg:ps-2 inline-block w-full"
|
|
124
130
|
>
|
|
125
131
|
<ClientOnly>
|
|
@@ -142,12 +148,12 @@ const fullSectionUrl = computed(() => {
|
|
|
142
148
|
<slot v-else name="title">{{ title }}</slot>
|
|
143
149
|
</component>
|
|
144
150
|
<slot name="description">
|
|
145
|
-
<p v-if="description" :class="
|
|
151
|
+
<p v-if="description" :class="descriptionText({ class: rc.descriptionText })">
|
|
146
152
|
{{ description }}
|
|
147
153
|
</p>
|
|
148
154
|
</slot>
|
|
149
|
-
<USeparator :class="
|
|
150
|
-
<div :class="
|
|
155
|
+
<USeparator :class="separator({ class: rc.separator })" />
|
|
156
|
+
<div :class="content({ class: rc.content })">
|
|
151
157
|
<slot />
|
|
152
158
|
</div>
|
|
153
159
|
</section>
|
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
export type SectionLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
2
|
-
|
|
2
|
+
export interface SectionProps {
|
|
3
3
|
level?: SectionLevel;
|
|
4
4
|
title: string;
|
|
5
5
|
description?: string;
|
|
6
6
|
isEditing?: boolean;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
7
|
+
rc?: {
|
|
8
|
+
section?: string;
|
|
9
|
+
link?: string;
|
|
10
|
+
heading?: string;
|
|
11
|
+
descriptionText?: string;
|
|
12
|
+
separator?: string;
|
|
13
|
+
content?: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface SectionEmits {
|
|
17
|
+
}
|
|
18
|
+
export interface SectionSlots {
|
|
19
|
+
default: (props: {}) => any;
|
|
20
|
+
title: (props: {}) => any;
|
|
21
|
+
description: (props: {}) => any;
|
|
22
|
+
}
|
|
23
|
+
type __VLS_Slots = SectionSlots;
|
|
24
|
+
declare const __VLS_base: import("vue").DefineComponent<SectionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SectionProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
25
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
26
|
declare const _default: typeof __VLS_export;
|
|
21
27
|
export default _default;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
export interface TestProps {
|
|
2
2
|
text: string;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
rc?: {
|
|
4
|
+
root?: string;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
export interface TestEmits {
|
|
8
|
+
}
|
|
9
|
+
export interface TestSlots {
|
|
10
|
+
content: (props: {}) => any;
|
|
11
|
+
}
|
|
12
|
+
type __VLS_Slots = TestSlots;
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<TestProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TestProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
14
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
10
15
|
declare const _default: typeof __VLS_export;
|
|
11
16
|
export default _default;
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { tv } from "../../utils/tv";
|
|
3
|
+
import { useRC } from "../../composables/useRC";
|
|
4
|
+
const { text, rc: rcProp } = defineProps({
|
|
5
|
+
text: { type: String, required: true },
|
|
6
|
+
rc: { type: Object, required: false }
|
|
4
7
|
});
|
|
8
|
+
const emit = defineEmits([]);
|
|
9
|
+
const slots = defineSlots();
|
|
10
|
+
const { rc } = useRC("Test", rcProp);
|
|
11
|
+
const testStyles = tv({
|
|
12
|
+
slots: {
|
|
13
|
+
root: ""
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
const { root } = testStyles();
|
|
5
17
|
</script>
|
|
6
18
|
|
|
7
19
|
<template>
|
|
8
|
-
<div v-bind="$attrs">
|
|
20
|
+
<div :class="root({ class: rc.root })" v-bind="$attrs">
|
|
9
21
|
<slot name="content">
|
|
10
22
|
<p>{{ text }}</p>
|
|
11
23
|
</slot>
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
export interface TestProps {
|
|
2
2
|
text: string;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
rc?: {
|
|
4
|
+
root?: string;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
export interface TestEmits {
|
|
8
|
+
}
|
|
9
|
+
export interface TestSlots {
|
|
10
|
+
content: (props: {}) => any;
|
|
11
|
+
}
|
|
12
|
+
type __VLS_Slots = TestSlots;
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<TestProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TestProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
14
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
10
15
|
declare const _default: typeof __VLS_export;
|
|
11
16
|
export default _default;
|
|
@@ -1,8 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
export interface LinkNodeProps {
|
|
2
2
|
href: string;
|
|
3
3
|
target?: string;
|
|
4
4
|
content: string;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
rc?: {
|
|
6
|
+
root?: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export interface LinkNodeEmits {
|
|
10
|
+
}
|
|
11
|
+
export interface LinkNodeSlots {
|
|
12
|
+
}
|
|
13
|
+
type __VLS_Slots = LinkNodeSlots;
|
|
14
|
+
declare const __VLS_base: import("vue").DefineComponent<LinkNodeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkNodeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
16
|
declare const _default: typeof __VLS_export;
|
|
8
17
|
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
|
-
|
|
3
|
+
import { tv } from "../../utils/tv";
|
|
4
|
+
import { useRC } from "../../composables/useRC";
|
|
5
|
+
const { href, target, content, rc: rcProp } = defineProps({
|
|
4
6
|
href: { type: String, required: true },
|
|
5
7
|
target: { type: String, required: false },
|
|
6
|
-
content: { type: String, required: true }
|
|
8
|
+
content: { type: String, required: true },
|
|
9
|
+
rc: { type: Object, required: false }
|
|
7
10
|
});
|
|
11
|
+
const emit = defineEmits([]);
|
|
12
|
+
const slots = defineSlots();
|
|
13
|
+
const { rc } = useRC("LinkNode", rcProp);
|
|
14
|
+
const linkNodeStyles = tv({
|
|
15
|
+
slots: {
|
|
16
|
+
root: ""
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const { root } = linkNodeStyles();
|
|
8
20
|
const rel = computed(
|
|
9
21
|
() => target === "_blank" ? "noopener noreferrer" : void 0
|
|
10
22
|
);
|
|
11
23
|
</script>
|
|
12
24
|
|
|
13
25
|
<template>
|
|
14
|
-
<ULink :to="href" :target="target" :rel="rel"
|
|
26
|
+
<ULink :to="href" :target="target" :rel="rel" :class="root({ class: rc.root })">
|
|
27
|
+
{{ content }}
|
|
28
|
+
</ULink>
|
|
15
29
|
</template>
|