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

fml-vue-media-library

v1.0.1

Published

This project is a add-on frontend module to Frontier Media Labs VueCake CMS. This module includes the frontend library for viewing files similar to the Wordpress Vue Media Library.

Downloads

18

Readme

Introduction

This project is a add-on frontend module to Frontier Media Labs VueCake CMS. This module includes the frontend library for viewing files similar to the Wordpress Vue Media Library.

Screenshots

Manager

Manager

Field

Empty field Field with image selected

Getting Started

npm install --save vue-medialibrary

Usage

Vue

    import  MediaLibrary  from  'vue-medialibrary';
    
    Vue.use(MediaLibrary, {
	    API_URL: 'http://urltoapp.tld'
    });

The API_URL is helpful if the application you are using the component in isn't the same application that the Laravel package is installed on. E.g. an SPA.

HTML Template

Manager

    <vue-medialibrary-manager v-if="show" />

Field

    <vue-medialibrary-field v-model="file" />

Manager API

Events

  • @close - this is used when the user has selected the close button in the manager, this should toggle off your original v-if. Naturally without a v-if this component will display at all times.
  • @select - this is primarily used within the field component so shouldn't be required, but it is triggered when the insert button has been selected on a media item. Only works if the selectable prop is set to true.
  • @fail-to-find - again primarily used within the field component so shouldn't be required. This will when a value is already set on the field component go and find that file so when the manager is opened that file is shown in the window on the right. Only works if the selectable prop is set to true.

Props

| Prop | Type | Default | Description |--|--|--|--|

| types | Object | { images: true, files: true } | Property controls whether both images and files can be toggled. Useful if you want to only use images or files. | | filetypes | Array | [] | To limit the media to only certain file types. E.g. [ 'png', 'jpg' ]. | | selectable | Boolean | false | Used by the field component but allows the media to be selectable, which also allows you to use the @select event. | | selected | String | null | Used by the field component but allows you to pass in a filename which will then be automatically opened on the right window e.g. test.jpg. This will also cause the @fail-to-find event to be in operation.|

Field API

Events

  • @close - this is used when the user has selected the close button in the manager, this should toggle off your original v-if. Naturally without a v-if this component will display at all times.
  • @select - this is primarily used within the field component so shouldn't be required, but it is triggered when the insert button has been selected on a media item. Only works if the selectable prop is set to true.
  • @fail-to-find - again primarily used within the field component so shouldn't be required. This will when a value is already set on the field component go and find that file so when the manager is opened that file is shown in the window on the right. Only works if the selectable prop is set to true.

Props

| Prop | Type | Default | Description |--|--|--|--| | types | Object | { images: true, files: true } | Property controls whether both images and files can be toggled within the manager. Useful if you want to only use images or files. | | filetypes | Array | [] | To limit the media to only certain file types. E.g. [ 'png', 'jpg' ] in the manager. | | helper | String | null | This allows you to put helpful message/text into the field. E.g. 'Maximum image width: 100px'. |

Future features

Just some ideas in the making...

  • Drag & Drop, this currently doens't work - you have to use the button currently.
  • Support multiple image variations. e.g. Responsive images.
  • Ability to multi select, or create a repeatable field for multiple images.