
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
@solid-primitives/fullscreen
Advanced tools
Creates a primitive wrapper around the Fullscreen API that can either be used as a directive or a primitive.
npm install @solid-primitives/fullscreen
# or
yarn add @solid-primitives/fullscreen
const MyComponent2: Component = () => {
const [fs, setFs] = createSignal(false);
let [ref, setRef] = createSignal<HTMLDivElement>();
const active: Accessor<boolean> = createFullscreen(ref, fs);
return (
<div ref={setRef} onClick={() => setFs(fs => !fs)}>
{!active() ? "click to fullscreen" : "click to exit fullscreen"}
</div>
);
};
This variant requires the ref to be a signal, otherwise the not-yet-filled ref will be captured in the closure of the primitive.
You can either put the options into the second argument accessor output (useful for the directive use case) or as a third argument.
const isActive: Accessor<boolean> = createFullscreen(
ref: HTMLElement | undefined,
active?: Accessor<FullscreenOptions | boolean>,
options?: FullscreenOptions
);
// can be used as a directive
const MyComponent: Component = () => {
const [fs, setFs] = createSignal(false);
return (<div use:createFullScreen={fs} onClick={() => setFs(fs => !fs)}>
{!fs() ? 'click to fullscreen' : 'click to exit fullscreen'}
</div>);
}
TODO
See CHANGELOG.md
FAQs
Primitive that wraps the fullscreen API.
The npm package @solid-primitives/fullscreen receives a total of 365 weekly downloads. As such, @solid-primitives/fullscreen popularity was classified as not popular.
We found that @solid-primitives/fullscreen demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.