This commit is contained in:
grtsinry43 2025-09-16 12:21:02 +08:00
parent 23af440616
commit 1457e0b17d
Signed by: grtsinry43
GPG Key ID: F3305FB3A978C934
9 changed files with 232 additions and 14 deletions

26
pnpm-lock.yaml generated
View File

@ -6330,16 +6330,16 @@ snapshots:
'@pkgjs/parseargs@0.11.0':
optional: true
'@portabletext/block-tools@1.1.22(@sanity/types@3.87.1(@types/react@18.3.20))(@types/react@18.3.20)':
'@portabletext/block-tools@1.1.22(@sanity/types@3.87.1(@types/react@18.3.20)(debug@4.4.0))(@types/react@18.3.20)':
dependencies:
'@sanity/types': 3.87.1(@types/react@18.3.20)(debug@4.4.0)
'@types/react': 18.3.20
get-random-values-esm: 1.0.2
lodash: 4.17.21
'@portabletext/editor@1.48.11(@sanity/schema@3.87.1(@types/react@18.3.20)(debug@4.4.0))(@sanity/types@3.87.1(@types/react@18.3.20))(@types/react@18.3.20)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rxjs@7.8.2)':
'@portabletext/editor@1.48.11(@sanity/schema@3.87.1(@types/react@18.3.20)(debug@4.4.0))(@sanity/types@3.87.1(@types/react@18.3.20)(debug@4.4.0))(@types/react@18.3.20)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rxjs@7.8.2)':
dependencies:
'@portabletext/block-tools': 1.1.22(@sanity/types@3.87.1(@types/react@18.3.20))(@types/react@18.3.20)
'@portabletext/block-tools': 1.1.22(@sanity/types@3.87.1(@types/react@18.3.20)(debug@4.4.0))(@types/react@18.3.20)
'@portabletext/patches': 1.1.3
'@portabletext/to-html': 2.0.14
'@sanity/schema': 3.87.1(@types/react@18.3.20)(debug@4.4.0)
@ -6626,7 +6626,7 @@ snapshots:
- '@types/react'
- supports-color
'@sanity/insert-menu@1.1.11(@emotion/is-prop-valid@1.2.2)(@sanity/types@3.87.1(@types/react@18.3.20))(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1)(styled-components@6.1.17(react-dom@18.3.1(react@18.3.1))(react@18.3.1))':
'@sanity/insert-menu@1.1.11(@emotion/is-prop-valid@1.2.2)(@sanity/types@3.87.1(@types/react@18.3.20)(debug@4.4.0))(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1)(styled-components@6.1.17(react-dom@18.3.1(react@18.3.1))(react@18.3.1))':
dependencies:
'@sanity/icons': 3.7.0(react@18.3.1)
'@sanity/types': 3.87.1(@types/react@18.3.20)(debug@4.4.0)
@ -6688,15 +6688,15 @@ snapshots:
- '@types/react'
- supports-color
'@sanity/presentation-comlink@1.0.18(@sanity/client@7.0.0)(@sanity/types@3.87.1(@types/react@18.3.20))':
'@sanity/presentation-comlink@1.0.18(@sanity/client@7.0.0(debug@4.4.0))(@sanity/types@3.87.1(@types/react@18.3.20)(debug@4.4.0))':
dependencies:
'@sanity/client': 7.0.0(debug@4.4.0)
'@sanity/comlink': 3.0.2
'@sanity/visual-editing-types': 1.0.17(@sanity/client@7.0.0)(@sanity/types@3.87.1(@types/react@18.3.20))
'@sanity/visual-editing-types': 1.0.17(@sanity/client@7.0.0(debug@4.4.0))(@sanity/types@3.87.1(@types/react@18.3.20)(debug@4.4.0))
transitivePeerDependencies:
- '@sanity/types'
'@sanity/preview-url-secret@2.1.10(@sanity/client@7.0.0)':
'@sanity/preview-url-secret@2.1.10(@sanity/client@7.0.0(debug@4.4.0))':
dependencies:
'@sanity/client': 7.0.0(debug@4.4.0)
'@sanity/uuid': 3.0.2
@ -6859,7 +6859,7 @@ snapshots:
- react-dom
- react-is
'@sanity/visual-editing-types@1.0.17(@sanity/client@7.0.0)(@sanity/types@3.87.1(@types/react@18.3.20))':
'@sanity/visual-editing-types@1.0.17(@sanity/client@7.0.0(debug@4.4.0))(@sanity/types@3.87.1(@types/react@18.3.20)(debug@4.4.0))':
dependencies:
'@sanity/client': 7.0.0(debug@4.4.0)
optionalDependencies:
@ -9685,8 +9685,8 @@ snapshots:
'@dnd-kit/sortable': 7.0.2(@dnd-kit/core@6.3.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)
'@dnd-kit/utilities': 3.2.2(react@18.3.1)
'@juggle/resize-observer': 3.4.0
'@portabletext/block-tools': 1.1.22(@sanity/types@3.87.1(@types/react@18.3.20))(@types/react@18.3.20)
'@portabletext/editor': 1.48.11(@sanity/schema@3.87.1(@types/react@18.3.20)(debug@4.4.0))(@sanity/types@3.87.1(@types/react@18.3.20))(@types/react@18.3.20)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rxjs@7.8.2)
'@portabletext/block-tools': 1.1.22(@sanity/types@3.87.1(@types/react@18.3.20)(debug@4.4.0))(@types/react@18.3.20)
'@portabletext/editor': 1.48.11(@sanity/schema@3.87.1(@types/react@18.3.20)(debug@4.4.0))(@sanity/types@3.87.1(@types/react@18.3.20)(debug@4.4.0))(@types/react@18.3.20)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rxjs@7.8.2)
'@portabletext/react': 3.2.1(react@18.3.1)
'@portabletext/toolkit': 2.0.17
'@rexxars/react-json-inspector': 9.0.1(react@18.3.1)
@ -9705,13 +9705,13 @@ snapshots:
'@sanity/id-utils': 1.0.0
'@sanity/image-url': 1.1.0
'@sanity/import': 3.38.2(@types/react@18.3.20)
'@sanity/insert-menu': 1.1.11(@emotion/is-prop-valid@1.2.2)(@sanity/types@3.87.1(@types/react@18.3.20))(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1)(styled-components@6.1.17(react-dom@18.3.1(react@18.3.1))(react@18.3.1))
'@sanity/insert-menu': 1.1.11(@emotion/is-prop-valid@1.2.2)(@sanity/types@3.87.1(@types/react@18.3.20)(debug@4.4.0))(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1)(styled-components@6.1.17(react-dom@18.3.1(react@18.3.1))(react@18.3.1))
'@sanity/logos': 2.1.13(@sanity/color@3.0.6)(react@18.3.1)
'@sanity/message-protocol': 0.9.0
'@sanity/migrate': 3.87.1(@types/react@18.3.20)
'@sanity/mutator': 3.87.1(@types/react@18.3.20)
'@sanity/presentation-comlink': 1.0.18(@sanity/client@7.0.0)(@sanity/types@3.87.1(@types/react@18.3.20))
'@sanity/preview-url-secret': 2.1.10(@sanity/client@7.0.0)
'@sanity/presentation-comlink': 1.0.18(@sanity/client@7.0.0(debug@4.4.0))(@sanity/types@3.87.1(@types/react@18.3.20)(debug@4.4.0))
'@sanity/preview-url-secret': 2.1.10(@sanity/client@7.0.0(debug@4.4.0))
'@sanity/schema': 3.87.1(@types/react@18.3.20)(debug@4.4.0)
'@sanity/sdk': 0.0.0-alpha.25(@types/react@18.3.20)(debug@4.4.0)(immer@10.1.1)(react@18.3.1)(use-sync-external-store@1.5.0(react@18.3.1))
'@sanity/telemetry': 0.8.1(react@18.3.1)

3
pnpm-workspace.yaml Normal file
View File

@ -0,0 +1,3 @@
onlyBuiltDependencies:
- esbuild
- sharp

View File

@ -0,0 +1,67 @@
import {defineArrayMember, defineType} from 'sanity'
/**
* This is the schema definition for the rich text fields used for
* for this blog studio. When you import it in schemas.js it can be
* reused in other parts of the studio with:
* {
* name: 'someName',
* title: 'Some title',
* type: 'blockContent'
* }
*/
export default defineType({
title: 'Block Content',
name: 'blockContent',
type: 'array',
of: [
defineArrayMember({
title: 'Block',
type: 'block',
// Styles let you set what your user can mark up blocks with. These
// correspond with HTML tags, but you can set any title or value
// you want and decide how you want to deal with it where you want to
// use your content.
styles: [
{title: 'Normal', value: 'normal'},
{title: 'H1', value: 'h1'},
{title: 'H2', value: 'h2'},
{title: 'H3', value: 'h3'},
{title: 'H4', value: 'h4'},
{title: 'Quote', value: 'blockquote'},
],
lists: [{title: 'Bullet', value: 'bullet'}],
// Marks let you mark up inline text in the block editor.
marks: {
// Decorators usually describe a single property e.g. a typographic
// preference or highlighting by editors.
decorators: [
{title: 'Strong', value: 'strong'},
{title: 'Emphasis', value: 'em'},
],
// Annotations can be any object structure e.g. a link or a footnote.
annotations: [
{
title: 'URL',
name: 'link',
type: 'object',
fields: [
{
title: 'URL',
name: 'href',
type: 'url',
},
],
},
],
},
}),
// You can add additional types here. Note that you can't use
// primitive types such as 'string' and 'number' in the same array
// as a block type.
defineArrayMember({
type: 'image',
options: {hotspot: true},
}),
],
})

