Skip to content
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
2 changes: 1 addition & 1 deletion apps/docs/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/types/routes.d.ts";
import "./.next/dev/types/routes.d.ts";

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
5 changes: 3 additions & 2 deletions apps/example-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
"dependencies": {
"@sanity/color-input": "^6.0.2",
"@sanity/dashboard": "^5.0.1",
"@sanity/sanity-plugin-async-list": "1.3.3",
"@sanity/vision": "^5.1.0",
"@seidhr/sanity-plugin-dashboard-widget-muna-docs": "*",
"@seidhr/sanity-plugin-muna-kulturnav-api": "*",
"@seidhr/sanity-plugin-muna-la-external-references": "*",
"@seidhr/sanity-plugin-timespan-input": "*",
"react": "^19.2.3",
"react-dom": "^19.2.3",
Expand All @@ -42,4 +43,4 @@
"bracketSpacing": false,
"singleQuote": true
}
}
}
22 changes: 20 additions & 2 deletions apps/example-studio/sanity.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import { structureTool } from 'sanity/structure'
import { dashboardTool } from "@sanity/dashboard";
import { visionTool } from '@sanity/vision'
import { colorInput } from '@sanity/color-input'
import { APISearchInput } from '@seidhr/sanity-plugin-muna-kulturnav-api'
import { createKulturnavLoader, externalReferenceInput } from '@seidhr/sanity-plugin-muna-la-external-references'
import { munaDocsWidget } from '@seidhr/sanity-plugin-dashboard-widget-muna-docs'
import { timespanInput } from '@seidhr/sanity-plugin-timespan-input'
import { schemaTypes } from './schemas'
import { asyncList } from '@sanity/sanity-plugin-async-list';

export default defineConfig({
name: 'default',
Expand All @@ -23,9 +24,26 @@ export default defineConfig({
munaDocsWidget({ layout: { width: 'auto' } }),
]
}),
APISearchInput({}),
externalReferenceInput({
schemaType: 'kulturnavReference',
loader: createKulturnavLoader({
entityTypes: ['Concept'],
}),
}),
timespanInput(),
colorInput(),
asyncList({
schemaType: 'disneyCharacter', // Name of type to be used in schema definitions
// Loader function to fetch data however you prefer
loader: async () => {
const response = await fetch('https://api.disneyapi.dev/character')
const result: { data: { name: string }[] } = await response.json()

return result.data.map((item) => {
return { value: item.name, ...item }
})
},
}),
],

schema: {
Expand Down
57 changes: 57 additions & 0 deletions apps/example-studio/schemas/Post.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,63 @@ export default defineType({
title: 'Timespan',
type: 'Timespan',
}),
defineField({
name: 'creator',
title: 'Creator',
type: 'array',
description: 'References to people from kulturnav.org',
of: [
{
type: 'kulturnavReference',
// Field-level options override plugin defaults
// This field will search for Person entities instead of Concept
options: {
loaderOptions: {
entityTypes: ['Person'],
},
autocompleteProps: {
placeholder: 'Search for a person...',
},
},
},
],
}),
defineField({
name: 'subjects',
title: 'Subjects',
type: 'array',
description: 'Array of concept references from kulturnav.org',
of: [
{
type: 'kulturnavReference',
// This field uses the plugin default (Concept) from sanity.config.ts
// but you could override it here if needed:
// options: { loaderOptions: { entityTypes: ['Concept'] } }
},
],
}),
defineField({
name: 'related_posts',
title: 'Related Posts',
type: 'array',
description: 'References to other posts',
of: [
{
type: 'reference',
to: [{ type: 'Post' }],
},
],
}),
defineField({
name: 'disney',
type: 'array',
description: 'References to disney characters',
of: [
{
type: 'disneyCharacter',
},
],
}),
],

preview: {
Expand Down
2 changes: 1 addition & 1 deletion apps/example-studio/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"with": [
"@seidhr/sanity-plugin-dashboard-widget-muna-docs#watch",
"@seidhr/sanity-plugin-timespan-input#watch",
"@seidhr/sanity-plugin-muna-kulturnav-api#watch"
"@seidhr/sanity-plugin-muna-la-external-references#watch"
]
}
}
Expand Down
Loading