@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, andonHoverChangedkept naming the annotation the pointer had left. Both pointer sources now listen topointerleaveand 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 apointercancelcancels the press instead of leaving it open. Fixes #1130.For code that uses these helpers directly:
StageGestureSinkhas an optionalleave(event), whichcreateStageSurface()gives.PagePointerSamplehas a'cancel'phase, and itspageis absent on the move that says the pointer left the page.
@embedpdf/plugin-signature@3.6.0
Minor Changes
- #1207 –
sign(),finish()andprepareSignature()takecontentsSizeBytes: the room the file reserves for the signature, in bytes, from 256 to 4 MiB, as the engine'sprepare()takes it. Left out,sign()andfinish()work it out from the key assign()of@embedpdf/core-signaturedoes, andprepareSignature()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 reporta 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 noonValidated.validate()andvalidateField()rejectinstance-closedthe 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 anonValidatedlistener closes the document.- No
onValidatedafter the close starts. A store subscriber that closes the document as the verdicts land no longer hears anonValidatedfor 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 whenuntil: 'persisted'was asked for.
@embedpdf/core@3.6.0
Minor Changes
-
#1211 –
PluginContexthasisOpen()andwhileOpen(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 fortaskwhile the instance is open. When it closes, the task is aborted if it can be, and the returned promise rejectsinstance-closedat 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 throughctx.docends at the close already. Inctx.cancellable(signal, ctx.whileOpen(task)), the caller's cancel reaches the task too: the promises both return carryabort(), as a call throughctx.docdoes.
The context from
createTestContext()in@embedpdf/core/testinghas both: closed oncedestroy()has started.
@embedpdf/core-signature@3.6.0
Minor Changes
- #1208 –
sign()works out the room for the signature when the call gives nocontentsSizeBytes, and a signing service or timestamp authority can say how large its answers get withmaxCmsBytes. A raw key's signature is measured from its certificates and key before it signs. A CMS key's room is itsmaxCmsBytes, whichCmsSigner,remoteSigner()andhttpTimestampAuthority()take, and a timestamp token adds its authority'smaxCmsBytes, 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. AcontentsSizeBytesthat a raw key's signature can't fit is refused before the key signs, withSignatureRefusedanddetails.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/IDgets a new second half while an encrypted file keeps its first.SignatureConformanceFixturestakes an optionalencryptedfixture with itspasswordfor 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/IDbytes from the same source.In WebAssembly, a save where the host has no
crypto.getRandomValuesnow 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.