New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@propellerads/ad-format

Package Overview
Dependencies
Maintainers
8
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@propellerads/ad-format - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

6

CHANGELOG.md

@@ -1,3 +0,7 @@

### `1.0.1`
#### `1.1.0`
* Remove `size` property.
#### `1.0.1`
* Add Native Widget animation & preview.

37

index.jsx
import React from 'react';
import PropTypes from 'prop-types';
import {
StyledAdFormat,
StyledPreview,
SIZES,
PREVIEWS,

@@ -14,3 +14,2 @@ FORMATS,

name,
size,
classNames,

@@ -22,31 +21,18 @@ isPreview,

<StyledPreview
size={size}
name={name}
className={classNames}
/>
) : <div />;
) : null;
}
return (SVGS
&& <StyledAdFormat size={size} classNames={classNames} dangerouslySetInnerHTML={{__html: SVGS[name]}} />);
return SVGS[name] ? (
<StyledAdFormat
className={classNames}
dangerouslySetInnerHTML={{__html: SVGS[name]}}
/>
) : null;
};
export const componentProps = {
size: [
SIZES.EXTRA_SMALL,
SIZES.SMALL,
SIZES.MEDIUM,
SIZES.LARGE,
SIZES.EXTRA_LARGE,
],
ads: [
FORMATS.INTERSTITIAL,
FORMATS.NATIVE, FORMATS.ONCLICK,
FORMATS.NATIVEADS, FORMATS.LINK,
FORMATS.DIRECT_LINK,
FORMATS.PUSH_LINK,
FORMATS.WEBSITE,
FORMATS.LANDING_PAGE,
FORMATS.IN_PAGE_PUSH,
FORMATS.NATIVE_WIDGET,
],
ads: Object.values(FORMATS),
};

@@ -56,3 +42,2 @@

name: PropTypes.oneOf(componentProps.ads).isRequired,
size: PropTypes.oneOf(componentProps.size),
classNames: PropTypes.string,

@@ -63,3 +48,2 @@ isPreview: PropTypes.bool,

AdFormat.defaultProps = {
size: SIZES.MEDIUM,
classNames: '',

@@ -75,3 +59,2 @@ isPreview: false,

PREVIEWS,
SIZES,
};
{
"name": "@propellerads/ad-format",
"version": "1.0.1",
"version": "1.1.0",
"main": "index.jsx",

@@ -5,0 +5,0 @@ "repository": "https://github.com/propellerads/ui-components",

@@ -23,12 +23,2 @@ import styled, {css} from 'styled-components';

const item = 210;
const SIZES = {
EXTRA_SMALL: 'extra_small',
SMALL: 'small',
MEDIUM: 'medium',
LARGE: 'large',
EXTRA_LARGE: 'extra_large',
};
const FORMATS = {

@@ -72,45 +62,10 @@ INTERSTITIAL: 'interstitial',

const extraSmallStyle = css`
width: ${item / 3}px;
height: ${item / 3}px;
`;
const smallStyle = css`
width: ${item / 2}px;
height: ${item / 2}px;
`;
const mediumStyle = css`
width: ${item}px;
height: ${item}px;
`;
const largeStyle = css`
width: ${item * 2}px;
height: ${item * 2}px;
`;
const extraLargeStyle = css`
width: ${item * 3}px;
height: ${item * 3}px;
`;
const StyledAdFormat = styled.div`
display: inline-block;
${(props) => props.size === SIZES.EXTRA_SMALL && extraSmallStyle}
${(props) => props.size === SIZES.SMALL && smallStyle}
${(props) => props.size === SIZES.MEDIUM && mediumStyle}
${(props) => props.size === SIZES.LARGE && largeStyle}
${(props) => props.size === SIZES.EXTRA_LARGE && extraLargeStyle}
`;
const StyledPreview = styled.img.attrs({
src: (props) => PREVIEWS[props.name],
alt: (props) => `${props.name} ad format`,
className: (props) => props.className,
})`
width: 210px;
height: 136px;
`;
const StyledPreview = styled.img.attrs(props => ({
src: PREVIEWS[props.name],
alt: `${props.name} ad format`,
}))``;

@@ -120,3 +75,2 @@ export {

StyledPreview,
SIZES,
PREVIEWS,

@@ -123,0 +77,0 @@ FORMATS,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc