pds-dev-kit-web-test 0.3.61 → 0.3.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/sub/DynamicLayout/pagesPreviewMock.d.ts +1 -0
- package/dist/src/sub/DynamicLayout/pagesPreviewMock.js +3 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/EmbedIframe.js +22 -9
- package/package.json +1 -1
- package/release-note.md +2 -3
|
@@ -10,7 +10,8 @@ exports.EMBEDED_SAMPLES = {
|
|
|
10
10
|
CLEAN: '<div>CLEAN</div>',
|
|
11
11
|
SCRIPT2: '<script src="https:/hello.js" type="text/javascript" async></script>',
|
|
12
12
|
FACEBOOK: '<iframe src="https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fsminglive%2Fposts%2Fpfbid023o4i8jNwoh9B3bdQSXKcsKZiaU7rK8FuLtgGdt2crQugFWHA7aiPJZWxPpZMqTh3l&show_text=true&width=500" width="500"height="437"style="border:none;overflow:hidden"scrolling="no"frameborder="0"allowfullscreen="true"allow="autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"></iframe>',
|
|
13
|
-
ALERT: '<script>alert("this-is-no"); console.log("hi"); </script>'
|
|
13
|
+
ALERT: '<script>alert("this-is-no"); console.log("hi"); </script>',
|
|
14
|
+
DAUM: '<div id="daumRoughmapContainer1710850127862" class="root_daum_roughmap root_daum_roughmap_landing"></div><script charset="UTF-8" class="daum_roughmap_loader_script" src="https://ssl.daumcdn.net/dmaps/map_js_init/roughmapLoader.js"></script><script charset="UTF-8">new daum.roughmap.Lander({"timestamp": "1710850127862", "key": "2ikv7", "mapWidth": "640", "mapHeight": "360"}).render(); console.log(\'what is this\')</script>'
|
|
14
15
|
};
|
|
15
16
|
exports.sampleCustomsection1 = {
|
|
16
17
|
administrativeTitle: 'UNTITLED',
|
|
@@ -2038,7 +2039,7 @@ exports.sampleCustomsection5 = {
|
|
|
2038
2039
|
CB_CONTENT_PROP_HOVER_SPEC_MUSE: true
|
|
2039
2040
|
},
|
|
2040
2041
|
CB_CONTENT_PROP_CODEBLOCK: {
|
|
2041
|
-
CB_CONTENT_PROP_CODEBLOCK_SPEC_CODE: exports.EMBEDED_SAMPLES.
|
|
2042
|
+
CB_CONTENT_PROP_CODEBLOCK_SPEC_CODE: exports.EMBEDED_SAMPLES.DAUM
|
|
2042
2043
|
},
|
|
2043
2044
|
CB_CONTENT_PROP_VISIBILITY: {
|
|
2044
2045
|
CB_CONTENT_PROP_VISIBILITY_SPEC_DESKTOP: true,
|
|
@@ -11,24 +11,37 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
11
11
|
var react_1 = require("react");
|
|
12
12
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
13
13
|
var EmbedIframe = function (_a) {
|
|
14
|
+
// const blobUrl = useMemo(() => {
|
|
15
|
+
// return getCodeBlobUrl(embedCode, style);
|
|
16
|
+
// }, [embedCode]);
|
|
14
17
|
var embedCode = _a.embedCode, style = _a.style;
|
|
15
|
-
var
|
|
16
|
-
return
|
|
17
|
-
}, [embedCode]);
|
|
18
|
-
|
|
18
|
+
var parsedCode = (0, react_1.useMemo)(function () {
|
|
19
|
+
return getHtmlCode(embedCode, style);
|
|
20
|
+
}, [embedCode, style]);
|
|
21
|
+
var iframeRef = (0, react_1.useRef)(null);
|
|
22
|
+
(0, react_1.useLayoutEffect)(function () {
|
|
23
|
+
if (!iframeRef.current) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
var iframeDoc = iframeRef.current.contentDocument || iframeRef.current.contentWindow.document;
|
|
27
|
+
iframeDoc.open();
|
|
28
|
+
iframeDoc.write(parsedCode);
|
|
29
|
+
iframeDoc.close();
|
|
30
|
+
}, [parsedCode]);
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(S_Iframe, { ref: iframeRef, title: "\uD2B9\uBCC4\uD55C\uC774\uB984", sandbox: "allow-scripts allow-same-origin allow-forms" }));
|
|
19
32
|
};
|
|
20
33
|
var S_Iframe = styled_components_1.default.iframe(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border: none;\n height: 100%;\n width: 100%;\n"], ["\n border: none;\n height: 100%;\n width: 100%;\n"])));
|
|
21
|
-
function
|
|
34
|
+
function getHtmlCode(code, style) {
|
|
22
35
|
var styleString = Object.entries(style).reduce(function (styleStr, _a) {
|
|
23
36
|
var prop = _a[0], value = _a[1];
|
|
24
37
|
var kebabProp = prop.replace(/([a-z0])([A-Z])/g, '$1-$2').toLowerCase();
|
|
25
38
|
return "".concat(styleStr).concat(kebabProp, ": ").concat(value, ";");
|
|
26
39
|
}, '');
|
|
27
|
-
var fullCode = "\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <
|
|
40
|
+
var fullCode = "\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <style>\n html, body {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n ".concat(styleString, "\n }\n\n </style>\n </head>\n <body>\n ").concat(code, "\n </body>\n </html>\n ");
|
|
28
41
|
// Use a blob to handle potentially complex scripts and avoid encoding issues
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return
|
|
42
|
+
// const blob = new Blob([fullCode], { type: 'text/html' });
|
|
43
|
+
// const url = URL.createObjectURL(blob);
|
|
44
|
+
return fullCode;
|
|
32
45
|
}
|
|
33
46
|
exports.default = EmbedIframe;
|
|
34
47
|
var templateObject_1;
|
package/package.json
CHANGED
package/release-note.md
CHANGED