Browse Source

style: run prettier

Konstantinos Kaloutas 2 years ago
parent
commit
249a9dc688

+ 6 - 4
tldraw/apps/tldraw-logseq/src/hooks/usePaste.ts

@@ -42,9 +42,9 @@ interface Asset extends TLAsset {
 }
 
 const assetExtensions = {
-  'image': ['.png', '.svg', '.jpg', '.jpeg', '.gif'],
-  'video': ['.mp4', '.webm', '.ogg'],
-  'pdf': ['.pdf']
+  image: ['.png', '.svg', '.jpg', '.jpeg', '.gif'],
+  video: ['.mp4', '.webm', '.ogg'],
+  pdf: ['.pdf'],
 }
 
 function getFileType(filename: string) {
@@ -53,7 +53,9 @@ function getFileType(filename: string) {
   if (!extensionMatch) return 'unknown'
   const extension = extensionMatch[0].toLowerCase()
 
-  const [type, _extensions] = Object.entries(assetExtensions).find(([_type, extensions]) => extensions.includes(extension)) ?? ['unknown', null]
+  const [type, _extensions] = Object.entries(assetExtensions).find(([_type, extensions]) =>
+    extensions.includes(extension)
+  ) ?? ['unknown', null]
 
   return type
 }

+ 1 - 3
tldraw/apps/tldraw-logseq/src/lib/shapes/PdfShape.tsx

@@ -30,9 +30,7 @@ export class PdfShape extends TLBoxShape<PdfShapeProps> {
 
   ReactComponent = observer(({ events, asset, isErasing, isEditing }: TLComponentProps) => {
     const ref = React.useRef<HTMLElement>(null)
-    const {
-      handlers,
-    } = React.useContext(LogseqContext)
+    const { handlers } = React.useContext(LogseqContext)
     const app = useApp<Shape>()
 
     const isMoving = useCameraMovingRef()

+ 1 - 1
tldraw/packages/core/src/utils/DataUtils.ts

@@ -101,7 +101,7 @@ export function getSizeFromSrc(dataURL: string, type: string): Promise<number[]>
       img.onload = () => resolve([img.width, img.height])
       img.src = dataURL
       img.onerror = err => reject(err)
-    } else if(type === 'pdf'){
+    } else if (type === 'pdf') {
       resolve([595, 842]) // A4 portrait dimensions at 72 ppi
     }
   })