pds-dev-kit-web-test 0.3.63 → 0.3.64
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/desktop/components/DesktopAlertDialog/DesktopAlertDialog.js +2 -0
- package/dist/src/sub/DynamicLayout/pagesPreviewMock.d.ts +4 -416
- package/dist/src/sub/DynamicLayout/pagesPreviewMock.js +10 -599
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlockMatcher.js +0 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/types.d.ts +0 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/types.d.ts +4 -11
- package/dist/src/sub/DynamicLayout/sections/CustomSection/types.js +0 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseProperties.d.ts +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/types.d.ts +1 -11
- package/package.json +1 -3
- package/release-note.md +7 -6
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/Embed.d.ts +0 -5
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/Embed.js +0 -45
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/EmbedCore.d.ts +0 -8
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/EmbedCore.js +0 -75
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/EmbedIframe.d.ts +0 -10
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/EmbedIframe.js +0 -49
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/constant.d.ts +0 -4
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/constant.js +0 -99
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/sanitizeEmbedCode.d.ts +0 -9
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/sanitizeEmbedCode.js +0 -44
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/types.d.ts +0 -6
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/types.js +0 -2
- package/webhook/node_modules/esrecurse/.babelrc +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { CB_BTN_PROPERTIES_TYPE, CB_DIVIDER_PROPERTIES_TYPE,
|
|
1
|
+
import type { CB_BTN_PROPERTIES_TYPE, CB_DIVIDER_PROPERTIES_TYPE, CB_IMG_PROPERTIES_TYPE, CB_RICHTEXT_PROPERTIES_TYPE, CB_TEXT_PROPERTIES_TYPE, CB_TWITTER_PROPERTIES_TYPE, CB_YOUTUBE_PROPERTIES_TYPE } from './util/types';
|
|
2
2
|
export type CB_TYPES = 'GENERAL';
|
|
3
|
-
export type ComponentBlock = CB_TEXT_TYPE | CB_BTN_TYPE | CB_RICHTEXT | CB_DIVIDER | CB_IMG | CB_YOUTUBE | CB_TWITTER
|
|
3
|
+
export type ComponentBlock = CB_TEXT_TYPE | CB_BTN_TYPE | CB_RICHTEXT | CB_DIVIDER | CB_IMG | CB_YOUTUBE | CB_TWITTER;
|
|
4
4
|
type GeneralCustomSectionType = {
|
|
5
5
|
id: number;
|
|
6
6
|
type: 'GENERAL';
|
|
@@ -17,7 +17,7 @@ export type GroupCustomSectionType = {
|
|
|
17
17
|
queryableDefinitionPreset: string;
|
|
18
18
|
dynamicLayoutSectionId: number;
|
|
19
19
|
};
|
|
20
|
-
export type AllCBProperties = CB_TEXT_PROPERTIES_TYPE | CB_BTN_PROPERTIES_TYPE | CB_RICHTEXT_PROPERTIES_TYPE | CB_RICHTEXT_PROPERTIES_TYPE | CB_DIVIDER_PROPERTIES_TYPE | CB_YOUTUBE_PROPERTIES_TYPE | CB_IMG_PROPERTIES_TYPE | CB_TWITTER_PROPERTIES_TYPE
|
|
20
|
+
export type AllCBProperties = CB_TEXT_PROPERTIES_TYPE | CB_BTN_PROPERTIES_TYPE | CB_RICHTEXT_PROPERTIES_TYPE | CB_RICHTEXT_PROPERTIES_TYPE | CB_DIVIDER_PROPERTIES_TYPE | CB_YOUTUBE_PROPERTIES_TYPE | CB_IMG_PROPERTIES_TYPE | CB_TWITTER_PROPERTIES_TYPE;
|
|
21
21
|
export type CB_TEXT_TYPE = GeneralCustomSectionType & {
|
|
22
22
|
componentBlockCode: CB_ALL_CODES.CB_TEXT;
|
|
23
23
|
jsonProperties: {
|
|
@@ -60,12 +60,6 @@ export type CB_TWITTER = GeneralCustomSectionType & {
|
|
|
60
60
|
data: CB_TWITTER_PROPERTIES_TYPE;
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
|
-
export type CB_IFRAME = GeneralCustomSectionType & {
|
|
64
|
-
componentBlockCode: CB_ALL_CODES.CB_EMBED;
|
|
65
|
-
jsonProperties: {
|
|
66
|
-
data: CB_TWITTER_PROPERTIES_TYPE;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
63
|
export declare enum CB_ALL_CODES {
|
|
70
64
|
CB_TEXT = "CB_TEXT",
|
|
71
65
|
CB_BTN = "CB_BTN",
|
|
@@ -73,7 +67,6 @@ export declare enum CB_ALL_CODES {
|
|
|
73
67
|
CB_DIVIDER = "CB_DIVIDER",
|
|
74
68
|
CB_IMG = "CB_IMG",
|
|
75
69
|
CB_YOUTUBE = "CB_YOUTUBE",
|
|
76
|
-
CB_TWITTER = "CB_TWITTER"
|
|
77
|
-
CB_EMBED = "CB_EMBED"
|
|
70
|
+
CB_TWITTER = "CB_TWITTER"
|
|
78
71
|
}
|
|
79
72
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CB_LAYOUT_PROP_KEYS } from './layoutPropParsers/types';
|
|
2
2
|
import { CB_STYLE_PROP_KEYS } from './stylePropParsers/types';
|
|
3
|
-
import type { Device, ParserResult, CB_TEXT_PROPERTIES_TYPE, CB_BTN_PROPERTIES_TYPE, CB_IMG_PROPERTIES_TYPE, CB_TWITTER_PROPERTIES_TYPE, CB_DIVIDER_PROPERTIES_TYPE, CB_YOUTUBE_PROPERTIES_TYPE, CB_RICHTEXT_PROPERTIES_TYPE
|
|
3
|
+
import type { Device, ParserResult, CB_TEXT_PROPERTIES_TYPE, CB_BTN_PROPERTIES_TYPE, CB_IMG_PROPERTIES_TYPE, CB_TWITTER_PROPERTIES_TYPE, CB_DIVIDER_PROPERTIES_TYPE, CB_YOUTUBE_PROPERTIES_TYPE, CB_RICHTEXT_PROPERTIES_TYPE } from './types';
|
|
4
4
|
export type specTypes = CB_LAYOUT_PROP_KEYS | CB_STYLE_PROP_KEYS;
|
|
5
|
-
export default function parseProperties(properties: CB_TEXT_PROPERTIES_TYPE | CB_BTN_PROPERTIES_TYPE | CB_IMG_PROPERTIES_TYPE | CB_TWITTER_PROPERTIES_TYPE | CB_DIVIDER_PROPERTIES_TYPE | CB_YOUTUBE_PROPERTIES_TYPE | CB_RICHTEXT_PROPERTIES_TYPE
|
|
5
|
+
export default function parseProperties(properties: CB_TEXT_PROPERTIES_TYPE | CB_BTN_PROPERTIES_TYPE | CB_IMG_PROPERTIES_TYPE | CB_TWITTER_PROPERTIES_TYPE | CB_DIVIDER_PROPERTIES_TYPE | CB_YOUTUBE_PROPERTIES_TYPE | CB_RICHTEXT_PROPERTIES_TYPE, device: Device): ParserResult;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CB_BTNTEXT_STYLE_PROPS, CB_STYLE_PROP_BTNCOLOR_SPECS } from '../components/ComponentBlock/componentBlocks/Button/btnTypes';
|
|
2
2
|
import type { CB_STYLE_PROP_TEXT_SPECS } from '../components/ComponentBlock/componentBlocks/Text/types';
|
|
3
3
|
import type { CB_TWITTER_STYLE_PROPS } from '../components/ComponentBlock/componentBlocks/Twitter/types';
|
|
4
|
-
import type { CB_CONTENT_PROP_CLINK,
|
|
4
|
+
import type { CB_CONTENT_PROP_CLINK, CB_CONTENT_PROP_IMAGE, CB_CONTENT_PROP_TEXT, CB_CONTENT_PROP_TWITTER } from '../components/ComponentBlock/componentBlocks/types';
|
|
5
5
|
import type { CB_CONTENT_PROP_YOUTUBE_TYPE, CB_STYLE_PROP_BGCOLOR_SPECS } from '../components/ComponentBlock/componentBlocks/Youtube/types';
|
|
6
6
|
import type { CB_CONTENT_PROP_VISIBILITY_SPECS } from './contentPropParsers/parseContentVisibility';
|
|
7
7
|
import type { CB_EFFECT_PROP_ENTANIM_SPECS } from './effectPropParsers/parseEffectPropEntAnim';
|
|
@@ -82,16 +82,6 @@ export type CB_TWITTER_PROPERTIES_TYPE = CB_GENERAL_PROPERTIES_TYPE & {
|
|
|
82
82
|
CB_LAYOUT_PROP_PADDING: CB_LAYOUT_PROP_PADDING_SPECS;
|
|
83
83
|
CB_EFFECT_PROP_ENTANIM: CB_EFFECT_PROP_ENTANIM_SPECS;
|
|
84
84
|
};
|
|
85
|
-
export type CB_EMBED_PROPERTIES_TYPE = CB_GENERAL_PROPERTIES_TYPE & {
|
|
86
|
-
CB_CONTENT_PROP_CODEBLOCK: CB_CONTENT_PROP_CODEBLOCK;
|
|
87
|
-
CB_CONTENT_PROP_VISIBILITY: CB_CONTENT_PROP_VISIBILITY_SPECS;
|
|
88
|
-
CB_STYLE_PROP_SHADOW: CB_STYLE_PROP_SHADOW_SPECS;
|
|
89
|
-
CB_STYLE_PROP_BGCOLOR: CB_STYLE_PROP_BGCOLOR_SPECS;
|
|
90
|
-
CB_STYLE_PROP_OPACITY: CB_STYLE_PROP_TEXT_OPACITY_SPECS;
|
|
91
|
-
CB_LAYOUT_PROP_PADDING: CB_LAYOUT_PROP_PADDING_SPECS;
|
|
92
|
-
CB_LAYOUT_PROP_ARRANGE: CB_LAYOUT_PROP_ARRANGE_SPECS;
|
|
93
|
-
CB_EFFECT_PROP_ENTANIM: CB_EFFECT_PROP_ENTANIM_SPECS;
|
|
94
|
-
};
|
|
95
85
|
export type CB_RICHTEXT_PROPERTIES_TYPE = CB_GENERAL_PROPERTIES_TYPE & {
|
|
96
86
|
CB_CONTENT_PROP_TEXTEDIT: {
|
|
97
87
|
CB_CONTENT_PROP_TEXTEDIT_SPEC_EDITOR: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pds-dev-kit-web-test",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.64",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"@types/google-spreadsheet": "^3.1.5",
|
|
16
16
|
"@types/react": "^17.0.27",
|
|
17
17
|
"@types/react-dom": "^17.0.9",
|
|
18
|
-
"dompurify": "^3.0.9",
|
|
19
18
|
"dotenv": "^8.2.0",
|
|
20
19
|
"google-spreadsheet": "^3.1.15",
|
|
21
20
|
"i18next": "^21.3.2",
|
|
@@ -84,7 +83,6 @@
|
|
|
84
83
|
"@storybook/node-logger": "^6.3.12",
|
|
85
84
|
"@storybook/preset-create-react-app": "^3.2.0",
|
|
86
85
|
"@storybook/react": "^6.3.12",
|
|
87
|
-
"@types/dompurify": "^3.0.5",
|
|
88
86
|
"@types/lodash": "^4.14.175",
|
|
89
87
|
"@types/node": "^16.10.2",
|
|
90
88
|
"@types/react-router-dom": "^5.3.3",
|
package/release-note.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
#
|
|
2
|
-
## [
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
# PDS-DEV-KIT-WEB Release Notes
|
|
2
|
+
## [v2.2.57]
|
|
3
|
+
## daily|https://design.storybook.publ.biz/
|
|
4
|
+
|
|
5
|
+
### Component
|
|
6
|
+
* BasicListItem
|
|
7
|
+
* MainButton과 Switch 우측의 스페이싱 제거
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
-
var react_1 = require("react");
|
|
19
|
-
var DynamicLayout_1 = require("../../../../../../../DynamicLayout");
|
|
20
|
-
var hooks_1 = require("../../../../hooks");
|
|
21
|
-
var util_1 = require("../../../../util");
|
|
22
|
-
var S_CB_AnimationObserverBox_1 = require("../components/S_CB_AnimationObserverBox");
|
|
23
|
-
var S_CB_BoxWithShadow_1 = require("../components/S_CB_BoxWithShadow");
|
|
24
|
-
var EmbedIframe_1 = __importDefault(require("./EmbedIframe"));
|
|
25
|
-
function Embed(props) {
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
27
|
-
var _a = (0, react_1.useContext)(DynamicLayout_1.dynamicLayoutContext), device = _a.device, mode = _a.mode;
|
|
28
|
-
var CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM, index = props.index;
|
|
29
|
-
var CB_CONTENT_PROP_CODEBLOCK_SPEC_CODE = props.CB_CONTENT_PROP_CODEBLOCK.CB_CONTENT_PROP_CODEBLOCK_SPEC_CODE, CB_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW;
|
|
30
|
-
var _b = (0, util_1.parseProperties)(props, device), style = _b.style, hoverStyle = _b.hoverStyle, layout = _b.layout, effect = _b.effect;
|
|
31
|
-
var cbRef = (0, react_1.useRef)(null);
|
|
32
|
-
var entry = (0, hooks_1.useIntersectionObserver)(cbRef, { threshold: 0.2, freezeOnceVisible: false }, [
|
|
33
|
-
index
|
|
34
|
-
]);
|
|
35
|
-
var isVisible = !!(entry === null || entry === void 0 ? void 0 : entry.isIntersecting);
|
|
36
|
-
var effectCssProperties = isVisible ? effect : {};
|
|
37
|
-
var editModeStyle = mode === 'EDIT' ? { pointerEvents: 'none' } : {};
|
|
38
|
-
var isNoneEffectType = device === 'DESKTOP'
|
|
39
|
-
? CB_EFFECT_PROP_ENTANIM.CB_EFFECT_PROP_ENTANIM_SPEC_TYPE === 'NONE'
|
|
40
|
-
: CB_EFFECT_PROP_ENTANIM['CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE'] === 'NONE';
|
|
41
|
-
var hasEffect = !isNoneEffectType;
|
|
42
|
-
var effectVisibleStyle = hasEffect ? { opacity: isVisible ? 1 : 0 } : {};
|
|
43
|
-
return ((0, jsx_runtime_1.jsx)(S_CB_AnimationObserverBox_1.S_CB_AnimationObserverBox, __assign({ ref: hasEffect ? cbRef : null, effectVisibleStyle: effectVisibleStyle }, { children: (0, jsx_runtime_1.jsx)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign({}, style), layout), effectCssProperties), editModeStyle), hoverStyle: hoverStyle, cbStylePropsShadowSpecs: CB_STYLE_PROP_SHADOW, device: device }, { children: (0, jsx_runtime_1.jsx)(EmbedIframe_1.default, { embedCode: CB_CONTENT_PROP_CODEBLOCK_SPEC_CODE, mode: mode, style: layout }) })) })));
|
|
44
|
-
}
|
|
45
|
-
exports.default = Embed;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { DynamicLayoutProps } from '../../../../../../../DynamicLayout/types';
|
|
3
|
-
interface EmbedCoreProps {
|
|
4
|
-
embedCode: string;
|
|
5
|
-
mode: DynamicLayoutProps['mode'];
|
|
6
|
-
}
|
|
7
|
-
declare const EmbedCore: React.FC<EmbedCoreProps>;
|
|
8
|
-
export default EmbedCore;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(o, k2, desc);
|
|
13
|
-
}) : (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
o[k2] = m[k];
|
|
16
|
-
}));
|
|
17
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
-
}) : function(o, v) {
|
|
20
|
-
o["default"] = v;
|
|
21
|
-
});
|
|
22
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
-
if (mod && mod.__esModule) return mod;
|
|
24
|
-
var result = {};
|
|
25
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
-
__setModuleDefault(result, mod);
|
|
27
|
-
return result;
|
|
28
|
-
};
|
|
29
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
30
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
31
|
-
if (ar || !(i in from)) {
|
|
32
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
33
|
-
ar[i] = from[i];
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
37
|
-
};
|
|
38
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
-
};
|
|
41
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
43
|
-
var DOMPurify = __importStar(require("dompurify"));
|
|
44
|
-
var styled_components_1 = __importDefault(require("styled-components"));
|
|
45
|
-
var constant_1 = require("./constant");
|
|
46
|
-
var PURIFY_CONFIG = {
|
|
47
|
-
ADD_TAGS: constant_1.PURIFY_BLOCK_TAGS,
|
|
48
|
-
ADD_ATTR: constant_1.PURIFY_BLOCK_ATTRS
|
|
49
|
-
};
|
|
50
|
-
var EmbedCore = function (_a) {
|
|
51
|
-
var embedCode = _a.embedCode, mode = _a.mode;
|
|
52
|
-
var sanitized = DOMPurify.sanitize(embedCode, PURIFY_CONFIG);
|
|
53
|
-
DOMPurify.addHook('afterSanitizeAttributes', function (node) {
|
|
54
|
-
if (node.tagName === 'IFRAME') {
|
|
55
|
-
node.setAttribute('sandbox', 'allow-scripts allow-same-origin allow-forms');
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
if (DOMPurify.removed.length > 0 && mode === 'EDIT') {
|
|
59
|
-
var message = removedMessage(DOMPurify.removed).join("\n");
|
|
60
|
-
return (0, jsx_runtime_1.jsx)(S_Error, { children: message });
|
|
61
|
-
}
|
|
62
|
-
// eslint-disable-next-line react/no-danger
|
|
63
|
-
return (0, jsx_runtime_1.jsx)(S_EmbedCore, { dangerouslySetInnerHTML: { __html: sanitized } });
|
|
64
|
-
};
|
|
65
|
-
function removedMessage(removed) {
|
|
66
|
-
return removed.reduce(function (acc, cur) {
|
|
67
|
-
var key = Object.keys(cur)[0];
|
|
68
|
-
var message = "".concat(key, ":").concat(cur[key].localName, " is not allowed.");
|
|
69
|
-
return __spreadArray(__spreadArray([], acc, true), [message], false);
|
|
70
|
-
}, []);
|
|
71
|
-
}
|
|
72
|
-
var S_Error = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n background-color: red;\n display: flex;\n height: 100%;\n justify-content: center;\n white-space: pre-line;\n width: 100%;\n"], ["\n align-items: center;\n background-color: red;\n display: flex;\n height: 100%;\n justify-content: center;\n white-space: pre-line;\n width: 100%;\n"])));
|
|
73
|
-
var S_EmbedCore = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-items: inherit;\n display: inherit;\n flex-direction: inherit;\n height: inherit;\n justify-content: inherit;\n width: inherit;\n"], ["\n align-items: inherit;\n display: inherit;\n flex-direction: inherit;\n height: inherit;\n justify-content: inherit;\n width: inherit;\n"])));
|
|
74
|
-
exports.default = EmbedCore;
|
|
75
|
-
var templateObject_1, templateObject_2;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { CSSProperties } from 'styled-components';
|
|
3
|
-
import type { DynamicLayoutProps } from '../../../../../../../DynamicLayout/types';
|
|
4
|
-
interface EmbedCoreProps {
|
|
5
|
-
embedCode: string;
|
|
6
|
-
mode: DynamicLayoutProps['mode'];
|
|
7
|
-
style: CSSProperties;
|
|
8
|
-
}
|
|
9
|
-
declare const EmbedIframe: React.FC<EmbedCoreProps>;
|
|
10
|
-
export default EmbedIframe;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
11
|
-
var react_1 = require("react");
|
|
12
|
-
var styled_components_1 = __importDefault(require("styled-components"));
|
|
13
|
-
var EmbedIframe = function (_a) {
|
|
14
|
-
// const blobUrl = useMemo(() => {
|
|
15
|
-
// return getCodeBlobUrl(embedCode, style);
|
|
16
|
-
// }, [embedCode]);
|
|
17
|
-
var embedCode = _a.embedCode, style = _a.style;
|
|
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",
|
|
32
|
-
// sandbox="allow-scripts allow-same-origin allow-forms"
|
|
33
|
-
allow: "accelerometer; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; clipboard-write;", sandbox: "allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts allow-downloads allow-pointer-lock" }));
|
|
34
|
-
};
|
|
35
|
-
var S_Iframe = styled_components_1.default.iframe(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border: none;\n display: block;\n height: 100%;\n width: 100%;\n"], ["\n border: none;\n display: block;\n height: 100%;\n width: 100%;\n"])));
|
|
36
|
-
function getHtmlCode(code, style) {
|
|
37
|
-
var styleString = Object.entries(style).reduce(function (styleStr, _a) {
|
|
38
|
-
var prop = _a[0], value = _a[1];
|
|
39
|
-
var kebabProp = prop.replace(/([a-z0])([A-Z])/g, '$1-$2').toLowerCase();
|
|
40
|
-
return "".concat(styleStr).concat(kebabProp, ": ").concat(value, ";");
|
|
41
|
-
}, '');
|
|
42
|
-
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 display: inline-flex !important;\n ".concat(styleString, "\n }\n\n body > div { \n flex-grow: 1;\n width: 100%;\n }\n </style>\n </head>\n <body>\n\n ").concat(code, "\n\n </body>\n </html>\n ");
|
|
43
|
-
// Use a blob to handle potentially complex scripts and avoid encoding issues
|
|
44
|
-
// const blob = new Blob([fullCode], { type: 'text/html' });
|
|
45
|
-
// const url = URL.createObjectURL(blob);
|
|
46
|
-
return fullCode;
|
|
47
|
-
}
|
|
48
|
-
exports.default = EmbedIframe;
|
|
49
|
-
var templateObject_1;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PURIFY_BLOCK_ATTRS = exports.PURIFY_BLOCK_TAGS = exports.attrBlacklist = exports.tagBlacklist = void 0;
|
|
4
|
-
exports.tagBlacklist = [
|
|
5
|
-
// 'script',
|
|
6
|
-
// 'iframe',
|
|
7
|
-
'object',
|
|
8
|
-
'embed',
|
|
9
|
-
'applet',
|
|
10
|
-
// 'link',
|
|
11
|
-
'meta',
|
|
12
|
-
'style'
|
|
13
|
-
];
|
|
14
|
-
exports.attrBlacklist = [
|
|
15
|
-
'onerror',
|
|
16
|
-
'onload',
|
|
17
|
-
'onclick',
|
|
18
|
-
'onmouseover',
|
|
19
|
-
'onfocus',
|
|
20
|
-
'onblur',
|
|
21
|
-
'onchange',
|
|
22
|
-
// 'href',
|
|
23
|
-
// 'src',
|
|
24
|
-
// 'style',
|
|
25
|
-
'target'
|
|
26
|
-
];
|
|
27
|
-
exports.PURIFY_BLOCK_TAGS = [
|
|
28
|
-
'applet',
|
|
29
|
-
'base',
|
|
30
|
-
'basefont',
|
|
31
|
-
'command',
|
|
32
|
-
'embed',
|
|
33
|
-
'frame',
|
|
34
|
-
'frameset',
|
|
35
|
-
'iframe',
|
|
36
|
-
'keygen',
|
|
37
|
-
'link',
|
|
38
|
-
'meta',
|
|
39
|
-
'noframes',
|
|
40
|
-
'noscript',
|
|
41
|
-
'object',
|
|
42
|
-
'param',
|
|
43
|
-
'script',
|
|
44
|
-
'title'
|
|
45
|
-
];
|
|
46
|
-
exports.PURIFY_BLOCK_ATTRS = [
|
|
47
|
-
'accept-charset',
|
|
48
|
-
'accesskey',
|
|
49
|
-
'allow',
|
|
50
|
-
'allowfullscreen',
|
|
51
|
-
'async',
|
|
52
|
-
'autocapitalize',
|
|
53
|
-
'autofocus',
|
|
54
|
-
'autoplay',
|
|
55
|
-
'buffered',
|
|
56
|
-
'challenge',
|
|
57
|
-
'charset',
|
|
58
|
-
'code',
|
|
59
|
-
'codebase',
|
|
60
|
-
'content',
|
|
61
|
-
'contenteditable',
|
|
62
|
-
'contextmenu',
|
|
63
|
-
'controls',
|
|
64
|
-
'data',
|
|
65
|
-
'decoding',
|
|
66
|
-
'defer',
|
|
67
|
-
'dirname',
|
|
68
|
-
'draggable',
|
|
69
|
-
'dropzone',
|
|
70
|
-
'form',
|
|
71
|
-
'formaction',
|
|
72
|
-
'http-equiv',
|
|
73
|
-
'icon',
|
|
74
|
-
'importance',
|
|
75
|
-
'itemprop',
|
|
76
|
-
'keytype',
|
|
77
|
-
'kind',
|
|
78
|
-
'language',
|
|
79
|
-
'lazyload',
|
|
80
|
-
'manifest',
|
|
81
|
-
'minlength',
|
|
82
|
-
'muted',
|
|
83
|
-
'ping',
|
|
84
|
-
'sandbox',
|
|
85
|
-
'scoped',
|
|
86
|
-
'slot',
|
|
87
|
-
'spellcheck',
|
|
88
|
-
'srcdoc',
|
|
89
|
-
'srclang',
|
|
90
|
-
'start',
|
|
91
|
-
'target',
|
|
92
|
-
'translate',
|
|
93
|
-
'wrap',
|
|
94
|
-
'referrerpolicy',
|
|
95
|
-
'frameborder',
|
|
96
|
-
'scrolling',
|
|
97
|
-
'marginheight',
|
|
98
|
-
'marginwidth'
|
|
99
|
-
];
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var constant_1 = require("./constant");
|
|
4
|
-
function sanitizeEmbedCode(embedCode) {
|
|
5
|
-
try {
|
|
6
|
-
var parser = new DOMParser();
|
|
7
|
-
var doc = parser.parseFromString(embedCode, 'text/html');
|
|
8
|
-
var scripts_1 = [];
|
|
9
|
-
// Function to check for the presence of blacklisted tags or attributes
|
|
10
|
-
var checkForBlacklist_1 = function (node) {
|
|
11
|
-
if (constant_1.tagBlacklist.includes(node.tagName.toLowerCase())) {
|
|
12
|
-
throw new Error("Blacklisted tag found: ".concat(node.tagName.toLowerCase()));
|
|
13
|
-
}
|
|
14
|
-
Array.from(node.attributes).forEach(function (attr) {
|
|
15
|
-
if (constant_1.attrBlacklist.includes(attr.name.toLowerCase())) {
|
|
16
|
-
throw new Error("Blacklisted attribute found: ".concat(attr.name.toLowerCase()));
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
// Collect and remove script tags
|
|
21
|
-
var scriptElements = doc.querySelectorAll('script');
|
|
22
|
-
scriptElements.forEach(function (script) {
|
|
23
|
-
var _a;
|
|
24
|
-
scripts_1.push(script.outerHTML);
|
|
25
|
-
(_a = script.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(script);
|
|
26
|
-
});
|
|
27
|
-
// Recursive function to check all nodes in the document
|
|
28
|
-
var checkNode_1 = function (node) {
|
|
29
|
-
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
30
|
-
checkForBlacklist_1(node);
|
|
31
|
-
}
|
|
32
|
-
Array.from(node.childNodes).forEach(checkNode_1);
|
|
33
|
-
};
|
|
34
|
-
checkNode_1(doc.body);
|
|
35
|
-
return {
|
|
36
|
-
html: doc.body.innerHTML,
|
|
37
|
-
scripts: scripts_1
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
return { error: new Error("Sanitization failed: ".concat(error.message)) };
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.default = sanitizeEmbedCode;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { DefaultBrightTheme } from '../../../../../../../DynamicLayout/sections/CustomSection/util/types';
|
|
2
|
-
export type TwitterPropsKeys = keyof CB_TWITTER_STYLE_PROPS;
|
|
3
|
-
export type CB_TWITTER_STYLE_PROPS = {
|
|
4
|
-
CB_STYLE_PROP_TWITTER_SPEC_THEME: DefaultBrightTheme;
|
|
5
|
-
'CB_STYLE_PROP_TWITTER_SPEC_THEME:MOBILE': DefaultBrightTheme | undefined;
|
|
6
|
-
};
|