This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {uuid} from '@sanity/uuid' | |
import {SanityDocumentLike} from 'sanity' | |
import {defineMigration, create} from 'sanity/migrate' | |
// Update these constants to match your Document Internationalization Plugin configuration | |
const BASE_FIELD = `__i18n_base` | |
const REFS_FIELD = `__i18n_refs` | |
const LANGUAGE_FIELD = `_lang` | |
const ID_SUFFIX = '__i18n' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"editor.padding.top": 10, | |
"editor.lineDecorationsWidth": 20, | |
"breadcrumbs.enabled": false, | |
"github.copilot.editor.enableCodeActions": false, | |
"github.copilot.editor.enableAutoCompletions": true, | |
"editor.cursorBlinking": "solid", | |
"editor.cursorSmoothCaretAnimation": "on", | |
"editor.cursorStyle": "line", | |
"editor.cursorWidth": 18, | |
"editor.fontSize": 20, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
createIfNotExists, | |
defineMigration, | |
} from 'sanity/migrate' | |
type WordPressDataType = | |
| 'categories' | |
| 'posts' | |
| 'tags' | |
| 'users' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* --------------------------------------------------------------------------------- | |
* This file has been generated by Sanity TypeGen. | |
* Command: `sanity typegen generate` | |
* | |
* Any modifications made directly to this file will be overwritten the next time | |
* the TypeScript definitions are generated. Please make changes to the Sanity | |
* schema definitions and/or GROQ queries if you need to update these types. | |
* | |
* For more information on how to use Sanity TypeGen, visit the official documentation: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { KeyedObject, TypedObject } from "sanity"; | |
import PageBuilderContent from "./pageBuilderContent"; | |
import PageBuilderColumns from "./pageBuilderColumns"; | |
const Components = { | |
pageBuilderContent: PageBuilderContent, | |
pageBuilderColumns: PageBuilderColumns, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {useEffect, useState} from 'react' | |
import {ImageAsset, ObjectInputProps, Reference, set, unset, useClient} from 'sanity' | |
type ExtendedImageValue = { | |
asset: Reference | |
lqip?: string | |
blurHash?: string | |
} | |
export default function ImageExtendedInput(props: ObjectInputProps<ExtendedImageValue>) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {useState, useEffect, useCallback} from 'react' | |
import {useToast, Card, Button, Stack, Text, Code} from '@sanity/ui' | |
import {extractWithPath} from '@sanity/mutator' | |
import { | |
Preview, | |
DocumentActionProps, | |
SanityDocument, | |
useClient, | |
useSchema, | |
pathToString, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create a single `article` document as a draft | |
* and Schedule it to be published in 2025 | |
* | |
* Save this file to the root of your Studio and run with: | |
* sanity exec createAndScheduleArticle.js --with-user-token | |
*/ | |
import sanityClient from 'part:@sanity/base/client' | |
import {uuid} from '@sanity/uuid' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getInnerFieldTypeNames(of = []) { | |
if (!of?.find((field) => field.fields)) { | |
return `` | |
} | |
const arrayObjectTypeNames = of.map((field) => field.name) | |
return arrayObjectTypeNames.join(`|`) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add to your schema like... | |
// {name: `pageBuilderTemplatePopulator`, type: `string`, inputComponent: TemplatePopulator}, | |
import {Button, Grid} from '@sanity/ui' | |
import React, {useCallback, useState} from 'react' | |
import sanityClient from 'part:@sanity/base/client' | |
const client = sanityClient.withConfig({apiVersion: `2021-05-19`}) | |
const contentData = [ |
NewerOlder