Skip to content

Release v3.6.0

Latest

Choose a tag to compare

@github-actions github-actions released this 04 Dec 12:35
909b4f2

@embedpdf/web@3.6.0

Minor Changes

  • #1204 – A pointer that leaves a Stage or a <PageView> ends its hover, and a press on a <PageView> belongs to the pointer that started it. Before, a hover ended only on a move over the gap beside a page. A fast move off the page, a page that fills the Stage or a drag released outside left the tool's ghost (an armed stamp, a shape's outline) on the page, and onHoverChanged kept naming the annotation the pointer had left. Both pointer sources now listen to pointerleave and send the hub a move over no page, as the gap does: when the pointer leaves with no press in progress, or right after a press that ended outside.

    attachPagePointer(), the pointer source of <PageView> in React, Vue, Svelte and Angular, follows the Stage's rules for several pointers. Only the pointer that started a press moves and ends it, so a finger elsewhere on the screen no longer redirects or ends a pen's drag. A second finger on a finger's press cancels it, so a pinch on the page no longer draws. A mouse or pen press ignores other pointers, and a pointercancel cancels the press instead of leaving it open. Fixes #1130.

    For code that uses these helpers directly: StageGestureSink has an optional leave(event), which createStageSurface() gives. PagePointerSample has a 'cancel' phase, and its page is absent on the move that says the pointer left the page.

@embedpdf/plugin-signature@3.6.0

Minor Changes

  • #1207 – sign(), finish() and prepareSignature() take contentsSizeBytes: the room the file reserves for the signature, in bytes, from 256 to 4 MiB, as the engine's prepare() takes it. Left out, sign() and finish() work it out from the key as sign() of @embedpdf/core-signature does, and prepareSignature() reserves 8192, or 16384 with a timestamp authority, as before. A signature larger than its room is refused after the key signed, and a signature made for one room fits no other, so a signing service whose signatures may be larger, such as one that adds its own timestamp, can now be given room with a margin. The refusal's message names a room to ask for, which the plugin now takes.

Patch Changes

  • #1211 – A document closed while its signatures are being checked no longer reports an error. Before, closing a document moments after sign(), or after an edit to a signed document, made the kernel report a state update after the instance closed … dropped, and a close while the engine was still reading the signatures logged [signature] validation failed. A check that ends after the close now publishes nothing: no verdicts and no onValidated.
    • validate() and validateField() reject instance-closed the moment the document closes, without waiting for what their check is waiting for, such as the trust anchors. Before, they waited for it, then resolved and wrote their verdicts into the closed document. Once a call has published its verdicts it resolves, even when an onValidated listener closes the document.
    • No onValidated after the close starts. A store subscriber that closes the document as the verdicts land no longer hears an onValidated for them.
    • The newer of two overlapping checks wins. The plugin checks again by itself after the signatures load and after an edit; when a new check starts while one is running, the older one is cancelled. Before, whichever ended last was kept, which could be the older one.
    • validateField() resolves its own check's verdict. Before, it read the field's verdict from the last published verdicts, so a check the plugin started by itself, ending at the same moment, could answer in its place: with the working copy's verdict when until: 'persisted' was asked for.

@embedpdf/core@3.6.0

Minor Changes

  • #1211 – PluginContext has isOpen() and whileOpen(task), for a verb whose work its document can close under it.

    • isOpen() says whether the plugin instance is still open. It turns false the moment its document starts closing, or for a workspace plugin the moment the kernel starts being destroyed, and it already says false inside the store subscribers the close's own steps call. That is also when a state write starts being dropped and reported. A verb asks it right before it writes state or fires an event where the close can have come since its last check: a store subscriber can close the document while a state write runs, before the event that follows it.
    • whileOpen(task) waits for task while the instance is open. When it closes, the task is aborted if it can be, and the returned promise rejects instance-closed at once. It is for work a verb waits for that isn't the engine's, such as an app's callback or a network check; an engine call through ctx.doc ends at the close already. In ctx.cancellable(signal, ctx.whileOpen(task)), the caller's cancel reaches the task too: the promises both return carry abort(), as a call through ctx.doc does.

    The context from createTestContext() in @embedpdf/core/testing has both: closed once destroy() has started.

@embedpdf/core-signature@3.6.0

Minor Changes

  • #1208 – sign() works out the room for the signature when the call gives no contentsSizeBytes, and a signing service or timestamp authority can say how large its answers get with maxCmsBytes. A raw key's signature is measured from its certificates and key before it signs. A CMS key's room is its maxCmsBytes, which CmsSigner, remoteSigner() and httpTimestampAuthority() take, and a timestamp token adds its authority's maxCmsBytes, or 10 KB. The room is rounded up to 4096 and is never less than before, 8192, or 16384 with a timestamp authority, so a signing that fit keeps its room. A contentsSizeBytes that a raw key's signature can't fit is refused before the key signs, with SignatureRefused and details.reason: 'too-large'.

Patch Changes

  • #1209 – A certificate path that leads to one of your anchors is trusted when the certificates offered with it also hold a cross-signed copy of that anchor. Before, the copy, whose own issuer was not offered, stopped the search for every path: the signer or the timestamp's authority read as untrusted, and the reason named the anchor as a certificate without an issuer. DigiCert's public timestamp authority sends such a copy of "DigiCert Trusted Root G4" with its tokens, so its timestamps read as untrusted with that root among your anchors. A cross-signed intermediate whose other issuer is not offered did the same.

    The search now follows only issuers that lead to an anchor. A path that reaches an anchor and fails there for another reason, such as an expired certificate, gives that reason. Validation also finishes when two of the certificates offered issued each other; before, it never did.

@embedpdf/engine-core@3.6.0

Minor Changes

  • #1212 – runSignatureConformance() checks what a signing candidate's digest tells: two candidates of the same document with the same inputs and signing time have different digests, for a signature and a document timestamp, and a signed revision's /ID gets a new second half while an encrypted file keeps its first. SignatureConformanceFixtures takes an optional encrypted fixture with its password for the encrypted file. Layer sessions in the suite now open with every permission, as its other sessions do.

@embedpdf/engine-runtime@3.6.0

Patch Changes

  • #1212 – A signature's or a document timestamp's digest no longer lets anyone confirm a guess at the document. Every save of a signing candidate writes 16 new bytes from the system's secure random source as the second half of the file's /ID, encrypted files included, so two candidates of the same document with the same inputs and signing time have different digests. Before, an encrypted file kept its old second half, so two such candidates of an RC4 file were the same bytes, and a plain file's new bytes came from a generator with a 32-bit seed. Every other save draws its new /ID bytes from the same source.

    In WebAssembly, a save where the host has no crypto.getRandomValues now fails, returning nothing, instead of aborting the runtime with the save half done. Every browser (pages on http and workers included), Node 19 and later, and the edge runtimes have it.

Other packages

64 more packages get a new version with no changes of their own.