sanity-io / color-input Goto Github PK
View Code? Open in Web Editor NEWColor input and schema for Sanity Studio
License: MIT License
Color input and schema for Sanity Studio
License: MIT License
The main Sanity package recently added support for Styled Components v6, however this package still specifies ^5.2 creating a dependency conflict.
Hi!
I was using this plugin on a Astro website, but whenever I want to use the plugin in my Remix project where I embed the Studio, it gives me this error
SyntaxError: The requested module '@sanity/color-input' does not provide an export named 'colorInput'
import { colorInput } from '@sanity/color-input'
import { visionTool } from '@sanity/vision'
import { defineConfig, isDev } from 'sanity'
import { deskTool } from 'sanity/desk'
import { defaultDocumentNodeResolver, structure } from '#sanity-desk/index.tsx'
import { schemaTypes } from '#sanity-schema/index.ts'
const devOnlyPlugins = [visionTool()]
export const config = defineConfig({
dataset: 'production',
projectId: 'YOUR_PROJECT_ID', // Project id is set dynamically in website cms route.
name: 'sanity-remix',
title: 'Sanity Remix',
schema: {
types: schemaTypes,
},
plugins: [
deskTool({
structure: structure,
defaultDocumentNode: defaultDocumentNodeResolver,
}),
colorInput(),
...(isDev ? devOnlyPlugins : []),
],
basePath: ``, // Base path is set dynamically in website cms route.
})
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: Cannot find preset's package (config:recommended). Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
Using a curated preset maintained by
These branches will be created by Renovate only once you click their checkbox below.
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
@typescript-eslint/eslint-plugin
, @typescript-eslint/parser
)These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@sanity/icons
, @sanity/ui
, @types/react
, @types/react-color
, @types/styled-components
, @types/tinycolor2
, eslint
, prettier-plugin-packagejson
, sanity
)@commitlint/cli
, @commitlint/config-conventional
).github/workflows/main.yml
actions/checkout v4
actions/setup-node v4
actions/checkout v4
actions/setup-node v4
actions/checkout v4
actions/setup-node v4
package.json
@sanity/icons ^2.0.0
@sanity/incompatible-plugin ^1.0.4
@sanity/ui ^1.0.0
lodash ^4.17.21
react-color ^2.19.3
@commitlint/cli ^17.8.1
@commitlint/config-conventional ^17.8.1
@sanity/pkg-utils ^2.4.10
@sanity/plugin-kit ^3.1.10
@sanity/semantic-release-preset ^4.1.6
@types/react ^18.2.33
@types/react-color ^2.17.9
@types/styled-components ^5.1.29
@types/tinycolor2 ^1.4.5
@typescript-eslint/eslint-plugin ^5.62.0
@typescript-eslint/parser ^5.62.0
eslint ^8.52.0
eslint-config-prettier ^8.10.0
eslint-config-sanity ^6.0.0
eslint-plugin-prettier ^4.2.1
eslint-plugin-react ^7.33.2
eslint-plugin-react-hooks ^4.6.0
npm-run-all ^4.1.5
prettier ^2.8.8
prettier-plugin-packagejson ^2.4.6
react ^18.2.0
react-dom ^18.2.0
react-is ^18.2.0
rimraf ^5.0.0
sanity ^3.19.0
semantic-release ^21.1.2
styled-components ^5.3.11
typescript ^4.9.5
react ^18
sanity ^3
styled-components ^5.2
node >=14
The color filed is always closed by default. Any way to have it opened by default?
Color input suddenly quit working when I upgraded Sanity versions. The studio runs fun but when I go to a document where the color input is being used as a field it crashes.
The error I'm receiving in studio is:
**Unhandled Runtime Error** TypeError: Cannot read properties of undefined (reading 'sanity')
It's throwing a typescript error in my sanity.config.ts
Here is my current package.json:
"private": true,
"scripts": {
"build": "next build",
"dev": "next",
"format": "npx prettier --write . --ignore-path .gitignore",
"lint": "next lint -- --ignore-path .gitignore",
"lint:fix": "npm run format && npm run lint -- --fix",
"start": "next start",
"type-check": "tsc --noEmit"
},
"prettier": {
"semi": false,
"singleQuote": true
},
"dependencies": {
"@gsid/react-time-ago": "^7.2.5",
"@marketsystems/nextjs13-appdir-breadcrumbs": "^1.0.4",
"@portabletext/react": "^3.0.4",
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-icons": "^1.3.0",
"@sanity/client": "^6.4.4",
"@sanity/color-input": "^3.1.0",
"@sanity/document-internationalization": "^2.0.1",
"@sanity/image-url": "^1.0.2",
"@sanity/vision": "^3.15.0",
"@stitches/react": "^1.2.8",
"@vercel/og": "^0.5.10",
"classnames": "^2.3.2",
"date-fns": "^2.30.0",
"intl-segmenter-polyfill": "^0.4.4",
"javascript-time-ago": "^2.5.9",
"moment-timezone": "^0.5.43",
"next": "^13.4.13",
"next-sanity": "^5.2.3",
"next-sanity-image": "^6.1.0",
"react": "^18.2.0",
"react-confetti": "^6.1.0",
"react-dom": "^18.2.0",
"react-icons": "^4.10.1",
"react-share": "^4.4.1",
"react-social-media-embed": "^2.3.3",
"sanity": "3.16.7",
"sanity-plugin-asset-source-unsplash": "^1.1.0",
"sanity-plugin-internationalized-array": "^1.10.1",
"styled-components": "^5.3.6",
"suspend-react": "^0.1.3",
"swiper": "^10.3.0",
"swr": "^2.2.0",
"use-mailchimp-form": "^3.1.0"
},
"devDependencies": {
"@types/node": "20.4.8",
"@types/react": "18.2.18",
"autoprefixer": "^10.4.13",
"eslint": "^8.46.0",
"eslint-config-next": "13.4.12",
"eslint-plugin-simple-import-sort": "^10.0.0",
"postcss": "^8.4.27",
"prettier": "^3.0.1",
"prettier-plugin-packagejson": "^2.4.5",
"prettier-plugin-tailwindcss": "^0.4.1",
"tailwindcss": "3.3.3",
"typescript": "5.1.6"
},
"engines": {
"node": ">=16"
}
}
Is your feature request related to a problem? Please describe.
I want content editors to stick to the predefined colors so they don't pick colors on the picker that mess up the aesthetic of the page/content.
Describe the solution you'd like
An option to disable the color picker(and input fields) so only the predefined colors are displayed and selectable.
Describe alternatives you've considered
...
Additional context
...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.