Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ playwright/.cache/
.kilocode/
.claude/
CLAUDE.md
prompts.txt

# amplify
.amplify
Expand Down
18 changes: 18 additions & 0 deletions bun-test-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,21 @@ global.document = dom.window.document
global.navigator = dom.window.navigator
global.HTMLElement = dom.window.HTMLElement
global.Element = dom.window.Element

// Suppress jsdom navigation warnings
const originalConsoleError = console.error
console.error = (...args: any[]) => {
const message = args[0]?.toString?.() || args[0]
if (message?.includes?.("navigation to another Document")) {
return
}
originalConsoleError(...args)
}
const originalConsoleWarn = console.warn
console.warn = (...args: any[]) => {
const message = args[0]?.toString?.() || args[0]
if (message?.includes?.("navigation to another Document")) {
return
}
originalConsoleWarn(...args)
}
8 changes: 5 additions & 3 deletions components/pdf-container/pdf-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createPluginRegistration } from "@embedpdf/core"
import { EmbedPDF } from "@embedpdf/core/react"
import { usePdfiumEngine } from "@embedpdf/engines/react"
import { ConsoleLogger } from "@embedpdf/models"
// import { AnnotationLayer, AnnotationPluginPackage } from "@embedpdf/plugin-annotation/react"
import { ExportPluginPackage } from "@embedpdf/plugin-export/react"
import { HistoryPluginPackage } from "@embedpdf/plugin-history/react"
import {
GlobalPointerProvider,
Expand All @@ -14,7 +14,7 @@ import { RenderLayer, RenderPluginPackage } from "@embedpdf/plugin-render/react"
import { Scroller, ScrollPluginPackage, ScrollStrategy } from "@embedpdf/plugin-scroll/react"
import { useRef } from "react"
import { Spinner } from "../shadcn-ui/spinner"
import { AnnotationToolbar } from "./annotation-toolbar"
import { Toolbar } from "./toolbar"
import { AnnotationLayer, AnnotationPluginPackage } from "./plugin-annotation-2"
// import { SearchLayer, SearchPluginPackage } from "@embedpdf/plugin-search/react"
import { SelectionLayer, SelectionPluginPackage } from "@embedpdf/plugin-selection/react"
Expand Down Expand Up @@ -82,6 +82,8 @@ export default function PDFContainer({ url }: PDFContainerProps) {
createPluginRegistration(SelectionPluginPackage),
// register Annotation after InteractionManager, Seletion, History
createPluginRegistration(AnnotationPluginPackage),
// register Export after Annotation
createPluginRegistration(ExportPluginPackage),
// register Zoom after InteractionManager, Viewport, Scroll
createPluginRegistration(ZoomPluginPackage, {
defaultZoomLevel: ZoomMode.Automatic,
Expand All @@ -91,7 +93,7 @@ export default function PDFContainer({ url }: PDFContainerProps) {
>
{({ pluginsReady }) => (
<GlobalPointerProvider>
<AnnotationToolbar data-testid="annotation-toolbar" />
<Toolbar data-testid="annotation-toolbar" />
<Viewport className="h-full w-full flex-1 overflow-auto bg-gray-100 select-none">
{!pluginsReady && (
<div className="flex h-full w-full items-center justify-center">
Expand Down
Loading