mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-27 17:56:25 +02:00
chore: ran linting
This commit is contained in:
parent
e46b24a2b1
commit
a482cc95de
67 changed files with 4971 additions and 5539 deletions
|
|
@ -1,44 +1,39 @@
|
|||
'use client';
|
||||
"use client";
|
||||
|
||||
import * as React from 'react';
|
||||
import * as React from "react";
|
||||
|
||||
import { DndPlugin } from '@platejs/dnd';
|
||||
import { useBlockSelected } from '@platejs/selection/react';
|
||||
import { cva } from 'class-variance-authority';
|
||||
import { type PlateElementProps, usePluginOption } from 'platejs/react';
|
||||
import { DndPlugin } from "@platejs/dnd";
|
||||
import { useBlockSelected } from "@platejs/selection/react";
|
||||
import { cva } from "class-variance-authority";
|
||||
import { type PlateElementProps, usePluginOption } from "platejs/react";
|
||||
|
||||
export const blockSelectionVariants = cva(
|
||||
'pointer-events-none absolute inset-0 z-1 bg-brand/[.13] transition-opacity',
|
||||
{
|
||||
defaultVariants: {
|
||||
active: true,
|
||||
},
|
||||
variants: {
|
||||
active: {
|
||||
false: 'opacity-0',
|
||||
true: 'opacity-100',
|
||||
},
|
||||
},
|
||||
}
|
||||
"pointer-events-none absolute inset-0 z-1 bg-brand/[.13] transition-opacity",
|
||||
{
|
||||
defaultVariants: {
|
||||
active: true,
|
||||
},
|
||||
variants: {
|
||||
active: {
|
||||
false: "opacity-0",
|
||||
true: "opacity-100",
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
export function BlockSelection(props: PlateElementProps) {
|
||||
const isBlockSelected = useBlockSelected();
|
||||
const isDragging = usePluginOption(DndPlugin, 'isDragging');
|
||||
const isBlockSelected = useBlockSelected();
|
||||
const isDragging = usePluginOption(DndPlugin, "isDragging");
|
||||
|
||||
if (
|
||||
!isBlockSelected ||
|
||||
props.plugin.key === 'tr' ||
|
||||
props.plugin.key === 'table'
|
||||
)
|
||||
return null;
|
||||
if (!isBlockSelected || props.plugin.key === "tr" || props.plugin.key === "table") return null;
|
||||
|
||||
return (
|
||||
<div
|
||||
className={blockSelectionVariants({
|
||||
active: isBlockSelected && !isDragging,
|
||||
})}
|
||||
data-slot="block-selection"
|
||||
/>
|
||||
);
|
||||
return (
|
||||
<div
|
||||
className={blockSelectionVariants({
|
||||
active: isBlockSelected && !isDragging,
|
||||
})}
|
||||
data-slot="block-selection"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue