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

@scaife-viewer/scaife-widgets

v0.14.0

Published

front-end component library for the Scaife Viewer ecosystem

Downloads

148

Readme

Scaife Widgets

front-end component library for the Scaife Viewer ecosystem

npm version github actions

This repository is part of the Scaife Viewer project, an open-source ecosystem for building rich online reading environments.

Citizens

Everything is a component in the Vue sense but we try to distinguish between:

  1. Components - stateless, presentation-only components
  2. Widgets - stateful, Vuex-backed components
  3. Stores - Vuex state stores

Getting Started

$ yarn add @scaife-viewer/scaife-widgets

Import components and widgets like so:

import {
  // components
  HelloWorld,
  Icon,
  Metadata,
  Paginator,
  TextSize,
  TextWidth,
  // widgets
  TextSizeWidget,
  TextWidthWidget,
  PassageAncestorsWidget,
  PassageChildrenWidget,
  PassageReferenceWidget
} from "@scaife-viewer/scaife-widgets";

Import css like so:

<style src='@scaife-viewer/scaife-widgets/dist/scaife-widgets.css'></style>

Import utils like so:

import { URN } from "@scaife-viewer/scaife-widgets";

Import constants like so:

import WIDGETS_NS from "@scaife-viewer/scaife-widgets";

Import and initialize the store like so:

import Vue from "vue";
import Vuex from "vuex";
import App from "./App.vue";
import { scaifeWidgets } from "@scaife-viewer/scaife-widgets";

Vue.use(Vuex);

const store = new Vuex.Store({
  modules: {
    [scaifeWidgets.namespace]: scaifeWidgets.store
  }
});

Vue.config.productionTip = false;

new Vue({
  render: h => h(App),
  store
}).$mount("#app");

See _example/sample for more examples.

TextSizeWidget and TextWidthWidget

The TextSizeWidget and TextWidthWidget widgets must be coupled with a "reader" component along with the appropriate class: text-${textSize} or text-width-${textWidth}, respectively.

Example:

<template>
  <div
    class="reader"
    :class="[`text-${textSize}`, `text-width-${textWidth}`]"
  >
    <!-- reader here -->
  </div>
</template>

Development

Project setup:

$ yarn install

Compile and minify for production:

$ yarn build

Run unit tests:

$ yarn test

Lint:

$ yarn lint

Develop scaife-widgets in parallel with a Scaife Viewer front end:

Within the scaife-widgets repo root directory:

$ yarn link
$ yarn watch

Within the Scaife Viewer front end directory:

$ yarn link "@scaife-viewer/scaife-widgets"
$ yarn serve

The watch script will re-build scaife-widgets when changes are made.

Since the module has been linked via yarn link, the front end's serve script will detect the changes and recompile the front end.

To revert to the canonical scaife-widgets installation within the Scaife Viewer front end:

yarn unlink "scaife-viewer/scaife-widgets"
yarn install --force