Add form field read-only control and signature interception bridge#3
Draft
mutumbakato wants to merge 4 commits into
Draft
Add form field read-only control and signature interception bridge#3mutumbakato wants to merge 4 commits into
mutumbakato wants to merge 4 commits into
Conversation
Exposes two native form capabilities through NutrientView on both the Legacy (Paper) and New (Fabric + TurboModule) architectures: - setFormFieldReadOnly(fullyQualifiedName, readOnly, persist): locks or unlocks a single form field. iOS maps persist=true to PSPDFFormField.isReadOnly (persisted PDF flag) and persist=false to isEditable (session-only). Android updates the LOCKEDCONTENTS flag on the field's widget annotations, preserving existing flags. - dismissSignaturePad(): dismisses the native signature creation UI when presented, resolving false otherwise. Type-checks the presented controller/fragment so unrelated UI is never dismissed. - interceptSignatureFields prop + onSignatureFieldTapped event: consumes taps on signature form fields (iOS PSPDFViewControllerDelegate tap handling, Android FormManager.OnFormElementClickedListener) and emits the field's fully qualified name and page index to JS instead of presenting the native signature UI. Verified with Catalog builds on both platforms (gradlew assembleDebug, xcodebuild), npm test, npm run lint, and regenerated types. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds a SignatureInterception example screen used to verify the new bridge at runtime on the Android emulator and iOS simulator via Maestro: signature tap interception (on/off), setFormFieldReadOnly lock/unlock, and dismissSignaturePad on an open and closed signature UI. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Standalone guide for customizing an SDK fork with the new APIs: public API semantics and platform differences, per-layer implementation walkthrough for both architectures, build/test instructions, runtime verification results, and packaging options. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
dismissSignaturePad only targeted the signature creation UI, so it worked on the first tap of a signature field but failed on later tries once a saved signature existed (or under the legacy signature flow), when the SDK presents the saved-signature picker instead. Android now scans candidate fragment managers for instances of both ElectronicSignatureFragment and SignaturePickerFragment (instanceof instead of tag lookup, since the picker's tag is private) and dismisses via the matching static helper. iOS now checks the entire presented navigation stack against the creation controller, the legacy signature controller, and PSPDFSignatureSelectorViewController. Verified on the Android emulator: after saving a signature, tapping the field opens the "Signatures" picker and dismissSignaturePad now closes it (previously returned false). Creation-UI cycles re-verified on both platforms; a signed field's annotation context menu is still correctly left alone (resolves false). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Author
Fix: repeated
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Exposes two native PDF form capabilities through
NutrientView, on both the Legacy (Paper) and New (Fabric + TurboModule) architectures, following the BRIDGING.md recipe:setFormFieldReadOnly(fullyQualifiedName, readOnly, persist?)— locks/unlocks a single form field. iOS mapspersist: truetoPSPDFFormField.isReadOnly(persisted PDF flag) andpersist: falsetoisEditable(session-only). Android updatesAnnotationFlags.LOCKEDCONTENTSon the field's widget annotations, preserving existing flags (READONLYis ignored for widgets, and Android'sFormFieldhas no read-only setter).interceptSignatureFieldsprop +onSignatureFieldTappedevent — consumes taps on signature form fields (iOSdidTapOnAnnotation:delegate, AndroidFormManager.OnFormElementClickedListener) and emits{fullyQualifiedName, pageIndex}to JS instead of presenting the native signature UI.dismissSignaturePad()— dismisses the native signature creation UI when presented (type-checked againstPSPDFSignatureCreationViewController/PSPDFSignatureViewControlleron iOS; located viaElectronicSignatureFragment.FRAGMENT_TAGon Android), resolvingfalseotherwise. Idempotent.Also included:
Verification
npm test(32/32),npm run lint,npm run build-and-generate-types— all pass.assembleDebug(compiles legacy + newarch source sets + codegen) and iOSxcodebuild— both succeed.dismissSignaturePad()with UI open →true, UI closeddismissSignaturePad()with nothing open →falseKnown caveat surfaced during testing: form interaction (and therefore interception) requires a writable document — Android
file:///android_asset/documents open read-only. Documented in the guide.Open items before undrafting
persist: falseshould reject on Android instead of behaving persistently.🤖 Generated with Claude Code