Skip to content

release: v4.5.1 - #647

Merged
kirtesh-cstk merged 10 commits into
mainfrom
stage_v4
Sep 11, 2026
Merged

kirtesh-cstk merged 10 commits into
mainfrom
stage_v4

Conversation

@kirtesh-cstk

Copy link
Copy Markdown
Contributor

Live Preview SDK v4.5.1

Summary

A patch release. It carries the dompurify XSS patch that was never published, and the edit button now returns the editor to the page it was opened from instead of the site root.

What's changed

Fixes

  • Edit button: sends the page the editor was on to the CMS, so returning to the entry keeps the reader's page instead of falling back to the base URL.
  • Security: dompurify bumped to patch the XSS advisory, along with the npm audit fix that came with it.

Refactoring

  • Live preview's own query params live in one list, so the strip-and-forward logic no longer keeps two copies in sync.

Tests

  • api key placeholder values standardized across the specs.

Chores

  • Version bump to 4.5.1; CHANGELOG regenerated via auto-changelog.
  • README CDN snippet pinned to @contentstack/live-preview-utils@4.5.1.
  • develop_v4 and stage_v4 back-merged, and the CODEOWNERS edit that landed on main directly is merged back in.

Post-merge checklist

  • Merge this PR (stage_v4 to main)
  • Create GitHub Release v4.5.1 from main (tag created via the Release UI), which triggers the npm-publish workflow
  • Verify @contentstack/live-preview-utils@4.5.1 is published to npm
  • Verify the CDN URL https://esm.sh/@contentstack/live-preview-utils@4.5.1 resolves

🤖 Generated with Claude Code

kirtesh-cstk and others added 10 commits August 10, 2026 17:07
The edit button linked to the entry and field but said nothing about the
page it was clicked from. The CMS cannot work that out from the entry
alone: a referenced entry can be rendered on several pages, and a nested
one has no page among the entries that directly reference it. Without it
the live preview panel falls back to the environment base URL.

The redirect URL now carries the current page as preview-url, which the CMS
already understands. Live preview's own query parameters are stripped so
only the page remains.

Co-Authored-By: Claude <noreply@anthropic.com>
The copier in addLivePreviewQueryTags and the stripper in getCurrentPageUrl
are inverse operations on the same set of parameters, and each carried its
own copy of it. Adding a parameter to one and not the other would have let a
preview parameter ride back into preview-url.

Both now read LIVE_PREVIEW_QUERY_PARAMS. getCurrentPageUrl drops that list
plus cslp-buttons, which the edit button reads off the page URL but must not
be forwarded onto internal links.

Also drops preview_variant from the strip list. It appears nowhere else in
src, so it was guarding against a parameter that does not exist.

The copier no longer requires content_type_uid and entry_uid to be present
together. Neither the SDK nor the panel produces a URL with one and not the
other, and setConfigFromParams already reads them independently.

Co-Authored-By: Claude <noreply@anthropic.com>
…view-url

fix(edit-button): send the page the editor was on to the CMS
@kirtesh-cstk
kirtesh-cstk requested a review from a team as a code owner September 10, 2026 10:39
@snyk-io

snyk-io Bot commented Sep 10, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 67.43% 2530 / 3752
🔵 Statements 66.28% 2570 / 3877
🔵 Functions 64.71% 453 / 700
🔵 Branches 61.98% 1531 / 2470
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/livePreview/editButton/editButton.ts 96.66% 89.59% 100% 97.74% 109-110, 181, 268, 413, 451, 573, 601, 648
src/utils/addLivePreviewQueryTags.ts 90% 50% 100% 90% 10
src/utils/getCurrentPageUrl.ts 70% 75% 100% 75% 25, 32-33
src/utils/livePreviewQueryParams.constant.ts 100% 100% 100% 100%
Generated in workflow #905 for commit b482d5a by the Vitest Coverage Report Action

@karancs06 karancs06 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!!

@kirtesh-cstk
kirtesh-cstk merged commit d7cb612 into main Sep 11, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants