Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add back the @sanity/color-input plugin to test studio #7502

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dev/test-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@sanity/block-tools": "3.57.3",
"@sanity/client": "^6.21.3",
"@sanity/color": "^3.0.0",
"@sanity/color-input": "^4.0.1",
"@sanity/google-maps-input": "^4.0.0",
"@sanity/icons": "^3.4.0",
"@sanity/image-url": "^1.0.2",
Expand Down
2 changes: 2 additions & 0 deletions dev/test-studio/sanity.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {assist} from '@sanity/assist'
import {colorInput} from '@sanity/color-input'
import {googleMapsInput} from '@sanity/google-maps-input'
import {BookIcon} from '@sanity/icons'
import {koKRLocale} from '@sanity/locale-ko-kr'
Expand Down Expand Up @@ -127,6 +128,7 @@ const sharedSettings = definePlugin({
lng: -74.1180863,
},
}),
colorInput(),
workshopTool({
collections: [
{name: 'sanity', title: 'sanity'},
Expand Down
146 changes: 82 additions & 64 deletions dev/test-studio/schema/plugins/color.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,69 +50,87 @@ export default defineType({
title: 'Title',
type: 'string',
},
// {
// name: 'testColor1',
// title: 'Color to be used in preview',
// description: 'A color input',
// type: 'color',
// },
// {
// name: 'testColor2',
// title: 'Color with no alpha',
// description: 'A color input with no alpha',
// type: 'color',
// options: {
// disableAlpha: true,
// },
// },
// {
// name: 'colorList',
// title: 'List of colors',
// description: 'An array of colors with the built in color preview',
// type: 'array',
// of: [
// {
// type: 'color',
// },
// ],
// },
// {
// name: 'readOnlyColor',
// title: 'Read-only color',
// description: 'Color input in readOnly mode',
// readOnly: true,
// type: 'color',
// },
// {
// name: 'colorGrid',
// title: 'Grid of colors',
// description: 'An grid of colors with the built in color preview',
// type: 'array',
// options: {
// layout: 'grid',
// },
// of: [
// {
// type: 'color',
// },
// ],
// },
// {
// name: 'objectWithObjectWithColors',
// title: 'Object with object with colors',
// type: 'object',
// fields: [
// {
// name: 'objectWithColors',
// title: 'Object with colors',
// type: 'object',
// fields: [
// {name: 'primaryColor', title: 'Primary color', type: 'color'},
// {name: 'secondaryColor', title: 'Secondary color', type: 'color'},
// {name: 'extraColor', title: 'Extra color', type: 'color'},
// ],
// },
// ],
// },
{
name: 'testColor1',
title: 'Color to be used in preview',
description: 'A color input',
type: 'color',
},
{
name: 'testColor2',
title: 'Color with no alpha',
description: 'A color input with no alpha',
type: 'color',
options: {
disableAlpha: true,
},
},
{
name: 'testColor3',
title: 'Color with presets',
description: 'A color input with a list of preset colors',
type: 'color',
options: {
colorList: [
'#FF6900',
{hex: '#FCB900'},
{r: 123, g: 220, b: 181},
{r: 0, g: 208, b: 132, a: 0.5},
{h: 203, s: 95, l: 77, a: 1},
{h: 202, s: 95, l: 46, a: 0.5},
{h: 345, s: 43, v: 97},
{h: 344, s: 91, v: 92, a: 0.5},
],
},
},
{
name: 'colorList',
title: 'List of colors',
description: 'An array of colors with the built in color preview',
type: 'array',
of: [
{
type: 'color',
},
],
},
{
name: 'readOnlyColor',
title: 'Read-only color',
description: 'Color input in readOnly mode',
readOnly: true,
type: 'color',
},
{
name: 'colorGrid',
title: 'Grid of colors',
description: 'An grid of colors with the built in color preview',
type: 'array',
options: {
layout: 'grid',
},
of: [
{
type: 'color',
},
],
},
{
name: 'objectWithObjectWithColors',
title: 'Object with object with colors',
type: 'object',
fields: [
{
name: 'objectWithColors',
title: 'Object with colors',
type: 'object',
fields: [
{name: 'primaryColor', title: 'Primary color', type: 'color'},
{name: 'secondaryColor', title: 'Secondary color', type: 'color'},
{name: 'extraColor', title: 'Extra color', type: 'color'},
],
},
],
},
],
})
70 changes: 70 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading