Releases: SimplePDF/simplepdf-embed
Release list
@simplepdf/react-embed-pdf@1.12.1
Patch Changes
- 9bc37de: Pin
@simplepdf/embedto an exact version (0.6.0) instead of the^0.6.0caret. A published@simplepdf/react-embed-pdfnow always installs the exact embed build it was tested against, giving us full control over the embed rollout: react ships a known embed version, and moving it is a deliberate release step rather than a caret range resolved at the consumer's install time.
@simplepdf/react-embed-pdf@1.12.0
Minor Changes
-
e91b4c7: Add a TanStack AI adapter (the
/tanstack-aisubpath) for client-side tool calling, alongside the existing Vercel AI SDK (/ai-sdk) adapter. Both wrap the same generated tool registry + bridge router, so the editor is drivable from either SDK with no duplicated logic.@simplepdf/embed/tanstack-ai:simplePDFToolDefinitions()(server, forchat({ tools })) andcreateSimplePDFTools({ embed })(browser.client()tools forclientTools(...)thenuseChat({ tools })).@simplepdf/react-embed-pdf/tanstack-ai:useEmbedTools(embedRef), the editor-bound client tools. Server definitions stay in the React-free core@simplepdf/embed/tanstack-ai, so a server route never pulls React in.@tanstack/aiis a new optional peer, pulled only by the/tanstack-aisubpath; the package roots stay free of it (and ofzod).- Public exports trimmed to the strict minimum. These are breaking removals, but the only consumer is copilot (migrated in lockstep), so they ship as a minor rather than a major:
@simplepdf/embedroot drops the internal helpersbuildEditorDomain,encodeContext,isBridgeResultLike.@simplepdf/embed/protocoldrops the internalINTERNAL_PROTOCOL/InternalProtocolType(used only by the bridge).@simplepdf/react-embed-pdfroot no longer re-exports the whole@simplepdf/embedcore or the wire-protocol vocabulary; import those from@simplepdf/embed/@simplepdf/embed/protocoldirectly.@simplepdf/react-embed-pdf/ai-sdkno longer re-exportssimplePDFToolDefinitions(import it from@simplepdf/embed/ai-sdk); the browser-sidecreateSimplePDFExecutorstays. Server tool-definitions now live only in the React-free core, so a server route never pulls React in.
Patch Changes
- Updated dependencies [e91b4c7]
- @simplepdf/embed@0.6.0
@simplepdf/embed@0.6.0
Minor Changes
-
e91b4c7: Add a TanStack AI adapter (the
/tanstack-aisubpath) for client-side tool calling, alongside the existing Vercel AI SDK (/ai-sdk) adapter. Both wrap the same generated tool registry + bridge router, so the editor is drivable from either SDK with no duplicated logic.@simplepdf/embed/tanstack-ai:simplePDFToolDefinitions()(server, forchat({ tools })) andcreateSimplePDFTools({ embed })(browser.client()tools forclientTools(...)thenuseChat({ tools })).@simplepdf/react-embed-pdf/tanstack-ai:useEmbedTools(embedRef), the editor-bound client tools. Server definitions stay in the React-free core@simplepdf/embed/tanstack-ai, so a server route never pulls React in.@tanstack/aiis a new optional peer, pulled only by the/tanstack-aisubpath; the package roots stay free of it (and ofzod).- Public exports trimmed to the strict minimum. These are breaking removals, but the only consumer is copilot (migrated in lockstep), so they ship as a minor rather than a major:
@simplepdf/embedroot drops the internal helpersbuildEditorDomain,encodeContext,isBridgeResultLike.@simplepdf/embed/protocoldrops the internalINTERNAL_PROTOCOL/InternalProtocolType(used only by the bridge).@simplepdf/react-embed-pdfroot no longer re-exports the whole@simplepdf/embedcore or the wire-protocol vocabulary; import those from@simplepdf/embed/@simplepdf/embed/protocoldirectly.@simplepdf/react-embed-pdf/ai-sdkno longer re-exportssimplePDFToolDefinitions(import it from@simplepdf/embed/ai-sdk); the browser-sidecreateSimplePDFExecutorstays. Server tool-definitions now live only in the React-free core, so a server route never pulls React in.
@simplepdf/react-embed-pdf@1.11.0
Minor Changes
-
980906d: Rebuilt on the
@simplepdf/embedcore, adding an AI-SDK-native agentic surface — a non-breaking superset of the existing component API.@simplepdf/react-embed-pdfno longer hand-rolls its own iframe bridge; it is a thin React layer over the shared@simplepdf/embedcore (the same coreweb-embed-pdfand future framework adapters sit on).The existing
<EmbedPDF>contract is preserved (drop-in): the props (companyIdentifier,documentURL,mode— still defaulting to"modal",onEmbedEvent,locale,baseDomain,context,className,style) and, crucially,onEmbedEventstill emits the editor's events VERBATIM:{ type: 'EDITOR_READY' | 'DOCUMENT_LOADED' | 'PAGE_FOCUSED' | 'SUBMISSION_SENT', data }with snake_case payloads.useEmbed()still returns{ embedRef, actions }.New (additive):
- A new opt-in
@simplepdf/react-embed-pdf/ai-sdksubpath exposes the agentic surface:useEmbedTools(embedRef)binds the tool registry to the live editor for the Vercel AI SDK (useChat({ tools })), plussimplePDFToolDefinitions(server) andcreateSimplePDFExecutor. It mirrors@simplepdf/embed's/ai-sdk, so the package root stays zod-free. useEmbed().actionsnow exposes the FULL editor surface (camelCase):createField,getFields,setFieldValue,focusField,movePage,rotatePage,deletePages,download, … — not just the original six.- A typed
documentprop ({ url } | { dataUrl } | { file }), the same shape ascreateEmbed. It also accepts data URLs and File/Blob, and a SimplePDF documents URL loads directly (prefill etc.).documentURLis now@deprecated(still works) in favor of it. - An optional
loggerprop surfaces the bridge's structured lifecycle/error logging. - The forwarded
ref(embedRef.current) stays the flat actions handle —embedRef.current.selectTool(...), etc. — now exposing the full camelCase action set. (The framework-free@simplepdf/embedcore groups its handle asembed.actions/embed.events/embed.lifecycle; the React layer flattens it to keep the existing ref contract.)
Imperative actions stay backward-compatible.
selectToolandsubmitgained camelCase argument shapes to match the rest of the SDK (selectTool({ tool }),submit({ downloadCopy })), but the previous forms —selectTool(toolType)andsubmit({ downloadCopyOnDevice })— still work as deprecated overloads that normalize to the new shape, so existinguseEmbed().actionscallers don't change. A relativedocumentURL/ triggerhref(e.g./form.pdf) is still accepted — it is resolved against the page URL, as before.One behavioral note: calling an action before
<EmbedPDF>has mounted now resolves to{ success: false, error: { code: 'unexpected:iframe_not_mounted' } }(the previous form returnedbad_request:embed_ref_not_available). Code that checksresult.successis unaffected; only code branching on the exact pre-mount error string needs updating.Packaging is preserved: still dual CJS + ESM, so
require()consumers keep working.zodremains a peer dependency, now required only by the agentic/ai-sdksubpath (it validates tool input) — the package root (<EmbedPDF>,useEmbed) is zod-free, so a non-agentic app never loads it. Installzodonly if you import/ai-sdk; npm 7+ adds it automatically, pnpm / Yarn PnP users add it explicitly. - A new opt-in
Patch Changes
- Updated dependencies [980906d]
- @simplepdf/embed@0.5.0
@simplepdf/embed@0.5.0
Minor Changes
-
980906d: camelCase SDK surface grouped into
actions/events/lifecycle,companyIdentifier, and direct loading of SimplePDF documents URLs.- Grouped handle:
createEmbedreturns{ actions, events, lifecycle }—embed.actions.*(operations),embed.events.on(type, handler)(subscriptions),embed.lifecycle.dispose()(teardown). - camelCase everywhere on the SDK, with the snake_case wire kept behind a transform owned by the bridge: method names + their arguments + results + the agentic tool names/args are camelCase (
embed.actions.getFields(),embed.actions.setFieldValue({ fieldId, value }),embed.actions.submit({ downloadCopy }),tools.getDocumentContent). The editor's snake_case wire is generated fromembed-api.jsonand transformed at the postMessage boundary — consumers never see it. - Events are the deliberate exception:
embed.events.on(type, handler)delivers the editor's outbound payloads VERBATIM (snake_case fields, e.g.document_id) forEDITOR_READY/DOCUMENT_LOADED/PAGE_FOCUSED/SUBMISSION_SENT, so the React layer'sonEmbedEventis unchanged. companyIdentifierreplacestenantincreateEmbed(it is the consumer's own SimplePDF subdomain —tenantread as if SimplePDF were multi-tenant per consumer).- Documents URLs load directly: when
document.urlis a<tenant>.<baseDomain>/documents/<id>URL (https, single tenant label),createEmbednavigates the iframe straight to it (carrying?context=) instead of host-fetching — so prefilled/stored documents open as themselves. - The React layer moved OUT of this package into
@simplepdf/react-embed-pdf(the/reactsubpath is removed); the editor iframe is grantedclipboard-read; clipboard-writeby default.
- Grouped handle:
@simplepdf/react-embed-pdf@1.10.0
Minor Changes
- cae5ce6: Adds new programmatic actions to the React embed component for advanced integrations: goTo, createField, clearFields, getDocumentContent
1.5.0
@simplepdf/react-embed-pdf@1.3.0
Features
Documentation
- Update documentation accordingly
Note: This release note has been written manually, and published after the release