Giter Site home page Giter Site logo

focusreactive / sanity-plugin-inline-svg-input Goto Github PK

View Code? Open in Web Editor NEW
17.0 17.0 2.0 963 KB

Sanity plugin to upload and preview inline SVGs

Home Page: https://www.npmjs.com/package/@focus-reactive/sanity-plugin-inline-svg-input

License: MIT License

TypeScript 96.32% JavaScript 3.68%
input plugin preview sanity-io sanity-studio svg

sanity-plugin-inline-svg-input's People

Contributors

chenaski avatar usulpro avatar

Stargazers

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

Watchers

 avatar

sanity-plugin-inline-svg-input's Issues

Please go through these comments on README before publishing

![preview](preview.gif)

can we put all screenshots to a doc/ folder. then this folder should be in .npmignore and image URL should be absolute ones from gitjub content (this way they will be shown on NPM page)

also can we have here own SVG? e.g. FR logo

add here something like "that's it! now you can use this field to upload SVG images and see the preview in your Sanity Studio". Show the response example of how it will come to frontend. Then "in case you want this field to be used as a document preview, you have to add a few more settings..."

const IconsListItem = defineType({

add how to import component

could you swap here so the type fields go after name

minor but I'd suggest not using name: 'text' because text is also a possible field type

preview: (props: PreviewProps<PreviewLayoutKey>) => {

not clear about PreviewProps and PreviewLayoutKey is it something from Sanity types? show how to import them

return <InlineSvgPreviewItem {...props} />

if component accept only 3 certain props let's better show them directly:

return <InlineSvgPreviewItem title={title} subtitle={subtitile} icon={icon} />

BTW is it really work this way? I thought we couldn't specify the entire card for a component including the title and subtitle

const IconsList = defineType({

please add a few words here to explain that this is a component having an array of bla-bla-bla....
Also let's follow such approach: of: [{ type: iconsListItem.name }],

If you want to use the SVG in your preview component, you can use the `InlineSvgPreviewComponent`:

it's not clear actually what is that about? a preview similar to previous sections would be good and give more details about where this component should be added

pnpm add @focus-reactive/sanity-plugin-inline-svg-input

OMG! It's not compatible with Bun? ๐Ÿ˜

## Develop & test

please add also here a few standard lines about how to run it locally

Double check package.json

"prepublishOnly": "run-s build",

is it something we need to run manually? if publishing process isn't just trivial npm publish please add a "publish" sections to readme

"types": "./dist/index.d.ts",

please make sure we have d.ts file generated on the package build step

I believe we can add a few more keywords here

https://github.com/focusreactive/sanity-plugin-inline-svg-input/blob/cf4aa8e0209debd1657d01bb675f4d439510cdbb/package.json#L74C36-L74C36

minor: do we really need this in dev dependencies?

https://github.com/focusreactive/sanity-plugin-inline-svg-input/blob/cf4aa8e0209debd1657d01bb675f4d439510cdbb/package.json#L50C6-L50C15

do we mention in README that we have this feature?

https://github.com/focusreactive/sanity-plugin-inline-svg-input/blob/cf4aa8e0209debd1657d01bb675f4d439510cdbb/package.json#L78C20-L78C20

does v18 is a requirement?

Add .npmignore

when package don't have NPM ignore file, the .gitignore will be used instead for packing files into a package. so it wouldn't put dist folder

Actually the better practice is to have a separate .npmignore file and use it to control what files we want to have in our npm package. e.g. src could be ignored

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.