Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@bentoproject/inline-gallery
Advanced tools
Displays slides, with optional pagination dots and thumbnails. Its implementation uses a Bento Base Carousel. Both components must be properly installed for the environment (Web Component vs Preact).
Displays slides, with optional pagination dots and thumbnails. Its implementation uses a Bento Base Carousel. Both components must be properly installed for the environment (Web Component vs Preact).
You must include each Bento component's required CSS library to guarantee proper loading and before adding custom styles. Or use the light-weight pre-upgrade styles available inline. See Layout and style.
npm install @bentoproject/inline-gallery
import {defineElement as defineBentoInlineGallery} from '@bentoproject/inline-gallery';
defineBentoInlineGallery();
<script>
<script type="module" src="https://cdn.ampproject.org/bento.mjs" crossorigin="anonymous"></script>
<script nomodule src="https://cdn.ampproject.org/bento.js" crossorigin="anonymous"></script>
<script type="module" src="https://cdn.ampproject.org/v0/bento-inline-gallery-1.0.mjs" crossorigin="anonymous"></script>
<script nomodule src="https://cdn.ampproject.org/v0/bento-inline-gallery-1.0.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.ampproject.org/v0/bento-inline-gallery-1.0.css" crossorigin="anonymous">
<!DOCTYPE html>
<html>
<head>
<script
type="module"
async
src="https://cdn.ampproject.org/bento.mjs"
></script>
<script nomodule src="https://cdn.ampproject.org/bento.js"></script>
<script
type="module"
async
src="https://cdn.ampproject.org/v0/bento-inline-gallery-1.0.mjs"
></script>
<script
nomodule
async
src="https://cdn.ampproject.org/v0/bento-inline-gallery-1.0.js"
></script>
<link
rel="stylesheet"
href="https://cdn.ampproject.org/v0/bento-inline-gallery-1.0.css"
/>
<script
type="module"
async
src="https://cdn.ampproject.org/v0/bento-base-carousel-1.0.mjs"
></script>
<script
nomodule
async
src="https://cdn.ampproject.org/v0/bento-base-carousel-1.0.js"
></script>
<link
rel="stylesheet"
href="https://cdn.ampproject.org/v0/bento-base-carousel-1.0.css"
/>
</head>
<body>
<bento-inline-gallery id="inline-gallery">
<bento-inline-gallery-thumbnails
style="height: 100px"
loop
></bento-inline-gallery-thumbnails>
<bento-base-carousel
style="height: 200px"
snap-align="center"
visible-count="3"
loop
>
<img src="img1.jpeg" data-thumbnail-src="img1-thumbnail.jpeg" />
<img src="img2.jpeg" data-thumbnail-src="img2-thumbnail.jpeg" />
<img src="img3.jpeg" data-thumbnail-src="img3-thumbnail.jpeg" />
<img src="img4.jpeg" data-thumbnail-src="img4-thumbnail.jpeg" />
<img src="img5.jpeg" data-thumbnail-src="img5-thumbnail.jpeg" />
<img src="img6.jpeg" data-thumbnail-src="img6-thumbnail.jpeg" />
</bento-base-carousel>
<bento-inline-gallery-pagination
style="height: 20px"
></bento-inline-gallery-pagination>
</bento-inline-gallery>
</body>
</html>
Each Bento component has a small CSS library you must include to guarantee proper loading without content shifts. Because of order-based specificity, you must manually ensure that stylesheets are included before any custom styles.
<link
rel="stylesheet"
type="text/css"
href="https://cdn.ampproject.org/v0/bento-inline-gallery-1.0.css"
/>
Alternatively, you may also make the light-weight pre-upgrade styles available inline:
<style>
bento-inline-gallery,
bento-inline-gallery-pagination,
bento-inline-gallery-thumbnails {
display: block;
}
bento-inline-gallery {
contain: layout;
}
bento-inline-gallery-pagination,
bento-inline-gallery-thumbnails {
overflow: hidden;
position: relative;
}
</style>
<bento-inline-gallery-pagination>
inset
Boolean attribute indicating whether to display the pagination indicator as inset (overlaying the carousel itself). Default is false
.
<bento-inline-gallery-thumbnails>
aspect-ratio
A Number defining the ratio of width to height that slides should be displayed in. This value is optional.
loop
Boolean attribute indicating whether thumbnails should loop. The default is false
.
You may use the bento-inline-gallery
, bento-inline-gallery-pagination
, bento-inline-gallery-thumbnails
, and bento-base-carousel
element selectors to style the pagination indicator, thumbnails, and carousel freely.
npm install @bentoproject/inline-gallery
import React from 'react';
import {BentoInlineGallery} from '@bentoproject/inline-gallery/react';
import '@bentoproject/inline-gallery/styles.css';
function App() {
return (
<BentoInlineGallery id="inline-gallery">
<BentoInlineGalleryThumbnails aspect-ratio="1.5" loop />
<BentoBaseCarousel snap-align="center" visible-count="1.2" loop>
<img src="server.com/static/inline-examples/images/image1.jpg" />
<img src="server.com/static/inline-examples/images/image2.jpg" />
<img src="server.com/static/inline-examples/images/image3.jpg" />
</BentoBaseCarousel>
<BentoInlineGalleryPagination inset />
</BentoInlineGallery>
);
}
The BentoInlineGallery
component has a defined layout size type. To ensure the component renders correctly, be sure to apply a size to the component and its immediate children via a desired CSS layout (such as one defined with width
). These can be applied inline:
<BentoInlineGallery style={{width: 300}}>...</BentoInlineGallery>
Or via className
:
<BentoInlineGallery className="custom-styles">...</BentoInlineGallery>
.custom-styles {
background-color: red;
}
BentoInlineGalleryPagination
In addition to the common props, BentoInlineGalleryPagination supports the props below:
inset
Boolean attribute indicating whether to display the pagination indicator as inset (overlaying the carousel itself). Default is false
.
BentoInlineGalleryThumbnails
In addition to the common props, BentoInlineGalleryThumbnails supports the props below:
aspectRatio
A Number defining the ratio of width to height that slides should be displayed in (this is optional).
loop
Boolean attribute indicating whether thumbnails should loop. Default is false
.
FAQs
Displays slides, with optional pagination dots and thumbnails. Its implementation uses a Bento Base Carousel. Both components must be properly installed for the environment (Web Component vs Preact).
The npm package @bentoproject/inline-gallery receives a total of 20 weekly downloads. As such, @bentoproject/inline-gallery popularity was classified as not popular.
We found that @bentoproject/inline-gallery demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.