Giter VIP home page Giter VIP logo

plugin-template-chess-input's Introduction

plugin-template-chess-input

Plugin template for input component modelling a chess board, including preview

Chess input component for Sanity

Main take-aways

  • Schema types can implement a part to be automatically loaded (part:@sanity/base/schema-type)
  • Schema types can define a default input and preview component
  • Schema types should always be built with the data model and querying concerns in mind. It should not be determined based on how a specific input component takes it's input.
  • Preview components has different contexts based on where they are rendered. They might appear in a list or inside the block content editor, for instance. Make sure it works in different contexts, or defer to the default preview component.
  • When the value of an input changes, create and emit fine-grained patches. This ensures it works well in a real-time setting.
  • Never assume the local state is the same as the remote state. Include setIfMissing-patches for parent paths - _type is often forgotten, but needs to be included at the root of an object. When inserting to an array, emit a setIfMissing patch that initializes the path to an empty array first.

Usage

sanity init plugin https://github.com/sanity-io/plugin-template-chess-input/archive/master.zip

License

MIT-licensed. See LICENSE.

plugin-template-chess-input's People

Contributors

rexxars avatar

Stargazers

Larah Armstrong avatar

Watchers

Simen Svale Skogsrud avatar  avatar even westvang avatar Per-Kristian Nordnes avatar CF avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.