How to use the @sanity/desk-tool/structure-builder.list function in @sanity/desk-tool

To help you get started, we’ve selected a few @sanity/desk-tool examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sanity-io / startup-starter-kit / backend / deskStructure.js View on Github external
.title("Content")
    .items([
      S.listItem()
        .title("Company Info")
        .schemaType("companyInfo")
        .child(
          S.editor()
            .id('companyInfo')
            .schemaType("companyInfo")
            .documentId("company-info")
        ),
      S.listItem()
      .title('Website')
      .schemaType("page")
      .child(
        S.list()
        .title("Website")
        .id('website')
        .items([
          /* S.documentTypeListItem('navigation').title('Navigation'), */
          S.documentTypeListItem('route').title('Routes') ,
          S.documentTypeListItem('page').title('Pages'),
          sectionItems
          /* ...Object.values(components).map(({name}) => ([S.documentTypeListItem(name), S.documentTypeListItem(`shared${name}`)])) */
          /* ...Object.values(sections).reduce(makeDocumentsAndObjects, []).map(name => S.documentTypeListItem(name).title(name)) */
        ])
      ),
      S.listItem()
        .title('Assistant')
        .schemaType("agent")
        .child(
          S.list()
github sanity-io / sanity / packages / test-studio / src / deskStructure.js View on Github external
export default () =>
  S.list()
    .id('root')
    .title('Content')
    .items([
      S.documentListItem()
        .id('foo-bar')
        .title('Singleton author')
        .schemaType('author'),

      S.divider(),

      S.listItem()
        .title('Anything with a title')
        .icon(() =&gt; <span style="{{fontSize:">T</span>)
        .child(() =&gt;
          delay(
            S.documentList({
github sanity-io / sanity / packages / test-studio / src / deskStructure.js View on Github external
.title('Deeper')
            .items([
              S.documentTypeListItem('book').title('Books'),
              S.documentTypeListItem('author').title('Authors')
            ])
        ),
      S.listItem()
        .title('Deep panes')
        .child(
          S.list()
            .title('Depth 1')
            .items([
              S.listItem()
                .title('Deeper')
                .child(
                  S.list()
                    .title('Depth 2')
                    .items([
                      S.listItem()
                        .title('Even deeper')
                        .child(
                          S.list()
                            .title('Depth 3')
                            .items([
                              S.listItem()
                                .title('Keep digging')
                                .child(
                                  S.list()
                                    .title('Depth 4')
                                    .items([
                                      S.listItem()
                                        .title('Dig into the core of the earth')
github sanity-io / sanity / packages / preview-gatsby-blog-studio / plugins / dashboard-widget-structure-menu / src / lib / structure.js View on Github external
export function getDefaultStructure () {
  const items = StructureBuilder.documentTypeListItems()
  return StructureBuilder.list()
    .id('__root__')
    .title('Content')
    .showIcons(items.some(item => item.getSchemaType().icon))
    .items(items)
}
github sanity-io / sanity / packages / preview-nextjs-landing-pages-studio / plugins / dashboard-widget-structure-menu / src / lib / structure.js View on Github external
export function getDefaultStructure() {
  const items = StructureBuilder.documentTypeListItems()
  return StructureBuilder.list()
    .id('__root__')
    .title('Content')
    .showIcons(items.some(item => item.getSchemaType().icon))
    .items(items)
}
github sanity-io / sanity-template-gatsby-blog / template / studio / deskStructure.js View on Github external
export default () =>
  S.list()
    .title('Content')
    .items([
      S.listItem()
        .title('Settings')
        .icon(MdSettings)
        .child(
          S.editor()
            .id('siteSettings')
            .schemaType('siteSettings')
            .documentId('siteSettings')
        ),
      S.listItem()
        .title('Blog posts')
        .schemaType('post')
        .child(S.documentTypeList('post').title('Blog posts')),
      S.listItem()
github sanity-io / startup-starter-kit / backend / deskStructure.js View on Github external
"companyInfo",
  "page",
  "route",
  "intent",
  "agent",
  "fulfillment",
  ...Object.values(components).reduce((acc, {name}) => ([...acc, name, `shared.${name}`]), []),
  ...Object.values(sections).reduce((acc, {name}) => ([...acc, name, `shared.${name}`]), [])
]
const hiddenDocTypes = listItem => !hiddenTypes.includes(listItem.getId())

const sectionItems = S.listItem()
  .title('Shared sections')
  .icon(Repeat)
  .child(
    S.list("Shared sections")
      .id('shared-sections')
      .title('Shared sections')
      .items([
        ...Object.values(sections).map(({name, title}) => S.documentTypeListItem(`shared.${name}`).title(title))
      ])
  )

export default () =>
  S.list()
    .title("Content")
    .items([
      S.listItem()
        .title("Company Info")
        .schemaType("companyInfo")
        .child(
          S.editor()
github sanity-io / sanity / packages / preview-nextjs-landing-pages-studio / src / deskStructure.js View on Github external
export default () =>
  S.list()
    .title('Site')
    .items([
      S.listItem()
        .title('Site config')
        .icon(MdSettings)
        .child(
          S.editor()
            .id('config')
            .schemaType('site-config')
            .documentId('global-config')
        ),
      S.listItem()
        .title('Pages')
        .icon(MdDashboard)
        .schemaType('page')
        .child(S.documentTypeList('page').title('Pages')),
github sanity-io / sanity-template-gatsby-portfolio / template / studio / deskStructure.js View on Github external
export default () =>
  S.list()
    .title('Content')
    .items([
      S.listItem()
        .title('Settings')
        .child(
          S.editor()
            .id('siteSettings')
            .schemaType('siteSettings')
            .documentId('siteSettings')
        )
        .icon(MdSettings),
      S.listItem()
        .title('Projects')
        .schemaType('project')
        .child(S.documentTypeList('project').title('Projects')),
      S.listItem()