Comparing version 9.0.42 to 9.0.43
{ | ||
"name": "zoid", | ||
"version": "9.0.42", | ||
"version": "9.0.43", | ||
"description": "Cross domain components.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -29,3 +29,3 @@ /* @flow */ | ||
focus : () => ZalgoPromise<void>, | ||
resize : ({ width : ?number, height : ?number }) => ZalgoPromise<void>, | ||
resize : ({| width : ?number, height : ?number |}) => ZalgoPromise<void>, | ||
onError : (mixed) => ZalgoPromise<void>, | ||
@@ -152,3 +152,3 @@ onProps : ((PropsType<P>) => void) => void, | ||
const resize = ({ width, height } : { width : ?number, height : ?number }) : ZalgoPromise<void> => { | ||
const resize = ({ width, height } : {| width : ?number, height : ?number |}) : ZalgoPromise<void> => { | ||
return parent.resize.fireAndForget({ width, height }); | ||
@@ -193,3 +193,3 @@ }; | ||
const getAutoResize = () : { width : boolean, height : boolean, element : ?HTMLElement } => { | ||
const getAutoResize = () : {| width : boolean, height : boolean, element : ?HTMLElement |} => { | ||
let { width = false, height = false, element = 'body' } = autoResize; | ||
@@ -196,0 +196,0 @@ element = getElementSafe(element); |
@@ -41,3 +41,3 @@ /* @flow */ | ||
url : string | ({ props : PropsType<P> }) => string, | ||
url : string | ({| props : PropsType<P> |}) => string, | ||
domain? : string | RegExp, | ||
@@ -49,10 +49,10 @@ bridgeUrl? : string, | ||
dimensions? : CssDimensionsType, | ||
autoResize? : { width? : boolean, height? : boolean, element? : string }, | ||
autoResize? : {| width? : boolean, height? : boolean, element? : string |}, | ||
allowedParentDomains? : StringMatcherType, | ||
attributes? : { | ||
attributes? : {| | ||
iframe? : { [string] : string }, | ||
popup? : { [string] : string } | ||
}, | ||
|}, | ||
@@ -64,3 +64,3 @@ defaultContext? : $Values<typeof CONTEXT>, | ||
validate? : ({ props : PropsInputType<P> }) => void, | ||
validate? : ({| props : PropsInputType<P> |}) => void, | ||
@@ -70,2 +70,13 @@ logger? : Logger | ||
type AttributesType = {| | ||
iframe? : { [string] : string }, | ||
popup? : { [string] : string } | ||
|}; | ||
type AutoResizeType = {| | ||
width? : boolean, | ||
height? : boolean, | ||
element? : string | ||
|}; | ||
export type NormalizedComponentOptionsType<P> = {| | ||
@@ -75,3 +86,3 @@ tag : string, | ||
url : string | ({ props : PropsType<P> }) => string, | ||
url : string | ({| props : PropsType<P> |}) => string, | ||
domain : ?(string | RegExp), | ||
@@ -82,10 +93,7 @@ bridgeUrl : ?string, | ||
dimensions : CssDimensionsType, | ||
autoResize : { width? : boolean, height? : boolean, element? : string }, | ||
autoResize : AutoResizeType, | ||
allowedParentDomains : StringMatcherType, | ||
attributes : { | ||
iframe? : { [string] : string }, | ||
popup? : { [string] : string } | ||
}, | ||
attributes : AttributesType, | ||
@@ -97,3 +105,3 @@ defaultContext : $Values<typeof CONTEXT>, | ||
validate : ?({ props : PropsInputType<P> }) => void, | ||
validate : ?({| props : PropsInputType<P> |}) => void, | ||
logger : Logger | ||
@@ -118,2 +126,12 @@ |}; | ||
const getDefaultAttributes = () : AttributesType => { | ||
// $FlowFixMe | ||
return {}; | ||
}; | ||
const getDefaultAutoResize = () : AutoResizeType => { | ||
// $FlowFixMe | ||
return {}; | ||
}; | ||
function normalizeOptions<P>(options : ComponentOptionsType<P>) : NormalizedComponentOptionsType<P> { | ||
@@ -127,5 +145,5 @@ let { | ||
dimensions = {}, | ||
autoResize = {}, | ||
autoResize = getDefaultAutoResize(), | ||
allowedParentDomains = WILDCARD, | ||
attributes = {}, | ||
attributes = getDefaultAttributes(), | ||
defaultContext = CONTEXT.IFRAME, | ||
@@ -132,0 +150,0 @@ containerTemplate = (__ZOID__.__DEFAULT_CONTAINER__ ? defaultContainerTemplate : null), |
@@ -19,3 +19,3 @@ /* @flow */ | ||
export type hidePropType = () => ZalgoPromise<void>; | ||
export type resizePropType = ({ width : ?number, height : ?number }) => ZalgoPromise<void>; | ||
export type resizePropType = ({| width : ?number, height : ?number |}) => ZalgoPromise<void>; | ||
export type getParentPropType = () => CrossDomainWindowType; | ||
@@ -34,2 +34,3 @@ export type getParentDomainPropType = () => string; | ||
// eslint-disable-next-line flowtype/require-exact-type | ||
export type PropsInputType<P> = { | ||
@@ -51,2 +52,3 @@ timeout? : timeoutPropType, | ||
// eslint-disable-next-line flowtype/require-exact-type | ||
export type PropsType<P> = { | ||
@@ -105,3 +107,3 @@ timeout? : timeoutPropType, | ||
onProps : ((PropsType<P>) => void) => void, | ||
resize : ({ width : ?number, height : ?number }) => ZalgoPromise<void>, | ||
resize : ({| width : ?number, height : ?number |}) => ZalgoPromise<void>, | ||
getParentDomain : () => string, | ||
@@ -113,3 +115,3 @@ getParent : () => CrossDomainWindowType, | ||
required? : boolean, | ||
queryParam? : boolean | string | ({ value : T }) => (string | ZalgoPromise<string>), | ||
queryParam? : boolean | string | ({| value : T |}) => (string | ZalgoPromise<string>), | ||
queryValue? : ({| value : T |}) => (ZalgoPromise<mixed> | mixed), | ||
@@ -174,3 +176,3 @@ sendToChild? : boolean, | ||
allowDelegate: true, | ||
validate({ value } : { value : CrossDomainWindowType | ProxyWindow }) { | ||
validate: ({ value }) => { | ||
if (__DEBUG__) { | ||
@@ -194,3 +196,3 @@ if (!isWindow(value) && !ProxyWindow.isProxyWindow(value)) { | ||
}, | ||
decorate({ value } : { value : CrossDomainWindowType | ProxyWindow }) : ProxyWindow { | ||
decorate: ({ value }) => { | ||
return toProxyWindow(value); | ||
@@ -197,0 +199,0 @@ } |
/* @flow */ | ||
declare var __ZOID__ : { | ||
declare var __ZOID__ : {| | ||
__VERSION__ : string, | ||
@@ -11,2 +11,2 @@ __GLOBAL_KEY__ : string, | ||
__DEFAULT_PRERENDER__ : boolean | ||
}; | ||
|}; |
@@ -9,7 +9,7 @@ /* @flow */ | ||
type AngularModule = {| | ||
directive : (string, () => { | ||
directive : (string, () => {| | ||
scope : { [string] : '=' | '@' }, | ||
restrict : string, | ||
controller : $ReadOnlyArray<string | Function> | ||
}) => AngularModule | ||
|}) => AngularModule | ||
|}; | ||
@@ -16,0 +16,0 @@ |
@@ -16,8 +16,8 @@ /* @flow */ | ||
type Angular2 = {| | ||
Component : ({ selector : string, template : string, inputs : $ReadOnlyArray<string> }) => { | ||
Class : ({ constructor : $ReadOnlyArray<Angular2Injection | Function>, ngOnInit : () => void, ngDoCheck : () => void }) => Angular2Component | ||
}, | ||
NgModule : ({ declarations : $ReadOnlyArray<Angular2Component>, exports : $ReadOnlyArray<Angular2Component> }) => { | ||
Class : ({ constructor : () => void }) => Angular2Module | ||
}, | ||
Component : ({| selector : string, template : string, inputs : $ReadOnlyArray<string> |}) => {| | ||
Class : ({| constructor : $ReadOnlyArray<Angular2Injection | Function>, ngOnInit : () => void, ngDoCheck : () => void |}) => Angular2Component | ||
|}, | ||
NgModule : ({| declarations : $ReadOnlyArray<Angular2Component>, exports : $ReadOnlyArray<Angular2Component> |}) => {| | ||
Class : ({| constructor : () => void |}) => Angular2Module | ||
|}, | ||
ElementRef : Angular2Injection, | ||
@@ -24,0 +24,0 @@ NgZone : Angular2Injection |
@@ -9,5 +9,7 @@ /* @flow */ | ||
declare class ReactClassType { | ||
// eslint-disable-next-line flowtype/require-exact-type | ||
declare class ReactClassType {} | ||
} | ||
// eslint-disable-next-line flowtype/require-exact-type | ||
declare class __ReactComponent {} | ||
@@ -18,9 +20,5 @@ type ReactElementType = {| | ||
declare class __ReactComponent { | ||
} | ||
type ReactType = {| | ||
Component : __ReactComponent, | ||
createClass : ({ render : () => ReactElementType, componentDidMount : () => void, componentDidUpdate : () => void }) => (typeof ReactClassType), | ||
createClass : ({| render : () => ReactElementType, componentDidMount : () => void, componentDidUpdate : () => void |}) => (typeof ReactClassType), | ||
createElement : (string, ?{ [string] : mixed }, ...children : $ReadOnlyArray<ReactElementType>) => ReactElementType | ||
@@ -27,0 +25,0 @@ |}; |
@@ -44,3 +44,3 @@ /* @flow */ | ||
checkClose : CrossDomainFunctionType<[], boolean>, | ||
resize : CrossDomainFunctionType<[{ width? : ?number, height? : ?number }], void>, | ||
resize : CrossDomainFunctionType<[{| width? : ?number, height? : ?number |}], void>, | ||
onError : (mixed) => ZalgoPromise<void>, | ||
@@ -77,3 +77,3 @@ show : () => ZalgoPromise<void>, | ||
focus : () => ZalgoPromise<void>, | ||
resize : ({ width : ?number, height : ?number }) => ZalgoPromise<void>, | ||
resize : ({| width : ?number, height : ?number |}) => ZalgoPromise<void>, | ||
onError : (mixed) => ZalgoPromise<void>, | ||
@@ -96,9 +96,9 @@ updateProps : PropsInputType<P> => ZalgoPromise<void>, | ||
type OnError = (mixed) => ZalgoPromise<void>; | ||
type RenderContainer = (proxyContainer : ProxyObject<HTMLElement>, { context : $Values<typeof CONTEXT>, uid : string, proxyFrame : ?ProxyObject<HTMLIFrameElement>, proxyPrerenderFrame : ?ProxyObject<HTMLIFrameElement> }) => ZalgoPromise<?ProxyObject<HTMLElement>>; | ||
type RenderContainer = (proxyContainer : ProxyObject<HTMLElement>, {| context : $Values<typeof CONTEXT>, uid : string, proxyFrame : ?ProxyObject<HTMLIFrameElement>, proxyPrerenderFrame : ?ProxyObject<HTMLIFrameElement> |}) => ZalgoPromise<?ProxyObject<HTMLElement>>; | ||
type SetProxyWin = (ProxyWindow) => ZalgoPromise<void>; | ||
type GetProxyWindow = () => ZalgoPromise<ProxyWindow>; | ||
type OpenFrame = (context : $Values<typeof CONTEXT>, { windowName : string }) => ZalgoPromise<?ProxyObject<HTMLIFrameElement>>; | ||
type OpenFrame = (context : $Values<typeof CONTEXT>, {| windowName : string |}) => ZalgoPromise<?ProxyObject<HTMLIFrameElement>>; | ||
type OpenPrerenderFrame = (context : $Values<typeof CONTEXT>) => ZalgoPromise<?ProxyObject<HTMLIFrameElement>>; | ||
type Prerender = (proxyPrerenderWin : ProxyWindow, { context : $Values<typeof CONTEXT>, uid : string }) => ZalgoPromise<void>; | ||
type Open = (context : $Values<typeof CONTEXT>, { proxyWin : ProxyWindow, proxyFrame : ?ProxyObject<HTMLIFrameElement>, windowName : string }) => ZalgoPromise<ProxyWindow>; | ||
type Prerender = (proxyPrerenderWin : ProxyWindow, {| context : $Values<typeof CONTEXT>, uid : string |}) => ZalgoPromise<void>; | ||
type Open = (context : $Values<typeof CONTEXT>, {| proxyWin : ProxyWindow, proxyFrame : ?ProxyObject<HTMLIFrameElement>, windowName : string |}) => ZalgoPromise<ProxyWindow>; | ||
type OpenPrerender = (context : $Values<typeof CONTEXT>, proxyWin : ProxyWindow, proxyPrerenderFrame : ?ProxyObject<HTMLIFrameElement>) => ZalgoPromise<ProxyWindow>; | ||
@@ -351,3 +351,3 @@ type WatchForUnload = () => ZalgoPromise<void>; | ||
const openFrame = (context : $Values<typeof CONTEXT>, { windowName } : { windowName : string }) : ZalgoPromise<?ProxyObject<HTMLIFrameElement>> => { | ||
const openFrame = (context : $Values<typeof CONTEXT>, { windowName } : {| windowName : string |}) : ZalgoPromise<?ProxyObject<HTMLIFrameElement>> => { | ||
if (openFrameOverride) { | ||
@@ -411,3 +411,3 @@ return openFrameOverride(context, { windowName }); | ||
} else { | ||
throw new Error(`No render target found`); | ||
throw new Error(`No render context available for ${ context }`); | ||
} | ||
@@ -466,3 +466,3 @@ }); | ||
const resize = ({ width, height } : { width? : ?number, height? : ?number }) : ZalgoPromise<void> => { | ||
const resize = ({ width, height } : {| width? : ?number, height? : ?number |}) : ZalgoPromise<void> => { | ||
return ZalgoPromise.try(() => { | ||
@@ -496,3 +496,3 @@ event.trigger(EVENT.RESIZE, { width, height }); | ||
const open = (context : $Values<typeof CONTEXT>, { proxyWin, proxyFrame, windowName } : { proxyWin : ProxyWindow, proxyFrame : ?ProxyObject<HTMLIFrameElement>, windowName : string }) : ZalgoPromise<ProxyWindow> => { | ||
const open = (context : $Values<typeof CONTEXT>, { proxyWin, proxyFrame, windowName } : {| proxyWin : ProxyWindow, proxyFrame : ?ProxyObject<HTMLIFrameElement>, windowName : string |}) : ZalgoPromise<ProxyWindow> => { | ||
if (openOverride) { | ||
@@ -537,3 +537,3 @@ return openOverride(context, { proxyWin, proxyFrame, windowName }); | ||
} else { | ||
throw new Error(`No render target found`); | ||
throw new Error(`No render context available for ${ context }`); | ||
} | ||
@@ -627,3 +627,3 @@ | ||
const buildChildPayload = ({ proxyWin, childDomain, domain, target = window, context, uid } : { proxyWin : ProxyWindow, childDomain : string, domain : string | RegExp, target : CrossDomainWindowType, context : $Values<typeof CONTEXT>, uid : string } = {}) : ChildPayload => { | ||
const buildChildPayload = ({ proxyWin, childDomain, domain, target = window, context, uid } : {| proxyWin : ProxyWindow, childDomain : string, domain : string | RegExp, target : CrossDomainWindowType, context : $Values<typeof CONTEXT>, uid : string |} = {}) : ChildPayload => { | ||
return { | ||
@@ -642,3 +642,3 @@ uid, | ||
const buildWindowName = ({ proxyWin, childDomain, domain, target, uid, context } : { proxyWin : ProxyWindow, childDomain : string, domain : string | RegExp, target : CrossDomainWindowType, context : $Values<typeof CONTEXT>, uid : string }) : string => { | ||
const buildWindowName = ({ proxyWin, childDomain, domain, target, uid, context } : {| proxyWin : ProxyWindow, childDomain : string, domain : string | RegExp, target : CrossDomainWindowType, context : $Values<typeof CONTEXT>, uid : string |}) : string => { | ||
const childPayload = buildChildPayload({ proxyWin, childDomain, domain, target, context, uid }); | ||
@@ -648,3 +648,3 @@ return `__${ ZOID }__${ name }__${ base64encode(JSON.stringify(childPayload)) }__`; | ||
const renderTemplate = (renderer : (RenderOptionsType<P>) => ?HTMLElement, { context, uid, container, doc, frame, prerenderFrame } : { context : $Values<typeof CONTEXT>, uid : string, container? : HTMLElement, doc : Document, frame? : ?HTMLIFrameElement, prerenderFrame? : ?HTMLIFrameElement }) : ?HTMLElement => { | ||
const renderTemplate = (renderer : (RenderOptionsType<P>) => ?HTMLElement, { context, uid, container, doc, frame, prerenderFrame } : {| context : $Values<typeof CONTEXT>, uid : string, container? : HTMLElement, doc : Document, frame? : ?HTMLIFrameElement, prerenderFrame? : ?HTMLIFrameElement |}) : ?HTMLElement => { | ||
// $FlowFixMe | ||
@@ -657,3 +657,3 @@ return renderer({ | ||
const prerender = (proxyPrerenderWin : ProxyWindow, { context, uid } : { context : $Values<typeof CONTEXT>, uid : string }) : ZalgoPromise<void> => { | ||
const prerender = (proxyPrerenderWin : ProxyWindow, { context, uid } : {| context : $Values<typeof CONTEXT>, uid : string |}) : ZalgoPromise<void> => { | ||
if (prerenderOverride) { | ||
@@ -704,3 +704,3 @@ return prerenderOverride(proxyPrerenderWin, { context, uid }); | ||
const renderContainer : RenderContainer = (proxyContainer : ProxyObject<HTMLElement>, { proxyFrame, proxyPrerenderFrame, context, uid } : | ||
{ context : $Values<typeof CONTEXT>, uid : string, proxyFrame : ?ProxyObject<HTMLIFrameElement>, proxyPrerenderFrame : ?ProxyObject<HTMLIFrameElement> }) : ZalgoPromise<?ProxyObject<HTMLElement>> => { | ||
{| context : $Values<typeof CONTEXT>, uid : string, proxyFrame : ?ProxyObject<HTMLIFrameElement>, proxyPrerenderFrame : ?ProxyObject<HTMLIFrameElement> |}) : ZalgoPromise<?ProxyObject<HTMLElement>> => { | ||
@@ -707,0 +707,0 @@ if (renderContainerOverride) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
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
20793
2876947