Skip to content

Commit cfacc15

Browse files
committed
fix: ts errors
1 parent 3bafec9 commit cfacc15

3 files changed

Lines changed: 53 additions & 50 deletions

File tree

new-deepnotes/apps/web/src/components/ui/dropdown-menu/DropdownMenuItem.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22
import type { DropdownMenuItemProps } from 'reka-ui'
33
import { DropdownMenuItem, useForwardProps } from 'reka-ui'
44
5-
const props = withDefaults(defineProps<DropdownMenuItemProps>(), {
5+
const props = withDefaults(defineProps<DropdownMenuItemProps & { inset?: boolean }>(), {
66
inset: false,
77
})
88
9-
const forwardedProps = useForwardProps(props)
9+
const { inset, ...rest } = props
10+
const forwardedProps = useForwardProps(rest)
1011
</script>
1112

1213
<template>
1314
<DropdownMenuItem
1415
v-bind="forwardedProps"
1516
class="relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0"
16-
:class="inset && 'pl-8'"
17+
:class="props.inset && 'pl-8'"
1718
>
1819
<slot />
1920
</DropdownMenuItem>

new-deepnotes/apps/web/src/features/spatial/NotePropertiesCard.vue

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,31 @@ const props = defineProps<{
1414
readOnly?: boolean
1515
}>()
1616
17-
const emit = defineEmits({
18-
'update:link': (value: string) => true,
19-
'update:head-enabled': (value: boolean) => true,
20-
'update:body-enabled': (value: boolean) => true,
21-
'update:head-wrap': (value: boolean) => true,
22-
'update:body-wrap': (value: boolean) => true,
23-
'update:pos-x': (value: number) => true,
24-
'update:pos-y': (value: number) => true,
25-
'update:anchor-x': (value: number) => true,
26-
'update:anchor-y': (value: number) => true,
27-
'update:width': (value: string) => true,
28-
'update:color': (value: number) => true,
29-
'update:color-inherit': (value: boolean) => true,
30-
'update:collapsible': (value: boolean) => true,
31-
'update:collapsed': (value: boolean) => true,
32-
'update:movable': (value: boolean) => true,
33-
'update:resizable': (value: boolean) => true,
34-
'update:read-only': (value: boolean) => true,
35-
'update:container-enabled': (value: boolean) => true,
36-
'update:container-horizontal': (value: boolean) => true,
37-
'update:container-spatial': (value: boolean) => true,
38-
'update:container-wrap-children': (value: boolean) => true,
39-
'update:container-stretch-children': (value: boolean) => true,
40-
'update:container-force-color-inheritance': (value: boolean) => true,
41-
})
17+
const emit = defineEmits<{
18+
'update:link': [value: string]
19+
'update:head-enabled': [value: boolean]
20+
'update:body-enabled': [value: boolean]
21+
'update:head-wrap': [value: boolean]
22+
'update:body-wrap': [value: boolean]
23+
'update:pos-x': [value: number]
24+
'update:pos-y': [value: number]
25+
'update:anchor-x': [value: number]
26+
'update:anchor-y': [value: number]
27+
'update:width': [value: string]
28+
'update:color': [value: number]
29+
'update:color-inherit': [value: boolean]
30+
'update:collapsible': [value: boolean]
31+
'update:collapsed': [value: boolean]
32+
'update:movable': [value: boolean]
33+
'update:resizable': [value: boolean]
34+
'update:read-only': [value: boolean]
35+
'update:container-enabled': [value: boolean]
36+
'update:container-horizontal': [value: boolean]
37+
'update:container-spatial': [value: boolean]
38+
'update:container-wrap-children': [value: boolean]
39+
'update:container-stretch-children': [value: boolean]
40+
'update:container-force-color-inheritance': [value: boolean]
41+
}>()
4242
4343
const link = computed(() => props.noteModel?.link?.value ?? '')
4444
const headEnabled = computed(() => props.noteModel?.head?.enabled?.value ?? true)
@@ -93,7 +93,7 @@ function handleColorSelect(colorIndex: number) {
9393
placeholder="https://..."
9494
class="h-8 text-xs"
9595
:disabled="readOnly"
96-
@update:model-value="emit('update:link', $event)"
96+
@update:model-value="emit('update:link', $event as string)"
9797
/>
9898
<Button
9999
variant="outline"
@@ -113,15 +113,15 @@ function handleColorSelect(colorIndex: number) {
113113
<Switch
114114
:model-value="headEnabled"
115115
:disabled="readOnly"
116-
@update:model-value="emit('update:head-enabled', $event)"
116+
@update:model-value="emit('update:head-enabled', $event as boolean)"
117117
/>
118118
<Label>Head</Label>
119119
</div>
120120
<div class="flex items-center gap-2">
121121
<Switch
122122
:model-value="bodyEnabled"
123123
:disabled="readOnly"
124-
@update:model-value="emit('update:body-enabled', $event)"
124+
@update:model-value="emit('update:body-enabled', $event as boolean)"
125125
/>
126126
<Label>Body</Label>
127127
</div>
@@ -133,15 +133,15 @@ function handleColorSelect(colorIndex: number) {
133133
<Switch
134134
:model-value="headWrap"
135135
:disabled="readOnly"
136-
@update:model-value="emit('update:head-wrap', Boolean($event))"
136+
@update:model-value="emit('update:head-wrap', $event as boolean)"
137137
/>
138138
<Label>Head wrap</Label>
139139
</div>
140140
<div class="flex items-center gap-2">
141141
<Switch
142142
:model-value="bodyWrap"
143143
:disabled="readOnly"
144-
@update:model-value="emit('update:body-wrap', Boolean($event))"
144+
@update:model-value="emit('update:body-wrap', $event as boolean)"
145145
/>
146146
<Label>Body wrap</Label>
147147
</div>
@@ -157,7 +157,7 @@ function handleColorSelect(colorIndex: number) {
157157
:model-value="posX"
158158
class="h-8 text-xs"
159159
:disabled="readOnly"
160-
@update:model-value="emit('update:pos-x', parseFloat(String($event)) || 0)"
160+
@update:model-value="emit('update:pos-x', Number($event) || 0)"
161161
/>
162162
</div>
163163
<div class="flex-1">
@@ -166,7 +166,7 @@ function handleColorSelect(colorIndex: number) {
166166
:model-value="posY"
167167
class="h-8 text-xs"
168168
:disabled="readOnly"
169-
@update:model-value="emit('update:pos-y', parseFloat(String($event)) || 0)"
169+
@update:model-value="emit('update:pos-y', Number($event) || 0)"
170170
/>
171171
</div>
172172
</div>
@@ -181,7 +181,7 @@ function handleColorSelect(colorIndex: number) {
181181
:value="anchorX"
182182
class="h-8 w-full rounded-md border border-input bg-background px-2 text-xs"
183183
:disabled="readOnly"
184-
@change="emit('update:anchor-x', parseFloat(($event.target as HTMLSelectElement).value))"
184+
@change="emit('update:anchor-x', Number(($event.target as HTMLSelectElement).value))"
185185
>
186186
<option value="0">Left</option>
187187
<option value="0.5">Center</option>
@@ -193,7 +193,7 @@ function handleColorSelect(colorIndex: number) {
193193
:value="anchorY"
194194
class="h-8 w-full rounded-md border border-input bg-background px-2 text-xs"
195195
:disabled="readOnly"
196-
@change="emit('update:anchor-y', parseFloat(($event.target as HTMLSelectElement).value))"
196+
@change="emit('update:anchor-y', Number(($event.target as HTMLSelectElement).value))"
197197
>
198198
<option value="0">Top</option>
199199
<option value="0.5">Center</option>
@@ -210,7 +210,7 @@ function handleColorSelect(colorIndex: number) {
210210
:value="width"
211211
class="h-8 w-full rounded-md border border-input bg-background px-2 text-xs"
212212
:disabled="readOnly"
213-
@change="emit('update:width', ($event.target as HTMLSelectElement).value)"
213+
@change="emit('update:width', ($event.target as HTMLSelectElement).value as string)"
214214
>
215215
<option value="Auto">Auto</option>
216216
<option value="Minimum">Minimum</option>
@@ -225,7 +225,7 @@ function handleColorSelect(colorIndex: number) {
225225
<Switch
226226
:model-value="colorInherit"
227227
:disabled="readOnly"
228-
@update:model-value="emit('update:color-inherit', $event)"
228+
@update:model-value="emit('update:color-inherit', $event as boolean)"
229229
/>
230230
<Label class="text-[10px]">Inherit</Label>
231231
</div>
@@ -253,15 +253,15 @@ function handleColorSelect(colorIndex: number) {
253253
<Switch
254254
:model-value="collapsible"
255255
:disabled="readOnly"
256-
@update:model-value="emit('update:collapsible', $event)"
256+
@update:model-value="emit('update:collapsible', $event as boolean)"
257257
/>
258258
<Label>Collapsible</Label>
259259
</div>
260260
<div class="flex items-center gap-2 pl-6">
261261
<Switch
262262
:model-value="collapsed"
263263
:disabled="readOnly || !collapsible"
264-
@update:model-value="emit('update:collapsed', $event)"
264+
@update:model-value="emit('update:collapsed', $event as boolean)"
265265
/>
266266
<Label>Collapsed</Label>
267267
</div>
@@ -273,47 +273,47 @@ function handleColorSelect(colorIndex: number) {
273273
<Switch
274274
:model-value="containerEnabled"
275275
:disabled="readOnly"
276-
@update:model-value="emit('update:container-enabled', $event)"
276+
@update:model-value="emit('update:container-enabled', $event as boolean)"
277277
/>
278278
<Label>Container</Label>
279279
</div>
280280
<div class="flex items-center gap-2 pl-6">
281281
<Switch
282282
:model-value="containerSpatial"
283283
:disabled="readOnly || !containerEnabled"
284-
@update:model-value="emit('update:container-spatial', $event)"
284+
@update:model-value="emit('update:container-spatial', $event as boolean)"
285285
/>
286286
<Label>Spatial</Label>
287287
</div>
288288
<div class="flex items-center gap-2 pl-6">
289289
<Switch
290290
:model-value="containerHorizontal"
291291
:disabled="readOnly || !containerEnabled"
292-
@update:model-value="emit('update:container-horizontal', $event)"
292+
@update:model-value="emit('update:container-horizontal', $event as boolean)"
293293
/>
294294
<Label>Horizontal layout</Label>
295295
</div>
296296
<div class="flex items-center gap-2 pl-6">
297297
<Switch
298298
:model-value="containerWrapChildren"
299299
:disabled="readOnly || !containerEnabled"
300-
@update:model-value="emit('update:container-wrap-children', $event)"
300+
@update:model-value="emit('update:container-wrap-children', $event as boolean)"
301301
/>
302302
<Label>Wrap children</Label>
303303
</div>
304304
<div class="flex items-center gap-2 pl-6">
305305
<Switch
306306
:model-value="containerStretchChildren"
307307
:disabled="readOnly || !containerEnabled"
308-
@update:model-value="emit('update:container-stretch-children', $event)"
308+
@update:model-value="emit('update:container-stretch-children', $event as boolean)"
309309
/>
310310
<Label>Stretch children</Label>
311311
</div>
312312
<div class="flex items-center gap-2 pl-6">
313313
<Switch
314314
:model-value="containerForceColorInheritance"
315315
:disabled="readOnly || !containerEnabled"
316-
@update:model-value="emit('update:container-force-color-inheritance', $event)"
316+
@update:model-value="emit('update:container-force-color-inheritance', $event as boolean)"
317317
/>
318318
<Label>Force color inheritance</Label>
319319
</div>
@@ -325,15 +325,15 @@ function handleColorSelect(colorIndex: number) {
325325
<Switch
326326
:model-value="movable"
327327
:disabled="readOnly"
328-
@update:model-value="emit('update:movable', $event)"
328+
@update:model-value="emit('update:movable', $event as boolean)"
329329
/>
330330
<Label>Movable</Label>
331331
</div>
332332
<div class="flex items-center gap-2">
333333
<Switch
334334
:model-value="resizable"
335335
:disabled="readOnly"
336-
@update:model-value="emit('update:resizable', $event)"
336+
@update:model-value="emit('update:resizable', $event as boolean)"
337337
/>
338338
<Label>Resizable</Label>
339339
</div>
@@ -344,7 +344,7 @@ function handleColorSelect(colorIndex: number) {
344344
<Switch
345345
:model-value="readOnly"
346346
:disabled="readOnly"
347-
@update:model-value="emit('update:read-only', $event)"
347+
@update:model-value="emit('update:read-only', $event as boolean)"
348348
/>
349349
<Label>Read-only</Label>
350350
</div>

new-deepnotes/apps/web/src/features/spatial/useUserTemplates.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ function legacyNoteToClipboard(
5656
result.head = {
5757
enabled: (h.enabled as boolean) ?? true,
5858
wrap: (h.wrap as boolean) ?? true,
59+
content: (h.content as string) ?? "",
5960
height: (h.height as { expanded: string; collapsed: string }) ?? {
6061
expanded: "Auto",
6162
collapsed: "Auto",
@@ -68,6 +69,7 @@ function legacyNoteToClipboard(
6869
result.body = {
6970
enabled: (b.enabled as boolean) ?? false,
7071
wrap: (b.wrap as boolean) ?? true,
72+
content: (b.content as string) ?? "",
7173
height: (b.height as { expanded: string; collapsed: string }) ?? {
7274
expanded: "Auto",
7375
collapsed: "Auto",

0 commit comments

Comments
 (0)