Overview

Code components may want to access window.drupalSettings. Which they can when they're rendered on a page or in the XB page preview. But not in the code editor preview currently, which is an empty iframe.

Proposed resolution

Pass drupalSettings to the code editor preview iframe in src/features/code-editor/Preview.tsx the same way we pass the compiled JavaScript to preview along with prop values and compiled JavaScript for slots.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

balintbrews created an issue. See original summary.

balintbrews’s picture

Assigned: balintbrews » Unassigned
Status: Active » Needs review
wim leers’s picture

Component: Page builder » Theme builder
Issue tags: +JavaScript

hooroomoo made their first commit to this issue’s fork.

hooroomoo’s picture

Status: Needs review » Fixed
Issue tags: -JavaScript +JavaScript

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.