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 🙏

© 2024 – Pkg Stats / Ryan Hefner

dragonfly-v

v1.0.169

Published

UI component to preview storyboard data

Downloads

230

Readme

:dragon_face: Dragonfly V (Vimeo)

Dragonfly is a component to parse Vimeo storyboard JSON and display them as they will be rendered.

:cyclone: Local Development

After having cloned the repository, you can initialize all the libraries you need by using these commands

npm install -g yarn
yarn install
cd server
yarn install
cd ..
yarn start

:eyeglasses: Tests

yarn test

:star2: Usage

To create a Dragonfly instance

import Dragonfly from 'dragonfly-v'

<Dragonfly
	storyboard={storyboard}
/>

To change Dragonfly current time

const dragonflyRef = useRef(null);

useEffect(() => {
	dragonflyRef.current.seek(2) // 2 seconds
}, []);

<Dragonfly
	ref={dragonflyRef}
	storyboard={storyboard}
/>

To Play / Pause the Dragonfly

const dragonflyRef = useRef(null);

useEffect(() => {
	dragonflyRef.current.play() // play DF
	// or
	dragonflyRef.current.pause() // pause DF
}, []);

<Dragonfly
	ref={dragonflyRef}
	storyboard={storyboard}
/>

| Prop | Type | Default Value | Notes | | ------------------- | --------- | ------------- | ----------------------------------------------------------------- | | storyboard | JSON | | | compositionOverride | Object | {} | { [elementId]: { rect / userRect, etc.} } - overrides composition | | animationsMetadata | Object | null | Animation metadata with animationId key | | loop | Boolean | false | Will start playing again when reaching duration/endTime | | startTime | Number | 0 | Absolute time in storyboard to start playing - ms | | endTime | number | duration | Absolute time in storyboard to finish playing - ms | | preloadMedia | Boolean | false | When passed, pre-loads the clip's media | | volume | number | 0 | Sets the audio volume of all of the audio elements. | | isSoundtrackEnabled | Boolean | false | Enable / Disable the clip's soundtrack | | isShowLogs | Boolean | false | Enable / Disable logs in the console | | isShowHiddenScenes | Boolean | false | Enable / Disable hidden elements / scenes | | isPosterMode | Boolean | false | Enable / Disable posterMode (show all elements for scene) | | isPlayMode | Boolean | true | Enable / Disable playing capability (webworker) | | isAssumeFontsLoaded | Boolean | false | Enable / Disable font files loading | | fontFamilyDecorator | Function | null | (fontName) => fontFamilyOf(fontName) | | loader | ReactNode | null | React component of the loader |

:nut_and_bolt: Element Types

| Element Type | Notes | | ------------- | ---------------------------------------------------- | | MediaElement | Video / Image Element | | LottieElement | Data / Text Element, those are Lottie based elements |

:sparkles: Events

To register and event use

<Dragonfly
	onLoad={() => ...}
	onTimeUpdate={() => ...}
	onEnded={() => ...}
	onPause={() => ...}
	onLoadedMetadata={(data) => ...}
	...
/>

| Prop | Returned Data | | ---------------- | ---------------------------------------- | | onLoad | | | onTimeUpdate | currentTime in seconds | | onEnded | | | onPause | currentTime in seconds | | onPlay | currentTime in seconds | | onLoadedMetadata | { duration } | | onProgress | { id: string, target: HTMLVideoElement } |

To use Dragonfly duration metadata

const [duration, setDuration] = useState(0);

<Dragonfly
	onLoadedMetadata={(data) => { setDuration(data.duration); }}
/>

:crayon: Fonts

  • In order for fonts to load, DF must run on one of the following domains:
vimeo.com, *.vimeo.com, *.test.magisto.com, *.ci.vimeows.com,  magisto.com, local.cdn.magisto.com, *.magisto.com

:construction: Missing Features

  • Drop shadow for "Cut out" text animation
  • Highlighting for "Cut Out" text animtion

:point_right: Branching

${sections}/${task}-${ticketId}

media/crop-support-EWK-53

general/update-readme-EWK-84

:rocket: Deployment

This repository uses CICD to deploy to production. For every commit to master a new version of dragonfly-v npm package will be created

:couple: Local dev with Editor

  • Go to DF project and run npm run link
  • Go to Editor project package.json and remove "previmeo.dev": "npm i"
  • In Editor project run npm link dragonfly-v
  • In Editor project run npm run vimeo.dev
  • Yay! now you can access all DF files inside editor project :)