rimelight-components 2.0.46 → 2.0.48

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.
Files changed (70) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +4 -2
  3. package/dist/runtime/components/app/ScrollToTop.d.vue.ts +4 -1
  4. package/dist/runtime/components/app/ScrollToTop.vue.d.ts +4 -1
  5. package/dist/runtime/components/blocks/Block.d.vue.ts +4 -17
  6. package/dist/runtime/components/blocks/Block.vue +25 -46
  7. package/dist/runtime/components/blocks/Block.vue.d.ts +4 -17
  8. package/dist/runtime/components/blocks/BlockEditRenderer.vue +55 -0
  9. package/dist/runtime/components/blocks/BlockEditor.d.vue.ts +15 -0
  10. package/dist/runtime/components/blocks/BlockEditor.vue +110 -0
  11. package/dist/runtime/components/blocks/BlockEditor.vue.d.ts +15 -0
  12. package/dist/runtime/components/{renderers/BlockRenderer.vue → blocks/BlockViewRenderer.vue} +21 -18
  13. package/dist/runtime/components/blocks/editor/CalloutBlockEditor.vue +1 -1
  14. package/dist/runtime/components/blocks/editor/CardBlockEditor.vue +1 -1
  15. package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.d.vue.ts +5 -2
  16. package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.vue +53 -5
  17. package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.vue.d.ts +5 -2
  18. package/dist/runtime/components/blocks/editor/SectionBlockEditor.d.vue.ts +5 -2
  19. package/dist/runtime/components/blocks/editor/SectionBlockEditor.vue +101 -45
  20. package/dist/runtime/components/blocks/editor/SectionBlockEditor.vue.d.ts +5 -2
  21. package/dist/runtime/components/blocks/editor/TestBlockEditor.d.vue.ts +7 -0
  22. package/dist/runtime/components/blocks/editor/TestBlockEditor.vue +44 -0
  23. package/dist/runtime/components/blocks/editor/TestBlockEditor.vue.d.ts +7 -0
  24. package/dist/runtime/components/blocks/renderer/CalloutBlockRenderer.vue +1 -1
  25. package/dist/runtime/components/blocks/renderer/CardBlockRenderer.vue +1 -1
  26. package/dist/runtime/components/blocks/renderer/ParagraphBlockRenderer.vue +1 -3
  27. package/dist/runtime/components/blocks/renderer/SectionBlockRenderer.vue +2 -1
  28. package/dist/runtime/components/blocks/renderer/TestBlockRenderer.d.vue.ts +4 -0
  29. package/dist/runtime/components/blocks/renderer/TestBlockRenderer.vue +9 -0
  30. package/dist/runtime/components/blocks/renderer/TestBlockRenderer.vue.d.ts +4 -0
  31. package/dist/runtime/components/cards/TeamCard.d.vue.ts +2 -2
  32. package/dist/runtime/components/cards/TeamCard.vue.d.ts +2 -2
  33. package/dist/runtime/components/content/Callout.d.vue.ts +2 -2
  34. package/dist/runtime/components/content/Callout.vue.d.ts +2 -2
  35. package/dist/runtime/components/content/Section.d.vue.ts +5 -5
  36. package/dist/runtime/components/content/Section.vue +13 -8
  37. package/dist/runtime/components/content/Section.vue.d.ts +5 -5
  38. package/dist/runtime/components/content/Test.d.vue.ts +16 -0
  39. package/dist/runtime/components/content/Test.vue +13 -0
  40. package/dist/runtime/components/content/Test.vue.d.ts +16 -0
  41. package/dist/runtime/composables/useBlockEditor.d.ts +27233 -0
  42. package/dist/runtime/composables/useBlockEditor.js +163 -0
  43. package/dist/runtime/types/blocks.d.ts +9 -2
  44. package/dist/runtime/utils/index.d.ts +0 -3
  45. package/dist/runtime/utils/index.js +0 -5
  46. package/dist/runtime/utils/richTextHelpers.d.ts +16 -0
  47. package/dist/runtime/utils/richTextHelpers.js +17 -0
  48. package/package.json +19 -25
  49. package/dist/runtime/components/backgrounds/AnimateGrid.d.vue.ts +0 -17
  50. package/dist/runtime/components/backgrounds/AnimateGrid.vue +0 -84
  51. package/dist/runtime/components/backgrounds/AnimateGrid.vue.d.ts +0 -17
  52. package/dist/runtime/components/backgrounds/FlickeringGrid.d.vue.ts +0 -13
  53. package/dist/runtime/components/backgrounds/FlickeringGrid.vue +0 -136
  54. package/dist/runtime/components/backgrounds/FlickeringGrid.vue.d.ts +0 -13
  55. package/dist/runtime/components/backgrounds/InteractiveGrid.d.vue.ts +0 -11
  56. package/dist/runtime/components/backgrounds/InteractiveGrid.vue +0 -58
  57. package/dist/runtime/components/backgrounds/InteractiveGrid.vue.d.ts +0 -11
  58. package/dist/runtime/components/renderers/BlockEditor.vue +0 -63
  59. package/dist/runtime/composables/useBlockContentEditor.d.ts +0 -32
  60. package/dist/runtime/composables/useBlockContentEditor.js +0 -63
  61. /package/dist/runtime/components/{renderers/BlockEditor.d.vue.ts → blocks/BlockEditRenderer.d.vue.ts} +0 -0
  62. /package/dist/runtime/components/{renderers/BlockEditor.vue.d.ts → blocks/BlockEditRenderer.vue.d.ts} +0 -0
  63. /package/dist/runtime/components/{renderers/BlockRenderer.d.vue.ts → blocks/BlockViewRenderer.d.vue.ts} +0 -0
  64. /package/dist/runtime/components/{renderers/BlockRenderer.vue.d.ts → blocks/BlockViewRenderer.vue.d.ts} +0 -0
  65. /package/dist/runtime/components/{renderers → blocks}/TOC.d.vue.ts +0 -0
  66. /package/dist/runtime/components/{renderers → blocks}/TOC.vue +0 -0
  67. /package/dist/runtime/components/{renderers → blocks}/TOC.vue.d.ts +0 -0
  68. /package/dist/runtime/components/{renderers → blocks}/TextRenderer.d.vue.ts +0 -0
  69. /package/dist/runtime/components/{renderers → blocks}/TextRenderer.vue +0 -0
  70. /package/dist/runtime/components/{renderers → blocks}/TextRenderer.vue.d.ts +0 -0
