Skip to content

Releases: SimplePDF/simplepdf-embed

@simplepdf/react-embed-pdf@1.12.1

Choose a tag to compare

@github-actions github-actions released this 30 Jun 08:47
e6a6029

Patch Changes

  • 9bc37de: Pin @simplepdf/embed to an exact version (0.6.0) instead of the ^0.6.0 caret. A published @simplepdf/react-embed-pdf now 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

Choose a tag to compare

@github-actions github-actions released this 30 Jun 08:24
8231f5d

Minor Changes

  • e91b4c7: Add a TanStack AI adapter (the /tanstack-ai subpath) 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, for chat({ tools })) and createSimplePDFTools({ embed }) (browser .client() tools for clientTools(...) then useChat({ 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/ai is a new optional peer, pulled only by the /tanstack-ai subpath; the package roots stay free of it (and of zod).
    • 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/embed root drops the internal helpers buildEditorDomain, encodeContext, isBridgeResultLike.
      • @simplepdf/embed/protocol drops the internal INTERNAL_PROTOCOL / InternalProtocolType (used only by the bridge).
      • @simplepdf/react-embed-pdf root no longer re-exports the whole @simplepdf/embed core or the wire-protocol vocabulary; import those from @simplepdf/embed / @simplepdf/embed/protocol directly.
      • @simplepdf/react-embed-pdf/ai-sdk no longer re-exports simplePDFToolDefinitions (import it from @simplepdf/embed/ai-sdk); the browser-side createSimplePDFExecutor stays. 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

Choose a tag to compare

@github-actions github-actions released this 30 Jun 08:24
8231f5d

Minor Changes

  • e91b4c7: Add a TanStack AI adapter (the /tanstack-ai subpath) 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, for chat({ tools })) and createSimplePDFTools({ embed }) (browser .client() tools for clientTools(...) then useChat({ 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/ai is a new optional peer, pulled only by the /tanstack-ai subpath; the package roots stay free of it (and of zod).
    • 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/embed root drops the internal helpers buildEditorDomain, encodeContext, isBridgeResultLike.
      • @simplepdf/embed/protocol drops the internal INTERNAL_PROTOCOL / InternalProtocolType (used only by the bridge).
      • @simplepdf/react-embed-pdf root no longer re-exports the whole @simplepdf/embed core or the wire-protocol vocabulary; import those from @simplepdf/embed / @simplepdf/embed/protocol directly.
      • @simplepdf/react-embed-pdf/ai-sdk no longer re-exports simplePDFToolDefinitions (import it from @simplepdf/embed/ai-sdk); the browser-side createSimplePDFExecutor stays. 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

Choose a tag to compare

@github-actions github-actions released this 29 Jun 09:15
b664d7b

Minor Changes

  • 980906d: Rebuilt on the @simplepdf/embed core, adding an AI-SDK-native agentic surface — a non-breaking superset of the existing component API.

    @simplepdf/react-embed-pdf no longer hand-rolls its own iframe bridge; it is a thin React layer over the shared @simplepdf/embed core (the same core web-embed-pdf and 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, onEmbedEvent still 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-sdk subpath exposes the agentic surface: useEmbedTools(embedRef) binds the tool registry to the live editor for the Vercel AI SDK (useChat({ tools })), plus simplePDFToolDefinitions (server) and createSimplePDFExecutor. It mirrors @simplepdf/embed's /ai-sdk, so the package root stays zod-free.
    • useEmbed().actions now exposes the FULL editor surface (camelCase): createField, getFields, setFieldValue, focusField, movePage, rotatePage, deletePages, download, … — not just the original six.
    • A typed document prop ({ url } | { dataUrl } | { file }), the same shape as createEmbed. It also accepts data URLs and File/Blob, and a SimplePDF documents URL loads directly (prefill etc.). documentURL is now @deprecated (still works) in favor of it.
    • An optional logger prop 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/embed core groups its handle as embed.actions / embed.events / embed.lifecycle; the React layer flattens it to keep the existing ref contract.)

    Imperative actions stay backward-compatible. selectTool and submit gained camelCase argument shapes to match the rest of the SDK (selectTool({ tool }), submit({ downloadCopy })), but the previous forms — selectTool(toolType) and submit({ downloadCopyOnDevice }) — still work as deprecated overloads that normalize to the new shape, so existing useEmbed().actions callers don't change. A relative documentURL / trigger href (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 returned bad_request:embed_ref_not_available). Code that checks result.success is 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. zod remains a peer dependency, now required only by the agentic /ai-sdk subpath (it validates tool input) — the package root (<EmbedPDF>, useEmbed) is zod-free, so a non-agentic app never loads it. Install zod only if you import /ai-sdk; npm 7+ adds it automatically, pnpm / Yarn PnP users add it explicitly.

Patch Changes

  • Updated dependencies [980906d]
    • @simplepdf/embed@0.5.0

@simplepdf/embed@0.5.0

Choose a tag to compare

@github-actions github-actions released this 29 Jun 09:32
b664d7b

Minor Changes

  • 980906d: camelCase SDK surface grouped into actions / events / lifecycle, companyIdentifier, and direct loading of SimplePDF documents URLs.

    • Grouped handle: createEmbed returns { 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 from embed-api.json and 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) for EDITOR_READY / DOCUMENT_LOADED / PAGE_FOCUSED / SUBMISSION_SENT, so the React layer's onEmbedEvent is unchanged.
    • companyIdentifier replaces tenant in createEmbed (it is the consumer's own SimplePDF subdomain — tenant read as if SimplePDF were multi-tenant per consumer).
    • Documents URLs load directly: when document.url is a <tenant>.<baseDomain>/documents/<id> URL (https, single tenant label), createEmbed navigates 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 /react subpath is removed); the editor iframe is granted clipboard-read; clipboard-write by default.

@simplepdf/react-embed-pdf@1.10.0

Choose a tag to compare

Minor Changes

  • cae5ce6: Adds new programmatic actions to the React embed component for advanced integrations: goTo, createField, clearFields, getDocumentContent

1.5.0

Choose a tag to compare

@bendersej bendersej released this 15 Sep 05:51

Features

  • Increase the screen real estate for the modal

@simplepdf/react-embed-pdf@1.3.0

Choose a tag to compare

@bendersej bendersej released this 03 Jan 06:34

Features

Documentation

  • Update documentation accordingly

Note: This release note has been written manually, and published after the release

1.2.1

Choose a tag to compare

@bendersej bendersej released this 20 Aug 14:20

Documentation

  • Add the license (MIT)

1.2.0

Choose a tag to compare

@bendersej bendersej released this 20 Aug 14:14

Features

  • Allow wrapping any element: either opening the chosen PDF document (via anchor tag) or the editor

Documentation

  • Update the documentation