Skip to content

Commit 02fc895

Browse files
committed
MC-18601: Page Builder Render
1 parent 48ca393 commit 02fc895

File tree

21 files changed

+165
-229
lines changed

21 files changed

+165
-229
lines changed

app/code/Magento/PageBuilder/Block/Adminhtml/Stage/Render.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,6 @@ public function __construct(
3232
$this->fileManager = $fileManager;
3333
}
3434

35-
/**
36-
* @return string
37-
* @throws \Magento\Framework\Exception\LocalizedException
38-
*/
39-
public function getLocalStoragePolyfillIUrl() : string
40-
{
41-
$asset = $this->_assetRepo->createAsset('mage/polyfill.js');
42-
return $asset->getUrl();
43-
}
4435

4536
/**
4637
* Generate the URL to RequireJS

app/code/Magento/PageBuilder/view/adminhtml/templates/stage/render.phtml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
/** @var \Magento\PageBuilder\Block\Adminhtml\Stage\Render $block */
88
?>
99
<script type="text/javascript">
10-
// Shim localStorage as it won't work correctly in our sandboxed iframe
10+
<?php
11+
// Shim localStorage without detection as it will not work as the iframe is sandboxed.
12+
?>
1113
Object.defineProperty(
1214
window,
1315
'localStorage',
@@ -36,6 +38,9 @@
3638
<script type="text/javascript" src="<?= $block->escapeUrl($block->getRequireJsUrl()); ?>"></script>
3739
<script type="text/javascript" src="<?= $block->escapeUrl($block->getRequireJsConfigUrl()); ?>"></script>
3840
<script type="text/javascript">
41+
<?php
42+
// Override the text! RequireJS plugin to allow us to load templates from the parent window
43+
?>
3944
require.config({
4045
'map': {
4146
'*': {
@@ -44,20 +49,26 @@
4449
},
4550
});
4651

52+
<?php
53+
/**
54+
* To be able to override the text plugin we need the Magento template engine to be used, as the template engine
55+
* within lib has a dependency on the text! plugin we need to ensure we set the template engine before the
56+
* dependency blocks us.
57+
*/
58+
?>
4759
require([
4860
'ko',
4961
'Magento_Ui/js/lib/knockout/template/engine',
5062
], function (ko, templateEngine) {
5163
'use strict';
5264

5365
ko.uid = 0;
54-
5566
ko.setTemplateEngine(templateEngine);
5667
});
5768
</script>
5869
<script type="text/javascript">
5970
require(['Magento_PageBuilder/js/render/frame'], function (listen) {
60-
listen('<?= $block->escapeUrl($block->getBaseUrl()); ?>');
71+
listen();
6172
});
6273
</script>
6374
Page Builder Render Frame

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/master.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/observable-updater.js

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/master-format/render.js

Lines changed: 14 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/master-format/render/serialize.js

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/render/content-type.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/render/frame.js

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/render/requirejs/text.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/render/view-model.js

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)