Skip to content

Commit

Permalink
Merge branches 'main' and 'main' of github.com:a-type/biscuits
Browse files Browse the repository at this point in the history
  • Loading branch information
a-type committed Mar 26, 2024
2 parents 9c7dd8e + bb4fad7 commit 7d12126
Show file tree
Hide file tree
Showing 42 changed files with 3,088 additions and 1,526 deletions.
6 changes: 3 additions & 3 deletions apps/gnocchi/verdant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"@0no-co/graphqlsp": "^1.3.4",
"@biscuits/client": "workspace:*",
"@verdant-web/cli": "^4.3.2",
"@verdant-web/common": "2.2.0",
"@verdant-web/react": "28.0.1",
"@verdant-web/store": "3.3.0",
"@verdant-web/common": "2.3.0",
"@verdant-web/react": "29.0.0",
"@verdant-web/store": "3.4.0",
"cuid": "^2.1.8",
"stopword": "^2.0.8"
},
Expand Down
4 changes: 0 additions & 4 deletions apps/gnocchi/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@
"@tiptap/starter-kit": "^2.2.4",
"@use-gesture/react": "^10.2.24",
"@vercel/analytics": "^0.1.6",
"@verdant-web/cli": "^4.3.1",
"@verdant-web/common": "2.2.0",
"@verdant-web/react": "28.0.1",
"@verdant-web/react-router": "^0.6.1",
"@verdant-web/store": "3.3.0",
"@zip.js/zip.js": "^2.7.6",
"classnames": "^2.3.2",
"convert-units": "^3.0.0-beta.4",
Expand Down
3 changes: 2 additions & 1 deletion apps/gnocchi/web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { TooltipProvider } from '@a-type/ui/components/tooltip';
import { P, H1 } from '@a-type/ui/components/typography';
import { ParticleLayer } from '@a-type/ui/components/particles';
import { GlobalSyncingIndicator } from '@/components/sync/GlobalSyncingIndicator.jsx';
import { Provider } from '@biscuits/client';
import { AppPreviewNotice, Provider } from '@biscuits/client';
import { graphqlClient } from './graphql.js';

