rimelight-components 2.1.16 → 2.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/app/Footer.d.vue.ts +5 -1
- package/dist/runtime/components/app/Footer.vue +20 -12
- package/dist/runtime/components/app/Footer.vue.d.ts +5 -1
- package/dist/runtime/components/app/Header.d.vue.ts +5 -1
- package/dist/runtime/components/app/Header.vue +4 -2
- package/dist/runtime/components/app/Header.vue.d.ts +5 -1
- package/dist/runtime/components/app/HeaderLayer.d.vue.ts +5 -3
- package/dist/runtime/components/app/HeaderLayer.vue +11 -2
- package/dist/runtime/components/app/HeaderLayer.vue.d.ts +5 -3
- package/dist/runtime/components/app/Image.d.vue.ts +13 -0
- package/dist/runtime/components/app/Image.vue +189 -0
- package/dist/runtime/components/app/Image.vue.d.ts +13 -0
- package/dist/runtime/components/app/Logo.d.vue.ts +5 -3
- package/dist/runtime/components/app/Logo.vue +9 -1
- package/dist/runtime/components/app/Logo.vue.d.ts +5 -3
- package/dist/runtime/components/app/NewsletterSignup.d.vue.ts +5 -3
- package/dist/runtime/components/app/NewsletterSignup.vue +9 -1
- package/dist/runtime/components/app/NewsletterSignup.vue.d.ts +5 -3
- package/dist/runtime/components/app/ScrollToTop.d.vue.ts +4 -2
- package/dist/runtime/components/app/ScrollToTop.vue +17 -9
- package/dist/runtime/components/app/ScrollToTop.vue.d.ts +4 -2
- package/dist/runtime/components/blocks/Block.d.vue.ts +5 -3
- package/dist/runtime/components/blocks/Block.vue +16 -7
- package/dist/runtime/components/blocks/Block.vue.d.ts +5 -3
- package/dist/runtime/components/blocks/BlockEditRenderer.d.vue.ts +5 -3
- package/dist/runtime/components/blocks/BlockEditRenderer.vue +9 -1
- package/dist/runtime/components/blocks/BlockEditRenderer.vue.d.ts +5 -3
- package/dist/runtime/components/blocks/BlockEditor.vue +4 -33
- package/dist/runtime/components/blocks/BlockViewRenderer.d.vue.ts +5 -3
- package/dist/runtime/components/blocks/BlockViewRenderer.vue +9 -1
- package/dist/runtime/components/blocks/BlockViewRenderer.vue.d.ts +5 -3
- package/dist/runtime/components/blocks/TextRenderer.d.vue.ts +5 -3
- package/dist/runtime/components/blocks/TextRenderer.vue +8 -0
- package/dist/runtime/components/blocks/TextRenderer.vue.d.ts +5 -3
- package/dist/runtime/components/blocks/editor/CalloutBlockEditor.d.vue.ts +5 -1
- package/dist/runtime/components/blocks/editor/CalloutBlockEditor.vue +8 -0
- package/dist/runtime/components/blocks/editor/CalloutBlockEditor.vue.d.ts +5 -1
- package/dist/runtime/components/blocks/editor/CardBlockEditor.d.vue.ts +5 -1
- package/dist/runtime/components/blocks/editor/CardBlockEditor.vue +9 -1
- package/dist/runtime/components/blocks/editor/CardBlockEditor.vue.d.ts +5 -1
- package/dist/runtime/components/blocks/editor/ImageBlockEditor.d.vue.ts +11 -3
- package/dist/runtime/components/blocks/editor/ImageBlockEditor.vue +21 -9
- package/dist/runtime/components/blocks/editor/ImageBlockEditor.vue.d.ts +11 -3
- package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.d.vue.ts +5 -3
- package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.vue +11 -7
- package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.vue.d.ts +5 -3
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.d.vue.ts +5 -3
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.vue +15 -5
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.vue.d.ts +5 -3
- package/dist/runtime/components/blocks/editor/TestBlockEditor.d.vue.ts +5 -3
- package/dist/runtime/components/blocks/editor/TestBlockEditor.vue +11 -3
- package/dist/runtime/components/blocks/editor/TestBlockEditor.vue.d.ts +5 -3
- package/dist/runtime/components/blocks/renderer/CalloutBlockRenderer.d.vue.ts +5 -1
- package/dist/runtime/components/blocks/renderer/CalloutBlockRenderer.vue +8 -0
- package/dist/runtime/components/blocks/renderer/CalloutBlockRenderer.vue.d.ts +5 -1
- package/dist/runtime/components/blocks/renderer/CardBlockRenderer.d.vue.ts +5 -1
- package/dist/runtime/components/blocks/renderer/CardBlockRenderer.vue +9 -1
- package/dist/runtime/components/blocks/renderer/CardBlockRenderer.vue.d.ts +5 -1
- package/dist/runtime/components/blocks/renderer/ImageBlockRenderer.d.vue.ts +5 -1
- package/dist/runtime/components/blocks/renderer/ImageBlockRenderer.vue +13 -3
- package/dist/runtime/components/blocks/renderer/ImageBlockRenderer.vue.d.ts +5 -1
- package/dist/runtime/components/blocks/renderer/ParagraphBlockRenderer.d.vue.ts +5 -1
- package/dist/runtime/components/blocks/renderer/ParagraphBlockRenderer.vue +8 -0
- package/dist/runtime/components/blocks/renderer/ParagraphBlockRenderer.vue.d.ts +5 -1
- package/dist/runtime/components/blocks/renderer/SectionBlockRenderer.d.vue.ts +5 -1
- package/dist/runtime/components/blocks/renderer/SectionBlockRenderer.vue +8 -0
- package/dist/runtime/components/blocks/renderer/SectionBlockRenderer.vue.d.ts +5 -1
- package/dist/runtime/components/blocks/renderer/TestBlockRenderer.d.vue.ts +5 -1
- package/dist/runtime/components/blocks/renderer/TestBlockRenderer.vue +8 -0
- package/dist/runtime/components/blocks/renderer/TestBlockRenderer.vue.d.ts +5 -1
- package/dist/runtime/components/cards/TeamCard.d.vue.ts +5 -3
- package/dist/runtime/components/cards/TeamCard.vue +25 -7
- package/dist/runtime/components/cards/TeamCard.vue.d.ts +5 -3
- package/dist/runtime/components/content/Callout.d.vue.ts +5 -3
- package/dist/runtime/components/content/Callout.vue +11 -2
- package/dist/runtime/components/content/Callout.vue.d.ts +5 -3
- package/dist/runtime/components/content/Section.d.vue.ts +5 -3
- package/dist/runtime/components/content/Section.vue +87 -86
- package/dist/runtime/components/content/Section.vue.d.ts +5 -3
- package/dist/runtime/components/content/Test.d.vue.ts +5 -3
- package/dist/runtime/components/content/Test.vue +9 -1
- package/dist/runtime/components/content/Test.vue.d.ts +5 -3
- package/dist/runtime/components/nodes/LinkNode.d.vue.ts +5 -3
- package/dist/runtime/components/nodes/LinkNode.vue +11 -1
- package/dist/runtime/components/nodes/LinkNode.vue.d.ts +5 -3
- package/dist/runtime/components/nodes/TextNode.d.vue.ts +5 -3
- package/dist/runtime/components/nodes/TextNode.vue +9 -1
- package/dist/runtime/components/nodes/TextNode.vue.d.ts +5 -3
- package/dist/runtime/components/page/PageEditor.d.vue.ts +4 -1
- package/dist/runtime/components/page/PageEditor.vue +67 -30
- package/dist/runtime/components/page/PageEditor.vue.d.ts +4 -1
- package/dist/runtime/components/page/PageMention.d.vue.ts +3 -1
- package/dist/runtime/components/page/PageMention.vue +15 -4
- package/dist/runtime/components/page/PageMention.vue.d.ts +3 -1
- package/dist/runtime/components/page/PagePropertiesEditor.d.vue.ts +8 -2
- package/dist/runtime/components/page/PagePropertiesEditor.vue +59 -21
- package/dist/runtime/components/page/PagePropertiesEditor.vue.d.ts +8 -2
- package/dist/runtime/components/page/PagePropertiesRenderer.d.vue.ts +8 -2
- package/dist/runtime/components/page/PagePropertiesRenderer.vue +70 -25
- package/dist/runtime/components/page/PagePropertiesRenderer.vue.d.ts +8 -2
- package/dist/runtime/components/page/PageRenderer.d.vue.ts +3 -1
- package/dist/runtime/components/page/PageRenderer.vue +52 -18
- package/dist/runtime/components/page/PageRenderer.vue.d.ts +3 -1
- package/dist/runtime/components/page/PageSurround.d.vue.ts +5 -3
- package/dist/runtime/components/page/PageSurround.vue +54 -24
- package/dist/runtime/components/page/PageSurround.vue.d.ts +5 -3
- package/dist/runtime/components/page/PageTOC.d.vue.ts +5 -3
- package/dist/runtime/components/page/PageTOC.vue +17 -7
- package/dist/runtime/components/page/PageTOC.vue.d.ts +5 -3
- package/dist/runtime/components/page/modals/CreatePageModal.vue +27 -21
- package/dist/runtime/components/page/modals/DeletePageModal.vue +23 -6
- package/dist/runtime/components/swatches/ColorSwatch.d.vue.ts +5 -3
- package/dist/runtime/components/swatches/ColorSwatch.vue +25 -11
- package/dist/runtime/components/swatches/ColorSwatch.vue.d.ts +5 -3
- package/dist/runtime/components/swatches/FontSwatch.d.vue.ts +5 -3
- package/dist/runtime/components/swatches/FontSwatch.vue +23 -10
- package/dist/runtime/components/swatches/FontSwatch.vue.d.ts +5 -3
- package/dist/runtime/components/swatches/ImageSwatch.d.vue.ts +5 -3
- package/dist/runtime/components/swatches/ImageSwatch.vue +23 -10
- package/dist/runtime/components/swatches/ImageSwatch.vue.d.ts +5 -3
- package/dist/runtime/components/utilities/Placeholder.d.vue.ts +5 -1
- package/dist/runtime/components/utilities/Placeholder.vue +14 -5
- package/dist/runtime/components/utilities/Placeholder.vue.d.ts +5 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export interface PageSurroundProps {
|
|
2
2
|
pageType: string;
|
|
3
3
|
previousTitle?: string;
|
|
4
4
|
previousDescription?: string;
|
|
@@ -6,7 +6,9 @@ type __VLS_Props = {
|
|
|
6
6
|
nextTitle?: string;
|
|
7
7
|
nextDescription?: string;
|
|
8
8
|
nextTo?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
9
|
+
}
|
|
10
|
+
export interface PageSurroundEmits {
|
|
11
|
+
}
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<PageSurroundProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PageSurroundProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
13
|
declare const _default: typeof __VLS_export;
|
|
12
14
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { tv } from "tailwind-variants";
|
|
2
3
|
import { useI18n } from "vue-i18n";
|
|
3
|
-
const { t } = useI18n();
|
|
4
4
|
const {
|
|
5
5
|
pageType,
|
|
6
6
|
previousTitle,
|
|
@@ -18,33 +18,66 @@ const {
|
|
|
18
18
|
nextDescription: { type: String, required: false },
|
|
19
19
|
nextTo: { type: String, required: false }
|
|
20
20
|
});
|
|
21
|
+
const emit = defineEmits([]);
|
|
22
|
+
const pageSurroundStyles = tv({
|
|
23
|
+
slots: {
|
|
24
|
+
grid: "grid grid-cols-1 gap-8 sm:grid-cols-2",
|
|
25
|
+
card: "group block h-full bg-transparent hover:bg-elevated/50 focus-visible:outline-primary",
|
|
26
|
+
cardContent: "flex flex-col gap-md",
|
|
27
|
+
cardContentEnd: "items-end",
|
|
28
|
+
headingGroup: "flex flex-col gap-xs",
|
|
29
|
+
headingGroupEnd: "items-end",
|
|
30
|
+
button: "w-fit text-md rounded-full text-primary group-hover:text-highlighted",
|
|
31
|
+
typeLabel: "text-muted",
|
|
32
|
+
infoGroup: "flex flex-col gap-sm",
|
|
33
|
+
infoGroupEnd: "items-end gap-xs",
|
|
34
|
+
title: "text-primary text-sm group-hover:text-highlighted",
|
|
35
|
+
titleEnd: "text-right",
|
|
36
|
+
description: "text-toned text-xs",
|
|
37
|
+
descriptionEnd: "text-right"
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const {
|
|
41
|
+
grid,
|
|
42
|
+
card,
|
|
43
|
+
cardContent,
|
|
44
|
+
cardContentEnd,
|
|
45
|
+
headingGroup,
|
|
46
|
+
headingGroupEnd,
|
|
47
|
+
button,
|
|
48
|
+
typeLabel,
|
|
49
|
+
infoGroup,
|
|
50
|
+
infoGroupEnd,
|
|
51
|
+
title: titleClass,
|
|
52
|
+
titleEnd,
|
|
53
|
+
description: descriptionClass,
|
|
54
|
+
descriptionEnd
|
|
55
|
+
} = pageSurroundStyles();
|
|
56
|
+
const { t } = useI18n();
|
|
21
57
|
</script>
|
|
22
58
|
|
|
23
59
|
<template>
|
|
24
|
-
<div class="grid
|
|
60
|
+
<div :class="grid()">
|
|
25
61
|
<div>
|
|
26
62
|
<ULink v-if="previousTitle" :to="previousTo" class="h-full">
|
|
27
|
-
<UCard
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
>
|
|
31
|
-
<div class="flex flex-col gap-md">
|
|
32
|
-
<div class="flex flex-col gap-xs">
|
|
63
|
+
<UCard variant="soft" :class="card()">
|
|
64
|
+
<div :class="cardContent()">
|
|
65
|
+
<div :class="headingGroup()">
|
|
33
66
|
<UButton
|
|
34
67
|
variant="outline"
|
|
35
68
|
icon="lucide:arrow-left"
|
|
36
|
-
class="
|
|
69
|
+
:class="button()"
|
|
37
70
|
/>
|
|
38
|
-
<span class="
|
|
71
|
+
<span :class="typeLabel()">
|
|
39
72
|
{{ t("navigation_previous") }}
|
|
40
73
|
{{ t(pageType) }}
|
|
41
74
|
</span>
|
|
42
75
|
</div>
|
|
43
|
-
<div class="
|
|
44
|
-
<p class="
|
|
76
|
+
<div :class="infoGroup()">
|
|
77
|
+
<p :class="titleClass()">
|
|
45
78
|
{{ previousTitle }}
|
|
46
79
|
</p>
|
|
47
|
-
<p class="
|
|
80
|
+
<p :class="descriptionClass()">
|
|
48
81
|
{{ previousDescription }}
|
|
49
82
|
</p>
|
|
50
83
|
</div>
|
|
@@ -54,27 +87,24 @@ const {
|
|
|
54
87
|
</div>
|
|
55
88
|
<div>
|
|
56
89
|
<ULink v-if="nextTitle" :to="nextTo" class="h-full">
|
|
57
|
-
<UCard
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
>
|
|
61
|
-
<div class="flex flex-col items-end gap-md">
|
|
62
|
-
<div class="flex flex-col items-end gap-xs">
|
|
90
|
+
<UCard variant="soft" :class="card()">
|
|
91
|
+
<div :class="[cardContent(), cardContentEnd()]">
|
|
92
|
+
<div :class="[headingGroup(), headingGroupEnd()]">
|
|
63
93
|
<UButton
|
|
64
94
|
variant="outline"
|
|
65
95
|
icon="lucide:arrow-right"
|
|
66
|
-
class="
|
|
96
|
+
:class="button()"
|
|
67
97
|
/>
|
|
68
|
-
<span class="
|
|
98
|
+
<span :class="typeLabel()">
|
|
69
99
|
{{ t("navigation_next") }}
|
|
70
100
|
{{ t(pageType) }}</span
|
|
71
101
|
>
|
|
72
102
|
</div>
|
|
73
|
-
<div class="
|
|
74
|
-
<p class="
|
|
103
|
+
<div :class="[infoGroup(), infoGroupEnd()]">
|
|
104
|
+
<p :class="[titleClass(), titleEnd()]">
|
|
75
105
|
{{ nextTitle }}
|
|
76
106
|
</p>
|
|
77
|
-
<p class="
|
|
107
|
+
<p :class="[descriptionClass(), descriptionEnd()]">
|
|
78
108
|
{{ nextDescription }}
|
|
79
109
|
</p>
|
|
80
110
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export interface PageSurroundProps {
|
|
2
2
|
pageType: string;
|
|
3
3
|
previousTitle?: string;
|
|
4
4
|
previousDescription?: string;
|
|
@@ -6,7 +6,9 @@ type __VLS_Props = {
|
|
|
6
6
|
nextTitle?: string;
|
|
7
7
|
nextDescription?: string;
|
|
8
8
|
nextTo?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
9
|
+
}
|
|
10
|
+
export interface PageSurroundEmits {
|
|
11
|
+
}
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<PageSurroundProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PageSurroundProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
13
|
declare const _default: typeof __VLS_export;
|
|
12
14
|
export default _default;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type { Block, HeadingLevel } from "../../types/index.js";
|
|
2
|
-
|
|
2
|
+
export interface PageTOCProps {
|
|
3
3
|
pageBlocks: Block[] | null;
|
|
4
4
|
title?: string;
|
|
5
5
|
levels?: HeadingLevel[];
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
|
+
export interface PageTOCEmits {
|
|
8
|
+
}
|
|
7
9
|
declare var __VLS_7: {};
|
|
8
10
|
type __VLS_Slots = {} & {
|
|
9
11
|
bottom?: (props: typeof __VLS_7) => any;
|
|
10
12
|
};
|
|
11
|
-
declare const __VLS_base: import("vue").DefineComponent<
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<PageTOCProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PageTOCProps> & Readonly<{}>, {
|
|
12
14
|
title: string;
|
|
13
15
|
levels: HeadingLevel[];
|
|
14
16
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -9,10 +9,11 @@ const props = defineProps({
|
|
|
9
9
|
title: { type: String, required: false, default: "table_of_contents" },
|
|
10
10
|
levels: { type: Array, required: false, default: () => [2, 3, 4] }
|
|
11
11
|
});
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const tocVariants = tv({
|
|
12
|
+
const emit = defineEmits([]);
|
|
13
|
+
const pageTOCStyles = tv({
|
|
15
14
|
slots: {
|
|
15
|
+
nav: "flex flex-col gap-sm w-full",
|
|
16
|
+
list: "flex flex-col",
|
|
16
17
|
link: "group relative flex items-center px-3 py-1.5 text-sm transition-all duration-200 border-s-2 -ms-px",
|
|
17
18
|
text: "truncate"
|
|
18
19
|
},
|
|
@@ -35,6 +36,15 @@ const tocVariants = tv({
|
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
});
|
|
39
|
+
const {
|
|
40
|
+
nav,
|
|
41
|
+
list,
|
|
42
|
+
link,
|
|
43
|
+
text
|
|
44
|
+
} = pageTOCStyles();
|
|
45
|
+
const { t } = useI18n();
|
|
46
|
+
const activeId = ref(null);
|
|
47
|
+
const { locale } = useI18n();
|
|
38
48
|
const extractHeadings = (blocks) => {
|
|
39
49
|
const headings = [];
|
|
40
50
|
if (!blocks) return headings;
|
|
@@ -84,18 +94,18 @@ onMounted(() => {
|
|
|
84
94
|
</script>
|
|
85
95
|
|
|
86
96
|
<template>
|
|
87
|
-
<nav class="
|
|
97
|
+
<nav :class="nav()" aria-label="Table of Contents">
|
|
88
98
|
<h5 v-if="title">
|
|
89
99
|
{{ t(title) }}
|
|
90
100
|
</h5>
|
|
91
101
|
|
|
92
|
-
<ul v-if="items.length > 0" class="
|
|
102
|
+
<ul v-if="items.length > 0" :class="list()">
|
|
93
103
|
<li v-for="item in items" :key="item.id">
|
|
94
104
|
<NuxtLink
|
|
95
105
|
:to="{ hash: `#${item.id}` }"
|
|
96
|
-
:class="
|
|
106
|
+
:class="pageTOCStyles({ active: activeId === item.id, level: item.level }).link()"
|
|
97
107
|
>
|
|
98
|
-
<span :class="
|
|
108
|
+
<span :class="text()">
|
|
99
109
|
{{ item.title }}
|
|
100
110
|
</span>
|
|
101
111
|
</NuxtLink>
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type { Block, HeadingLevel } from "../../types/index.js";
|
|
2
|
-
|
|
2
|
+
export interface PageTOCProps {
|
|
3
3
|
pageBlocks: Block[] | null;
|
|
4
4
|
title?: string;
|
|
5
5
|
levels?: HeadingLevel[];
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
|
+
export interface PageTOCEmits {
|
|
8
|
+
}
|
|
7
9
|
declare var __VLS_7: {};
|
|
8
10
|
type __VLS_Slots = {} & {
|
|
9
11
|
bottom?: (props: typeof __VLS_7) => any;
|
|
10
12
|
};
|
|
11
|
-
declare const __VLS_base: import("vue").DefineComponent<
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<PageTOCProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PageTOCProps> & Readonly<{}>, {
|
|
12
14
|
title: string;
|
|
13
15
|
levels: HeadingLevel[];
|
|
14
16
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -3,25 +3,31 @@ import { ref, computed, watch } from "vue";
|
|
|
3
3
|
import {} from "../../../types";
|
|
4
4
|
import { tv } from "tailwind-variants";
|
|
5
5
|
import { useI18n } from "vue-i18n";
|
|
6
|
-
const { t } = useI18n();
|
|
7
6
|
const { isOpen, loading, definitions } = defineProps({
|
|
8
7
|
isOpen: { type: Boolean, required: true },
|
|
9
8
|
definitions: { type: Object, required: true },
|
|
10
9
|
loading: { type: Boolean, required: false }
|
|
11
10
|
});
|
|
12
|
-
const
|
|
11
|
+
const emit = defineEmits(["close", "confirm"]);
|
|
13
12
|
const createPageModalStyles = tv({
|
|
14
13
|
slots: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
select: "w-full px-3 py-2 rounded-md border border-neutral-300 bg-white"
|
|
14
|
+
header: "flex items-center justify-between",
|
|
15
|
+
headerTitle: "text-base font-semibold leading-6",
|
|
16
|
+
closeButton: "-my-1",
|
|
17
|
+
body: "space-y-4 py-4",
|
|
18
|
+
field: "w-full",
|
|
19
|
+
footer: "flex justify-end gap-2"
|
|
22
20
|
}
|
|
23
21
|
});
|
|
24
|
-
const
|
|
22
|
+
const {
|
|
23
|
+
header: headerClass,
|
|
24
|
+
headerTitle,
|
|
25
|
+
closeButton,
|
|
26
|
+
body,
|
|
27
|
+
field,
|
|
28
|
+
footer
|
|
29
|
+
} = createPageModalStyles();
|
|
30
|
+
const { t } = useI18n();
|
|
25
31
|
const selectedType = ref("");
|
|
26
32
|
const title = ref("");
|
|
27
33
|
const slug = ref("");
|
|
@@ -44,8 +50,8 @@ const handleConfirm = () => {
|
|
|
44
50
|
const properties = {};
|
|
45
51
|
Object.entries(definition.properties).forEach(([groupKey, group]) => {
|
|
46
52
|
properties[groupKey] = {};
|
|
47
|
-
Object.entries(group.fields).forEach(([fieldKey,
|
|
48
|
-
properties[groupKey][fieldKey] =
|
|
53
|
+
Object.entries(group.fields).forEach(([fieldKey, field2]) => {
|
|
54
|
+
properties[groupKey][fieldKey] = field2.value;
|
|
49
55
|
});
|
|
50
56
|
});
|
|
51
57
|
const newPage = {
|
|
@@ -55,29 +61,29 @@ const handleConfirm = () => {
|
|
|
55
61
|
properties,
|
|
56
62
|
blocks: definition.initialBlocks ? definition.initialBlocks() : []
|
|
57
63
|
};
|
|
58
|
-
|
|
64
|
+
emit("confirm", newPage);
|
|
59
65
|
};
|
|
60
66
|
</script>
|
|
61
67
|
|
|
62
68
|
<template>
|
|
63
|
-
<UModal :model-value="isOpen" @update:model-value="
|
|
69
|
+
<UModal :model-value="isOpen" @update:model-value="emit('close')">
|
|
64
70
|
<slot/>
|
|
65
71
|
<template #content>
|
|
66
72
|
<UCard>
|
|
67
73
|
<template #header>
|
|
68
|
-
<div class="
|
|
69
|
-
<h3 class="
|
|
70
|
-
<UButton color="neutral" variant="ghost" icon="i-heroicons-x-mark-20-solid" class="
|
|
74
|
+
<div :class="headerClass()">
|
|
75
|
+
<h3 :class="headerTitle()">Create New Page</h3>
|
|
76
|
+
<UButton color="neutral" variant="ghost" icon="i-heroicons-x-mark-20-solid" :class="closeButton()" @click="emit('close')" />
|
|
71
77
|
</div>
|
|
72
78
|
</template>
|
|
73
79
|
|
|
74
|
-
<div class="
|
|
80
|
+
<div :class="body()">
|
|
75
81
|
<UFormField label="Page Template" required>
|
|
76
82
|
<USelect
|
|
77
83
|
v-model="selectedType"
|
|
78
84
|
:items="typeOptions"
|
|
79
85
|
:placeholder="t('editor.template_placeholder', 'Select a template...')"
|
|
80
|
-
class="
|
|
86
|
+
:class="field()"
|
|
81
87
|
/>
|
|
82
88
|
</UFormField>
|
|
83
89
|
|
|
@@ -91,8 +97,8 @@ const handleConfirm = () => {
|
|
|
91
97
|
</div>
|
|
92
98
|
|
|
93
99
|
<template #footer>
|
|
94
|
-
<div class="
|
|
95
|
-
<UButton color="neutral" variant="ghost" label="Cancel" @click="
|
|
100
|
+
<div :class="footer()">
|
|
101
|
+
<UButton color="neutral" variant="ghost" label="Cancel" @click="emit('close')" />
|
|
96
102
|
<UButton
|
|
97
103
|
color="primary"
|
|
98
104
|
label="Create & Edit"
|
|
@@ -1,13 +1,30 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ref, watch } from "vue";
|
|
3
3
|
import { useI18n } from "vue-i18n";
|
|
4
|
+
import { tv } from "tailwind-variants";
|
|
5
|
+
const { t } = useI18n();
|
|
4
6
|
const { isOpen, loading, pageTitle } = defineProps({
|
|
5
7
|
isOpen: { type: Boolean, required: true },
|
|
6
8
|
loading: { type: Boolean, required: false },
|
|
7
9
|
pageTitle: { type: String, required: true }
|
|
8
10
|
});
|
|
9
11
|
const emits = defineEmits(["close", "confirm"]);
|
|
10
|
-
const
|
|
12
|
+
const deletePageModalStyles = tv({
|
|
13
|
+
slots: {
|
|
14
|
+
header: "flex items-center justify-between",
|
|
15
|
+
headerTitle: "text-base font-semibold leading-6 text-error-600",
|
|
16
|
+
closeButton: "-my-1",
|
|
17
|
+
body: "text-sm text-neutral-600 dark:text-neutral-400",
|
|
18
|
+
footer: "flex justify-end gap-2"
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const {
|
|
22
|
+
header: headerClass,
|
|
23
|
+
headerTitle,
|
|
24
|
+
closeButton,
|
|
25
|
+
body,
|
|
26
|
+
footer
|
|
27
|
+
} = deletePageModalStyles();
|
|
11
28
|
const confirmationInput = ref("");
|
|
12
29
|
const CONFIRMATION_TEXT = "DELETE";
|
|
13
30
|
watch(() => isOpen, (val) => {
|
|
@@ -26,21 +43,21 @@ const handleConfirm = () => {
|
|
|
26
43
|
<template #content>
|
|
27
44
|
<UCard :ui="{ body: 'space-y-4' }">
|
|
28
45
|
<template #header>
|
|
29
|
-
<div class="
|
|
30
|
-
<h3 class="
|
|
46
|
+
<div :class="headerClass()">
|
|
47
|
+
<h3 :class="headerTitle()">
|
|
31
48
|
{{ t("editor.delete_page_title", "Delete Page") }}
|
|
32
49
|
</h3>
|
|
33
50
|
<UButton
|
|
34
51
|
color="neutral"
|
|
35
52
|
variant="ghost"
|
|
36
53
|
icon="lucide:x"
|
|
37
|
-
class="
|
|
54
|
+
:class="closeButton()"
|
|
38
55
|
@click="emits('close')"
|
|
39
56
|
/>
|
|
40
57
|
</div>
|
|
41
58
|
</template>
|
|
42
59
|
|
|
43
|
-
<div class="
|
|
60
|
+
<div :class="body()">
|
|
44
61
|
<p>
|
|
45
62
|
Are you sure you want to delete <strong>{{ pageTitle }}</strong>?
|
|
46
63
|
This action is permanent and cannot be undone.
|
|
@@ -61,7 +78,7 @@ const handleConfirm = () => {
|
|
|
61
78
|
</UFormField>
|
|
62
79
|
|
|
63
80
|
<template #footer>
|
|
64
|
-
<div class="
|
|
81
|
+
<div :class="footer()">
|
|
65
82
|
<UButton
|
|
66
83
|
color="neutral"
|
|
67
84
|
variant="ghost"
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
export interface ColorSwatchProps {
|
|
2
2
|
name?: string;
|
|
3
3
|
hex?: string;
|
|
4
4
|
rgb?: string;
|
|
5
5
|
hsl?: string;
|
|
6
6
|
oklch?: string;
|
|
7
7
|
cmyk?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
8
|
+
}
|
|
9
|
+
export interface ColorSwatchEmits {
|
|
10
|
+
}
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<ColorSwatchProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorSwatchProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
12
|
declare const _default: typeof __VLS_export;
|
|
11
13
|
export default _default;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import { useClipboard } from "@vueuse/core";
|
|
4
4
|
import { useToast } from "@nuxt/ui/composables";
|
|
5
|
+
import { tv } from "tailwind-variants";
|
|
5
6
|
const { copy } = useClipboard();
|
|
6
7
|
const toast = useToast();
|
|
7
8
|
const { name, hex, rgb, hsl, oklch, cmyk } = defineProps({
|
|
@@ -12,6 +13,19 @@ const { name, hex, rgb, hsl, oklch, cmyk } = defineProps({
|
|
|
12
13
|
oklch: { type: String, required: false },
|
|
13
14
|
cmyk: { type: String, required: false }
|
|
14
15
|
});
|
|
16
|
+
const emit = defineEmits([]);
|
|
17
|
+
const colorSwatchStyles = tv({
|
|
18
|
+
slots: {
|
|
19
|
+
card: "w-full rounded-none xl:w-fit",
|
|
20
|
+
title: "text-lg font-bold",
|
|
21
|
+
content: "flex flex-col items-center gap-sm xl:flex-row xl:items-start",
|
|
22
|
+
preview: "flex aspect-square size-48 p-sm",
|
|
23
|
+
details: "flex flex-col justify-end gap-xs text-xs",
|
|
24
|
+
buttonGroup: "flex w-full flex-col justify-center gap-sm",
|
|
25
|
+
button: "w-full xl:w-36"
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const { card, title: titleStyle, content, preview, details, buttonGroup, button } = colorSwatchStyles();
|
|
15
29
|
const copyToClipboard = async (text) => {
|
|
16
30
|
try {
|
|
17
31
|
await copy(`${text}`);
|
|
@@ -42,13 +56,13 @@ const color = computed(() => {
|
|
|
42
56
|
</script>
|
|
43
57
|
|
|
44
58
|
<template>
|
|
45
|
-
<UCard variant="subtle" class="
|
|
59
|
+
<UCard variant="subtle" :class="card()">
|
|
46
60
|
<template #header v-if="name">
|
|
47
|
-
<h3 class="
|
|
61
|
+
<h3 :class="titleStyle()">{{ name }}</h3>
|
|
48
62
|
</template>
|
|
49
|
-
<div class="
|
|
50
|
-
<div class="
|
|
51
|
-
<div class="
|
|
63
|
+
<div :class="content()">
|
|
64
|
+
<div :class="preview()" :style="{ backgroundColor: color }">
|
|
65
|
+
<div :class="details()">
|
|
52
66
|
<span v-if="name" class="text-sm">{{ formatColor(name) }}</span>
|
|
53
67
|
<span v-if="hex">HEX {{ formatColor(hex) }}</span>
|
|
54
68
|
<span v-if="rgb">{{ formatColor(rgb) }}</span>
|
|
@@ -57,14 +71,14 @@ const color = computed(() => {
|
|
|
57
71
|
<span v-if="cmyk">{{ formatColor(cmyk) }}</span>
|
|
58
72
|
</div>
|
|
59
73
|
</div>
|
|
60
|
-
<div class="
|
|
74
|
+
<div :class="buttonGroup()">
|
|
61
75
|
<UButton
|
|
62
76
|
v-if="hex"
|
|
63
77
|
variant="outline"
|
|
64
78
|
size="sm"
|
|
65
79
|
icon="lucide:copy"
|
|
66
80
|
label="Copy HEX"
|
|
67
|
-
class="
|
|
81
|
+
:class="button()"
|
|
68
82
|
@click="copyToClipboard(hex)"
|
|
69
83
|
/>
|
|
70
84
|
<UButton
|
|
@@ -73,7 +87,7 @@ const color = computed(() => {
|
|
|
73
87
|
size="sm"
|
|
74
88
|
icon="lucide:copy"
|
|
75
89
|
label="Copy RGB"
|
|
76
|
-
class="
|
|
90
|
+
:class="button()"
|
|
77
91
|
@click="copyToClipboard(rgb)"
|
|
78
92
|
/>
|
|
79
93
|
<UButton
|
|
@@ -82,7 +96,7 @@ const color = computed(() => {
|
|
|
82
96
|
size="sm"
|
|
83
97
|
icon="lucide:copy"
|
|
84
98
|
label="Copy HSL"
|
|
85
|
-
class="
|
|
99
|
+
:class="button()"
|
|
86
100
|
@click="copyToClipboard(hsl)"
|
|
87
101
|
/>
|
|
88
102
|
<UButton
|
|
@@ -91,7 +105,7 @@ const color = computed(() => {
|
|
|
91
105
|
size="sm"
|
|
92
106
|
icon="lucide:copy"
|
|
93
107
|
label="Copy OKLCH"
|
|
94
|
-
class="
|
|
108
|
+
:class="button()"
|
|
95
109
|
@click="copyToClipboard(oklch)"
|
|
96
110
|
/>
|
|
97
111
|
<UButton
|
|
@@ -100,7 +114,7 @@ const color = computed(() => {
|
|
|
100
114
|
size="sm"
|
|
101
115
|
icon="lucide:copy"
|
|
102
116
|
label="Copy CMYK"
|
|
103
|
-
class="
|
|
117
|
+
:class="button()"
|
|
104
118
|
@click="copyToClipboard(cmyk)"
|
|
105
119
|
/>
|
|
106
120
|
</div>
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
export interface ColorSwatchProps {
|
|
2
2
|
name?: string;
|
|
3
3
|
hex?: string;
|
|
4
4
|
rgb?: string;
|
|
5
5
|
hsl?: string;
|
|
6
6
|
oklch?: string;
|
|
7
7
|
cmyk?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
8
|
+
}
|
|
9
|
+
export interface ColorSwatchEmits {
|
|
10
|
+
}
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<ColorSwatchProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorSwatchProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
12
|
declare const _default: typeof __VLS_export;
|
|
11
13
|
export default _default;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
export interface FontSwatchProps {
|
|
2
2
|
name?: string;
|
|
3
3
|
jpg?: string;
|
|
4
4
|
png?: string;
|
|
5
5
|
webp?: string;
|
|
6
6
|
svg?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
7
|
+
}
|
|
8
|
+
export interface FontSwatchEmits {
|
|
9
|
+
}
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<FontSwatchProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FontSwatchProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
11
|
declare const _default: typeof __VLS_export;
|
|
10
12
|
export default _default;
|