@front10/basic-widget
Advanced tools
Comparing version 0.24.11 to 0.24.12
@@ -1,4 +0,4 @@ | ||
import { Heading as Heading$1, Inline, Box, Paragraph, LinkButton as LinkButton$1, Image as Image$1, Loader, Embed as Embed$1, Video as Video$1, CustomHtml, Quote, Separator, Grid, Stack } from '@front10/base-elements'; | ||
import React__default, { createElement } from 'react'; | ||
import nanoid from 'nanoid'; | ||
import { Heading as Heading$1, Inline, Box, Paragraph, LinkButton as LinkButton$1, Image as Image$1, Embed as Embed$1, Video as Video$1, CustomHtml, Quote, Separator, Grid, Stack } from '@front10/base-elements'; | ||
import { createElement, useEffect } from 'react'; | ||
import { nanoid } from 'nanoid'; | ||
import { withContainer } from '@front10/container-elements'; | ||
@@ -206,17 +206,29 @@ | ||
height = _ref$height === void 0 ? "auto" : _ref$height, | ||
props = _objectWithoutPropertiesLoose(_ref, ["width", "height", "ref"]); | ||
ref = _ref.ref, | ||
cmpId = _ref.cmpId, | ||
props = _objectWithoutPropertiesLoose(_ref, ["width", "height", "ref", "cmpId"]); | ||
var _React$useState = React__default.useState(true), | ||
isLoading = _React$useState[0], | ||
setIsLoading = _React$useState[1]; | ||
useEffect(function () { | ||
var _window2, _window2$MC; | ||
var handleLoad = function handleLoad() { | ||
setIsLoading(false); | ||
}; | ||
var sendParentId = function sendParentId() { | ||
var _window, _window$MC, _ref$current; | ||
return React__default.createElement(React__default.Fragment, null, isLoading && React__default.createElement(Loader, null), React__default.createElement(Embed$1, Object.assign({ | ||
onLoad: handleLoad, | ||
// @ts-ignore | ||
(_window = window) === null || _window === void 0 ? void 0 : (_window$MC = _window.MC) === null || _window$MC === void 0 ? void 0 : _window$MC.Helpers.sendMessages(ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.contentWindow, "on-update-parent-id", { | ||
cmpId: cmpId | ||
}); | ||
}; // @ts-ignore | ||
(_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$MC = _window2.MC) === null || _window2$MC === void 0 ? void 0 : _window2$MC.Helpers.listenMessages("on-request-parent-id", sendParentId); | ||
return function () { | ||
window.removeEventListener("message", sendParentId); | ||
}; | ||
}, [ref, cmpId]); | ||
return createElement(Embed$1, Object.assign({ | ||
height: height, | ||
width: width | ||
}, props))); | ||
width: width, | ||
ref: ref | ||
}, props)); | ||
}; | ||
@@ -223,0 +235,0 @@ |
@@ -41,3 +41,3 @@ import { Quote, InlineProps } from "@front10/base-elements"; | ||
readonly video: ({ align, width, height, sx, ref, src, ...props }: import("./Video").ParagraphProps) => JSX.Element; | ||
readonly embed: ({ width, height, ref, ...props }: import("./Embed").ParagraphProps) => JSX.Element; | ||
readonly embed: ({ width, height, ref, cmpId, ...props }: import("./Embed").ParagraphProps) => JSX.Element; | ||
readonly "link-button": ({ align, ...props }: import("./LinkButton").LinkButtonProps) => JSX.Element; | ||
@@ -44,0 +44,0 @@ readonly separator: (props: import("@theme-ui/components").BoxProps) => JSX.Element; |
@@ -10,3 +10,3 @@ /// <reference types="react" /> | ||
export declare type ParagraphProps = CustomProps & BaseProps; | ||
export declare const Embed: ({ width, height, ref, ...props }: ParagraphProps) => JSX.Element; | ||
export declare const Embed: ({ width, height, ref, cmpId, ...props }: ParagraphProps) => JSX.Element; | ||
export {}; |
{ | ||
"version": "0.24.11", | ||
"version": "0.24.12", | ||
"license": "", | ||
@@ -40,7 +40,7 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@front10/base-elements": "^0.24.11", | ||
"@front10/container-elements": "^0.24.11", | ||
"@front10/utils": "^0.24.11" | ||
"@front10/base-elements": "^0.24.12", | ||
"@front10/container-elements": "^0.24.12", | ||
"@front10/utils": "^0.24.12" | ||
}, | ||
"gitHead": "fef7c6504836e7da0beb845363747f90ce7719f1" | ||
"gitHead": "e83b637512583a0c83cf7f5d76ea22a211f33a2f" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
118344
26
1329
3
2