|
62 | 62 | getTextInputReplacementsExtension |
63 | 63 | } from "@/form/components/fields/editor/extensions/TextInputReplacements"; |
64 | 64 | import CodeBlockDropdown from "@/form/components/fields/editor/toolbar/CodeBlockDropdown.vue"; |
| 65 | + import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"; |
65 | 66 |
|
66 | 67 | const emit = defineEmits<FormFieldEmits<FormEditorFieldData>>(); |
67 | 68 | const props = defineProps<FormFieldProps<FormEditorFieldData>>(); |
|
189 | 190 | } |
190 | 191 | ); |
191 | 192 |
|
192 | | - declare module '@tiptap/core' { |
193 | | - interface Storage { |
194 | | - scrollYPercentage: number; |
195 | | - } |
196 | | - } |
197 | 193 |
|
198 | 194 | const isFullscreen = ref(false); |
199 | 195 | const fullscreenPlaceholderHeight = ref(0); |
|
303 | 299 | <Separator orientation="vertical" class="h-4 self-center last:hidden" /> |
304 | 300 | </template> |
305 | 301 | <template v-else :key="button"> |
306 | | - <Toggle |
307 | | - size="sm" |
308 | | - :model-value="buttons[button].isActive(editor)" |
309 | | - :disabled="field.readOnly" |
310 | | - :title="buttons[button].label()" |
311 | | - @click="button === 'upload' || button === 'upload-image' |
312 | | - ? uploadModal.open({ locale: props.locale }) |
313 | | - : buttons[button].command(editor)" |
314 | | - > |
315 | | - <component :is="buttons[button].icon" class="size-4" /> |
316 | | - </Toggle> |
| 302 | + <TooltipProvider> |
| 303 | + <Tooltip :disabled="!buttons[button].tooltip" :delay-duration="0" disable-hoverable-content> |
| 304 | + <TooltipTrigger as-child> |
| 305 | + <Toggle |
| 306 | + size="sm" |
| 307 | + :model-value="buttons[button].isActive(editor)" |
| 308 | + :disabled="field.readOnly" |
| 309 | + :title="!buttons[button].tooltip ? buttons[button].label() : null" |
| 310 | + @click="button === 'upload' || button === 'upload-image' |
| 311 | + ? uploadModal.open({ locale: props.locale }) |
| 312 | + : buttons[button].command(editor)" |
| 313 | + > |
| 314 | + <component :is="buttons[button].icon" class="size-4" /> |
| 315 | + </Toggle> |
| 316 | + </TooltipTrigger> |
| 317 | + <template v-if="buttons[button].tooltip"> |
| 318 | + <TooltipContent side="top" :side-offset="10"> |
| 319 | + <h4 class="font-medium">{{ buttons[button].label() }}</h4> |
| 320 | + <div v-html="buttons[button].tooltip()"></div> |
| 321 | + </TooltipContent> |
| 322 | + </template> |
| 323 | + </Tooltip> |
| 324 | + </TooltipProvider> |
317 | 325 | </template> |
318 | 326 | </template> |
319 | 327 | <template v-if="dropdownEmbeds.length > 0"> |
|
419 | 427 | 'group/editor content w-full rounded-b-md focus:outline-none px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50', |
420 | 428 | '[&_.selection-highlight]:bg-[Highlight] [&_.selection-highlight]:py-0.5', |
421 | 429 | '[&_.ProseMirror-selectednode]:outline-none! [&:focus_.ProseMirror-selectednode]:ring-1 [&_.ProseMirror-selectednode]:ring-primary', |
422 | | - `[&_.footnotes]:before:content-(--footnote-title) [&_.footnotes]:before:text-xs [&_.footnotes]:before:text-muted-foreground [&_.footnotes]:before:block [&_.footnotes]:before:ml-[-1.75em] [&_.footnotes]:before:mb-2 [&_.footnotes]:-mx-3 [&_.footnotes]:pt-2 [&_.footnotes]:pb-2 [&_.footnotes]:pr-3 [&_.footnotes]:pl-[calc(.75rem+1.75em)] [&_.footnotes>li]:relative [&_.footnotes>li]:pl-[1.25em] [&_.footnotes]:border-t [&_.footnote-ref]:underline [&_.footnote-ref]:underline-offset-4 [&_.footnote-ref]:decoration-foreground/20 [&_.footnote-ref]:hover:decoration-foreground [&_.footnote-ref]:before:content-['['] [&_.footnote-ref]:after:content-[']']`, |
| 430 | + `[&_.footnotes]:before:content-(--footnote-title) [&_.footnotes]:before:text-xs [&_.footnotes]:before:text-muted-foreground [&_.footnotes]:before:block [&_.footnotes]:before:ml-[-1.75em] [&_.footnotes]:before:mb-2 [&_.footnotes]:-mx-3 [&_.footnotes]:pt-2 [&_.footnotes]:pb-2 [&_.footnotes]:pr-3 [&_.footnotes]:pl-[calc(.75rem+1.75em)] [&_.footnotes>li]:relative [&_.footnotes>li]:pl-[1.25em] [&_.footnotes]:border-t`, |
| 431 | + ` [&_.footnote-ref]:cursor-pointer [&_.footnote-ref]:underline [&_.footnote-ref]:underline-offset-4 [&_.footnote-ref]:decoration-foreground/20 [&_.footnote-ref]:hover:decoration-foreground [&_.footnote-ref]:p-1 [&_.footnote-ref]:-m-1 [&_.footnote-ref]:before:content-['['] [&_.footnote-ref]:after:content-[']']`, |
423 | 432 | { |
424 | 433 | 'content-lg max-w-3xl mx-auto py-6 px-4 sm:px-6 text-base min-h-max': isFullscreen, |
425 | 434 | }, |
|
0 commit comments