@sanity/cli-test 0.0.2-alpha.13 → 0.0.2-alpha.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,11 +16,11 @@
16
16
  "@sanity/sdk-react": "^2.6.0",
17
17
  "react": "^19.2.3",
18
18
  "react-dom": "^19.2.3",
19
- "sanity": "^5.9.0"
19
+ "sanity": "^5.12.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/react": "^19.2.9",
23
- "sanity": "^5.9.0",
23
+ "sanity": "^5.12.0",
24
24
  "typescript": "^5.9.3"
25
25
  }
26
26
  }
@@ -15,10 +15,10 @@
15
15
  "start": "sanity start"
16
16
  },
17
17
  "dependencies": {
18
- "@sanity/vision": "^5.9.0",
18
+ "@sanity/vision": "^5.12.0",
19
19
  "react": "^19.2.3",
20
20
  "react-dom": "^19.2.3",
21
- "sanity": "^5.9.0",
21
+ "sanity": "^5.12.0",
22
22
  "styled-components": "^6.3.8"
23
23
  },
24
24
  "devDependencies": {
@@ -15,10 +15,10 @@
15
15
  "start": "sanity start"
16
16
  },
17
17
  "dependencies": {
18
- "@sanity/vision": "^5.9.0",
18
+ "@sanity/vision": "^5.12.0",
19
19
  "react": "^19.2.3",
20
20
  "react-dom": "^19.2.3",
21
- "sanity": "^5.9.0",
21
+ "sanity": "^5.12.0",
22
22
  "styled-components": "^6.3.8"
23
23
  },
24
24
  "devDependencies": {
@@ -16,11 +16,11 @@
16
16
  "@sanity/sdk-react": "^2.6.0",
17
17
  "react": "^19.2.3",
18
18
  "react-dom": "^19.2.3",
19
- "sanity": "^5.9.0"
19
+ "sanity": "^5.12.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/react": "^19.2.9",
23
- "sanity": "^5.9.0",
23
+ "sanity": "^5.12.0",
24
24
  "typescript": "^5.9.3"
25
25
  }
26
26
  }
@@ -15,7 +15,7 @@
15
15
  "dependencies": {
16
16
  "react": "^19.2.3",
17
17
  "react-dom": "^19.2.3",
18
- "sanity": "^5.9.0",
18
+ "sanity": "^5.12.0",
19
19
  "styled-components": "^6.3.8"
20
20
  },
21
21
  "devDependencies": {
@@ -0,0 +1 @@
1
+ SANITY_STUDIO_PREFIXED_VAR=yes-this-is-prefixed
@@ -0,0 +1,80 @@
1
+ import {styled} from 'styled-components'
2
+
3
+ const CustomBox = styled.div`
4
+ animation: 3s linear 0s infinite normal none spin;
5
+ background: white;
6
+ border: 1px solid black;
7
+ cursor: pointer;
8
+ height: 40px;
9
+ width: 40px;
10
+ &:hover {
11
+ background: red;
12
+ }
13
+ @keyframes spin {
14
+ from {
15
+ transform: rotate(0);
16
+ }
17
+ to {
18
+ transform: rotate(180deg);
19
+ }
20
+ }
21
+ `
22
+
23
+ export default {
24
+ fields: [
25
+ {
26
+ description: <span style={{textDecoration: 'line-through'}}>Title description</span>,
27
+ name: 'title',
28
+ title: <em style={{textDecoration: 'underline'}}>Title</em>,
29
+ type: 'string',
30
+ },
31
+ {
32
+ description: (
33
+ <div>
34
+ <div>Image description šŸ“·</div>
35
+ <div style={{display: 'inline-block', padding: '2em'}}>
36
+ <a href="https://www.sanity.io" rel="noopener noreferrer" target="_blank">
37
+ <CustomBox />
38
+ </a>
39
+ </div>
40
+ </div>
41
+ ),
42
+ name: 'image',
43
+ title: <span>Image šŸ–¼ļø</span>,
44
+ type: 'image',
45
+ },
46
+ {
47
+ description: (
48
+ <span>
49
+ Subtitle description <span style={{color: 'red'}}>x ← x - (Jįµ€J + Ī»Iā‚™ą¼ā‚™)⁻¹ Jįµ€r</span>
50
+ <script>window.alert('šŸ‘»')</script>
51
+ </span>
52
+ ),
53
+ name: 'subtitle',
54
+ title: (
55
+ <div>
56
+ <h1 style={{fontWeight: 'bold'}}>Subtitle (h1)</h1>
57
+ <h2>Subtitle (h2)</h2>
58
+ <h3>Subtitle (h3)</h3>
59
+ </div>
60
+ ),
61
+ type: 'string',
62
+ },
63
+ ],
64
+ name: 'fieldComponentsTest',
65
+ preview: {
66
+ prepare({media, title}: any) {
67
+ return {
68
+ media,
69
+ subtitle: 'example subtitle',
70
+ title: title,
71
+ }
72
+ },
73
+ select: {
74
+ media: 'image',
75
+ title: 'title',
76
+ },
77
+ },
78
+ title: 'Fields with React components',
79
+ type: 'document',
80
+ }
@@ -16,10 +16,11 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@sanity/code-input": "^7.0.6",
19
- "@sanity/vision": "^5.9.0",
19
+ "@sanity/vision": "^5.12.0",
20
20
  "react": "^19.2.3",
21
21
  "react-dom": "^19.2.3",
22
- "sanity": "^5.9.0",
22
+ "sanity": "^5.12.0",
23
+ "sanity-plugin-media": "^4.1.1",
23
24
  "styled-components": "^6.3.8",
24
25
  "vite-tsconfig-paths": "^6.0.5"
25
26
  },