export function App() {
Expand All @@ -37,6 +37,7 @@ export function App() {
<Provider graphqlClient={graphqlClient} appId="gnocchi">
<GroceriesProvider>
<ParticleLayer>
<AppPreviewNotice />
<Pages />
<Toaster
position="bottom-center"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useListId } from '@/contexts/ListContext.jsx';
import useMergedRef from '@/hooks/useMergedRef.js';
import { useIsFirstRender, usePrevious } from '@/hooks/usePrevious.js';
import { categorizeOnboarding } from '@/onboarding/categorizeOnboarding.js';
import { Presence, Profile, hooks } from '@/stores/groceries/index.js';
import { Person, Presence, Profile, hooks } from '@/stores/groceries/index.js';
import { Button } from '@a-type/ui/components/button';
import {
CheckboxIndicator,
Expand Down Expand Up @@ -48,7 +48,6 @@ import {
Pencil1Icon,
TrashIcon,
} from '@radix-ui/react-icons';
import { UserInfo } from '@verdant-web/store';
import classNames from 'classnames';
import {
CSSProperties,
Expand Down Expand Up @@ -355,7 +354,7 @@ function RecentPeople({ item }: { item: Item }) {

function usePeopleWhoLastEditedThis(itemId: string) {
const groceries = hooks.useClient();
const [people, setPeople] = useState<UserInfo<Profile, Presence>[]>(() => {
const [people, setPeople] = useState<Person[]>(() => {
return Object.values(groceries.sync.presence.peers).filter(
(p) => p.presence.lastInteractedItem === itemId,
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { makeRecipeLink } from '@/components/recipes/makeRecipeLink.js';
import { Presence, Profile, hooks } from '@/stores/groceries/index.js';
import { Person, Presence, Profile, hooks } from '@/stores/groceries/index.js';
import { Button } from '@a-type/ui/components/button';
import { PageNowPlaying } from '@a-type/ui/components/layouts';
import { UserInfo } from '@verdant-web/common';
import { Cross2Icon } from '@radix-ui/react-icons';
import { Suspense, useState } from 'react';
import { PersonAvatar } from '../people/PersonAvatar.jsx';
Expand Down Expand Up @@ -55,7 +54,7 @@ function RecipePresenceLink({
onDismiss,
}: {
recipeId: string;
person: UserInfo<Profile, Presence>;
person: Person;
onDismiss: () => void;
}) {
const recipe = hooks.useRecipe(recipeId);
Expand Down
18 changes: 8 additions & 10 deletions apps/gnocchi/web/src/pages/Pages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,21 +170,19 @@ const routes = makeRoutes([
]);

function LayoutWithNavBar() {
const big = useMediaQuery('(min-width: 640px)');
if (big) {
return (
<PageRoot>
<Outlet />
<NavBar />
</PageRoot>
);
}
return (
<PageRoot>
<SwipeOutlet scroll className="[grid-area:content]" />
<Outlet />
<NavBar />
</PageRoot>
);

// return (
// <PageRoot>
// <SwipeOutlet scroll className="[grid-area:content]" />
// <NavBar />
// </PageRoot>
// );
}

export function Pages() {
Expand Down
19 changes: 13 additions & 6 deletions apps/gnocchi/web/src/pages/groceries/GroceriesPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ListEdit } from '@/components/groceries/lists/ListEdit.jsx';
import { ListSelect } from '@/components/groceries/lists/ListSelect.jsx';
import { Icon } from '@/components/icons/Icon.jsx';
import { RecipeSavePrompt } from '@/components/recipes/savePrompt/RecipeSavePrompt.jsx';
import { OfflineIndicator } from '@/components/sync/OfflineIndicator.jsx';
import { RecipePresenceNotification } from '@/components/sync/collaborationMenu/RecipePresenceNotification.jsx';
Expand Down Expand Up @@ -64,13 +65,19 @@ export function GroceriesPage() {
<Suspense>
<ChangelogDisplay className="sm:hidden" hideOnSeen />
</Suspense>
<Suspense>
<OfflineIndicator />
</Suspense>
<InstallButton />
<UserMenu>
<Suspense>
<PresencePeople />
</Suspense>
</UserMenu>
<OfflineIndicator />
<Suspense>
<UserMenu>
<Suspense
fallback={<Icon className="w-32px h-32px" name="profile" />}
>
<PresencePeople />
</Suspense>
</UserMenu>
</Suspense>
</div>
</TopControls>
<AddBar />
Expand Down
3 changes: 2 additions & 1 deletion apps/gnocchi/web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default defineConfig(({ command, mode }) => ({
srcDir: 'src',
filename: 'service-worker.ts',
manifest: {
id: 'gnocchi-main',
name: 'Gnocchi',
short_name: 'Gnocchi',
description: 'Your grocery list, done better.',
Expand Down Expand Up @@ -70,7 +71,7 @@ export default defineConfig(({ command, mode }) => ({
],
categories: ['food'],
display: 'standalone',
start_url: '/',
start_url: '/?directLaunch=true',
share_target: {
action: 'share',
method: 'POST',
Expand Down
8 changes: 4 additions & 4 deletions apps/trip-tick/verdant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"react": "^18.2.0"
},
"dependencies": {
"@verdant-web/cli": "^4.1.0",
"@verdant-web/common": "^1.16.1",
"@verdant-web/react": "^24.0.1",
"@verdant-web/store": "^2.8.4",
"@verdant-web/cli": "^4.3.2",
"@verdant-web/common": "2.3.0",
"@verdant-web/react": "29.0.0",
"@verdant-web/store": "3.4.0",
"cuid": "^2.1.8"
}
}
8 changes: 4 additions & 4 deletions apps/trip-tick/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
"@a-type/ui": "^0.6.17",
"@a-type/utils": "^1.0.6",
"@biscuits/client": "workspace:*",
"@trip-tick.biscuits/verdant": "workspace:*",
"@radix-ui/react-progress": "^1.0.3",
"@radix-ui/react-toggle-group": "^1.0.4",
"@react-spring/web": "^9.7.3",
"@tanstack/react-query": "^4.24.10",
"@trip-tick.biscuits/verdant": "workspace:*",
"@unocss/transformer-variant-group": "^0.54.1",
"@verdant-web/react": "^24.0.1",
"@verdant-web/react-router": "^0.5.4",
"@verdant-web/store": "^2.8.4",
"@verdant-web/react": "^29.0.0",
"@verdant-web/react-router": "^0.6.1",
"@verdant-web/store": "^3.4.0",
"classnames": "^2.3.2",
"date-fns": "^2.30.0",
"react": "^18.2.0",
Expand Down
8 changes: 7 additions & 1 deletion apps/trip-tick/web/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { Pages } from '@/pages/Pages.jsx';
import { clientDescriptor, hooks } from '@/store.js';
import { IconSpritesheet } from '@a-type/ui/components/icon';
import { useIsLoggedIn, Provider, createGraphQLClient } from '@biscuits/client';
import {
useIsLoggedIn,
Provider,
createGraphQLClient,
AppPreviewNotice,
} from '@biscuits/client';
import { ReactNode, Suspense } from 'react';
import { Toaster } from 'react-hot-toast';

Expand All @@ -12,6 +17,7 @@ export function App() {
<Suspense>
<Provider appId="trip-tick" graphqlClient={graphqlClient}>
<LofiProvider>
<AppPreviewNotice />
<Pages />
<IconSpritesheet />
<Toaster
Expand Down
2 changes: 2 additions & 0 deletions apps/trip-tick/web/src/pages/Pages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { updateApp, updateState } from '@/updateState.js';
import { PageRoot } from '@a-type/ui/components/layouts';
import { TopLoader } from '@/components/nav/TopLoader.jsx';
import { Navigation } from '@/components/nav/Navigation.jsx';
import { LogoutNotice } from '@biscuits/client';

// dynamically import pages that may not be visited
const ListsPage = lazy(() => import('./ListsPage.jsx'));
Expand Down Expand Up @@ -52,6 +53,7 @@ export function Pages() {
<Router routes={routes} onNavigate={onNavigate}>
<Outlet />
<TopLoader />
<LogoutNotice />
</Router>
<Navigation />
</PageRoot>
Expand Down
9 changes: 5 additions & 4 deletions apps/trip-tick/web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ export default defineConfig({
srcDir: 'src',
filename: 'service-worker.ts',
manifest: {
name: 'packing-list',
short_name: 'packing-list',
description: '',
id: 'trip-tick-main',
name: 'Trip Tick',
short_name: 'Trip Tick',
description: 'Stress-free trip packing',
theme_color: '#ffffff',
background_color: '#ffffff',
icons: [
Expand All @@ -34,7 +35,7 @@ export default defineConfig({
],
categories: [],
display: 'standalone',
start_url: '/',
start_url: '/?directLaunch=true',
} as any,
includeAssets: ['fonts/**/*', 'images/**/*'],

Expand Down
69 changes: 0 additions & 69 deletions apps/trip-tick/web/vite.config.ts.timestamp-1710171524420.mjs

This file was deleted.

4 changes: 4 additions & 0 deletions packages/apps/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ export const appIds = apps.map((app) => app.id) as AppId[];
export function isValidAppId(appId: string): appId is AppId {
return appIds.includes(appId as AppId);
}

export const appsById = Object.fromEntries(
apps.map((app) => [app.id, app]),
) as Record<AppId, (typeof apps)[number]>;
10 changes: 5 additions & 5 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
"type": "module",
"dependencies": {
"@0no-co/graphqlsp": "^1.3.4",
"@biscuits/apps": "workspace:*",
"@biscuits/error": "workspace:*",
"@biscuits/libraries": "workspace:*",
"@biscuits/apps": "workspace:*",
"@urql/exchange-refocus": "^1.0.2",
"@urql/exchange-retry": "^1.2.1",
"clsx": "2.1.0",
"gql.tada": "^1.2.1",
"urql": "^4.0.6",
"clsx": "2.1.0"
"urql": "^4.0.6"
},
"peerDependencies": {
"@a-type/ui": "^0.6.17",
Expand All @@ -41,9 +41,9 @@
"vite-plugin-pwa": "0.19.2"
},
"devDependencies": {
"@types/react": "18.0.14",
"@a-type/ui": "^0.6.17",
"@verdant-web/store": "^3.2.2",
"@types/react": "18.0.14",
"@verdant-web/store": "^3.4.0",
"react": "^18.2.0",
"vite-plugin-pwa": "0.19.2"
}
Expand Down
Loading

0 comments on commit 7d12126

Please sign in to comment.