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

editableboard-vue

v1.1.2

Published

A chess position editor component for Vue JS (>= 3), written in Typescript.

Downloads

182

Readme

Editable board component

A chess position editor component for Vue JS (>= 3), written in Typescript.

Usage

  1. With your package manager, add the 'editableboard-vue' package (e.g bun add editableboard-vue)
  2. In you main.js add the following content :
import EditableBoardVueComponent from "editableboard-vue";
import "editableboard-vue/dist/style.css";
  1. Don't forget to use the component (in the same file), e.g :
createApp(App)
  .use(EditableBoardVueComponent) //add this line
  .use(pinia)
  .use(router);
  1. You can use the EditableBoardVue component from any template in your project. E.g :
<EditableBoardVue
  :size="500"
  ref="board"
  :reversed="reversed"
  :white-turn="whiteTurn"
/>

Documentation

Attributes

| Name | Purpose | Type | Default | | ------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------- | ----------- | | size | Defines the common width and height of the board, in pixels. | number | 100 | | whiteTurn | Says if the turn indicator at bottom of the board shows a white turn. | boolean | false | | reversed | Says if the black side is at bottom of the board. | boolean | false | | background | Defines the overall background color of the board. | string | #124589 | | coordinatesVisible | Says if the coordinates (around the cells) are visible. | boolean | true | | coordinatesColor | Defines the text color of the coordinates. | string | yellow | | whiteCellsColor | Defines the color of the white cells. | string | navajowhite | | blackCellsColor | Defines the color of the black cells. | string | peru |

Methods

getBoardCode

Get the board position Forsyth-Edwards Notation : only returns the first part of the specification, the part related to the board.

This method does not take any parameter and does not return anything.

setCurrentEditingValue

Sets the current editing piece value, in Forsyth-Edwards Notation. For example : give 'K' for setting white king as the editing value. Also, if you want to define the erase value, simply pass an empty string. The first value, before any call to this method, is the erase value ('').

| Field name | Purpose | Type | Default | |------------|:--------------------------------------:|-------:|-------------| | value | Defines the current editing piece FEN. | string | Not defined |

This method does not return anything.

setFromBoardCode

Sets the position of the board, in Forsyth-Edwards Notation, though only the first part of the string will be taken into account (not even the player type, as you have the property whiteTurn for that purpose). The first value, before any call to this method or any editing from the user, is the standard position of chess.

| Field name | Purpose | Type | Default | |---------------|:---------------------------------------------:|-------:|-------------| | boardFen | Defines the current position in FEN notation. | string | Not defined |

This method does return anything.

For developers

Building

  1. Install dependencies : e.g with bun bun install
  2. Build : e.g with bun bun run vue-tsc && bun run vite build

Credits

Pieces vectors definitions from CBurnett and found on Wikimedia commons.