rimelight-components 2.1.89 → 2.1.91
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/blocks/AddBlockModal.d.vue.ts +36 -0
- package/dist/runtime/components/blocks/AddBlockModal.vue +155 -0
- package/dist/runtime/components/blocks/AddBlockModal.vue.d.ts +36 -0
- package/dist/runtime/components/blocks/Block.vue +6 -4
- package/dist/runtime/components/blocks/BlockEditor.d.vue.ts +1 -10
- package/dist/runtime/components/blocks/BlockEditor.vue +29 -35
- package/dist/runtime/components/blocks/BlockEditor.vue.d.ts +1 -10
- package/dist/runtime/components/blocks/index.d.ts +1 -0
- package/dist/runtime/components/blocks/index.js +1 -0
- package/dist/runtime/components/blocks/index.mjs +1 -0
- package/dist/runtime/components/page/PageEditor.d.vue.ts +6 -0
- package/dist/runtime/components/page/PageEditor.vue +5 -5
- package/dist/runtime/components/page/PageEditor.vue.d.ts +6 -0
- package/dist/runtime/components/page/PageVersionSelector.d.vue.ts +4 -4
- package/dist/runtime/components/page/PageVersionSelector.vue.d.ts +4 -4
- package/dist/runtime/components/page/modals/CreatePageModal.vue +3 -3
- package/dist/runtime/components/page/modals/DeletePageModal.d.vue.ts +9 -3
- package/dist/runtime/components/page/modals/DeletePageModal.vue +10 -7
- package/dist/runtime/components/page/modals/DeletePageModal.vue.d.ts +9 -3
- package/dist/runtime/components/page/modals/PageTreeModal.vue +31 -13
- package/dist/runtime/composables/pages/useBlockEditor.d.ts +694 -25280
- package/dist/runtime/locale/en.js +5 -1
- package/dist/runtime/locale/en.mjs +5 -1
- package/dist/runtime/types/blocks.d.ts +2 -27
- package/dist/runtime/types/pages.d.ts +1 -0
- package/dist/runtime/utils/blocks.d.ts +10 -0
- package/dist/runtime/utils/blocks.js +38 -0
- package/dist/runtime/utils/blocks.mjs +38 -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/page.d.ts +5 -1
- package/dist/runtime/utils/page.js +10 -0
- package/dist/runtime/utils/page.mjs +10 -0
- package/package.json +1 -1
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.1.
|
|
7
|
+
const version = "2.1.91";
|
|
8
8
|
const homepage = "https://rimelight.com/tools/rimelight-components";
|
|
9
9
|
|
|
10
10
|
const defaultOptions = {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type BlockDefinition } from "../../utils/blocks.js";
|
|
2
|
+
export interface AddBlockModalProps {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
rc?: {
|
|
5
|
+
header?: string;
|
|
6
|
+
headerTitle?: string;
|
|
7
|
+
closeButton?: string;
|
|
8
|
+
body?: string;
|
|
9
|
+
search?: string;
|
|
10
|
+
categoryList?: string;
|
|
11
|
+
categoryHeader?: string;
|
|
12
|
+
blockGrid?: string;
|
|
13
|
+
blockItem?: string;
|
|
14
|
+
blockIcon?: string;
|
|
15
|
+
blockLabel?: string;
|
|
16
|
+
blockDescription?: string;
|
|
17
|
+
footer?: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
type __VLS_Props = AddBlockModalProps;
|
|
21
|
+
export interface AddBlockModalEmits {
|
|
22
|
+
select: [definition: BlockDefinition];
|
|
23
|
+
}
|
|
24
|
+
type __VLS_ModelProps = {
|
|
25
|
+
"open"?: boolean;
|
|
26
|
+
};
|
|
27
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
28
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
29
|
+
"update:open": (value: boolean) => any;
|
|
30
|
+
select: (definition: BlockDefinition) => any;
|
|
31
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
32
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
33
|
+
onSelect?: ((definition: BlockDefinition) => any) | undefined;
|
|
34
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
|
+
declare const _default: typeof __VLS_export;
|
|
36
|
+
export default _default;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, computed } from "vue";
|
|
3
|
+
import { BLOCK_DEFINITIONS, CATEGORY_ORDER } from "../../utils/blocks";
|
|
4
|
+
import { useRC } from "../../composables";
|
|
5
|
+
import { useI18n } from "vue-i18n";
|
|
6
|
+
import { tv } from "../../internal/tv";
|
|
7
|
+
const open = defineModel("open", { type: Boolean, ...{ default: false } });
|
|
8
|
+
const { rc: rcProp } = defineProps({
|
|
9
|
+
open: { type: Boolean, required: false },
|
|
10
|
+
rc: { type: Object, required: false }
|
|
11
|
+
});
|
|
12
|
+
const emit = defineEmits(["select"]);
|
|
13
|
+
const { rc } = useRC("AddBlockModal", rcProp);
|
|
14
|
+
const addBlockModalStyles = tv({
|
|
15
|
+
slots: {
|
|
16
|
+
header: "flex items-center justify-between px-4 py-3 border-b border-neutral-200 dark:border-neutral-800",
|
|
17
|
+
headerTitle: "text-base font-semibold leading-6",
|
|
18
|
+
closeButton: "-my-1",
|
|
19
|
+
body: "p-0 max-h-[70vh] flex flex-col",
|
|
20
|
+
search: "p-4 border-b border-neutral-100 dark:border-neutral-900",
|
|
21
|
+
categoryList: "overflow-y-auto flex-1 p-4 space-y-6",
|
|
22
|
+
categoryHeader: "text-xs font-bold text-dimmed uppercase tracking-wider mb-3",
|
|
23
|
+
blockGrid: "flex flex-col gap-2",
|
|
24
|
+
blockItem: "flex items-start gap-3 p-3 rounded-lg border border-neutral-200 dark:border-neutral-800 hover:border-primary-500 dark:hover:border-primary-500 hover:bg-primary-50 dark:hover:bg-primary-950/20 transition-all cursor-pointer text-left",
|
|
25
|
+
blockIcon: "w-10 h-10 flex items-center justify-center rounded-md bg-neutral-100 dark:bg-neutral-900 text-neutral-500 group-hover:text-primary-500",
|
|
26
|
+
blockLabel: "font-medium text-sm block",
|
|
27
|
+
blockDescription: "text-xs text-dimmed",
|
|
28
|
+
footer: "flex justify-end gap-2 p-4 border-t border-neutral-200 dark:border-neutral-800"
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const {
|
|
32
|
+
header: headerClass,
|
|
33
|
+
headerTitle,
|
|
34
|
+
closeButton,
|
|
35
|
+
body,
|
|
36
|
+
search: searchClass,
|
|
37
|
+
categoryList,
|
|
38
|
+
categoryHeader,
|
|
39
|
+
blockGrid,
|
|
40
|
+
blockItem,
|
|
41
|
+
blockIcon,
|
|
42
|
+
blockLabel,
|
|
43
|
+
blockDescription,
|
|
44
|
+
footer
|
|
45
|
+
} = addBlockModalStyles();
|
|
46
|
+
const { t } = useI18n();
|
|
47
|
+
const searchQuery = ref("");
|
|
48
|
+
const filteredBlocks = computed(() => {
|
|
49
|
+
if (!searchQuery.value) return BLOCK_DEFINITIONS;
|
|
50
|
+
const query = searchQuery.value.toLowerCase();
|
|
51
|
+
return BLOCK_DEFINITIONS.filter(
|
|
52
|
+
(block) => block.label.toLowerCase().includes(query) || block.type.toLowerCase().includes(query) || block.category.toLowerCase().includes(query) || block.description?.toLowerCase().includes(query)
|
|
53
|
+
);
|
|
54
|
+
});
|
|
55
|
+
const groupedBlocks = computed(() => {
|
|
56
|
+
const groups = {};
|
|
57
|
+
filteredBlocks.value.forEach((block) => {
|
|
58
|
+
const category = block.category;
|
|
59
|
+
if (!groups[category]) {
|
|
60
|
+
groups[category] = [];
|
|
61
|
+
}
|
|
62
|
+
groups[category].push(block);
|
|
63
|
+
});
|
|
64
|
+
const sortedGroups = {};
|
|
65
|
+
CATEGORY_ORDER.forEach((category) => {
|
|
66
|
+
if (groups[category]) {
|
|
67
|
+
sortedGroups[category] = groups[category];
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
Object.keys(groups).forEach((category) => {
|
|
71
|
+
if (!sortedGroups[category]) {
|
|
72
|
+
sortedGroups[category] = groups[category];
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
return sortedGroups;
|
|
76
|
+
});
|
|
77
|
+
const handleSelect = (block) => {
|
|
78
|
+
emit("select", block);
|
|
79
|
+
open.value = false;
|
|
80
|
+
};
|
|
81
|
+
</script>
|
|
82
|
+
|
|
83
|
+
<template>
|
|
84
|
+
<UModal v-model:open="open">
|
|
85
|
+
<template #content>
|
|
86
|
+
<UCard :ui="{ body: 'p-0' }">
|
|
87
|
+
<template #header>
|
|
88
|
+
<div :class="headerClass({ class: rc.header })">
|
|
89
|
+
<h3 :class="headerTitle({ class: rc.headerTitle })">{{ t("page_editor.add_block") }}</h3>
|
|
90
|
+
<UButton
|
|
91
|
+
color="neutral"
|
|
92
|
+
variant="ghost"
|
|
93
|
+
icon="lucide:x"
|
|
94
|
+
:class="closeButton({ class: rc.closeButton })"
|
|
95
|
+
@click="open = false"
|
|
96
|
+
/>
|
|
97
|
+
</div>
|
|
98
|
+
</template>
|
|
99
|
+
|
|
100
|
+
<div :class="body({ class: rc.body })">
|
|
101
|
+
<div :class="searchClass({ class: rc.search })">
|
|
102
|
+
<UInput
|
|
103
|
+
v-model="searchQuery"
|
|
104
|
+
icon="lucide:search"
|
|
105
|
+
:placeholder="t('page_editor.search_blocks')"
|
|
106
|
+
autofocus
|
|
107
|
+
color="neutral"
|
|
108
|
+
variant="subtle"
|
|
109
|
+
class="w-full"
|
|
110
|
+
/>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
<div :class="categoryList({ class: rc.categoryList })">
|
|
114
|
+
<template v-if="Object.keys(groupedBlocks).length > 0">
|
|
115
|
+
<div v-for="(blocks, category) in groupedBlocks" :key="category">
|
|
116
|
+
<h4 :class="categoryHeader({ class: rc.categoryHeader })">{{ category }}</h4>
|
|
117
|
+
<div :class="blockGrid({ class: rc.blockGrid })">
|
|
118
|
+
<button
|
|
119
|
+
v-for="block in blocks"
|
|
120
|
+
:key="block.type"
|
|
121
|
+
:class="blockItem({ class: rc.blockItem })"
|
|
122
|
+
@click="handleSelect(block)"
|
|
123
|
+
>
|
|
124
|
+
<div :class="blockIcon({ class: rc.blockIcon })">
|
|
125
|
+
<UIcon :name="block.icon" size="20" />
|
|
126
|
+
</div>
|
|
127
|
+
<div class="flex-1">
|
|
128
|
+
<div class="flex items-center justify-between gap-2">
|
|
129
|
+
<span :class="blockLabel({ class: rc.blockLabel })">{{ block.label }}</span>
|
|
130
|
+
<span class="text-[10px] font-mono text-dimmed px-1.5 py-0.5 bg-neutral-100 dark:bg-neutral-900 rounded">{{ block.type }}</span>
|
|
131
|
+
</div>
|
|
132
|
+
<p v-if="block.description" :class="blockDescription({ class: rc.blockDescription })">
|
|
133
|
+
{{ block.description }}
|
|
134
|
+
</p>
|
|
135
|
+
</div>
|
|
136
|
+
</button>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</template>
|
|
140
|
+
<div v-else class="flex flex-col items-center justify-center py-12 text-center">
|
|
141
|
+
<UIcon name="lucide:search-slash" size="40" class="text-neutral-400 mb-4" />
|
|
142
|
+
<p class="text-dimmed">{{ t("page_editor.no_blocks_found") }}</p>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
<template #footer>
|
|
148
|
+
<div :class="footer({ class: rc.footer })">
|
|
149
|
+
<UButton color="neutral" variant="ghost" :label="t('common.cancel')" @click="open = false" />
|
|
150
|
+
</div>
|
|
151
|
+
</template>
|
|
152
|
+
</UCard>
|
|
153
|
+
</template>
|
|
154
|
+
</UModal>
|
|
155
|
+
</template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type BlockDefinition } from "../../utils/blocks.js";
|
|
2
|
+
export interface AddBlockModalProps {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
rc?: {
|
|
5
|
+
header?: string;
|
|
6
|
+
headerTitle?: string;
|
|
7
|
+
closeButton?: string;
|
|
8
|
+
body?: string;
|
|
9
|
+
search?: string;
|
|
10
|
+
categoryList?: string;
|
|
11
|
+
categoryHeader?: string;
|
|
12
|
+
blockGrid?: string;
|
|
13
|
+
blockItem?: string;
|
|
14
|
+
blockIcon?: string;
|
|
15
|
+
blockLabel?: string;
|
|
16
|
+
blockDescription?: string;
|
|
17
|
+
footer?: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
type __VLS_Props = AddBlockModalProps;
|
|
21
|
+
export interface AddBlockModalEmits {
|
|
22
|
+
select: [definition: BlockDefinition];
|
|
23
|
+
}
|
|
24
|
+
type __VLS_ModelProps = {
|
|
25
|
+
"open"?: boolean;
|
|
26
|
+
};
|
|
27
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
28
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
29
|
+
"update:open": (value: boolean) => any;
|
|
30
|
+
select: (definition: BlockDefinition) => any;
|
|
31
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
32
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
33
|
+
onSelect?: ((definition: BlockDefinition) => any) | undefined;
|
|
34
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
|
+
declare const _default: typeof __VLS_export;
|
|
36
|
+
export default _default;
|
|
@@ -25,6 +25,8 @@ const onDelete = () => editorApi.removeBlock(id);
|
|
|
25
25
|
const onDuplicate = () => editorApi.duplicateBlock(id);
|
|
26
26
|
const onMoveUp = () => editorApi.moveBlock(id, -1);
|
|
27
27
|
const onMoveDown = () => editorApi.moveBlock(id, 1);
|
|
28
|
+
const onAddAbove = () => editorApi.openAddBlockModal(id, "before");
|
|
29
|
+
const onAddBelow = () => editorApi.openAddBlockModal(id, "after");
|
|
28
30
|
const items = ref([
|
|
29
31
|
[
|
|
30
32
|
{
|
|
@@ -41,13 +43,13 @@ const items = ref([
|
|
|
41
43
|
[
|
|
42
44
|
{
|
|
43
45
|
icon: "lucide:corner-right-up",
|
|
44
|
-
label: "Add Block Above"
|
|
45
|
-
|
|
46
|
+
label: "Add Block Above",
|
|
47
|
+
onSelect: onAddAbove
|
|
46
48
|
},
|
|
47
49
|
{
|
|
48
50
|
icon: "lucide:corner-right-down",
|
|
49
|
-
label: "Add Block Below"
|
|
50
|
-
|
|
51
|
+
label: "Add Block Below",
|
|
52
|
+
onSelect: onAddBelow
|
|
51
53
|
}
|
|
52
54
|
],
|
|
53
55
|
[
|
|
@@ -8,14 +8,11 @@ export interface BlockEditorEmits {
|
|
|
8
8
|
save: [];
|
|
9
9
|
mutation: [];
|
|
10
10
|
}
|
|
11
|
-
export interface BlockEditorSlots {
|
|
12
|
-
}
|
|
13
|
-
type __VLS_Slots = BlockEditorSlots;
|
|
14
11
|
type __VLS_ModelProps = {
|
|
15
12
|
modelValue: Block[];
|
|
16
13
|
};
|
|
17
14
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
18
|
-
declare const
|
|
15
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
19
16
|
undo: () => void;
|
|
20
17
|
redo: () => void;
|
|
21
18
|
canUndo: import("vue").ComputedRef<boolean>;
|
|
@@ -29,11 +26,5 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
29
26
|
onMutation?: (() => any) | undefined;
|
|
30
27
|
"onUpdate:modelValue"?: ((value: Block[]) => any) | undefined;
|
|
31
28
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
32
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
33
29
|
declare const _default: typeof __VLS_export;
|
|
34
30
|
export default _default;
|
|
35
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
36
|
-
new (): {
|
|
37
|
-
$slots: S;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
@@ -1,25 +1,15 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { provide,
|
|
3
|
-
import { useBlockEditor } from "../../composables";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { provide, ref } from "vue";
|
|
3
|
+
import { useBlockEditor, useRC } from "../../composables";
|
|
4
|
+
import {} from "../../utils/blocks";
|
|
5
|
+
import { useI18n } from "vue-i18n";
|
|
6
6
|
const { historyLimit, rc: rcProp } = defineProps({
|
|
7
7
|
historyLimit: { type: Number, required: false },
|
|
8
8
|
rc: { type: Object, required: false }
|
|
9
9
|
});
|
|
10
10
|
const blocks = defineModel({ type: Array, ...{ required: true } });
|
|
11
11
|
const emit = defineEmits(["save", "mutation"]);
|
|
12
|
-
const
|
|
13
|
-
const blockTypes = [
|
|
14
|
-
{ label: "Paragraph", value: "ParagraphBlock", icon: "i-lucide-pilcrow" },
|
|
15
|
-
{ label: "Section", value: "SectionBlock", icon: "i-lucide-heading" },
|
|
16
|
-
{ label: "Image", value: "ImageBlock", icon: "i-lucide-image" },
|
|
17
|
-
{ label: "Callout", value: "CalloutBlock", icon: "i-lucide-info" },
|
|
18
|
-
{ label: "Quote", value: "QuoteBlock", icon: "i-lucide-quote" },
|
|
19
|
-
{ label: "List", value: "UnorderedListBlock", icon: "i-lucide-list" },
|
|
20
|
-
{ label: "Card", value: "CardBlock", icon: "i-lucide-square" },
|
|
21
|
-
{ label: "Collapsible Card", value: "CollapsibleCardBlock", icon: "i-lucide-chevron-right-square" }
|
|
22
|
-
];
|
|
12
|
+
const { t } = useI18n();
|
|
23
13
|
const { rc } = useRC("BlockEditor", rcProp);
|
|
24
14
|
const {
|
|
25
15
|
removeBlock,
|
|
@@ -32,13 +22,15 @@ const {
|
|
|
32
22
|
canUndo,
|
|
33
23
|
canRedo
|
|
34
24
|
} = useBlockEditor(blocks, { maxHistorySize: historyLimit, onMutation: () => emit("mutation") });
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
25
|
+
const isAddBlockModalOpen = ref(false);
|
|
26
|
+
const addBlockTarget = ref({ id: null, position: "after" });
|
|
27
|
+
const openAddBlockModal = (targetId = null, position = "after") => {
|
|
28
|
+
addBlockTarget.value = { id: targetId, position };
|
|
29
|
+
isAddBlockModalOpen.value = true;
|
|
30
|
+
};
|
|
31
|
+
const handleBlockSelect = (definition) => {
|
|
32
|
+
insertBlock(definition.type, addBlockTarget.value.id, addBlockTarget.value.position);
|
|
33
|
+
};
|
|
42
34
|
provide("block-editor-api", {
|
|
43
35
|
removeBlock,
|
|
44
36
|
moveBlock,
|
|
@@ -48,7 +40,8 @@ provide("block-editor-api", {
|
|
|
48
40
|
canUndo,
|
|
49
41
|
canRedo,
|
|
50
42
|
undo,
|
|
51
|
-
redo
|
|
43
|
+
redo,
|
|
44
|
+
openAddBlockModal
|
|
52
45
|
});
|
|
53
46
|
defineExpose({ undo, redo, canUndo, canRedo });
|
|
54
47
|
</script>
|
|
@@ -58,18 +51,19 @@ defineExpose({ undo, redo, canUndo, canRedo });
|
|
|
58
51
|
<RCBlockEditRenderer :blocks="blocks" />
|
|
59
52
|
|
|
60
53
|
<div class="flex flex-col items-center justify-center p-4 border-t border-neutral-200 dark:border-neutral-800 border-dashed rounded-lg">
|
|
61
|
-
<span class="text-sm text-dimmed mb-2">
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
variant="outline"
|
|
70
|
-
icon="i-lucide-plus"
|
|
71
|
-
/>
|
|
72
|
-
</UDropdownMenu>
|
|
54
|
+
<span class="text-sm text-dimmed mb-2">{{ t("page_editor.append_new_block") }}</span>
|
|
55
|
+
<UButton
|
|
56
|
+
color="neutral"
|
|
57
|
+
:label="t('page_editor.add_block', 'Add Block')"
|
|
58
|
+
variant="outline"
|
|
59
|
+
icon="i-lucide-plus"
|
|
60
|
+
@click="openAddBlockModal()"
|
|
61
|
+
/>
|
|
73
62
|
</div>
|
|
63
|
+
|
|
64
|
+
<RCAddBlockModal
|
|
65
|
+
v-model:open="isAddBlockModalOpen"
|
|
66
|
+
@select="handleBlockSelect"
|
|
67
|
+
/>
|
|
74
68
|
</div>
|
|
75
69
|
</template>
|
|
@@ -8,14 +8,11 @@ export interface BlockEditorEmits {
|
|
|
8
8
|
save: [];
|
|
9
9
|
mutation: [];
|
|
10
10
|
}
|
|
11
|
-
export interface BlockEditorSlots {
|
|
12
|
-
}
|
|
13
|
-
type __VLS_Slots = BlockEditorSlots;
|
|
14
11
|
type __VLS_ModelProps = {
|
|
15
12
|
modelValue: Block[];
|
|
16
13
|
};
|
|
17
14
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
18
|
-
declare const
|
|
15
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
19
16
|
undo: () => void;
|
|
20
17
|
redo: () => void;
|
|
21
18
|
canUndo: import("vue").ComputedRef<boolean>;
|
|
@@ -29,11 +26,5 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
29
26
|
onMutation?: (() => any) | undefined;
|
|
30
27
|
"onUpdate:modelValue"?: ((value: Block[]) => any) | undefined;
|
|
31
28
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
32
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
33
29
|
declare const _default: typeof __VLS_export;
|
|
34
30
|
export default _default;
|
|
35
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
36
|
-
new (): {
|
|
37
|
-
$slots: S;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
@@ -3,5 +3,6 @@ export { default as BlockEditRenderer } from './BlockEditRenderer.vue.js';
|
|
|
3
3
|
export { default as BlockEditor } from './BlockEditor.vue.js';
|
|
4
4
|
export { default as BlockViewRenderer } from './BlockViewRenderer.vue.js';
|
|
5
5
|
export { default as TextRenderer } from './TextRenderer.vue.js';
|
|
6
|
+
export { default as AddBlockModal } from './AddBlockModal.vue.js';
|
|
6
7
|
export * from './editor/index.js';
|
|
7
8
|
export * from './renderer/index.js';
|
|
@@ -3,5 +3,6 @@ export { default as BlockEditRenderer } from "./BlockEditRenderer.vue";
|
|
|
3
3
|
export { default as BlockEditor } from "./BlockEditor.vue";
|
|
4
4
|
export { default as BlockViewRenderer } from "./BlockViewRenderer.vue";
|
|
5
5
|
export { default as TextRenderer } from "./TextRenderer.vue";
|
|
6
|
+
export { default as AddBlockModal } from "./AddBlockModal.vue";
|
|
6
7
|
export * from "./editor/index.js";
|
|
7
8
|
export * from "./renderer/index.js";
|
|
@@ -3,5 +3,6 @@ export { default as BlockEditRenderer } from "./BlockEditRenderer.vue";
|
|
|
3
3
|
export { default as BlockEditor } from "./BlockEditor.vue";
|
|
4
4
|
export { default as BlockViewRenderer } from "./BlockViewRenderer.vue";
|
|
5
5
|
export { default as TextRenderer } from "./TextRenderer.vue";
|
|
6
|
+
export { default as AddBlockModal } from "./AddBlockModal.vue";
|
|
6
7
|
export * from "./editor/index.mjs";
|
|
7
8
|
export * from "./renderer/index.mjs";
|
|
@@ -38,6 +38,8 @@ type __VLS_Props = PageEditorProps;
|
|
|
38
38
|
export interface PageEditorEmits {
|
|
39
39
|
save: [value: Page];
|
|
40
40
|
'version-navigate': [version: PageVersion];
|
|
41
|
+
'version-approved': [version: PageVersion];
|
|
42
|
+
'version-reverted': [version: PageVersion];
|
|
41
43
|
}
|
|
42
44
|
export interface PageEditorSlots {
|
|
43
45
|
'header-actions'?: (props: {}) => any;
|
|
@@ -64,6 +66,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
64
66
|
properties: import("../../types/index.js").BasePageProperties;
|
|
65
67
|
} & import("../../types/index.js").BasePage) => any;
|
|
66
68
|
"version-navigate": (version: PageVersion) => any;
|
|
69
|
+
"version-approved": (version: PageVersion) => any;
|
|
70
|
+
"version-reverted": (version: PageVersion) => any;
|
|
67
71
|
"update:currentVersionId": (value: string | null) => any;
|
|
68
72
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
69
73
|
onSave?: ((value: {
|
|
@@ -75,6 +79,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
75
79
|
properties: import("../../types/index.js").BasePageProperties;
|
|
76
80
|
} & import("../../types/index.js").BasePage) => any) | undefined;
|
|
77
81
|
"onVersion-navigate"?: ((version: PageVersion) => any) | undefined;
|
|
82
|
+
"onVersion-approved"?: ((version: PageVersion) => any) | undefined;
|
|
83
|
+
"onVersion-reverted"?: ((version: PageVersion) => any) | undefined;
|
|
78
84
|
"onUpdate:currentVersionId"?: ((value: string | null) => any) | undefined;
|
|
79
85
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
80
86
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -40,7 +40,7 @@ const {
|
|
|
40
40
|
});
|
|
41
41
|
const page = defineModel({ type: null, ...{ required: true } });
|
|
42
42
|
const versionId = defineModel("currentVersionId", { type: [String, null], ...{ default: null } });
|
|
43
|
-
const emit = defineEmits(["save", "version-navigate"]);
|
|
43
|
+
const emit = defineEmits(["save", "version-navigate", "version-approved", "version-reverted"]);
|
|
44
44
|
const slots = defineSlots();
|
|
45
45
|
const { rc } = useRC("PageEditor", rcProp);
|
|
46
46
|
const pageEditorStyles = tv({
|
|
@@ -291,22 +291,22 @@ const handleTreeNavigate = (slug) => {
|
|
|
291
291
|
:page-id="page.id"
|
|
292
292
|
:is-admin="isAdmin"
|
|
293
293
|
@version-selected="(v) => emit('version-navigate', v)"
|
|
294
|
+
@version-approved="(v) => emit('version-approved', v)"
|
|
295
|
+
@version-reverted="(v) => emit('version-reverted', v)"
|
|
294
296
|
/>
|
|
295
297
|
<slot name="header-actions" />
|
|
296
298
|
<RCCreatePageModal
|
|
297
|
-
:
|
|
299
|
+
v-model:open="isCreateModalOpen"
|
|
298
300
|
:definitions="pageDefinitions"
|
|
299
301
|
:loading="isCreating"
|
|
300
|
-
@close="isCreateModalOpen = false"
|
|
301
302
|
@confirm="handleCreateConfirm"
|
|
302
303
|
>
|
|
303
304
|
<UButton icon="lucide:file-plus" :label="t('page_editor.create_page')" color="primary" size="xs" />
|
|
304
305
|
</RCCreatePageModal>
|
|
305
306
|
<RCDeletePageModal
|
|
306
|
-
:
|
|
307
|
+
v-model:open="isDeleteModalOpen"
|
|
307
308
|
:loading="isDeleting"
|
|
308
309
|
:page-title="getLocalizedContent(page.title, locale)"
|
|
309
|
-
@close="isDeleteModalOpen = false"
|
|
310
310
|
@confirm="handleDeleteConfirm"
|
|
311
311
|
>
|
|
312
312
|
<UButton icon="lucide:file-plus" :label="t('page_editor.delete_page')" color="error" size="xs" />
|
|
@@ -38,6 +38,8 @@ type __VLS_Props = PageEditorProps;
|
|
|
38
38
|
export interface PageEditorEmits {
|
|
39
39
|
save: [value: Page];
|
|
40
40
|
'version-navigate': [version: PageVersion];
|
|
41
|
+
'version-approved': [version: PageVersion];
|
|
42
|
+
'version-reverted': [version: PageVersion];
|
|
41
43
|
}
|
|
42
44
|
export interface PageEditorSlots {
|
|
43
45
|
'header-actions'?: (props: {}) => any;
|
|
@@ -64,6 +66,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
64
66
|
properties: import("../../types/index.js").BasePageProperties;
|
|
65
67
|
} & import("../../types/index.js").BasePage) => any;
|
|
66
68
|
"version-navigate": (version: PageVersion) => any;
|
|
69
|
+
"version-approved": (version: PageVersion) => any;
|
|
70
|
+
"version-reverted": (version: PageVersion) => any;
|
|
67
71
|
"update:currentVersionId": (value: string | null) => any;
|
|
68
72
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
69
73
|
onSave?: ((value: {
|
|
@@ -75,6 +79,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
75
79
|
properties: import("../../types/index.js").BasePageProperties;
|
|
76
80
|
} & import("../../types/index.js").BasePage) => any) | undefined;
|
|
77
81
|
"onVersion-navigate"?: ((version: PageVersion) => any) | undefined;
|
|
82
|
+
"onVersion-approved"?: ((version: PageVersion) => any) | undefined;
|
|
83
|
+
"onVersion-reverted"?: ((version: PageVersion) => any) | undefined;
|
|
78
84
|
"onUpdate:currentVersionId"?: ((value: string | null) => any) | undefined;
|
|
79
85
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
80
86
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -11,15 +11,15 @@ export interface PageVersionSelectorProps {
|
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
declare const __VLS_export: import("vue").DefineComponent<PageVersionSelectorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
-
"update:currentVersionId": (value: string | null) => any;
|
|
15
|
-
"version-selected": (version: PageVersion) => any;
|
|
16
14
|
"version-approved": (version: PageVersion) => any;
|
|
17
15
|
"version-reverted": (version: PageVersion) => any;
|
|
16
|
+
"update:currentVersionId": (value: string | null) => any;
|
|
17
|
+
"version-selected": (version: PageVersion) => any;
|
|
18
18
|
}, string, import("vue").PublicProps, Readonly<PageVersionSelectorProps> & Readonly<{
|
|
19
|
-
"onUpdate:currentVersionId"?: ((value: string | null) => any) | undefined;
|
|
20
|
-
"onVersion-selected"?: ((version: PageVersion) => any) | undefined;
|
|
21
19
|
"onVersion-approved"?: ((version: PageVersion) => any) | undefined;
|
|
22
20
|
"onVersion-reverted"?: ((version: PageVersion) => any) | undefined;
|
|
21
|
+
"onUpdate:currentVersionId"?: ((value: string | null) => any) | undefined;
|
|
22
|
+
"onVersion-selected"?: ((version: PageVersion) => any) | undefined;
|
|
23
23
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
24
|
declare const _default: typeof __VLS_export;
|
|
25
25
|
export default _default;
|
|
@@ -11,15 +11,15 @@ export interface PageVersionSelectorProps {
|
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
declare const __VLS_export: import("vue").DefineComponent<PageVersionSelectorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
-
"update:currentVersionId": (value: string | null) => any;
|
|
15
|
-
"version-selected": (version: PageVersion) => any;
|
|
16
14
|
"version-approved": (version: PageVersion) => any;
|
|
17
15
|
"version-reverted": (version: PageVersion) => any;
|
|
16
|
+
"update:currentVersionId": (value: string | null) => any;
|
|
17
|
+
"version-selected": (version: PageVersion) => any;
|
|
18
18
|
}, string, import("vue").PublicProps, Readonly<PageVersionSelectorProps> & Readonly<{
|
|
19
|
-
"onUpdate:currentVersionId"?: ((value: string | null) => any) | undefined;
|
|
20
|
-
"onVersion-selected"?: ((version: PageVersion) => any) | undefined;
|
|
21
19
|
"onVersion-approved"?: ((version: PageVersion) => any) | undefined;
|
|
22
20
|
"onVersion-reverted"?: ((version: PageVersion) => any) | undefined;
|
|
21
|
+
"onUpdate:currentVersionId"?: ((value: string | null) => any) | undefined;
|
|
22
|
+
"onVersion-selected"?: ((version: PageVersion) => any) | undefined;
|
|
23
23
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
24
|
declare const _default: typeof __VLS_export;
|
|
25
25
|
export default _default;
|
|
@@ -85,9 +85,9 @@ watch(open, (isOpen) => {
|
|
|
85
85
|
<UButton
|
|
86
86
|
color="neutral"
|
|
87
87
|
variant="ghost"
|
|
88
|
-
icon="
|
|
88
|
+
icon="lucide:x"
|
|
89
89
|
:class="closeButton({ class: rc.closeButton })"
|
|
90
|
-
@click="
|
|
90
|
+
@click="open = false"
|
|
91
91
|
/>
|
|
92
92
|
</div>
|
|
93
93
|
</template>
|
|
@@ -113,7 +113,7 @@ watch(open, (isOpen) => {
|
|
|
113
113
|
|
|
114
114
|
<template #footer>
|
|
115
115
|
<div :class="footer({ class: rc.footer })">
|
|
116
|
-
<UButton color="neutral" variant="ghost" :label="t('common.cancel')" @click="
|
|
116
|
+
<UButton color="neutral" variant="ghost" :label="t('common.cancel')" @click="open = false" />
|
|
117
117
|
<UButton
|
|
118
118
|
color="primary"
|
|
119
119
|
:label="t('page_properties.create_and_edit')"
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export interface DeletePageModalProps {
|
|
2
|
-
isOpen: boolean;
|
|
3
2
|
loading?: boolean;
|
|
4
3
|
pageTitle: string;
|
|
5
4
|
rc?: {
|
|
@@ -10,6 +9,7 @@ export interface DeletePageModalProps {
|
|
|
10
9
|
footer?: string;
|
|
11
10
|
};
|
|
12
11
|
}
|
|
12
|
+
type __VLS_Props = DeletePageModalProps;
|
|
13
13
|
export interface DeletePageModalEmits {
|
|
14
14
|
close: [];
|
|
15
15
|
confirm: [];
|
|
@@ -18,11 +18,17 @@ export interface DeletePageModalSlots {
|
|
|
18
18
|
default: (props: {}) => any;
|
|
19
19
|
}
|
|
20
20
|
type __VLS_Slots = DeletePageModalSlots;
|
|
21
|
-
|
|
21
|
+
type __VLS_ModelProps = {
|
|
22
|
+
"open"?: boolean;
|
|
23
|
+
};
|
|
24
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
25
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
26
|
close: () => any;
|
|
27
|
+
"update:open": (value: boolean) => any;
|
|
23
28
|
confirm: () => any;
|
|
24
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
29
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
25
30
|
onClose?: (() => any) | undefined;
|
|
31
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
26
32
|
onConfirm?: (() => any) | undefined;
|
|
27
33
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
34
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|