@finema/finework-layer 2.0.18 → 2.0.20

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.0.20](https://gitlab.finema.co/finema/finework/finework-frontend-layer/compare/2.0.19...2.0.20) (2026-07-31)
4
+
5
+ ## [2.0.19](https://gitlab.finema.co/finema/finework/finework-frontend-layer/compare/2.0.18...2.0.19) (2026-07-31)
6
+
3
7
  ## [2.0.18](https://gitlab.finema.co/finema/finework/finework-frontend-layer/compare/2.0.17...2.0.18) (2026-07-31)
4
8
 
5
9
  ## [2.0.17](https://gitlab.finema.co/finema/finework/finework-frontend-layer/compare/2.0.16...2.0.17) (2026-07-31)
@@ -8,13 +8,13 @@
8
8
  }"
9
9
  >
10
10
  <Icon
11
- name="ph:star"
11
+ name="ph:bookmark-simple"
12
12
  class="size-6 cursor-pointer"
13
13
  title="Add bookmark"
14
14
  />
15
15
 
16
16
  <template #content>
17
- <Card class="w-[360px]">
17
+ <Card class="w-95">
18
18
  <div class="mb-3 flex items-center justify-between">
19
19
  <h3 class="text-base font-semibold">
20
20
  Add bookmark
@@ -50,7 +50,7 @@
50
50
  <div class="flex flex-1 flex-col gap-2">
51
51
  <Input
52
52
  v-model="url"
53
- placeholder="Paste the link you want to bookmark"
53
+ placeholder="Paste a link"
54
54
  size="lg"
55
55
  @blur="onFetchPreview"
56
56
  @keyup.enter="onFetchPreview"
@@ -64,13 +64,15 @@
64
64
  v-if="!isCreatingFolder"
65
65
  class="flex gap-2"
66
66
  >
67
- <Select
67
+ <SelectMenu
68
68
  v-if="folderOptions.length > 0"
69
69
  v-model="folderId"
70
70
  :items="folderOptions"
71
+ value-key="value"
71
72
  placeholder="Folder"
72
73
  size="lg"
73
74
  class="flex-1"
75
+ clearable
74
76
  />
75
77
  <Button
76
78
  icon="ph:folder-plus"
@@ -124,7 +126,7 @@
124
126
  </Button>
125
127
  <Button
126
128
  :loading="bookmarks.add.status.isLoading || bookmarks.update.status.isLoading"
127
- :disabled="!url || !name"
129
+ :disabled="!url"
128
130
  @click="onSave"
129
131
  >
130
132
  Done
@@ -158,8 +160,6 @@ const folderOptions = computed(() => folders.fetch.items.map((folder) => ({
158
160
  value: folder.id,
159
161
  })))
160
162
 
161
- const defaultFolderId = computed(() => folders.fetch.items[0]?.id)
162
-
163
163
  onMounted(() => {
164
164
  bookmarks.fetchAll()
165
165
  folders.fetchAll()
@@ -173,7 +173,7 @@ watch(isOpen, (open) => {
173
173
  url.value = ''
174
174
  name.value = ''
175
175
  thumbnailUrl.value = null
176
- folderId.value = defaultFolderId.value
176
+ folderId.value = undefined
177
177
  })
178
178
 
179
179
  const onFetchPreview = () => {
@@ -181,7 +181,7 @@ const onFetchPreview = () => {
181
181
 
182
182
  if (existing.value) {
183
183
  name.value = existing.value.name
184
- folderId.value = existing.value.folder_id ?? defaultFolderId.value
184
+ folderId.value = existing.value.folder_id ?? undefined
185
185
  thumbnailUrl.value = existing.value.favicon_url || existing.value.image_url
186
186
 
187
187
  return
@@ -191,10 +191,6 @@ const onFetchPreview = () => {
191
191
  params: {
192
192
  url: url.value,
193
193
  },
194
- }).then(() => {
195
- if (!preview.data.value) return
196
- if (!name.value) name.value = preview.data.value.name
197
- thumbnailUrl.value = preview.data.value.favicon_url || preview.data.value.image_url || null
198
194
  })
199
195
  }
200
196
 
@@ -217,10 +213,12 @@ const onCreateFolder = async () => {
217
213
  }
218
214
 
219
215
  const onSave = async () => {
216
+ const bookmarkName = name.value || url.value
217
+
220
218
  if (existing.value) {
221
219
  await bookmarks.updateRun(existing.value.id, {
222
220
  data: {
223
- name: name.value,
221
+ name: bookmarkName,
224
222
  folder_id: folderId.value,
225
223
  },
226
224
  })
@@ -228,7 +226,7 @@ const onSave = async () => {
228
226
  await bookmarks.addRun({
229
227
  data: {
230
228
  url: url.value,
231
- name: name.value,
229
+ name: bookmarkName,
232
230
  folder_id: folderId.value,
233
231
  },
234
232
  })
@@ -243,6 +241,12 @@ const onRemove = async () => {
243
241
  isOpen.value = false
244
242
  }
245
243
 
244
+ useWatchTrue(() => preview.status.isSuccess, () => {
245
+ if (!preview.data) return
246
+ name.value = preview.data.name
247
+ thumbnailUrl.value = preview.data.favicon_url || preview.data.image_url || null
248
+ })
249
+
246
250
  useWatchTrue(() => bookmarks.add.status.isSuccess, () => {
247
251
  bookmarks.fetchAll()
248
252
  })
@@ -41,7 +41,7 @@ export const routes = {
41
41
  bookmarks: {
42
42
  label: 'Bookmarks',
43
43
  to: '/account/bookmarks',
44
- icon: 'ph:star',
44
+ icon: 'ph:bookmarks',
45
45
  },
46
46
  },
47
47
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@finema/finework-layer",
3
3
  "type": "module",
4
- "version": "2.0.18",
4
+ "version": "2.0.20",
5
5
  "main": "./nuxt.config.ts",
6
6
  "scripts": {
7
7
  "dev": "nuxi dev .playground -o",