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,12 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
export interface BlockProps {
|
|
2
2
|
id: string;
|
|
3
3
|
type: string;
|
|
4
|
-
}
|
|
4
|
+
}
|
|
5
|
+
export interface BlockEmits {
|
|
6
|
+
}
|
|
5
7
|
declare var __VLS_12: {};
|
|
6
8
|
type __VLS_Slots = {} & {
|
|
7
9
|
default?: (props: typeof __VLS_12) => any;
|
|
8
10
|
};
|
|
9
|
-
declare const __VLS_base: import("vue").DefineComponent<
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<BlockProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BlockProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
12
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
13
|
declare const _default: typeof __VLS_export;
|
|
12
14
|
export default _default;
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { inject,
|
|
3
|
-
|
|
4
|
-
if (!editorApi) {
|
|
5
|
-
throw new Error("RCBlock must be used within a BlockEditor component");
|
|
6
|
-
}
|
|
2
|
+
import { inject, ref } from "vue";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
7
4
|
const { id, type } = defineProps({
|
|
8
5
|
id: { type: String, required: true },
|
|
9
6
|
type: { type: String, required: true }
|
|
10
7
|
});
|
|
8
|
+
const emit = defineEmits([]);
|
|
9
|
+
const blockStyles = tv({
|
|
10
|
+
slots: {
|
|
11
|
+
root: "group relative pl-12 flex flex-row gap-xs",
|
|
12
|
+
menuContainer: "top-0 left-0 z-10 opacity-0 transition-opacity group-hover:opacity-100"
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const { root, menuContainer } = blockStyles();
|
|
16
|
+
const editorApi = inject("block-editor-api");
|
|
17
|
+
if (!editorApi) {
|
|
18
|
+
throw new Error("RCBlock must be used within a BlockEditor component");
|
|
19
|
+
}
|
|
11
20
|
const onDelete = () => editorApi.removeBlock(id);
|
|
12
21
|
const onDuplicate = () => editorApi.duplicateBlock(id);
|
|
13
22
|
const onMoveUp = () => editorApi.moveBlock(id, -1);
|
|
@@ -54,8 +63,8 @@ const items = ref([
|
|
|
54
63
|
</script>
|
|
55
64
|
|
|
56
65
|
<template>
|
|
57
|
-
<div class="
|
|
58
|
-
<div class="
|
|
66
|
+
<div :class="root()">
|
|
67
|
+
<div :class="menuContainer()">
|
|
59
68
|
<UDropdownMenu :items="items">
|
|
60
69
|
<UButton icon="lucide:grip-vertical" variant="ghost" color="neutral" />
|
|
61
70
|
</UDropdownMenu>
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
export interface BlockProps {
|
|
2
2
|
id: string;
|
|
3
3
|
type: string;
|
|
4
|
-
}
|
|
4
|
+
}
|
|
5
|
+
export interface BlockEmits {
|
|
6
|
+
}
|
|
5
7
|
declare var __VLS_12: {};
|
|
6
8
|
type __VLS_Slots = {} & {
|
|
7
9
|
default?: (props: typeof __VLS_12) => any;
|
|
8
10
|
};
|
|
9
|
-
declare const __VLS_base: import("vue").DefineComponent<
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<BlockProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BlockProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
12
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
13
|
declare const _default: typeof __VLS_export;
|
|
12
14
|
export default _default;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Block } from "../../types/index.js";
|
|
2
|
-
|
|
2
|
+
export interface BlockEditRendererProps {
|
|
3
3
|
blocks: Block[];
|
|
4
|
-
}
|
|
5
|
-
|
|
4
|
+
}
|
|
5
|
+
export interface BlockEditRendererEmits {
|
|
6
|
+
}
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<BlockEditRendererProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BlockEditRendererProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
8
|
declare const _default: typeof __VLS_export;
|
|
7
9
|
export default _default;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import {} from "vue";
|
|
3
3
|
import { getBlockEditorComponent } from "../../internal/blockMapper";
|
|
4
|
+
import { tv } from "tailwind-variants";
|
|
4
5
|
const { blocks } = defineProps({
|
|
5
6
|
blocks: { type: Array, required: true }
|
|
6
7
|
});
|
|
8
|
+
const emit = defineEmits([]);
|
|
9
|
+
const blockEditRendererStyles = tv({
|
|
10
|
+
slots: {
|
|
11
|
+
root: "flex flex-col gap-lg w-full"
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
const { root } = blockEditRendererStyles();
|
|
7
15
|
const getComponent = (block) => {
|
|
8
16
|
if (!block || !block.type || block.type.length === 0) {
|
|
9
17
|
console.error("Block object is missing the critical 'type' field.");
|
|
@@ -19,7 +27,7 @@ const getComponent = (block) => {
|
|
|
19
27
|
</script>
|
|
20
28
|
|
|
21
29
|
<template>
|
|
22
|
-
<div class="
|
|
30
|
+
<div :class="root()">
|
|
23
31
|
<UEmpty
|
|
24
32
|
v-if="!blocks || blocks.length === 0"
|
|
25
33
|
variant="naked"
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Block } from "../../types/index.js";
|
|
2
|
-
|
|
2
|
+
export interface BlockEditRendererProps {
|
|
3
3
|
blocks: Block[];
|
|
4
|
-
}
|
|
5
|
-
|
|
4
|
+
}
|
|
5
|
+
export interface BlockEditRendererEmits {
|
|
6
|
+
}
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<BlockEditRendererProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BlockEditRendererProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
8
|
declare const _default: typeof __VLS_export;
|
|
7
9
|
export default _default;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { provide
|
|
2
|
+
import { provide } from "vue";
|
|
3
3
|
import { useBlockEditor } from "../../composables";
|
|
4
|
-
|
|
4
|
+
import { tv } from "tailwind-variants";
|
|
5
5
|
const { historyLimit } = defineProps({
|
|
6
6
|
historyLimit: { type: Number, required: false }
|
|
7
7
|
});
|
|
8
8
|
const emit = defineEmits(["save"]);
|
|
9
|
+
const blocks = defineModel({ type: Array, ...{ required: true } });
|
|
10
|
+
const blockEditorStyles = tv({});
|
|
9
11
|
const {
|
|
10
12
|
removeBlock,
|
|
11
13
|
moveBlock,
|
|
@@ -29,37 +31,6 @@ provide("block-editor-api", {
|
|
|
29
31
|
redo
|
|
30
32
|
});
|
|
31
33
|
defineExpose({ undo, redo, canUndo, canRedo });
|
|
32
|
-
const handleSave = () => {
|
|
33
|
-
emit("save");
|
|
34
|
-
};
|
|
35
|
-
const showPreview = ref(false);
|
|
36
|
-
const gridClass = computed(() => ({
|
|
37
|
-
// The base grid: transitions enable smooth resizing
|
|
38
|
-
"grid transition-[grid-template-columns] duration-300 ease-out": true,
|
|
39
|
-
// When hidden, use a single column (Editor takes full width)
|
|
40
|
-
"grid-cols-1": !showPreview.value,
|
|
41
|
-
// When visible, use two equal columns (Editor + Preview)
|
|
42
|
-
"grid-cols-2 gap-xl": showPreview.value
|
|
43
|
-
}));
|
|
44
|
-
const editorPanelClass = computed(() => ({
|
|
45
|
-
// When preview is visible, both editor/preview share 1/2 span.
|
|
46
|
-
"col-span-1 w-full": showPreview.value,
|
|
47
|
-
// When preview is hidden, the editor uses the full grid space.
|
|
48
|
-
"col-span-2 w-full": !showPreview.value
|
|
49
|
-
}));
|
|
50
|
-
const togglePreview = () => {
|
|
51
|
-
showPreview.value = !showPreview.value;
|
|
52
|
-
};
|
|
53
|
-
const undoAction = () => {
|
|
54
|
-
if (canUndo.value) {
|
|
55
|
-
undo();
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
const redoAction = () => {
|
|
59
|
-
if (canRedo.value) {
|
|
60
|
-
redo();
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
34
|
</script>
|
|
64
35
|
|
|
65
36
|
<template>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Block } from "../../types/index.js";
|
|
2
|
-
|
|
2
|
+
export interface BlockViewRendererProps {
|
|
3
3
|
blocks: Block[];
|
|
4
|
-
}
|
|
5
|
-
|
|
4
|
+
}
|
|
5
|
+
export interface BlockViewRendererEmits {
|
|
6
|
+
}
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<BlockViewRendererProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BlockViewRendererProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
8
|
declare const _default: typeof __VLS_export;
|
|
7
9
|
export default _default;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import {} from "vue";
|
|
3
3
|
import { getBlockRendererComponent } from "../../internal/blockMapper";
|
|
4
|
+
import { tv } from "tailwind-variants";
|
|
4
5
|
const { blocks } = defineProps({
|
|
5
6
|
blocks: { type: Array, required: true }
|
|
6
7
|
});
|
|
8
|
+
const emit = defineEmits([]);
|
|
9
|
+
const blockViewRendererStyles = tv({
|
|
10
|
+
slots: {
|
|
11
|
+
root: "flex flex-col gap-lg"
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
const { root } = blockViewRendererStyles();
|
|
7
15
|
const getComponent = (block) => {
|
|
8
16
|
if (!block || !block.type || block.type.length === 0) {
|
|
9
17
|
console.error("Block object is missing the critical 'type' field.");
|
|
@@ -19,7 +27,7 @@ const getComponent = (block) => {
|
|
|
19
27
|
</script>
|
|
20
28
|
|
|
21
29
|
<template>
|
|
22
|
-
<div class="
|
|
30
|
+
<div :class="root()">
|
|
23
31
|
<UEmpty
|
|
24
32
|
v-if="!blocks || blocks.length === 0"
|
|
25
33
|
variant="naked"
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Block } from "../../types/index.js";
|
|
2
|
-
|
|
2
|
+
export interface BlockViewRendererProps {
|
|
3
3
|
blocks: Block[];
|
|
4
|
-
}
|
|
5
|
-
|
|
4
|
+
}
|
|
5
|
+
export interface BlockViewRendererEmits {
|
|
6
|
+
}
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<BlockViewRendererProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BlockViewRendererProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
8
|
declare const _default: typeof __VLS_export;
|
|
7
9
|
export default _default;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type RichTextContent } from "../../types/index.js";
|
|
2
|
-
|
|
2
|
+
export interface TextRendererProps {
|
|
3
3
|
content: RichTextContent;
|
|
4
|
-
}
|
|
5
|
-
|
|
4
|
+
}
|
|
5
|
+
export interface TextRendererEmits {
|
|
6
|
+
}
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<TextRendererProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TextRendererProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
8
|
declare const _default: typeof __VLS_export;
|
|
7
9
|
export default _default;
|
|
@@ -4,12 +4,20 @@ import {
|
|
|
4
4
|
import TextNode from "../nodes/TextNode.vue";
|
|
5
5
|
import LinkNode from "../nodes/LinkNode.vue";
|
|
6
6
|
import PageMention from "../page/PageMention.vue";
|
|
7
|
+
import { tv } from "tailwind-variants";
|
|
7
8
|
defineOptions({
|
|
8
9
|
name: "TextRenderer"
|
|
9
10
|
});
|
|
10
11
|
const { content } = defineProps({
|
|
11
12
|
content: { type: Array, required: true }
|
|
12
13
|
});
|
|
14
|
+
const emit = defineEmits([]);
|
|
15
|
+
const textRendererStyles = tv({
|
|
16
|
+
slots: {
|
|
17
|
+
root: ""
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const { root } = textRendererStyles();
|
|
13
21
|
const getTag = (item) => {
|
|
14
22
|
switch (item.type) {
|
|
15
23
|
case "text":
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type RichTextContent } from "../../types/index.js";
|
|
2
|
-
|
|
2
|
+
export interface TextRendererProps {
|
|
3
3
|
content: RichTextContent;
|
|
4
|
-
}
|
|
5
|
-
|
|
4
|
+
}
|
|
5
|
+
export interface TextRendererEmits {
|
|
6
|
+
}
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<TextRendererProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TextRendererProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
8
|
declare const _default: typeof __VLS_export;
|
|
7
9
|
export default _default;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { CalloutBlockProps } from "../../../types/index.js";
|
|
2
|
-
|
|
2
|
+
export interface CalloutBlockEditorProps extends CalloutBlockProps {
|
|
3
|
+
}
|
|
4
|
+
export interface CalloutBlockEditorEmits {
|
|
5
|
+
}
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<CalloutBlockEditorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CalloutBlockEditorProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
7
|
declare const _default: typeof __VLS_export;
|
|
4
8
|
export default _default;
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { tv } from "tailwind-variants";
|
|
2
3
|
const { variant, children, to, target } = defineProps({
|
|
3
4
|
variant: { type: String, required: true },
|
|
4
5
|
children: { type: Array, required: true },
|
|
5
6
|
to: { type: String, required: false },
|
|
6
7
|
target: { type: String, required: false }
|
|
7
8
|
});
|
|
9
|
+
const emit = defineEmits([]);
|
|
10
|
+
const calloutBlockEditorStyles = tv({
|
|
11
|
+
slots: {
|
|
12
|
+
root: ""
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const { root } = calloutBlockEditorStyles();
|
|
8
16
|
</script>
|
|
9
17
|
|
|
10
18
|
<template>
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { CalloutBlockProps } from "../../../types/index.js";
|
|
2
|
-
|
|
2
|
+
export interface CalloutBlockEditorProps extends CalloutBlockProps {
|
|
3
|
+
}
|
|
4
|
+
export interface CalloutBlockEditorEmits {
|
|
5
|
+
}
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<CalloutBlockEditorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CalloutBlockEditorProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
7
|
declare const _default: typeof __VLS_export;
|
|
4
8
|
export default _default;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { CardBlockProps } from "../../../types/index.js";
|
|
2
|
-
|
|
2
|
+
export interface CardBlockEditorProps extends CardBlockProps {
|
|
3
|
+
}
|
|
4
|
+
export interface CardBlockEditorEmits {
|
|
5
|
+
}
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<CardBlockEditorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CardBlockEditorProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
7
|
declare const _default: typeof __VLS_export;
|
|
4
8
|
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { tv } from "tailwind-variants";
|
|
2
3
|
const { title, to, target, children } = defineProps({
|
|
3
4
|
title: { type: String, required: true },
|
|
4
5
|
to: { type: String, required: false },
|
|
@@ -6,11 +7,18 @@ const { title, to, target, children } = defineProps({
|
|
|
6
7
|
description: { type: String, required: false },
|
|
7
8
|
children: { type: Array, required: true }
|
|
8
9
|
});
|
|
10
|
+
const emit = defineEmits([]);
|
|
11
|
+
const cardBlockEditorStyles = tv({
|
|
12
|
+
slots: {
|
|
13
|
+
card: "flex h-full flex-col"
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
const { card } = cardBlockEditorStyles();
|
|
9
17
|
</script>
|
|
10
18
|
|
|
11
19
|
<template>
|
|
12
20
|
<NuxtLink :to="to" :target="target">
|
|
13
|
-
<UCard class="
|
|
21
|
+
<UCard :class="card()">
|
|
14
22
|
<h3>{{ title }}</h3>
|
|
15
23
|
<RCBlockEditRenderer :blocks="children" />
|
|
16
24
|
</UCard>
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { CardBlockProps } from "../../../types/index.js";
|
|
2
|
-
|
|
2
|
+
export interface CardBlockEditorProps extends CardBlockProps {
|
|
3
|
+
}
|
|
4
|
+
export interface CardBlockEditorEmits {
|
|
5
|
+
}
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<CardBlockEditorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CardBlockEditorProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
7
|
declare const _default: typeof __VLS_export;
|
|
4
8
|
export default _default;
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
1
|
+
import { type ImageBlockProps } from "../../../types/index.js";
|
|
2
|
+
export interface ImageBlockEditorProps extends ImageBlockProps {
|
|
3
|
+
}
|
|
4
|
+
export interface ImageBlockEditorEmits {
|
|
5
|
+
(e: "update:src", value: string | null): void;
|
|
6
|
+
(e: "update:alt", value: string): void;
|
|
7
|
+
(e: "update:caption", value: string | null): void;
|
|
8
|
+
(e: "update:file", value: File | null): void;
|
|
9
|
+
}
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<ImageBlockEditorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
3
11
|
"update:src": (value: string | null) => any;
|
|
4
12
|
"update:alt": (value: string) => any;
|
|
5
13
|
"update:caption": (value: string | null) => any;
|
|
6
14
|
"update:file": (value: File | null) => any;
|
|
7
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<ImageBlockEditorProps> & Readonly<{
|
|
8
16
|
"onUpdate:src"?: ((value: string | null) => any) | undefined;
|
|
9
17
|
"onUpdate:alt"?: ((value: string) => any) | undefined;
|
|
10
18
|
"onUpdate:caption"?: ((value: string | null) => any) | undefined;
|
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ref, watch, computed } from "vue";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
import {} from "../../../types";
|
|
3
5
|
import { useObjectUrl } from "@vueuse/core";
|
|
4
|
-
const
|
|
6
|
+
const { src, alt, caption } = defineProps({
|
|
5
7
|
src: { type: String, required: true },
|
|
6
8
|
alt: { type: String, required: true },
|
|
7
9
|
caption: { type: String, required: false }
|
|
8
10
|
});
|
|
9
11
|
const emit = defineEmits(["update:src", "update:alt", "update:caption", "update:file"]);
|
|
12
|
+
const imageBlockEditorStyles = tv({
|
|
13
|
+
slots: {
|
|
14
|
+
root: "mx-auto space-y-4 flex flex-col gap-xs w-full",
|
|
15
|
+
upload: "min-h-48 w-full",
|
|
16
|
+
previewContainer: "w-full relative rounded-lg border border-default overflow-hidden",
|
|
17
|
+
previewImage: "w-full h-auto object-contain transition-opacity duration-300",
|
|
18
|
+
emptyPreview: "w-full h-48 flex items-center justify-center bg-elevated/25"
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const { root, upload, previewContainer, previewImage, emptyPreview } = imageBlockEditorStyles();
|
|
10
22
|
const fileToUpload = ref(null);
|
|
11
|
-
const localAlt = ref(
|
|
12
|
-
const localCaption = ref(
|
|
23
|
+
const localAlt = ref(alt || "");
|
|
24
|
+
const localCaption = ref(caption || "");
|
|
13
25
|
const filePreviewUrl = useObjectUrl(fileToUpload);
|
|
14
26
|
const previewSrc = computed(() => {
|
|
15
|
-
return fileToUpload.value ? filePreviewUrl.value :
|
|
27
|
+
return fileToUpload.value ? filePreviewUrl.value : src;
|
|
16
28
|
});
|
|
17
29
|
const removeFile = () => {
|
|
18
30
|
fileToUpload.value = null;
|
|
@@ -31,26 +43,26 @@ watch(fileToUpload, (newFile) => {
|
|
|
31
43
|
</script>
|
|
32
44
|
|
|
33
45
|
<template>
|
|
34
|
-
<figure class="
|
|
46
|
+
<figure :class="root()">
|
|
35
47
|
<UFileUpload
|
|
36
48
|
v-slot="{ open }"
|
|
37
49
|
v-model="fileToUpload"
|
|
38
50
|
accept="image/*"
|
|
39
|
-
class="
|
|
51
|
+
:class="upload()"
|
|
40
52
|
variant="area"
|
|
41
53
|
color="neutral"
|
|
42
54
|
label="Drop image here"
|
|
43
55
|
description="JPG, PNG, GIF or WEBP. Click to select."
|
|
44
56
|
>
|
|
45
57
|
<div class="flex flex-col items-center justify-center space-y-3 p-4">
|
|
46
|
-
<div class="
|
|
58
|
+
<div :class="previewContainer()">
|
|
47
59
|
<img
|
|
48
60
|
v-if="previewSrc"
|
|
49
61
|
:src="previewSrc"
|
|
50
62
|
:alt="localAlt || 'Image preview'"
|
|
51
|
-
class="
|
|
63
|
+
:class="previewImage()"
|
|
52
64
|
/>
|
|
53
|
-
<div v-else class="
|
|
65
|
+
<div v-else :class="emptyPreview()">
|
|
54
66
|
<UIcon name="i-lucide-image" class="w-10 h-10 text-muted" />
|
|
55
67
|
</div>
|
|
56
68
|
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
1
|
+
import { type ImageBlockProps } from "../../../types/index.js";
|
|
2
|
+
export interface ImageBlockEditorProps extends ImageBlockProps {
|
|
3
|
+
}
|
|
4
|
+
export interface ImageBlockEditorEmits {
|
|
5
|
+
(e: "update:src", value: string | null): void;
|
|
6
|
+
(e: "update:alt", value: string): void;
|
|
7
|
+
(e: "update:caption", value: string | null): void;
|
|
8
|
+
(e: "update:file", value: File | null): void;
|
|
9
|
+
}
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<ImageBlockEditorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
3
11
|
"update:src": (value: string | null) => any;
|
|
4
12
|
"update:alt": (value: string) => any;
|
|
5
13
|
"update:caption": (value: string | null) => any;
|
|
6
14
|
"update:file": (value: File | null) => any;
|
|
7
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<ImageBlockEditorProps> & Readonly<{
|
|
8
16
|
"onUpdate:src"?: ((value: string | null) => any) | undefined;
|
|
9
17
|
"onUpdate:alt"?: ((value: string) => any) | undefined;
|
|
10
18
|
"onUpdate:caption"?: ((value: string | null) => any) | undefined;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { ParagraphBlockProps } from "../../../types/index.js";
|
|
2
|
-
|
|
2
|
+
export interface ParagraphBlockEditorProps extends ParagraphBlockProps {
|
|
3
3
|
id: string;
|
|
4
|
-
}
|
|
5
|
-
|
|
4
|
+
}
|
|
5
|
+
export interface ParagraphBlockEditorEmits {
|
|
6
|
+
}
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<ParagraphBlockEditorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ParagraphBlockEditorProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
8
|
declare const _default: typeof __VLS_export;
|
|
7
9
|
export default _default;
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { inject, ref, watch, onMounted, nextTick } from "vue";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
3
4
|
import { richTextToHtml, parseHtmlToRichText } from "../../../utils";
|
|
4
5
|
const editorApi = inject("block-editor-api");
|
|
5
6
|
const props = defineProps({
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
id: { type: String, required: true },
|
|
8
|
+
text: { type: Array, required: true }
|
|
8
9
|
});
|
|
10
|
+
const emit = defineEmits([]);
|
|
11
|
+
const paragraphBlockEditorStyles = tv({
|
|
12
|
+
slots: {
|
|
13
|
+
root: "p-2 outline-none min-h-6 focus:ring-2 focus:ring-blue-500 rounded-md transition duration-150 text-base"
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
const { root } = paragraphBlockEditorStyles();
|
|
9
17
|
const editorRef = ref(null);
|
|
10
18
|
const localHtml = ref(richTextToHtml(props.text));
|
|
11
19
|
const isContentChanging = ref(false);
|
|
@@ -49,10 +57,6 @@ onMounted(() => {
|
|
|
49
57
|
ref="editorRef"
|
|
50
58
|
contenteditable="true"
|
|
51
59
|
@blur="commitContentOnBlur"
|
|
52
|
-
:class="
|
|
53
|
-
'p-2 outline-none min-h-6',
|
|
54
|
-
'focus:ring-2 focus:ring-blue-500 rounded-md transition duration-150',
|
|
55
|
-
'text-base'
|
|
56
|
-
]"
|
|
60
|
+
:class="root()"
|
|
57
61
|
></div>
|
|
58
62
|
</template>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { ParagraphBlockProps } from "../../../types/index.js";
|
|
2
|
-
|
|
2
|
+
export interface ParagraphBlockEditorProps extends ParagraphBlockProps {
|
|
3
3
|
id: string;
|
|
4
|
-
}
|
|
5
|
-
|
|
4
|
+
}
|
|
5
|
+
export interface ParagraphBlockEditorEmits {
|
|
6
|
+
}
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<ParagraphBlockEditorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ParagraphBlockEditorProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
8
|
declare const _default: typeof __VLS_export;
|
|
7
9
|
export default _default;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type SectionBlockProps } from "../../../types/index.js";
|
|
2
|
-
|
|
2
|
+
export interface SectionBlockEditorProps extends SectionBlockProps {
|
|
3
3
|
id: string;
|
|
4
|
-
}
|
|
5
|
-
|
|
4
|
+
}
|
|
5
|
+
export interface SectionBlockEditorEmits {
|
|
6
|
+
}
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<SectionBlockEditorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SectionBlockEditorProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
8
|
declare const _default: typeof __VLS_export;
|
|
7
9
|
export default _default;
|
|
@@ -2,13 +2,23 @@
|
|
|
2
2
|
import { inject, ref, computed, watch } from "vue";
|
|
3
3
|
import {} from "../../../types";
|
|
4
4
|
import {} from "@nuxt/ui/components/Select.vue";
|
|
5
|
+
import { tv } from "tailwind-variants";
|
|
5
6
|
const { level, title, description, children, id } = defineProps({
|
|
7
|
+
id: { type: String, required: true },
|
|
6
8
|
level: { type: Number, required: true },
|
|
7
9
|
title: { type: String, required: true },
|
|
8
10
|
description: { type: String, required: false },
|
|
9
|
-
children: { type: Array, required: true }
|
|
10
|
-
id: { type: String, required: true }
|
|
11
|
+
children: { type: Array, required: true }
|
|
11
12
|
});
|
|
13
|
+
const emit = defineEmits([]);
|
|
14
|
+
const sectionBlockEditorStyles = tv({
|
|
15
|
+
slots: {
|
|
16
|
+
root: "flex flex-col gap-sm",
|
|
17
|
+
headerContainer: "flex flex-row gap-xs",
|
|
18
|
+
titleInput: "w-full"
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const { root, headerContainer, titleInput } = sectionBlockEditorStyles();
|
|
12
22
|
const hasChildren = computed(() => children && children.length > 0);
|
|
13
23
|
const editorApi = inject("block-editor-api");
|
|
14
24
|
const localLevel = ref(level);
|
|
@@ -67,10 +77,10 @@ watch(
|
|
|
67
77
|
</script>
|
|
68
78
|
|
|
69
79
|
<template>
|
|
70
|
-
<div class="
|
|
80
|
+
<div :class="root()">
|
|
71
81
|
<RCSection :level="localLevel" :title="localTitle" :description="description" is-editing>
|
|
72
82
|
<template #title>
|
|
73
|
-
<div class="
|
|
83
|
+
<div :class="headerContainer()">
|
|
74
84
|
<USelect
|
|
75
85
|
v-model="localLevel"
|
|
76
86
|
:items="levelItems"
|
|
@@ -87,7 +97,7 @@ watch(
|
|
|
87
97
|
placeholder="Section Title..."
|
|
88
98
|
@input="updateLocalTitle"
|
|
89
99
|
@blur="commitTitleOnBlur"
|
|
90
|
-
class="
|
|
100
|
+
:class="titleInput()"
|
|
91
101
|
/>
|
|
92
102
|
</div>
|
|
93
103
|
</template>
|