a tool for shared writing and social publishing

use type only imports from src/replicache

+81 -91
+3 -3
actions/createNewLeafletFromTemplate.ts
··· 4 4 import { drizzle } from "drizzle-orm/postgres-js"; 5 5 import { NextRequest } from "next/server"; 6 6 import postgres from "postgres"; 7 - import { Fact } from "src/replicache"; 8 - import { Attributes } from "src/replicache/attributes"; 7 + import type { Fact } from "src/replicache"; 8 + import type { Attribute } from "src/replicache/attributes"; 9 9 import { Database } from "supabase/database.types"; 10 10 import { v7 } from "uuid"; 11 11 ··· 41 41 let { data } = await supabase.rpc("get_facts", { 42 42 root: rootEntity, 43 43 }); 44 - let initialFacts = (data as unknown as Fact<keyof typeof Attributes>[]) || []; 44 + let initialFacts = (data as unknown as Fact<Attribute>[]) || []; 45 45 46 46 let oldEntityIDToNewID = {} as { [k: string]: string }; 47 47 let oldEntities = initialFacts.reduce((acc, f) => {
+3 -5
actions/publishToPublication.ts
··· 15 15 import { TID } from "@atproto/common"; 16 16 import { supabaseServerClient } from "supabase/serverClient"; 17 17 import { scanIndex, scanIndexLocal } from "src/replicache/utils"; 18 - import { Fact } from "src/replicache"; 19 - import { Attributes } from "src/replicache/attributes"; 18 + import type { Fact } from "src/replicache"; 19 + import type { Attribute } from "src/replicache/attributes"; 20 20 import { YJSFragmentToString } from "components/Blocks/TextBlock/RenderYJSFragment"; 21 21 import { ids } from "lexicons/api/lexicons"; 22 22 import { OmitKey } from "lexicons/api/util"; ··· 59 59 root: root_entity, 60 60 }); 61 61 62 - let scan = scanIndexLocal( 63 - (data as unknown as Fact<keyof typeof Attributes>[]) || [], 64 - ); 62 + let scan = scanIndexLocal((data as unknown as Fact<Attribute>[]) || []); 65 63 let images = blocks 66 64 .filter((b) => b.type === "image") 67 65 .map((b) => scan.eav(b.value, "block/image")[0]);
+1 -3
actions/subscriptions/confirmEmailSubscription.ts
··· 1 1 "use server"; 2 2 3 3 import { createClient } from "@supabase/supabase-js"; 4 - import { createIdentity } from "actions/createIdentity"; 5 4 import { and, eq, sql } from "drizzle-orm"; 6 5 import { drizzle } from "drizzle-orm/postgres-js"; 7 6 import { ··· 10 9 permission_tokens, 11 10 } from "drizzle/schema"; 12 11 import postgres from "postgres"; 13 - import { Fact, PermissionToken } from "src/replicache"; 14 - import { serverMutationContext } from "src/replicache/serverMutationContext"; 12 + import type { Fact } from "src/replicache"; 15 13 import { Database } from "supabase/database.types"; 16 14 import { v7 } from "uuid"; 17 15
+1 -1
actions/subscriptions/deleteSubscription.ts
··· 4 4 import { email_subscriptions_to_entity, facts } from "drizzle/schema"; 5 5 import postgres from "postgres"; 6 6 import { eq, and, sql } from "drizzle-orm"; 7 - import { Fact } from "src/replicache"; 7 + import type { Fact } from "src/replicache"; 8 8 import { v7 } from "uuid"; 9 9 10 10 export async function deleteSubscription(subscriptionID: string) {
+1 -1
actions/subscriptions/sendPostToSubscribers.ts
··· 6 6 import { drizzle } from "drizzle-orm/postgres-js"; 7 7 import { email_subscriptions_to_entity, entities } from "drizzle/schema"; 8 8 import postgres from "postgres"; 9 - import { PermissionToken } from "src/replicache"; 9 + import type { PermissionToken } from "src/replicache"; 10 10 import { Database } from "supabase/database.types"; 11 11 12 12 let supabase = createServerClient<Database>(
+3 -3
actions/subscriptions/subscribeToMailboxWithEmail.ts
··· 7 7 import { email_subscriptions_to_entity } from "drizzle/schema"; 8 8 import postgres from "postgres"; 9 9 import { getBlocksWithTypeLocal } from "src/hooks/queries/useBlocks"; 10 - import { Fact, PermissionToken } from "src/replicache"; 11 - import { Attributes } from "src/replicache/attributes"; 10 + import type { Fact, PermissionToken } from "src/replicache"; 11 + import type { Attribute } from "src/replicache/attributes"; 12 12 import { Database } from "supabase/database.types"; 13 13 import * as Y from "yjs"; 14 14 import { YJSFragmentToString } from "components/Blocks/TextBlock/RenderYJSFragment"; ··· 90 90 let { data } = await supabase.rpc("get_facts", { 91 91 root: root_entity, 92 92 }); 93 - let initialFacts = (data as unknown as Fact<keyof typeof Attributes>[]) || []; 93 + let initialFacts = (data as unknown as Fact<Attribute>[]) || []; 94 94 let firstPage = initialFacts.find((f) => f.attribute === "root/page") as 95 95 | Fact<"root/page"> 96 96 | undefined;
+2 -2
app/[leaflet_id]/Leaflet.tsx
··· 1 1 "use client"; 2 2 import { Fact, PermissionToken, ReplicacheProvider } from "src/replicache"; 3 - import { Attributes } from "src/replicache/attributes"; 3 + import type { Attribute } from "src/replicache/attributes"; 4 4 import { SelectionManager } from "components/SelectionManager"; 5 5 import { Pages } from "components/Pages"; 6 6 import { ··· 16 16 17 17 export function Leaflet(props: { 18 18 token: PermissionToken; 19 - initialFacts: Fact<keyof typeof Attributes>[]; 19 + initialFacts: Fact<Attribute>[]; 20 20 leaflet_id: string; 21 21 }) { 22 22 return (
+3 -4
app/[leaflet_id]/icon.tsx
··· 1 1 import { ImageResponse } from "next/og"; 2 - import { Fact } from "src/replicache"; 3 - import { Attributes } from "src/replicache/attributes"; 2 + import type { Fact } from "src/replicache"; 3 + import type { Attribute } from "src/replicache/attributes"; 4 4 import { Database } from "../../supabase/database.types"; 5 5 import { createServerClient } from "@supabase/ssr"; 6 6 import { parseHSBToRGB } from "src/utils/parseHSB"; ··· 36 36 let { data } = await supabase.rpc("get_facts", { 37 37 root: rootEntity, 38 38 }); 39 - let initialFacts = 40 - (data as unknown as Fact<keyof typeof Attributes>[]) || []; 39 + let initialFacts = (data as unknown as Fact<Attribute>[]) || []; 41 40 let themePageBG = initialFacts.find( 42 41 (f) => f.attribute === "theme/card-background", 43 42 ) as Fact<"theme/card-background"> | undefined;
+4 -4
app/[leaflet_id]/page.tsx
··· 2 2 import * as Y from "yjs"; 3 3 import * as base64 from "base64-js"; 4 4 5 - import { Fact } from "src/replicache"; 6 - import { Attributes } from "src/replicache/attributes"; 5 + import type { Fact } from "src/replicache"; 6 + import type { Attribute } from "src/replicache/attributes"; 7 7 import { YJSFragmentToString } from "components/Blocks/TextBlock/RenderYJSFragment"; 8 8 import { Leaflet } from "./Leaflet"; 9 9 import { scanIndexLocal } from "src/replicache/utils"; ··· 53 53 getRSVPData(res.data.permission_token_rights.map((ptr) => ptr.entity_set)), 54 54 getPollData(res.data.permission_token_rights.map((ptr) => ptr.entity_set)), 55 55 ]); 56 - let initialFacts = (data as unknown as Fact<keyof typeof Attributes>[]) || []; 56 + let initialFacts = (data as unknown as Fact<Attribute>[]) || []; 57 57 return ( 58 58 <PageSWRDataProvider 59 59 rsvp_data={rsvp_data} ··· 81 81 let { data } = await supabaseServerClient.rpc("get_facts", { 82 82 root: rootEntity, 83 83 }); 84 - let initialFacts = (data as unknown as Fact<keyof typeof Attributes>[]) || []; 84 + let initialFacts = (data as unknown as Fact<Attribute>[]) || []; 85 85 let scan = scanIndexLocal(initialFacts); 86 86 let firstPage = 87 87 scan.eav(rootEntity, "root/page")[0]?.data.value || rootEntity;
+4 -6
app/api/rpc/[command]/getFactsFromHomeLeaflets.ts
··· 1 1 import { z } from "zod"; 2 - import { Fact } from "src/replicache"; 3 - import { Attributes } from "src/replicache/attributes"; 2 + import type { Fact } from "src/replicache"; 3 + import type { Attribute } from "src/replicache/attributes"; 4 4 import { makeRoute } from "../lib"; 5 5 import { Env } from "./route"; 6 6 ··· 20 20 result: all_facts.data.reduce( 21 21 (acc, fact) => { 22 22 if (!acc[fact.root_id]) acc[fact.root_id] = []; 23 - acc[fact.root_id].push( 24 - fact as unknown as Fact<keyof typeof Attributes>, 25 - ); 23 + acc[fact.root_id].push(fact as unknown as Fact<Attribute>); 26 24 return acc; 27 25 }, 28 - {} as { [key: string]: Fact<keyof typeof Attributes>[] }, 26 + {} as { [key: string]: Fact<Attribute>[] }, 29 27 ), 30 28 }; 31 29 }
+3 -5
app/api/rpc/[command]/pull.ts
··· 4 4 PullResponseV1, 5 5 VersionNotSupportedResponse, 6 6 } from "replicache"; 7 - import { Fact } from "src/replicache"; 7 + import type { Fact } from "src/replicache"; 8 8 import { FactWithIndexes } from "src/replicache/utils"; 9 - import { Attributes } from "src/replicache/attributes"; 9 + import type { Attributes } from "src/replicache/attributes"; 10 10 import { makeRoute } from "../lib"; 11 11 import { Env } from "./route"; 12 12 ··· 95 95 return { 96 96 op: "put", 97 97 key: f.id, 98 - value: FactWithIndexes( 99 - f as unknown as Fact<keyof typeof Attributes>, 100 - ), 98 + value: FactWithIndexes(f as unknown as Fact<Attribute>), 101 99 } as const; 102 100 }), 103 101 ],
+2 -2
app/home/LeafletList.tsx
··· 6 6 import { Fact, ReplicacheProvider } from "src/replicache"; 7 7 import { LeafletPreview } from "./LeafletPreview"; 8 8 import { useIdentityData } from "components/IdentityProvider"; 9 - import { Attributes } from "src/replicache/attributes"; 9 + import type { Attribute } from "src/replicache/attributes"; 10 10 import { getIdentityData } from "actions/getIdentityData"; 11 11 import { callRPC } from "app/api/rpc/client"; 12 12 13 13 export function LeafletList(props: { 14 14 initialFacts: { 15 - [root_entity: string]: Fact<keyof typeof Attributes>[]; 15 + [root_entity: string]: Fact<Attribute>[]; 16 16 }; 17 17 }) { 18 18 let { data: localLeaflets } = useSWR("leaflets", () => getHomeDocs(), {
+1 -1
app/home/LeafletOptions.tsx
··· 1 1 "use client"; 2 2 3 3 import { Menu, MenuItem } from "components/Layout"; 4 - import { PermissionToken } from "src/replicache"; 4 + import type { PermissionToken } from "src/replicache"; 5 5 import { hideDoc } from "./storage"; 6 6 import { useState } from "react"; 7 7 import { ButtonPrimary } from "components/Buttons";
+5 -6
app/home/icon.tsx
··· 1 1 import { ImageResponse } from "next/og"; 2 - import { Fact } from "src/replicache"; 3 - import { Attributes } from "src/replicache/attributes"; 2 + import type { Fact } from "src/replicache"; 3 + import type { Attribute } from "src/replicache/attributes"; 4 4 import { Database } from "../../supabase/database.types"; 5 5 import { createServerClient } from "@supabase/ssr"; 6 6 import { parseHSBToRGB } from "src/utils/parseHSB"; ··· 49 49 let { data } = await supabase.rpc("get_facts", { 50 50 root: rootEntity, 51 51 }); 52 - let initialFacts = 53 - (data as unknown as Fact<keyof typeof Attributes>[]) || []; 52 + let initialFacts = (data as unknown as Fact<Attribute>[]) || []; 54 53 let themePageBG = initialFacts.find( 55 54 (f) => f.attribute === "theme/card-background", 56 55 ) as Fact<"theme/card-background"> | undefined; ··· 67 66 return new ImageResponse( 68 67 ( 69 68 // ImageResponse JSX element 70 - (<div style={{ display: "flex" }}> 69 + <div style={{ display: "flex" }}> 71 70 <svg 72 71 width="32" 73 72 height="32" ··· 91 90 fill={fillColor ? fillColor : "#272727"} 92 91 /> 93 92 </svg> 94 - </div>) 93 + </div> 95 94 ), 96 95 // ImageResponse options 97 96 {
+2 -2
app/home/page.tsx
··· 1 1 import { cookies } from "next/headers"; 2 2 import { Fact, ReplicacheProvider } from "src/replicache"; 3 - import { Attributes } from "src/replicache/attributes"; 3 + import type { Attribute } from "src/replicache/attributes"; 4 4 import { 5 5 ThemeBackgroundProvider, 6 6 ThemeProvider, ··· 76 76 : undefined, 77 77 ]); 78 78 let initialFacts = 79 - (homeLeafletFacts.data as unknown as Fact<keyof typeof Attributes>[]) || []; 79 + (homeLeafletFacts.data as unknown as Fact<Attribute>[]) || []; 80 80 81 81 let root_entity = permission_token.root_entity; 82 82 let home_docs_initialFacts = allLeafletFacts?.result || {};
+1 -1
app/home/storage.ts
··· 1 - import { PermissionToken } from "src/replicache"; 1 + import type { PermissionToken } from "src/replicache"; 2 2 import { mutate } from "swr"; 3 3 4 4 export type HomeDoc = {
-1
app/lish/[handle]/[publication]/DraftList.tsx
··· 1 1 "use client"; 2 2 3 - import { Fact, ReplicacheProvider } from "src/replicache"; 4 3 import { usePublicationRelationship } from "./usePublicationRelationship"; 5 4 import { usePublicationContext } from "components/Providers/PublicationContext"; 6 5 import Link from "next/link";
+5 -6
app/templates/icon.tsx
··· 2 2 // we could make it different so it's clear it's not your personal colors? 3 3 4 4 import { ImageResponse } from "next/og"; 5 - import { Fact } from "src/replicache"; 6 - import { Attributes } from "src/replicache/attributes"; 5 + import type { Fact } from "src/replicache"; 6 + import type { Attribute } from "src/replicache/attributes"; 7 7 import { Database } from "../../supabase/database.types"; 8 8 import { createServerClient } from "@supabase/ssr"; 9 9 import { parseHSBToRGB } from "src/utils/parseHSB"; ··· 52 52 let { data } = await supabase.rpc("get_facts", { 53 53 root: rootEntity, 54 54 }); 55 - let initialFacts = 56 - (data as unknown as Fact<keyof typeof Attributes>[]) || []; 55 + let initialFacts = (data as unknown as Fact<Attribute>[]) || []; 57 56 let themePageBG = initialFacts.find( 58 57 (f) => f.attribute === "theme/card-background", 59 58 ) as Fact<"theme/card-background"> | undefined; ··· 70 69 return new ImageResponse( 71 70 ( 72 71 // ImageResponse JSX element 73 - (<div style={{ display: "flex" }}> 72 + <div style={{ display: "flex" }}> 74 73 <svg 75 74 width="32" 76 75 height="32" ··· 94 93 fill={fillColor ? fillColor : "#272727"} 95 94 /> 96 95 </svg> 97 - </div>) 96 + </div> 98 97 ), 99 98 // ImageResponse options 100 99 {
+1 -1
components/Blocks/BlockCommands.tsx
··· 1 - import { Fact, ReplicacheMutators } from "src/replicache"; 1 + import type { Fact, ReplicacheMutators } from "src/replicache"; 2 2 import { useUIState } from "src/useUIState"; 3 3 4 4 import { generateKeyBetween } from "fractional-indexing";
+1 -1
components/Blocks/TextBlock/inputRules.ts
··· 5 5 } from "prosemirror-inputrules"; 6 6 import { MutableRefObject } from "react"; 7 7 import { Replicache } from "replicache"; 8 - import { ReplicacheMutators } from "src/replicache"; 8 + import type { ReplicacheMutators } from "src/replicache"; 9 9 import { BlockProps } from "../Block"; 10 10 import { focusBlock } from "src/utils/focusBlock"; 11 11 import { schema } from "./schema";
+1 -1
components/Blocks/TextBlock/keymap.ts
··· 12 12 } from "prosemirror-state"; 13 13 import { RefObject } from "react"; 14 14 import { Replicache } from "replicache"; 15 - import { ReplicacheMutators } from "src/replicache"; 15 + import type { ReplicacheMutators } from "src/replicache"; 16 16 import { elementId } from "src/utils/elementId"; 17 17 import { schema } from "./schema"; 18 18 import { useUIState } from "src/useUIState";
+1 -1
components/Blocks/TextBlock/useHandlePaste.ts
··· 14 14 import { markdownToHtml } from "src/htmlMarkdownParsers"; 15 15 import { betterIsUrl, isUrl } from "src/utils/isURL"; 16 16 import { TextSelection } from "prosemirror-state"; 17 - import { FilterAttributes } from "src/replicache/attributes"; 17 + import type { FilterAttributes } from "src/replicache/attributes"; 18 18 import { addLinkBlock } from "src/utils/addLinkBlock"; 19 19 import { UndoManager } from "src/undoManager"; 20 20
+8 -4
src/replicache/attributes.ts
··· 242 242 ...ImageBlockAttributes, 243 243 ...PollBlockAttributes, 244 244 }; 245 - type Attribute = typeof Attributes; 245 + export type Attributes = typeof Attributes; 246 + export type Attribute = keyof Attributes; 246 247 export type Data<A extends keyof typeof Attributes> = { 247 248 text: { type: "text"; value: string }; 248 249 string: { type: "string"; value: string }; ··· 316 317 }; 317 318 color: { type: "color"; value: string }; 318 319 }[(typeof Attributes)[A]["type"]]; 319 - export type FilterAttributes<F extends Partial<Attribute[keyof Attribute]>> = { 320 - [A in keyof Attribute as Attribute[A] extends F ? A : never]: Attribute[A]; 321 - }; 320 + export type FilterAttributes<F extends Partial<Attributes[keyof Attributes]>> = 321 + { 322 + [A in keyof Attributes as Attributes[A] extends F 323 + ? A 324 + : never]: Attributes[A]; 325 + };
+3 -3
src/replicache/clientMutationContext.ts
··· 39 39 }, 40 40 }, 41 41 async assertFact(f) { 42 - let attribute = Attributes[f.attribute as keyof typeof Attributes]; 42 + let attribute = Attributes[f.attribute as Attribute]; 43 43 if (!attribute) return; 44 44 let id = f.id || v7(); 45 45 let data = { ...f.data }; ··· 110 110 }, 111 111 async deleteEntity(entity) { 112 112 let existingFacts = await tx 113 - .scan<Fact<keyof typeof Attributes>>({ 113 + .scan<Fact<Attribute>>({ 114 114 indexName: "eav", 115 115 prefix: `${entity}`, 116 116 }) 117 117 .toArray(); 118 118 let references = await tx 119 - .scan<Fact<keyof typeof Attributes>>({ 119 + .scan<Fact<Attribute>>({ 120 120 indexName: "vae", 121 121 prefix: entity, 122 122 })
+7 -6
src/replicache/index.tsx
··· 17 17 WriteTransaction, 18 18 } from "replicache"; 19 19 import { mutations } from "./mutations"; 20 - import { Attributes, Data, FilterAttributes } from "./attributes"; 20 + import { Attributes } from "./attributes"; 21 + import { Attribute, Data, FilterAttributes } from "./attributes"; 21 22 import { clientMutationContext } from "./clientMutationContext"; 22 23 import { supabaseBrowserClient } from "supabase/browserClient"; 23 24 import { callRPC } from "app/api/rpc/client"; ··· 26 27 import { createUndoManager } from "src/undoManager"; 27 28 import { RealtimeChannel } from "@supabase/supabase-js"; 28 29 29 - export type Fact<A extends keyof typeof Attributes> = { 30 + export type Fact<A extends Attribute> = { 30 31 id: string; 31 32 entity: string; 32 33 attribute: A; ··· 37 38 undoManager: createUndoManager(), 38 39 rootEntity: "" as string, 39 40 rep: null as null | Replicache<ReplicacheMutators>, 40 - initialFacts: [] as Fact<keyof typeof Attributes>[], 41 + initialFacts: [] as Fact<Attribute>[], 41 42 permission_token: {} as PermissionToken, 42 43 }); 43 44 export function useReplicache() { ··· 65 66 }; 66 67 export function ReplicacheProvider(props: { 67 68 rootEntity: string; 68 - initialFacts: Fact<keyof typeof Attributes>[]; 69 + initialFacts: Fact<Attribute>[]; 69 70 token: PermissionToken; 70 71 name: string; 71 72 children: React.ReactNode; ··· 191 192 ); 192 193 } 193 194 194 - type CardinalityResult<A extends keyof typeof Attributes> = 195 + type CardinalityResult<A extends Attribute> = 195 196 (typeof Attributes)[A]["cardinality"] extends "one" 196 197 ? DeepReadonlyObject<Fact<A>> | null 197 198 : DeepReadonlyObject<Fact<A>>[]; 198 - export function useEntity<A extends keyof typeof Attributes>( 199 + export function useEntity<A extends Attribute>( 199 200 entity: string | null, 200 201 attribute: A, 201 202 ): CardinalityResult<A> {
+4 -4
src/replicache/mutations.ts
··· 11 11 permission_set: string; 12 12 }) => Promise<boolean>; 13 13 scanIndex: { 14 - eav: <A extends keyof typeof Attributes>( 14 + eav: <A extends Attribute>( 15 15 entity: string, 16 16 attribute: A, 17 17 ) => Promise<DeepReadonly<Fact<A>[]>>; 18 18 }; 19 19 deleteEntity: (entity: string) => Promise<void>; 20 - assertFact: <A extends keyof typeof Attributes>( 20 + assertFact: <A extends Attribute>( 21 21 f: Omit<Fact<A>, "id"> & { id?: string }, 22 22 ) => Promise<void>; 23 23 retractFact: (id: string) => Promise<void>; ··· 332 332 }; 333 333 334 334 export type FactInput = { 335 - [k in keyof typeof Attributes]: Omit<Fact<k>, "id"> & { id?: string }; 336 - }[keyof typeof Attributes]; 335 + [k in Attribute]: Omit<Fact<k>, "id"> & { id?: string }; 336 + }[Attribute]; 337 337 const assertFact: Mutation<FactInput | Array<FactInput>> = async ( 338 338 args, 339 339 ctx,
+1 -1
src/replicache/serverMutationContext.ts
··· 77 77 }, 78 78 async assertFact(f) { 79 79 if (!f.entity) return; 80 - let attribute = Attributes[f.attribute as keyof typeof Attributes]; 80 + let attribute = Attributes[f.attribute as Attribute]; 81 81 if (!attribute) return; 82 82 let id = f.id || v7(); 83 83 let data = { ...f.data };
+5 -8
src/replicache/utils.ts
··· 1 1 import { PostgresJsDatabase } from "drizzle-orm/postgres-js"; 2 2 import * as driz from "drizzle-orm"; 3 - import { Fact } from "."; 3 + import type { Fact } from "."; 4 4 import { replicache_clients } from "drizzle/schema"; 5 - import { Attributes, FilterAttributes } from "./attributes"; 5 + import type { Attribute, FilterAttributes } from "./attributes"; 6 6 import { ReadTransaction, WriteTransaction } from "replicache"; 7 7 8 - export function FactWithIndexes(f: Fact<keyof typeof Attributes>) { 8 + export function FactWithIndexes(f: Fact<Attribute>) { 9 9 let indexes: { 10 10 eav: string; 11 11 aev: string; ··· 42 42 } 43 43 44 44 export const scanIndex = (tx: ReadTransaction) => ({ 45 - async eav<A extends keyof typeof Attributes>( 46 - entity: string, 47 - attribute: A | "", 48 - ) { 45 + async eav<A extends Attribute>(entity: string, attribute: A | "") { 49 46 return ( 50 47 ( 51 48 await tx ··· 69 66 }); 70 67 71 68 export const scanIndexLocal = (initialFacts: Fact<any>[]) => ({ 72 - eav<A extends keyof typeof Attributes>(entity: string, attribute: A) { 69 + eav<A extends Attribute>(entity: string, attribute: A) { 73 70 return initialFacts.filter( 74 71 (f) => f.entity === entity && f.attribute === attribute, 75 72 ) as Fact<A>[];
+1 -1
src/utils/addImage.ts
··· 1 1 import { Replicache } from "replicache"; 2 2 import { ReplicacheMutators } from "../replicache"; 3 3 import { supabaseBrowserClient } from "supabase/browserClient"; 4 - import { FilterAttributes } from "src/replicache/attributes"; 4 + import type { FilterAttributes } from "src/replicache/attributes"; 5 5 import { rgbaToDataURL, rgbaToThumbHash, thumbHashToDataURL } from "thumbhash"; 6 6 import { v7 } from "uuid"; 7 7
+1 -1
src/utils/addLinkBlock.ts
··· 4 4 LinkPreviewMetadataResult, 5 5 } from "app/api/link_previews/route"; 6 6 import { Replicache } from "replicache"; 7 - import { ReplicacheMutators } from "src/replicache"; 7 + import type { ReplicacheMutators } from "src/replicache"; 8 8 import { AtpAgent } from "@atproto/api"; 9 9 import { v7 } from "uuid"; 10 10
+1 -1
src/utils/copySelection.ts
··· 1 1 import { getBlocksAsHTML } from "src/utils/getBlocksAsHTML"; 2 2 import { htmlToMarkdown } from "src/htmlMarkdownParsers"; 3 3 import { Replicache } from "replicache"; 4 - import { ReplicacheMutators } from "src/replicache"; 4 + import type { ReplicacheMutators } from "src/replicache"; 5 5 import { Block } from "components/Blocks/Block"; 6 6 7 7 export async function copySelection(
+1 -1
src/utils/getBlocksAsHTML.tsx
··· 1 1 import { ReadTransaction, Replicache } from "replicache"; 2 - import { Fact, ReplicacheMutators } from "src/replicache"; 2 + import type { Fact, ReplicacheMutators } from "src/replicache"; 3 3 import { scanIndex } from "src/replicache/utils"; 4 4 import { renderToStaticMarkup } from "react-dom/server"; 5 5 import * as Y from "yjs";
+1 -1
src/utils/list-operations.ts
··· 1 1 import { Block } from "components/Blocks/Block"; 2 2 import { Replicache } from "replicache"; 3 - import { ReplicacheMutators } from "src/replicache"; 3 + import type { ReplicacheMutators } from "src/replicache"; 4 4 import { useUIState } from "src/useUIState"; 5 5 import { v7 } from "uuid"; 6 6