npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@htmlbricks/hb-editor-video

v0.76.5

Published

Video trimmer UI: plays `src` with an `hb-range-slider` synced to the playhead and in/out bounds (`track` min/max seconds). Numeric time fields, cue-to-current-time buttons, and optional `hb-form` gate final submission. Emits `changeTrackValues`, `dispatc

Readme

hb-editor-video (editor-video)

Package: @htmlbricks/hb-editor-video
Category: media
Tags: media, video, editor

Overview

hb-editor-video is a video trimmer web component: it plays an MP4 from src, shows a 16:9 Bulma card with the video, and keeps an hb-range-slider in sync with playback so the user can set in and out times in seconds (track.minValue / track.maxValue). Numeric h / m / s fields and small cue buttons snap the trim window to the current playhead. An optional hb-form (driven by a JSON schema string on form) can gate the primary Send action until metadata is valid. The footer shows the selected duration and a Send control.

The component registers hb-range-slider and hb-form at runtime (same bundle version as the host package). Icons use Bootstrap Icons (stylesheet injected in the shadow tree).

Custom element

<hb-editor-video></hb-editor-video>

Attributes (HTML)

Web component attributes are strings. Use JSON strings for structured props where noted (track, form). Names follow snake_case where applicable.

| Attribute | Required | Description | | --- | --- | --- | | src | Yes | URL of the video source (MP4; passed to <video><source>. | | track | No | JSON string for the trim window in seconds, e.g. {"minValue":0,"maxValue":120}. Parsed on the client; if omitted, defaults apply and values are clamped to the loaded media duration on loadedmetadata. | | form | No | JSON string describing the hb-form schema (same shape the form component expects). When set, the embedded form is shown with submit hidden; Send triggers validation and, when valid, a dispatchTrack event with track fields merged into the submitted form payload. | | id | No | Optional element id. |

The TypeScript Component type also includes optional style; it is not wired in the current Svelte implementation—prefer styling the host with CSS or documented CSS variables below.

Behavior

  • Playback: Play/pause toggles the <video> element. During timeupdate, the current time is clamped inside [track.minValue, track.maxValue] (pauses and seeks when crossing bounds).
  • Slider: hb-range-slider receives min / max from the asset duration, minval / maxval from track, and position_value from the playhead. Moving the slider updates track, seeks the video, and emits changeTrackValues.
  • Time inputs: Editing h/m/s recomputes track.minValue / track.maxValue in seconds and emits changeTrackValues.
  • Cue buttons: Set in from current time (▼/▲ pair on the left) or out from current time (right), then emit changeTrackValues.
  • No form: Send dispatches dispatchTrack with the current ITrack (minValue, maxValue in seconds).
  • With form: Send is only enabled when the form is valid (hb-form update events). Clicking Send submits the form path; on success, dispatchTrack fires with Object.assign(track, formDetails) (validated form fields merged onto the track object).

Events

Listen with addEventListener or framework equivalents; event.detail shapes:

| Event | detail | | --- | --- | | changeTrackValues | { minVaule: number; maxValue: number } — fired when the trim range or slider changes. Note: the first property is spelled minVaule in the implementation and typings (typo preserved for compatibility). | | dispatchTrack | ITrack (seconds) as the event detail when form is unset. When form is set, the same object shape with validated hb-form fields merged in (Object.assign onto the track). |

CSS custom properties

Theme and layout follow Bulma 1.x tokens. Relevant variables (see extra/docs.ts / styleSetup):

| Variable | Role | | --- | --- | | --hb-slider-background-color | Accent for the nested hb-range-slider (trim bar). The markup maps it from --bulma-primary by default; set it on hb-editor-video to retint the slider independently. | | --bulma-primary | Primary Send button and default slider accent when mapped in markup. | | --bulma-control-height | Line box for the duration row and width of small time inputs. | | --bulma-link | Link-styled Bulma tokens where they apply. |

CSS ::part names

None.

Slots

None.

Minimal examples

Trim only (no form):

<hb-editor-video
  src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"
  track='{"minValue":0,"maxValue":120}'
></hb-editor-video>

With a small metadata form (schema is a JSON string; this matches the Storybook-style example in extra/docs.ts):

<hb-editor-video
  id="my-editor"
  src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"
  track='{"minValue":0,"maxValue":5}'
  form='[{"type":"text","id":"clipTitle","label":"Clip title","required":false,"value":"","placeholder":"Optional label"}]'
></hb-editor-video>

Listening from JavaScript:

const el = document.querySelector("hb-editor-video");

el.addEventListener("changeTrackValues", (e) => {
  console.log(e.detail.minVaule, e.detail.maxValue);
});

el.addEventListener("dispatchTrack", (e) => {
  console.log("final selection", e.detail);
});

TypeScript (authoring)

From types/webcomponent.type.d.ts:

export interface ITrack {
  minValue: number;
  maxValue: number;
}

export type Component = {
  id?: string;
  style?: string;
  src: string;
  form?: string;
  track?: ITrack;
};

export type Events = {
  changeTrackValues: { minVaule: number; maxValue: number };
  dispatchTrack: ITrack & Record<string, unknown>;
};

License

Package metadata in extra/docs.ts lists Apache-2.0 (LICENSE.md). The Svelte source file header may still cite MIT for historical attribution; treat the package license as authoritative for distribution.