View File

@ -0,0 +1,15 @@
import {defineField, defineType} from 'sanity'
export default defineType({
name: 'developmentHistory',
title: '发展历史',
type: 'document',
fields: [
defineField({
name: 'events',
title: 'Events',
type: 'array',
of: [{type: 'developmentHistoryEvent'}],
}),
],
})

View File

@ -0,0 +1,38 @@
import {defineField, defineType} from 'sanity'
export default defineType({
name: 'developmentHistoryEvent',
title: 'Development History Event',
type: 'object',
fields: [
defineField({
name: 'timestamp',
title: 'Timestamp',
type: 'datetime',
}),
defineField({
name: 'event',
title: 'Event',
type: 'string',
}),
defineField({
name: 'description',
title: 'Description',
type: 'text',
}),
],
preview: {
select: {
title: 'event',
subtitle: 'timestamp',
},
prepare(selection) {
const {title, subtitle} = selection
const date = subtitle ? new Date(subtitle).toLocaleDateString() : ''
return {
title: title,
subtitle: date,
}
},
},
})

View File

@ -1 +1,18 @@
export const schemaTypes = []
import blockContent from './blockContent'
import techStack from './techStack'
import project from './project'
import teamComposition from './teamComposition'
import developmentHistory from './developmentHistory'
import developmentHistoryEvent from './developmentHistoryEvent'
export const schemaTypes = [
// Document types
techStack,
project,
teamComposition,
developmentHistory,
// Other types
blockContent,
developmentHistoryEvent,
]

39
schemaTypes/project.ts Normal file
View File

@ -0,0 +1,39 @@
import {defineField, defineType} from 'sanity'
export default defineType({
name: 'project',
title: '项目',
type: 'document',
fields: [
defineField({
name: 'name',
title: 'Name',
type: 'string',
}),
defineField({
name: 'screenshot',
title: 'Screenshot',
type: 'image',
options: {
hotspot: true,
},
}),
defineField({
name: 'techStack',
title: 'Tech Stack',
type: 'array',
of: [{type: 'string'}],
}),
defineField({
name: 'deployUrl',
title: 'Deployment URL',
type: 'url',
}),
defineField({
name: 'description',
title: 'Description',
type: 'text',
}),
],
})

View File

@ -0,0 +1,19 @@
import {defineField, defineType} from 'sanity'
export default defineType({
name: 'teamComposition',
title: '团队组成',
type: 'document',
fields: [
defineField({
name: 'department',
title: 'Department',
type: 'string',
}),
defineField({
name: 'numberOfPeople',
title: 'Number of People',
type: 'number',
}),
],
})

20
schemaTypes/techStack.ts Normal file
View File

@ -0,0 +1,20 @@
import {defineField, defineType} from 'sanity'
export default defineType({
name: 'techStack',
title: '技术栈',
type: 'document',
fields: [
defineField({
name: 'domain',
title: 'Domain',
type: 'string',
}),
defineField({
name: 'keywords',
title: 'Keywords',
type: 'array',
of: [{type: 'string'}],
}),
],
})