From 2602c5194cd58b02d48b66b582830f5896a876cf Mon Sep 17 00:00:00 2001 From: Dylan Vorster Date: Fri, 12 Jan 2024 15:09:18 -0700 Subject: [PATCH] more fixes --- .../next.config.js | 8 +++- .../package.json | 1 + .../src/app/editor/[document_id]/page.tsx | 21 +---------- .../src/app/globals.scss | 2 + .../src/app/layout.tsx | 37 ++----------------- .../src/app/sql-console/page.tsx | 1 - pnpm-lock.yaml | 7 ++++ 7 files changed, 21 insertions(+), 56 deletions(-) diff --git a/demos/powersync-supabase-yjs-text-collab-demo/next.config.js b/demos/powersync-supabase-yjs-text-collab-demo/next.config.js index fde737a..ec228a3 100644 --- a/demos/powersync-supabase-yjs-text-collab-demo/next.config.js +++ b/demos/powersync-supabase-yjs-text-collab-demo/next.config.js @@ -5,7 +5,7 @@ module.exports = withImages({ images: { disableStaticImages: true }, - webpack: (config, { buildId, dev, isServer, defaultLoaders, nextRuntime, webpack }) => { + webpack: (config, { isServer }) => { if (isServer) { return config; } @@ -16,7 +16,11 @@ module.exports = withImages({ rules: [ ...config.module.rules, { - test: /\.scss$/, + test: /\.css/, + use: ['style-loader', 'css-loader'] + }, + { + test: /\.scss/, use: ['style-loader', 'css-loader', 'sass-loader'] } ] diff --git a/demos/powersync-supabase-yjs-text-collab-demo/package.json b/demos/powersync-supabase-yjs-text-collab-demo/package.json index 6c27f38..2d633a4 100644 --- a/demos/powersync-supabase-yjs-text-collab-demo/package.json +++ b/demos/powersync-supabase-yjs-text-collab-demo/package.json @@ -28,6 +28,7 @@ "@tiptap/extension-task-list": "2.1.13", "@tiptap/react": "2.1.13", "@tiptap/starter-kit": "2.1.13", + "lato-font": "^3.0.0", "d3": "^7.3.0", "fast-glob": "^3.2.11", "formik": "^2.4.5", diff --git a/demos/powersync-supabase-yjs-text-collab-demo/src/app/editor/[document_id]/page.tsx b/demos/powersync-supabase-yjs-text-collab-demo/src/app/editor/[document_id]/page.tsx index e7d3ee1..7dfd79b 100644 --- a/demos/powersync-supabase-yjs-text-collab-demo/src/app/editor/[document_id]/page.tsx +++ b/demos/powersync-supabase-yjs-text-collab-demo/src/app/editor/[document_id]/page.tsx @@ -1,32 +1,15 @@ 'use client'; -import _ from 'lodash'; -import React, { useCallback, useEffect, useState, useRef, useMemo } from 'react'; +import React, { useEffect, useMemo, useRef, useState } from 'react'; import { useSupabase } from '@/components/providers/SystemProvider'; import { usePowerSync, usePowerSyncWatchedQuery } from '@journeyapps/powersync-react'; -import { - Box, - Button, - Container, - Dialog, - DialogActions, - DialogContent, - DialogContentText, - DialogTitle, - List, - TextField, - Typography, - styled -} from '@mui/material'; -import Fab from '@mui/material/Fab'; -import AddIcon from '@mui/icons-material/Add'; +import { Box, Container, Typography } from '@mui/material'; import { useRouter } from 'next/navigation'; import { v4 as uuidv4 } from 'uuid'; import { b64ToUint8Array, Uint8ArrayTob64 } from '@/library/binary-utils'; import * as Y from 'yjs'; import Collaboration from '@tiptap/extension-collaboration'; -import CollaborationCursor from '@tiptap/extension-collaboration-cursor'; import Highlight from '@tiptap/extension-highlight'; import TaskItem from '@tiptap/extension-task-item'; import TaskList from '@tiptap/extension-task-list'; diff --git a/demos/powersync-supabase-yjs-text-collab-demo/src/app/globals.scss b/demos/powersync-supabase-yjs-text-collab-demo/src/app/globals.scss index c34e885..f169a8d 100644 --- a/demos/powersync-supabase-yjs-text-collab-demo/src/app/globals.scss +++ b/demos/powersync-supabase-yjs-text-collab-demo/src/app/globals.scss @@ -15,4 +15,6 @@ body { min-height: 100vh; margin: 0; background: var(--background-rgb); + font-family: Lato !important; + font-weight: 400 !important;; } diff --git a/demos/powersync-supabase-yjs-text-collab-demo/src/app/layout.tsx b/demos/powersync-supabase-yjs-text-collab-demo/src/app/layout.tsx index c874ff7..3118918 100644 --- a/demos/powersync-supabase-yjs-text-collab-demo/src/app/layout.tsx +++ b/demos/powersync-supabase-yjs-text-collab-demo/src/app/layout.tsx @@ -1,44 +1,13 @@ 'use client'; import React from 'react'; -import { - AppBar, - Box, - CssBaseline, - Divider, - Drawer, - IconButton, - List, - ListItem, - ListItemButton, - ListItemIcon, - ListItemText, - Toolbar, - Typography, - styled -} from '@mui/material'; -import MenuIcon from '@mui/icons-material/Menu'; -import WifiIcon from '@mui/icons-material/Wifi'; -import SignalWifiOffIcon from '@mui/icons-material/SignalWifiOff'; -import ChecklistRtlIcon from '@mui/icons-material/ChecklistRtl'; -import ExitToAppIcon from '@mui/icons-material/ExitToApp'; -import TerminalIcon from '@mui/icons-material/Terminal'; - -import { usePowerSync } from '@journeyapps/powersync-react'; -import { useSupabase } from '@/components/providers/SystemProvider'; - -import { useRouter } from 'next/navigation'; -import Image from 'next/image'; -import type { Metadata } from 'next'; +import { CssBaseline } from '@mui/material'; import { ThemeProviderContainer } from '@/components/providers/ThemeProviderContainer'; import { DynamicSystemProvider } from '@/components/providers/DynamicSystemProvider'; import './globals.scss'; - -import { Lato } from 'next/font/google'; - -const font = Lato({ subsets: ['latin'], display: 'swap', weight: '400' }); +import 'lato-font'; export default function RootLayout({ children }: { children: React.ReactNode }) { return ( @@ -46,7 +15,7 @@ export default function RootLayout({ children }: { children: React.ReactNode }) PowerSync Yjs CRDT Text Collaboration Demo - + {children} diff --git a/demos/powersync-supabase-yjs-text-collab-demo/src/app/sql-console/page.tsx b/demos/powersync-supabase-yjs-text-collab-demo/src/app/sql-console/page.tsx index 68f4755..03eaca1 100644 --- a/demos/powersync-supabase-yjs-text-collab-demo/src/app/sql-console/page.tsx +++ b/demos/powersync-supabase-yjs-text-collab-demo/src/app/sql-console/page.tsx @@ -1,5 +1,4 @@ 'use client'; -import _ from 'lodash'; import React from 'react'; import { usePowerSyncWatchedQuery } from '@journeyapps/powersync-react'; import { Box, Button, Grid, TextField, styled } from '@mui/material'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4197fcb..703778b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -206,6 +206,9 @@ importers: js-logger: specifier: ^1.6.1 version: 1.6.1 + lato-font: + specifier: ^3.0.0 + version: 3.0.0 lexical: specifier: ^0.11.1 version: 0.11.3 @@ -6595,6 +6598,10 @@ packages: language-subtag-registry: 0.3.22 dev: true + /lato-font@3.0.0: + resolution: {integrity: sha512-wKhFCh9XX91Lepf38ynnZTNpkQD1OWuXV1RwFgcchUVQZzBixJ/yXCaVCIrNI3CbgT9pLcLzWKgn+6OETzAnug==} + dev: false + /leven@3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} engines: {node: '>=6'}