@@ -1,58 +0,0 @@
1
- <script setup>
2
- import { cn } from "../../utils";
3
- import { ref, computed } from "vue";
4
- const props = defineProps({
5
- className: { type: null, required: false },
6
- squaresClassName: { type: null, required: false },
7
- width: { type: Number, required: false, default: 40 },
8
- height: { type: Number, required: false, default: 40 },
9
- squares: { type: Array, required: false, default: () => [24, 24] }
10
- });
11
- const horizontal = computed(() => props.squares[0]);
12
- const vertical = computed(() => props.squares[1]);
13
- const totalSquares = computed(() => horizontal.value * vertical.value);
14
- const hoveredSquare = ref(null);
15
- const gridWidth = computed(() => props.width * horizontal.value);
16
- const gridHeight = computed(() => props.height * vertical.value);
17
- function getX(index) {
18
- return index % horizontal.value * props.width;
19
- }
20
- function getY(index) {
21
- return Math.floor(index / horizontal.value) * props.height;
22
- }
23
- const svgClass = computed(
24
- () => cn(
25
- "absolute inset-0 h-full w-full border border-neutral-400/30",
26
- props.className
27
- )
28
- );
29
- function getRectClass(index) {
30
- return cn(
31
- "stroke-neutral-400/30 transition-all duration-100 ease-in-out [&:not(:hover)]:duration-1000",
32
- hoveredSquare.value === index ? "fill-neutral-300/30" : "fill-transparent",
33
- props.squaresClassName
34
- );
35
- }
36
- function handleMouseEnter(index) {
37
- hoveredSquare.value = index;
38
- }
39
- function handleMouseLeave() {
40
- hoveredSquare.value = null;
41
- }
42
- </script>
43
-
44
- <template>
45
- <svg :width="gridWidth" :height="gridHeight" :class="svgClass">
46
- <rect
47
- v-for="(_, index) in totalSquares"
48
- :key="index"
49
- :x="getX(index)"
50
- :y="getY(index)"
51
- :width="width"
52
- :height="height"
53
- :class="getRectClass(index)"
54
- @mouseenter="handleMouseEnter(index)"
55
- @mouseleave="handleMouseLeave"
56
- />
57
- </svg>
58
- </template>
@@ -1,11 +0,0 @@
1
- import { type HTMLAttributes } from "vue";
2
- interface InteractiveGridPatternProps {
3
- className?: HTMLAttributes["class"];
4
- squaresClassName?: HTMLAttributes["class"];
5
- width?: number;
6
- height?: number;
7
- squares?: [number, number];
8
- }
9
- declare const __VLS_export: import("vue").DefineComponent<InteractiveGridPatternProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<InteractiveGridPatternProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
- declare const _default: typeof __VLS_export;
11
- export default _default;
@@ -1,63 +0,0 @@
1
- <script setup>
2
- import { inject, provide } from "vue";
3
- import { getBlockEditorComponent } from "../../utils/blockMapper";
4
- const { blocks } = defineProps({
5
- blocks: { type: Array, required: true }
6
- });
7
- const { removeBlock, moveBlock } = inject("blockEditorMutators", {
8
- removeBlock: (id) => console.warn(`[Renderer] removeBlock not provided. Cannot delete block ${id}.`),
9
- moveBlock: (id, newIndex) => console.warn(`[Renderer] moveBlock not provided. Cannot move block ${id}.`)
10
- });
11
- provide("blockEditorMutators", { removeBlock, moveBlock });
12
- const getComponent = (block) => {
13
- if (!block || !block.type || block.type.length === 0) {
14
- console.error(
15
- "[EditorBlockRenderer] Block object is missing the critical 'type' field."
16
- );
17
- return null;
18
- }
19
- const resolvedComponent = getBlockEditorComponent(block.type);
20
- if (!resolvedComponent) {
21
- console.error(
22
- `[EditorBlockRenderer] Editor component resolution failed for block type: ${block.type}`
23
- );
24
- return null;
25
- }
26
- return resolvedComponent;
27
- };
28
- </script>
29
-
30
- <template>
31
- <div class="flex flex-col gap-lg editor-block-renderer">
32
- <UEmpty
33
- v-if="!blocks || blocks.length === 0"
34
- variant="naked"
35
- icon="lucide:pencil-line"
36
- title="Start adding content blocks."
37
- description="There is no content yet. Use the '+' button below to add your first block."
38
- />
39
- <div v-else class="flex flex-col gap-md ml-10">
40
- <template v-for="block in blocks" :key="block.id">
41
- <RCBlock v-if="getComponent(block)" :id="block.id">
42
- <component
43
- :is="getComponent(block)"
44
- v-bind="block.props"
45
- :is-editing="true"
46
- :key="block.id"
47
- :type="block.type"
48
- class="block-editor-container"
49
- />
50
- </RCBlock>
51
- <template v-else>
52
- <UAlert
53
- color="warning"
54
- variant="subtle"
55
- icon="lucide:octagon-alert"
56
- title="Editor Rendering Error"
57
- :description="`Editor component for type \'${block.type || 'UNKNOWN_OR_MISSING'}\' was not found. Please ensure the block name is correct and the editor component exists in the \'editor\' subdirectory.`"
58
- />
59
- </template>
60
- </template>
61
- </div>
62
- </div>
63
- </template>
@@ -1,32 +0,0 @@
1
- import { type Ref } from "vue";
2
- import { type Block } from "../types/blocks.js";
3
- /**
4
- * Defines the contract for the consuming application's save function.
5
- * This allows the composable to trigger persistence without knowing the API details.
6
- * It's assumed the callback will handle the necessary API calls and error handling.
7
- */
8
- type SaveCallback = (blocks: Block[]) => Promise<void> | void;
9
- export interface UseBlockContentEditorOptions {
10
- /** The initial array of blocks loaded from the database/API. */
11
- initialBlocks: Block[];
12
- /** The function the editor calls to persist changes. It is debounced internally. */
13
- saveCallback: SaveCallback;
14
- /** Optional. The debounce delay in milliseconds (default: 1000ms). */
15
- debounceDelay?: number;
16
- }
17
- /**
18
- * Manages the reactive state, updates, and debounced persistence of a block content array.
19
- * This composable is decoupled from data fetching and specific API endpoints.
20
- *
21
- * @param options Configuration object including initial blocks and a save callback.
22
- */
23
- export declare const useBlockContentEditor: ({ initialBlocks, saveCallback, debounceDelay, }: UseBlockContentEditorOptions) => {
24
- blocks: Ref<Block[], Block[]>;
25
- isSaving: Ref<boolean, boolean>;
26
- lastSavedAt: Ref<Date | null, Date | null>;
27
- hasUnsavedChanges: Ref<boolean, boolean>;
28
- addBlock: (newBlock: Block, index?: number) => void;
29
- removeBlock: (blockId: string) => void;
30
- moveBlock: (blockId: string, newIndex: number) => void;
31
- };
32
- export {};
@@ -1,63 +0,0 @@
1
- import { ref, watch } from "vue";
2
- import { useDebounceFn } from "@vueuse/core";
3
- export const useBlockContentEditor = ({
4
- initialBlocks,
5
- saveCallback,
6
- debounceDelay = 1e3
7
- }) => {
8
- const blocks = ref(JSON.parse(JSON.stringify(initialBlocks)));
9
- const isSaving = ref(false);
10
- const lastSavedAt = ref(null);
11
- const hasUnsavedChanges = ref(false);
12
- const persistChanges = async (currentBlocks) => {
13
- isSaving.value = true;
14
- hasUnsavedChanges.value = false;
15
- try {
16
- await saveCallback(currentBlocks);
17
- lastSavedAt.value = /* @__PURE__ */ new Date();
18
- console.log("Blocks persisted successfully via callback.");
19
- } catch (error) {
20
- console.error("[BlockEditor] Error during persistence callback:", error);
21
- hasUnsavedChanges.value = true;
22
- } finally {
23
- isSaving.value = false;
24
- }
25
- };
26
- const debouncedSave = useDebounceFn(() => {
27
- persistChanges(JSON.parse(JSON.stringify(blocks.value)));
28
- }, debounceDelay);
29
- watch(
30
- blocks,
31
- () => {
32
- hasUnsavedChanges.value = true;
33
- debouncedSave();
34
- },
35
- { deep: true }
36
- // Crucial: Watch nested changes (e.g., text inside a ParagraphBlock)
37
- );
38
- const addBlock = (newBlock, index = blocks.value.length) => {
39
- blocks.value.splice(index, 0, newBlock);
40
- };
41
- const removeBlock = (blockId) => {
42
- blocks.value = blocks.value.filter((block) => block.id !== blockId);
43
- };
44
- const moveBlock = (blockId, newIndex) => {
45
- const oldIndex = blocks.value.findIndex((block) => block.id === blockId);
46
- if (oldIndex === -1) return;
47
- const [blockToMove] = blocks.value.splice(oldIndex, 1);
48
- blocks.value.splice(newIndex, 0, blockToMove);
49
- };
50
- return {
51
- // Core Data
52
- blocks,
53
- // The array the EditorBlockRenderer will use
54
- // Status
55
- isSaving,
56
- lastSavedAt,
57
- hasUnsavedChanges,
58
- // Editor Actions (Mutators)
59
- addBlock,
60
- removeBlock,
61
- moveBlock
62
- };
63
- };