feat(VCST-4933): support Shared Components in Page Builder preview - #2410
Open
ToxaKZ wants to merge 1 commit into
Open
feat(VCST-4933): support Shared Components in Page Builder preview#2410ToxaKZ wants to merge 1 commit into
ToxaKZ wants to merge 1 commit into
Conversation
…nked component overlay
ToxaKZ
requested review from
Andrew-Orlov,
goldenmaya,
ivan-kalachikov and
yuskithedeveloper
and removed request for
a team
July 31, 2026 04:31
|
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.



Description
Adds the Storefront preview support required by Page Builder Shared Components.
The published Storefront does not resolve or fetch Shared Components at runtime. The Page Builder module expands
componentRefplacements before Pages indexing, so public Storefront routes continue to receive ordinary Page Builder blocks.This PR implements the authoring-preview side:
Companion PageBuilder module PR
VirtoCommerce/vc-module-pagebuilder#159
Reactive Page Builder content
vp-page-builder.vuereparses incoming content whenever the Pages document changes. It updates the rendered page for cache/network replacements, validates the expected Page Builder shape, clears stale content when the new payload is empty or malformed, and preserves ordinary block rendering.Preview protocol and security
The preview
postMessagecontract is centralized and validated.Messages are accepted only when:
source;Asynchronous handling is serialized so an older locale or navigation update cannot overwrite newer preview state.
The
epquery parameter accepts only valid HTTP(S) URLs and is reduced to its clean origin. Malformed values andjavascript:/file:endpoints are rejected.Shared Component placement overlay
Designer sends a resolved template together with placement metadata:
The preview:
sequenceDiagram participant D as Page Builder Designer participant I as Storefront preview iframe participant O as Shared Component overlay I->>D: preview loaded and supported blocks D->>I: resolved template and placement boundaries I->>O: render anchors and boundaries O->>D: hover/select placementId D->>I: select/hover placementId I->>O: highlight or scroll to placementOverlay elements are authoring-only and are not part of business content.
Iframe lifecycle
A newly loaded or replaced iframe must complete its own
preview-loadedhandshake before queued messages are sent. Ready state from an old iframe is not reused.This prevents updates from being posted before the new iframe has installed its listener.
Published-page behavior
flowchart LR PB["Page Builder raw content"] -->|"resolve componentRef"| PI["Pages index"] PI -->|"ordinary expanded blocks"| SF["Storefront VPPageBuilder"]There is no production-time Storefront request to the Shared Components API. A component update becomes visible after the PageBuilder propagation job causes Pages to reindex affected published documents.
Verification
Covered scenarios include VPPageBuilder content replacement, malformed content clearing, protocol validation, message ordering, iframe reconnect, boundary normalization, overlay rendering/resize/hover/click/selection/scrolling, and endpoint validation.
References
QA-test:
Assume the Page Builder module and this Storefront build are already installed and configured.
1. Ordinary content regression
2. Shared Component preview boundary
3. Selection and navigation synchronization
4. Live component editing
5. Iframe lifecycle
6. Published Storefront integration
/designer-preview.7. Security validation
javascript:, andfile:epvalues do not establish a trusted Designer origin.Jira-link:
https://virtocommerce.atlassian.net/browse/VCST-4933
Artifact URL:
https://vc3prerelease.blob.core.windows.net/packages/vc-theme-b2b-vue-2.55.0-pr-2410-5afe-5afebbb3.zip