Skip to content

Commit cae5ce6

Browse files
authored
feat: new react-embed actions (#23)
## Background Adds new programmatic actions to the React embed component for advanced integrations. Closes: - #3 - #5 ## Changes - Add `goTo({ page })` action to navigate to a specific page - Add `createField({ type, page, x, y, width, height, value? })` action to programmatically create annotation fields - Add `clearFields({ fieldIds?, page? })` action to remove fields by ID or page - Add `getDocumentContent({ extractionMode? })` action to extract document content (supports OCR) - Introduce `ActionResult<TData>` discriminated union for typed action responses - Increase request timeout from 5s to 30s to support OCR extraction - Add test coverage - Update documentation
1 parent d3c5f42 commit cae5ce6

19 files changed

+2924
-278
lines changed

.changeset/long-paths-tell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@simplepdf/react-embed-pdf": minor
3+
---
4+
5+
Adds new programmatic actions to the React embed component for advanced integrations: goTo, createField, clearFields, getDocumentContent

.github/workflows/react.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ jobs:
3838

3939
- name: Types
4040
run: npm run test:types
41+
42+
- name: Tests
43+
run: npm test

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ chrome-extension/release/
1010
chrome-extension/release.zip
1111

1212
.claude/
13-
.wrangler/
13+
.wrangler/
14+
15+
coverage

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib"
3+
}

0 commit comments

Comments
 (0)