Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d88384b
Add example pdf
jdmcleod Feb 4, 2026
a0659a8
Add pdf js
jdmcleod Feb 4, 2026
2d36230
Add pdf worker and some UI
jdmcleod Feb 4, 2026
d683914
Add copilot instructions
jdmcleod Feb 4, 2026
bea8b8a
Add component hierarchy
jdmcleod Feb 4, 2026
cf219f7
WIP
jdmcleod Feb 4, 2026
1330f8a
Make scrollable
jdmcleod Feb 4, 2026
db9b4c0
Text highlighting
jdmcleod Feb 4, 2026
dfe3f9d
Account for device pixel ratio
jdmcleod Feb 4, 2026
f3784f5
Extract pdf page component
jdmcleod Feb 4, 2026
186ef6f
Remove updated() from pdf-thumbnail
julliancalkins Feb 4, 2026
0a5aa18
Prevent simultaineous rendering
julliancalkins Feb 4, 2026
dbbc894
Prefix components
jdmcleod Feb 4, 2026
5258668
Catch RenderingCancelledException errors
julliancalkins Feb 4, 2026
d36072d
Fix text selection
jdmcleod Feb 4, 2026
9322494
Fix scrolling to selected page
julliancalkins Feb 4, 2026
d7cef33
Add icons and Rubik font
jdmcleod Feb 4, 2026
503581f
Use system font
jdmcleod Feb 4, 2026
3fa4825
Implement print button
jdmcleod Feb 4, 2026
b71837d
Implement download button
jdmcleod Feb 4, 2026
1b54415
Collapsible sidebar
jdmcleod Feb 4, 2026
456ec87
Allow manually inputting page number
jdmcleod Feb 4, 2026
edea299
Style updates
jdmcleod Feb 4, 2026
66605d7
Theme color
jdmcleod Feb 4, 2026
2bc7cd4
Make text highlight color be themed
jdmcleod Feb 4, 2026
f0c107c
Only scroll when necessary
julliancalkins Feb 4, 2026
3e473fa
Extract more css variables
jdmcleod Feb 4, 2026
9b3784f
Apply scrolling to page input
julliancalkins Feb 4, 2026
c38e009
Scroll sidebar alongside the canvas
julliancalkins Feb 4, 2026
f8c532b
Add titles for tooltips
julliancalkins Feb 4, 2026
754da5e
Add release script
jdmcleod Feb 4, 2026
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
16 changes: 16 additions & 0 deletions .github/instructions/css.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
applyTo: '**/*.css,**/*.scss'
---

SCSS is used for styling, but avoid using mixins. Use BEM methodology for class naming.

## CSS Library
We use Optics for our CSS library. It provides a set of components and tokens that should be used
to maintain consistency across the application. Consider if the component you are creating should be a modifier of an existing component before creating a new one.

## CSS Variables
Avoid adding in fallbacks for CSS variables. See the list of available Optics tokens in the
`.github/docs/optics/tokens.json` file.

## Specificity
Never use `!important`. Always make the selector more specific to solve those issues.
11 changes: 11 additions & 0 deletions .github/instructions/js.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
applyTo: "**/*.js,**/*.mjs,**/*.cjs"
---

- Prefer ESM syntax for JavaScript files, and avoid using CommonJS syntax unless the file is already CommonJS.
- Important: Never use semicolons at the end of statements.
- Use single quotes for strings, except when the string contains a single quote, in which case use double quotes.
- Use `const` for variables that are not reassigned, and `let` for variables that are reassigned.

## Frameworks and Libraries
- Use [Lit](https://lit.dev/) for building web components.
18 changes: 18 additions & 0 deletions .github/instructions/project.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
applyTo: '**/*'
---
## Project Context
This project is a collection of web components developed by RoleModel Software, designed to enhance web applications with reusable UI elements. The PDF Viewer component leverages PDF.js to provide a customizable and embeddable PDF viewing experience.

## General
- Do not create summary markdown files after making changes

## Tech Stack
- Lit for web components
- PDF.js for PDF rendering

## Response
- Provide evidence-based responses to feedback, focusing on technical accuracy and clarity.
- Maintain a professional and constructive tone in all communications.
- Avoid unnecessary embellishments or emotional language; focus on the task at hand.
— Avoid unnecessary comments; the code should be self-explanatory.
20 changes: 20 additions & 0 deletions .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Deploy to NPM

on:
release:
types: [published]

jobs:
build-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: yarn install --immutable
- run: yarn build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# spider
Shared web components library
# Spider web components
i By RoleModel Software

# PDF Viewer

[PDF.js](https://mozilla.github.io/pdf.js) is awesome, but you will notice this paragraph in their setup instructions:
> The viewer is built on the display layer and is the UI for PDF viewer in Firefox and the other browser extensions within the project. It can be a good starting point for building your own viewer. However, we do ask if you plan to embed the viewer in your own site, that it not just be an unmodified version. Please re-skin it or build upon it.
This component aims to be that skin layer built upon PDF.js packaged in a lovely drop-in web component.
Binary file added data/example.pdf
Binary file not shown.
Binary file added data/the-veldt.pdf
Binary file not shown.
5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
<!-- <link rel="icon" type="image/svg+xml" href="/vite.svg" />-->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Spider Web Components</title>
<script type="module" src="/src/components/pdf-viewer/pdf-viewer.js"></script>
<script type="module" src="/src/components/pdf-viewer/rm-pdf-viewer.js"></script>
<link rel="stylesheet" href="/src/assets/application.css" />
</head>
<body>
<pdf-viewer></pdf-viewer>
<rm-pdf-viewer src="/data/the-veldt.pdf" theme-hue="217" theme-saturation="89"></rm-pdf-viewer>
</body>
</html>
Loading