rimelight-components 2.0.48 → 2.0.49

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.48",
3
+ "version": "2.0.49",
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.48";
7
+ const version = "2.0.49";
8
8
  const homepage = "https://rimelight.com/tools/rimelight-components";
9
9
 
10
10
  const defaultOptions = {
@@ -54,9 +54,9 @@ const items = ref([
54
54
  </script>
55
55
 
56
56
  <template>
57
- <div class="group relative">
57
+ <div class="group relative pl-12 flex flex-row gap-xs">
58
58
  <div
59
- class="absolute top-0 left-0 z-10 -ms-10 opacity-0 transition-opacity group-hover:opacity-100"
59
+ class="top-0 left-0 z-10 opacity-0 transition-opacity group-hover:opacity-100"
60
60
  >
61
61
  <UDropdownMenu :items="items">
62
62
  <UButton icon="lucide:grip-vertical" variant="ghost" color="neutral" />
@@ -1,15 +1,23 @@
1
1
  import type { Block } from "../../types/blocks.js";
2
+ export interface BlockEditorProps {
3
+ historyLimit?: number;
4
+ isSaving: boolean;
5
+ }
6
+ type __VLS_Props = BlockEditorProps;
7
+ export interface BlockEditorEmits {
8
+ (e: "save"): void;
9
+ }
2
10
  type __VLS_ModelProps = {
3
11
  modelValue: Block[];
4
12
  };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
14
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
15
  "update:modelValue": (value: Block[]) => any;
7
16
  } & {
8
- "update:modelValue": (value: Block[]) => any;
9
17
  save: () => any;
10
- }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
11
- "onUpdate:modelValue"?: ((value: Block[]) => any) | undefined;
18
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
12
19
  onSave?: (() => any) | undefined;
20
+ "onUpdate:modelValue"?: ((value: Block[]) => any) | undefined;
13
21
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
22
  declare const _default: typeof __VLS_export;
15
23
  export default _default;
@@ -2,7 +2,11 @@
2
2
  import { provide, ref, computed } from "vue";
3
3
  import { useBlockEditor } from "../../composables/useBlockEditor";
4
4
  const blocks = defineModel({ type: Array, ...{ required: true } });
5
- const emit = defineEmits(["update:modelValue", "save"]);
5
+ const { historyLimit, isSaving } = defineProps({
6
+ historyLimit: { type: Number, required: false },
7
+ isSaving: { type: Boolean, required: true }
8
+ });
9
+ const emit = defineEmits(["save"]);
6
10
  const {
7
11
  removeBlock,
8
12
  moveBlock,
@@ -13,7 +17,7 @@ const {
13
17
  redo,
14
18
  canUndo,
15
19
  canRedo
16
- } = useBlockEditor(blocks);
20
+ } = useBlockEditor(blocks, historyLimit);
17
21
  provide("block-editor-api", {
18
22
  removeBlock,
19
23
  moveBlock,
@@ -59,52 +63,65 @@ const redoAction = () => {
59
63
  </script>
60
64
 
61
65
  <template>
62
- <div class="mb-lg flex justify-between pr-8">
63
-
64
- <div class="flex items-center gap-sm">
66
+ <UHeader class="fixed mt-16 top-0 left-0 z-50 h-12 w-full bg-muted">
67
+ <template #left>
68
+ <div class="flex items-center gap-xs">
65
69
  <UButton
66
70
  icon="lucide:rotate-ccw"
67
- label="Undo"
68
71
  variant="outline"
69
72
  color="neutral"
73
+ size="xs"
70
74
  :disabled="!canUndo"
71
75
  @click="undoAction"
72
76
  />
73
77
  <UButton
74
78
  icon="lucide:rotate-cw"
75
- label="Redo"
76
79
  variant="outline"
77
80
  color="neutral"
81
+ size="xs"
78
82
  :disabled="!canRedo"
79
83
  @click="redoAction"
80
84
  />
81
85
  </div>
86
+ </template>
82
87
 
83
- <UButton
84
- :icon="showPreview ? 'lucide:eye-off' : 'lucide:eye'"
85
- :label="showPreview ? 'Hide Preview' : 'Show Preview'"
86
- variant="outline"
87
- color="neutral"
88
- @click="togglePreview"
89
- />
90
- </div>
91
-
92
- <div :class="gridClass">
88
+ <template #right>
89
+ <div class="flex items-center gap-xs">
90
+ <UButton
91
+ :icon="showPreview ? 'lucide:eye-off' : 'lucide:eye'"
92
+ label="Preview"
93
+ variant="outline"
94
+ color="neutral"
95
+ size="xs"
96
+ @click="togglePreview"
97
+ />
98
+ <UButton
99
+ icon="lucide:save"
100
+ label="Save"
101
+ color="primary"
102
+ size="xs"
103
+ :loading="isSaving"
104
+ @click="handleSave"
105
+ />
106
+ </div>
107
+ </template>
108
+ </UHeader>
109
+ <UPage>
110
+ <div :class="gridClass">
93
111
 
94
- <div :class="editorPanelClass">
95
- <div class="pl-8">
96
- <RCBlockEditRenderer :blocks="blocks" />
112
+ <div :class="editorPanelClass">
113
+ <RCBlockEditRenderer :blocks="blocks" />
97
114
  </div>
98
- </div>
99
115
 
100
- <div
101
- v-if="showPreview"
102
- class="col-span-1 w-full"
103
- >
104
- <RCBlockViewRenderer
105
- :blocks="blocks"
106
- class="transition duration-300 opacity-100"
107
- />
116
+ <div
117
+ v-if="showPreview"
118
+ class="col-span-1 w-full"
119
+ >
120
+ <RCBlockViewRenderer
121
+ :blocks="blocks"
122
+ class="transition duration-300 opacity-100"
123
+ />
124
+ </div>
108
125
  </div>
109
- </div>
126
+ </UPage>
110
127
  </template>
@@ -1,15 +1,23 @@
1
1
  import type { Block } from "../../types/blocks.js";
2
+ export interface BlockEditorProps {
3
+ historyLimit?: number;
4
+ isSaving: boolean;
5
+ }
6
+ type __VLS_Props = BlockEditorProps;
7
+ export interface BlockEditorEmits {
8
+ (e: "save"): void;
9
+ }
2
10
  type __VLS_ModelProps = {
3
11
  modelValue: Block[];
4
12
  };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
14
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
15
  "update:modelValue": (value: Block[]) => any;
7
16
  } & {
8
- "update:modelValue": (value: Block[]) => any;
9
17
  save: () => any;
10
- }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
11
- "onUpdate:modelValue"?: ((value: Block[]) => any) | undefined;
18
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
12
19
  onSave?: (() => any) | undefined;
20
+ "onUpdate:modelValue"?: ((value: Block[]) => any) | undefined;
13
21
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
22
  declare const _default: typeof __VLS_export;
15
23
  export default _default;
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.48",
4
+ "version": "2.0.49",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",