rimelight-components 2.2.2 → 2.2.3

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.2.2",
3
+ "version": "2.2.3",
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.2.2";
7
+ const version = "2.2.3";
8
8
  const homepage = "https://rimelight.com/tools/rimelight-components";
9
9
 
10
10
  const defaultOptions = {
@@ -15,7 +15,6 @@ const state = reactive({
15
15
  labels: note?.labels?.map((l) => l.label.id) || []
16
16
  });
17
17
  const { data: fetchedLabels } = useApi("/api/notes/labels", {
18
- lazy: true,
19
18
  default: () => []
20
19
  });
21
20
  const allLabels = ref([]);
@@ -156,6 +155,18 @@ watch(open, (isOpen) => {
156
155
  emit("close");
157
156
  }
158
157
  });
158
+ const deleteNote = async () => {
159
+ if (!state.id) return;
160
+ try {
161
+ await $api(`/api/notes/${state.id}`, {
162
+ method: "DELETE"
163
+ });
164
+ open.value = false;
165
+ emit("saved", null);
166
+ } catch (e) {
167
+ console.error("Failed to delete note", e);
168
+ }
169
+ };
159
170
  onUnmounted(() => {
160
171
  if (saveTimeout.value) {
161
172
  clearTimeout(saveTimeout.value);
@@ -216,7 +227,7 @@ onUnmounted(() => {
216
227
  variant="ghost"
217
228
  @click="state.isArchived = !state.isArchived"
218
229
  />
219
- <UButton color="error" icon="lucide:trash-2" size="sm" variant="ghost" @click="" />
230
+ <UButton color="error" icon="lucide:trash-2" size="sm" variant="ghost" @click="deleteNote" />
220
231
  </div>
221
232
  </div>
222
233
  <div class="flex items-center justify-between">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rimelight-components",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "A component library by Rimelight Entertainment.",
5
5
  "keywords": [
6
6
  "nuxt",