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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rimelight-components",
3
- "version": "2.0.36",
3
+ "version": "2.0.38",
4
4
  "docs": "https://rimelight.com/tools/rimelight-components",
5
5
  "configKey": "rimelightComponents",
6
6
  "compatibility": {
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.36";
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 { SectionBlockProps } from "~~/src/runtime/types/blocks";
2
- type __VLS_Props = {
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
- blockProps: { type: Object, required: true },
6
- blockId: { type: String, required: true }
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.blockProps.title ? slugify(props.blockProps.title) : void 0);
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.blockProps.children || []);
19
+ const childrenBlocks = computed(() => props.children || []);
22
20
  </script>
23
21
 
24
22
  <template>
25
- <div class="block-editor-container relative border-2 border-dashed border-primary-200 p-4 rounded-lg bg-primary-50/50 group">
26
-
27
- <div class="absolute -translate-x-1/2 z-10 opacity-0 group-hover:opacity-100 transition-opacity flex gap-2">
28
- <UButton icon="lucide:trash-2" variant="solid" size="sm" @click="handleRemove" />
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="props.blockProps.level"
33
- :title="props.blockProps.title"
34
- :description="props.blockProps.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="props.blockProps.title"
41
- @input="updateTitle"
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="props.blockProps.description !== void 0"
50
- :value="props.blockProps.description"
51
- @input="updateDescription"
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
- <RCBlockEditorRenderer :blocks="childrenBlocks" />
63
+ <RCEditorBlockRenderer :blocks="childrenBlocks" />
60
64
  </div>
61
-
62
65
  </RCSection>
63
66
  </div>
64
67
  </template>
@@ -1,8 +1,4 @@
1
- import type { SectionBlockProps } from "~~/src/runtime/types/blocks";
2
- type __VLS_Props = {
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
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rimelight-components",
3
3
  "description": "A component library by Rimelight Entertainment.",
4
- "version": "2.0.36",
4
+ "version": "2.0.38",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",