release: v4.4.3#604
Merged
Merged
Conversation
test: added test cases for post message hook
…tances For multiple custom fields, show the edit modal button only on whole-field selection and suppress all toolbar actions (move, delete, form, add-instance) for individual instances. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…/click
When event.target.closest("[data-cslp]") returns null, fall back to
document.elementsFromPoint(clientX, clientY) so Visual Builder hover and
click detection can find a data-cslp element beneath an unrelated sibling
overlay (e.g. an empty CSS-grid spacer cell visually overlapping a text
column). Opt-in via overlayPropagation: { enable: true } in the LP init
config; default off so existing apps see no behavior change.
- src/types/types.ts: IConfigOverlayPropagation interface, added to
IInitData and IConfig.
- src/configManager/config.default.ts: default { enable: false } in both
getUserInitData and getDefaultConfig.
- src/configManager/handleUserConfig.ts: merge initData.overlayPropagation
onto Config, following the existing editButton fallback pattern.
- src/visualBuilder/utils/getCsDataOfElement.ts: elementsFromPoint
fallback when closest() misses, gated on the flag.
- Tests: 3 new cases in getCsDataOfElement.test.ts (fallback off, on,
on-with-no-match) and 3 cases in handleUserConfig.test.ts. vitest.setup
extends the existing elementFromPoint stub with elementsFromPoint.
- docs/live-preview-configs.md + README.md: new section describing the
flag and when to enable it; note that standalone LP Edit button support
is tracked separately (VB-1623).
Refs VB-1583. Related: VB-1616 (multi-instance focus), VB-1623 (standalone
LP edit button overlayPropagation follow-up).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Port the overlayPropagation bullet added to README.md in commit 44e6d4c so the template stays in sync and the entry survives README regeneration. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…dit button Add elementsFromPoint fallback inside addCslpOutline() gated on Config.get().overlayPropagation.enable so the floating Edit button can pierce blocking sibling overlays, matching the existing Visual Builder fix in getCsDataOfElement.ts. Add a throttled mousemove listener (100ms) in LivePreviewEditButton constructor (also gated on the flag) so the Edit button tracks the cursor while it moves within the interior of a blocking overlay element — mouseover alone does not re-fire in that case. Listener is cleaned up in destroy(). Extract a highlightCslpElement helper in cslpdata.ts to avoid duplicating the highlight logic between the composedPath loop and the elementsFromPoint fallback. Update docs/live-preview-configs.md to document both pipelines covered by the flag and remove the "Visual Builder only" note. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…dit button Add elementsFromPoint fallback inside addCslpOutline() gated on Config.get().overlayPropagation.enable so the floating Edit button can pierce blocking sibling overlays, matching the existing Visual Builder fix in getCsDataOfElement.ts. Add a throttled mousemove listener (100ms) in LivePreviewEditButton constructor (also gated on the flag) so the Edit button tracks the cursor while it moves within the interior of a blocking overlay element — mouseover alone does not re-fire in that case. Listener is cleaned up in destroy(). Fix a timing issue: the module-load effect creates LivePreviewEditButton before init() runs (config defaults apply). LivePreview constructor now calls destroy() on the effect-created instance before creating a new one with the correct init config, ensuring overlayPropagation and other user-provided config are honoured. Extract a highlightCslpElement helper in cslpdata.ts to avoid duplicating the highlight logic between the composedPath loop and the elementsFromPoint fallback. Update docs/live-preview-configs.md to document both pipelines covered by the flag and remove the "Visual Builder only" note. Tests: 3 new cases in cslpdata.test.ts (fallback off, on-finds-element, on-no-match) and 3 cases in editButtonAction.test.ts (no listener when disabled, listener added when enabled, listener removed on destroy). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
test: added unit test cases fo visual builder specific to mode
…tom field instances Treat multiple custom field instances as non-interactive elements — no hover outline, no custom cursor, no focus overlay or toolbar on click. Uses cached schema check (hasFieldSchema guard) to avoid blocking UI on cold cache. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…field-multiple-toolbar
…ntentstack/live-preview-sdk into VB-1583/custom-field-multiple-toolbar
…ance fieldPathWithIndex
…ent via closest() - Extract getParentCslp and getWholeFieldElement utils to derive parent CSLP and locate DOM ancestor without global querySelector - Handles V1 and V2 CSLP formats by stripping the trailing index segment from fieldMetadata.cslpValue instead of constructing CSLP from parts - Use closest() to find nearest matching ancestor, preventing wrong element dispatch when same CSLP appears multiple times in the page - Log debug message when whole-field parent is not found in DOM - Add unit tests for getWholeFieldElement utility Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…le-toolbar feat(VB-1583): restrict toolbar actions for multiple custom field instances
test: added test cases of useCollab / preview share
fix: added changes of new tab init related remaining code
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
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.
Live Preview SDK v4.4.3
Summary
Release v4.4.3 of
@contentstack/live-preview-utils. Adds theoverlayPropagationinit flag, hardens behavior around custom-field multiple instances, fixes new-tab init carryover, and lands sizeable unit-test coverage.What's changed
Features
overlayPropagationinit flag controls cslp hover/click propagation; extended to the standalone Live Preview Edit button.closest(), and restricted toolbar actions are scoped correctly.Fixes
fieldPathWithIndexinisCustomFieldMultipleInstanceto avoid runtime errors on partial instances.Tests
useCollab/ preview share, post-message hooks, and visual builder mode handling.mouseClick,mouseHover,editButtonAction,fieldToolbar,getCsDataOfElement,getWholeFieldElement,handleIndividualFields,isCustomFieldMultipleInstance, contentstack-live-preview HOC, and the visual-builder index.Docs
overlayPropagationin the config list (main.mustache) and clarified its hover/click detection behavior.Chores
4.4.3; CHANGELOG regenerated viaauto-changelog.@contentstack/live-preview-utils@4.4.3.Post-merge checklist
stage_v4→main)v4.4.3frommain(tag created via Release UI) — triggersnpm-publishworkflow@contentstack/live-preview-utils@4.4.3is published to npmhttps://esm.sh/@contentstack/live-preview-utils@4.4.3resolves