@@ -3,11 +3,14 @@ import {visionTool} from '@sanity/vision'
3
3
  // eslint-disable-next-line import/no-unresolved
4
4
  import {theme} from 'https://themer.sanity.build/api/hues?preset=dew'
5
5
  import {defineConfig, defineField, defineType} from 'sanity'
6
+ import {media} from 'sanity-plugin-media'
6
7
  import {structureTool} from 'sanity/structure'
7
8
 
8
9
  import DescriptionInput from '@/descriptionInput'
9
10
  import {schemaTypes} from '@/schemaTypes'
10
11
 
12
+ import fieldComponentsTest from './fieldComponentsTest.jsx'
13
+
11
14
  // Look ma, dynamic imports in the config šŸ™ˆ
12
15
  // Look ma, top level await in the config šŸ™ˆ
13
16
  const arbitraryImport = await import('@/defines')
@@ -22,12 +25,12 @@ export default defineConfig({
22
25
  // @ts-expect-error - defined through vite's `define` option in CLI config
23
26
  projectId: PROJECT_ID,
24
27
 
25
- plugins: [structureTool(), visionTool(), codeInput()],
28
+ plugins: [structureTool(), visionTool(), codeInput(), media()],
26
29
 
27
30
  schema: {
28
31
  types: [
29
32
  ...schemaTypes,
30
-
33
+ fieldComponentsTest,
31
34
  defineType({
32
35
  fields: [
33
36
  defineField({name: 'title', type: 'string'}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/cli-test",
3
- "version": "0.0.2-alpha.13",
3
+ "version": "0.0.2-alpha.15",
4
4
  "description": "Sanity CLI test helpers and utilities",
5
5
  "keywords": [
6
6
  "sanity",
@@ -50,7 +50,7 @@
50
50
  "devDependencies": {
51
51
  "@eslint/compat": "^2.0.2",
52
52
  "@oclif/core": "^4.8.0",
53
- "@sanity/client": "^7.14.1",
53
+ "@sanity/client": "^7.16.0",
54
54
  "@sanity/pkg-utils": "^10.4.4",
55
55
  "@swc/cli": "^0.8.0",
56
56
  "@types/node": "^20.19.33",
@@ -61,16 +61,16 @@
61
61
  "typescript": "^5.9.3",
62
62
  "vitest": "^4.0.18",
63
63
  "yaml": "^2.8.2",
64
- "@repo/tsconfig": "3.70.0",
65
64
  "@repo/package.config": "0.0.1",
66
- "@sanity/cli-core": "0.1.0-alpha.14",
65
+ "@repo/tsconfig": "3.70.0",
66
+ "@sanity/cli-core": "0.1.0-alpha.16",
67
67
  "@sanity/eslint-config-cli": "0.0.0-alpha.2"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "@oclif/core": "^4.0.0",
71
71
  "@sanity/client": "^7.0.0",
72
72
  "vitest": ">=3.0.0 <5.0.0",
73
- "@sanity/cli-core": "0.1.0-alpha.14"
73
+ "@sanity/cli-core": "0.1.0-alpha.16"
74
74
  },
75
75
  "engines": {
76
76
  "node": ">=20.19.1 <22 || >=22.12"