Giter VIP home page Giter VIP logo

sanity-snippets's People

Contributors

aratramba avatar hdoro avatar jayne-mast avatar simeongriggs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

sanity-snippets's Issues

[tip] regex camelCase field name and Sentence case title

Most of the time I name fields the name and title values are the same, just formatted differently. Here's a snippet I use to take a camel case title, convert it to sentence case, and jump straight to the type. Thought I'd share this in case anyone would find it useful.

Screen Recording 2020-12-08 at 20 34 43-2

{
  "description": "Sanity field",
  "prefix": "field",
  "body": ["{", "\ttitle: '${1/(^.)|([A-Z](?=[a-z]))/${1:/upcase}${2:+ }${2:/downcase}/g}',", "\tname: '$1',", "\ttype: '$2',", "}"]
}

Provide an option to select each schema types

It would be great if we could select schema type for each field listed here: https://www.sanity.io/docs/schema-types

Currently, it provides only "sanityFld". For example, If I wanted to add Image schema inside a document, its not possible.

Option 1: Add manual schema type for every schema type
Option 2: Add VSCode Intellisense for each "type" in "sanityfld"

or, the cheapest option, provide an option to choose schama type for "type" same as you have given for SanitySchema Type object | document

Thanks a lot for this great extension.

Apply schema snippets to react typescript (*.tsx) files

Thanks, loving this so far. It is possible to use react in schema definition files to override the preview and editor experience. Those files require a .tsx extension. The snippets only seem to light up in typescript .ts files however. Is it possible to get these to work in *.tsx files?

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.