rimelight-components 2.0.36 → 2.0.38
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/editor/CalloutBlockEditor.d.vue.ts +4 -0
- package/dist/runtime/components/blocks/editor/CalloutBlockEditor.vue +16 -0
- package/dist/runtime/components/blocks/editor/CalloutBlockEditor.vue.d.ts +4 -0
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.d.vue.ts +2 -6
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.vue +29 -26
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.vue.d.ts +2 -6
- package/dist/runtime/types/blocks.d.ts +6 -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.0.
|
|
7
|
+
const version = "2.0.38";
|
|
8
8
|
const homepage = "https://rimelight.com/tools/rimelight-components";
|
|
9
9
|
|
|
10
10
|
const defaultOptions = {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CalloutBlockProps } from "~~/src/runtime/types/blocks";
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<CalloutBlockProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CalloutBlockProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
const { variant, children, to, target } = defineProps({
|
|
3
|
+
variant: { type: String, required: true },
|
|
4
|
+
children: { type: Array, required: true },
|
|
5
|
+
to: { type: String, required: false },
|
|
6
|
+
target: { type: String, required: false }
|
|
7
|
+
});
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div class="p-8 bg-error-500">
|
|
12
|
+
<RCCallout :variant="variant" :to="to" :target="target">
|
|
13
|
+
<RCBlockRenderer :blocks="children" />
|
|
14
|
+
</RCCallout>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CalloutBlockProps } from "~~/src/runtime/types/blocks";
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<CalloutBlockProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CalloutBlockProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
blockProps: SectionBlockProps;
|
|
4
|
-
blockId: string;
|
|
5
|
-
};
|
|
6
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
1
|
+
import type { SectionBlockEditorProps } from "~~/src/runtime/types/blocks";
|
|
2
|
+
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>;
|
|
7
3
|
declare const _default: typeof __VLS_export;
|
|
8
4
|
export default _default;
|
|
@@ -2,63 +2,66 @@
|
|
|
2
2
|
import { computed, inject } from "vue";
|
|
3
3
|
import { slugify } from "../../../utils";
|
|
4
4
|
const props = defineProps({
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
blockId: { type: String, required: true },
|
|
6
|
+
isFocused: { type: Boolean, required: false },
|
|
7
|
+
level: { type: Number, required: true },
|
|
8
|
+
title: { type: String, required: true },
|
|
9
|
+
description: { type: String, required: false },
|
|
10
|
+
children: { type: Array, required: true }
|
|
7
11
|
});
|
|
8
|
-
const headingId = computed(() => props.
|
|
9
|
-
const updateTitle = (event) => {
|
|
10
|
-
props.blockProps.title = event.target.value;
|
|
11
|
-
};
|
|
12
|
-
const updateDescription = (event) => {
|
|
13
|
-
props.blockProps.description = event.target.value;
|
|
14
|
-
};
|
|
12
|
+
const headingId = computed(() => props.title ? slugify(props.title) : void 0);
|
|
15
13
|
const { removeBlock } = inject("blockEditorMutators", {
|
|
16
14
|
removeBlock: (id) => console.warn(`removeBlock not implemented for ${id}`)
|
|
17
15
|
});
|
|
18
16
|
const handleRemove = () => {
|
|
19
17
|
removeBlock(props.blockId);
|
|
20
18
|
};
|
|
21
|
-
const childrenBlocks = computed(() => props.
|
|
19
|
+
const childrenBlocks = computed(() => props.children || []);
|
|
22
20
|
</script>
|
|
23
21
|
|
|
24
22
|
<template>
|
|
25
|
-
<div
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
<div
|
|
24
|
+
class="block-editor-container group relative rounded-lg border-2 border-dashed border-primary-200 bg-primary-50/50 p-4"
|
|
25
|
+
>
|
|
26
|
+
<div
|
|
27
|
+
class="absolute z-10 flex -translate-x-1/2 gap-2 opacity-0 transition-opacity group-hover:opacity-100"
|
|
28
|
+
>
|
|
29
|
+
<UButton
|
|
30
|
+
icon="lucide:trash-2"
|
|
31
|
+
variant="solid"
|
|
32
|
+
size="sm"
|
|
33
|
+
@click="handleRemove"
|
|
34
|
+
/>
|
|
29
35
|
</div>
|
|
30
36
|
|
|
31
37
|
<RCSection
|
|
32
|
-
:level="
|
|
33
|
-
:title="
|
|
34
|
-
:description="
|
|
38
|
+
:level="level"
|
|
39
|
+
:title="title"
|
|
40
|
+
:description="description"
|
|
35
41
|
:id="headingId"
|
|
36
42
|
is-editing
|
|
37
43
|
>
|
|
38
44
|
<template #title>
|
|
39
45
|
<input
|
|
40
|
-
:value="
|
|
41
|
-
|
|
42
|
-
:class="`text-${props.blockProps.level === 1 ? '3xl' : 'xl'} font-bold w-full focus:outline-none bg-transparent pointer-events-auto`"
|
|
46
|
+
:value="title"
|
|
47
|
+
:class="`text-${level === 1 ? '3xl' : 'xl'} pointer-events-auto w-full bg-transparent font-bold focus:outline-none`"
|
|
43
48
|
placeholder="Enter section title..."
|
|
44
49
|
/>
|
|
45
50
|
</template>
|
|
46
51
|
|
|
47
52
|
<template #description>
|
|
48
53
|
<textarea
|
|
49
|
-
v-if="
|
|
50
|
-
:value="
|
|
51
|
-
|
|
52
|
-
class="text-md text-muted w-full resize-none focus:outline-none bg-transparent pointer-events-auto"
|
|
54
|
+
v-if="description !== void 0"
|
|
55
|
+
:value="description"
|
|
56
|
+
class="text-md pointer-events-auto w-full resize-none bg-transparent text-muted focus:outline-none"
|
|
53
57
|
placeholder="Optional description..."
|
|
54
58
|
rows="2"
|
|
55
59
|
/>
|
|
56
60
|
</template>
|
|
57
61
|
|
|
58
62
|
<div class="mt-4">
|
|
59
|
-
<
|
|
63
|
+
<RCEditorBlockRenderer :blocks="childrenBlocks" />
|
|
60
64
|
</div>
|
|
61
|
-
|
|
62
65
|
</RCSection>
|
|
63
66
|
</div>
|
|
64
67
|
</template>
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
blockProps: SectionBlockProps;
|
|
4
|
-
blockId: string;
|
|
5
|
-
};
|
|
6
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
1
|
+
import type { SectionBlockEditorProps } from "~~/src/runtime/types/blocks";
|
|
2
|
+
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>;
|
|
7
3
|
declare const _default: typeof __VLS_export;
|
|
8
4
|
export default _default;
|
|
@@ -22,6 +22,12 @@ export interface SectionBlockProps {
|
|
|
22
22
|
description?: string;
|
|
23
23
|
children: Block[];
|
|
24
24
|
}
|
|
25
|
+
export interface SectionBlockEditorProps extends SectionBlockProps {
|
|
26
|
+
/** A unique ID used by the editor to track, move, and delete the block. */
|
|
27
|
+
blockId: string;
|
|
28
|
+
/** Optional context for editor behavior (e.g., is the block currently focused). */
|
|
29
|
+
isFocused?: boolean;
|
|
30
|
+
}
|
|
25
31
|
export interface ParagraphBlockProps {
|
|
26
32
|
text: RichTextContent;
|
|
27
33
|
}
|