Kacper/UI customization updates#195
Open
sc0 wants to merge 3 commits into
Open
Conversation
MahmoudElsayad
approved these changes
Jun 11, 2026
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.
Update Web UI customization examples for Nutrient SDK 1.15.1
Refreshes the two web UI-customization examples to run on the latest SDK and adopt the updated UI customization callback API, plus a round of correctness fixes to the document-editor sidebar.
Why
The examples were pinned to
@nutrient-sdk/viewer@1.9.1and used the old UI customization callback signature, where the callback received theinstancedirectly. In current SDK versions the callback receives agetInstancegetter instead, so the examples broke when run against a recent SDK. This bumps both examples to1.15.1and migrates them to the new API, then fixes several bugs in the document-editor sidebar that surfaced along the way.Changes
Both examples
@nutrient-sdk/viewer1.9.1 → 1.15.1(lockfiles regenerated).getInstancerather thaninstance, so the instance is resolved viaconst instance = getInstance()insideonMount.web/ui-customizationcommentThreadslot callback to thegetInstancesignature.web/ui-customization-doc-editor-sidebarSIDEBAR_IDconstant (customDocumentEditorSidebar) used as both the sidebar slot key and thesidebarModeview-state value, with a typed cast so a custom id type-checks against the publishedsidebarModetype.width/height; new and duplicated pages now match a reference page's dimensions instead of a hardcoded300×400.movePages.Filebefore queuing the operation, so it doesn't depend on an original file handle the browser may invalidate before the operation runs.Original PR: #161
Related guides PR: https://github.com/PSPDFKit/nutrient-website/pull/2541