@driftime/sanity-plugin-handbook 0.3.0 → 0.3.1

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.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ComponentProps","defaultTitle","defaultDocumentTitle","defaultUndocumentedFieldMessage","defaultIconProps","width","height","strokeWidth","ComponentProps","BookOpenTextIconProps","BookOpenTextIcon","props","$","_c","t0","t1","t2","t3","t4","t5","Symbol","for","t6","ComponentProps","ComponentType","createElement","defaultIconProps","createSanityIcon","icon","props","Icon","SanityIcon","ComponentProps","PortableCodeProps","PortableCode","t0","$","_c","props","style","t1","paddingBlock","paddingInline","fontSize","backgroundColor","borderRadius","t2","BlockDecoratorProps","PortableCode","CodeDecorator","t0","$","_c","children","t1","Text","BlockListItemProps","ListItemStyle","t0","$","_c","children","t1","Symbol","for","marginTop","t2","Box","Text","BoxProps","PortableBlockquoteProps","muted","PortableBlockquote","t0","$","_c","children","props","style","t1","borderLeft","t2","Symbol","for","fontStyle","t3","t4","Text","TextProps","PortableHeadingProps","Omit","PortableHeading","props","$","_c","t0","Text","TextProps","PortableParagraphProps","PortableParagraph","props","$","_c","t0","BlockStyleProps","PortableBlockquote","PortableHeading","PortableParagraph","ParagraphStyle","t0","$","_c","children","t1","HeadingStyle","BlockquoteStyle","defineArrayMember","defineField","PortableTextObject","Strict","SanityHandbookLink","_type","href","linkAnnotation","name","type","description","preview","select","prepare","selection","title","fields","validation","rule","uri","scheme","ComponentProps","InfoIconProps","InfoIcon","props","$","_c","t0","t1","t2","Symbol","for","t3","ComponentProps","LightbulbIconProps","LightbulbIcon","props","$","_c","t0","t1","t2","Symbol","for","t3","ComponentProps","TriangleAlertIconProps","TriangleAlertIcon","props","$","_c","t0","t1","t2","Symbol","for","t3","Card","Flex","Text","CardProps","CardTone","ComponentProps","ComponentType","ReactNode","defaultIconProps","InfoIcon","LightbulbIcon","TriangleAlertIcon","CalloutVariant","CalloutVariantStyle","icon","tone","CalloutContentProps","Omit","variant","children","presentation","Record","tip","info","warning","CalloutContent","t0","$","_c","props","Icon","t1","Symbol","for","flexShrink","marginTop","fontSize","color","t2","t3","t4","t5","t6","PreviewProps","CalloutContent","CalloutVariant","SanityHandbookCallout","CalloutPreviewProps","variant","body","CalloutPreview","t0","$","_c","t1","t2","Symbol","for","display","flexDirection","gap","t3","map","_temp2","t4","t5","_key","children","whiteSpace","_temp","join","child","text","ComponentProps","MessageCircleIconProps","MessageCircleIcon","props","$","_c","t0","Symbol","for","t1","defineArrayMember","defineField","defineType","PortableTextObject","PortableTextSpan","PortableTextTextBlock","CalloutVariant","CalloutPreview","CodeDecorator","ParagraphStyle","MessageCircleIcon","createSanityIcon","linkAnnotation","SanityKeyedArray","Strict","SanityHandbookCallout","_type","calloutTypeName","variant","body","calloutType","name","type","title","icon","description","components","preview","select","prepare","selection","fields","initialValue","validation","rule","required","options","list","value","layout","direction","of","styles","component","lists","marks","decorators","annotations","Card","CardProps","Code","CodeContentProps","code","language","CodeContent","t0","$","_c","props","style","t1","overflowX","t2","t3","Nullable","isDefined","value","T","undefined","trim","Array","isArray","some","element","prototype","Reflect","getPrototypeOf","Object","keys","length","convertCase","format","words","replaceAll","toLowerCase","_match","character","toUpperCase","PreviewProps","CodeContent","isDefined","CodePreviewProps","code","language","CodePreview","t0","$","_c","t1","ComponentProps","CodeIconProps","CodeIcon","props","$","_c","t0","t1","Symbol","for","t2","defineField","defineType","PortableTextObject","CodePreview","CodeIcon","createSanityIcon","Strict","SanityHandbookCode","_type","codeTypeName","code","language","codeType","name","type","title","icon","description","components","preview","select","fields","options","list","value","ComponentProps","HorizontalRuleContentProps","HorizontalRuleContent","t0","$","_c","props","style","t1","border","borderTop","t2","PreviewProps","HorizontalRuleContent","HorizontalRulePreviewProps","HorizontalRulePreview","_props","$","_c","t0","Symbol","for","marginBlock","ComponentProps","SeparatorHorizontalIconProps","SeparatorHorizontalIcon","props","$","_c","t0","t1","t2","Symbol","for","t3","defineField","defineType","PortableTextObject","HorizontalRulePreview","SeparatorHorizontalIcon","createSanityIcon","Strict","SanityHandbookHorizontalRule","_type","horizontalRuleTypeName","horizontalRuleType","name","type","title","icon","description","components","preview","prepare","fields","hidden","Text","ComponentProps","CaptionProps","children","Caption","t0","$","_c","props","style","t1","marginBlockStart","t2","Symbol","for","fontStyle","t3","t4","ComponentProps","Caption","isDefined","ImageContentProps","url","alt","caption","ImageContent","t0","$","_c","props","t1","t2","Symbol","for","display","maxWidth","borderRadius","t3","t4","t5","PreviewProps","ImageContent","isDefined","ImagePreviewProps","url","alt","caption","ImagePreview","t0","$","_c","t1","Symbol","for","padding","t2","ComponentProps","ImageIconProps","ImageIcon","props","$","_c","t0","t1","t2","Symbol","for","t3","defineField","defineType","PortableTextObject","ImagePreview","ImageIcon","createSanityIcon","Strict","SanityHandbookImage","_type","imageTypeName","asset","url","caption","alt","imageType","name","type","title","icon","description","components","preview","select","fields","options","hotspot","ComponentProps","Caption","isDefined","VideoContentProps","url","caption","VideoContent","t0","$","_c","props","t1","Symbol","for","display","maxWidth","borderRadius","WebkitTransform","t2","t3","t4","t5","t6","PreviewProps","VideoContent","isDefined","VideoPreviewProps","url","caption","VideoPreview","t0","$","_c","t1","Symbol","for","padding","t2","ComponentProps","FilmIconProps","FilmIcon","props","$","_c","t0","t1","t2","t3","t4","t5","t6","t7","Symbol","for","t8","defineField","defineType","PortableTextObject","VideoPreview","FilmIcon","createSanityIcon","Strict","SanityHandbookVideo","_type","videoTypeName","asset","url","caption","videoType","name","type","title","icon","description","components","preview","select","fields","options","accept","defineArrayMember","defineField","CodeDecorator","ListItemStyle","BlockquoteStyle","HeadingStyle","ParagraphStyle","SanityHandbookBlockDefinition","linkAnnotation","calloutTypeName","codeTypeName","horizontalRuleTypeName","imageTypeName","videoTypeName","SanityHandbookGuide","createGuideContentField","customBlocks","name","type","description","of","styles","title","value","component","lists","marks","decorators","annotations","map","block","schema","defineField","defineType","PortableTextBlock","SanityDocument","defaultDocumentTitle","BookOpenTextIcon","createSanityIcon","SanityHandbookBlockDefinition","createGuideContentField","SanityKeyedArray","Strict","SanityHandbookGuide","_type","guideTypeName","title","description","content","createGuideType","customBlocks","name","type","icon","preview","select","prepare","selection","subtitle","fields","validation","rule","required","ComponentProps","BookTextIconProps","BookTextIcon","props","$","_c","t0","t1","t2","Symbol","for","t3","ComponentProps","ListPlusIconProps","ListPlusIcon","props","$","_c","t0","t1","t2","t3","t4","Symbol","for","t5","defineArrayMember","defineField","defineType","SanityDocument","BookTextIcon","ListPlusIcon","createSanityIcon","isDefined","SanityHandbookGuide","guideTypeName","SanityKeyedArray","Strict","SanityHandbookGuideGroup","title","guides","SanityHandbook","_type","handbookTypeName","groups","handbookType","name","type","icon","description","preview","prepare","fields","of","validation","rule","required","to","select","guide0","guide1","guide2","selection","all","filter","guide","shown","slice","hasMore","formatSubtitle","join","subtitle","guideTypeName","handbookTypeName","singletonTypes","Set","documentTypes","sidebarWidth","sidebarMinimumWidth","sidebarMaximumWidth","contentMinimumWidth","contentFlex","collapsedPaneWidth","sidebarItemHeight","toolMinimumWidth","contentWidth","contentPaddingInline","contentPaddingBlockStart","contentPaddingBlockEnd","contentSpacing","section","paragraph","heading","media","callout","blockquote","list","nestedList","rule","imageTypeName","videoTypeName","assetUrlFragment","guideContentFragment","guideFragment","SanityClient","TypedQuery","__result","T","defineTypedQuery","query","fetchQuery","client","fetch","undefined","guideFragment","defineTypedQuery","SanityHandbookGuide","guideTypeName","SanityHandbook","handbookTypeName","handbookQuery","handbookDocumentsQuery","useEffect","useState","useClient","handbookDocumentsQuery","handbookQuery","fetchQuery","SanityHandbook","useHandbookDocument","$","_c","t0","Symbol","for","apiVersion","client","handbook","setHandbook","undefined","loading","setLoading","t1","t2","fetchHandbook","subscription","listen","subscribe","unsubscribe","t3","createContext","useContext","useState","ReactNode","useHandbookDocument","isDefined","SanityHandbookBlockDefinition","SanityHandbookDocumentRole","SanityHandbook","HandbookProviderConfig","sidebarTitle","roles","blocks","undocumentedFieldMessage","HandbookContextValues","activeTab","sidebarExpanded","loading","handbook","setActiveTab","id","setSidebarExpanded","expanded","HandbookProviderProps","children","HandbookContext","undefined","useHandbookContext","handbookContext","Error","HandbookProvider","t0","$","_c","t1","t2","Box","Card","Flex","Layer","LayerProvider","Text","useElementSize","useTheme_v2","useContext","ComponentProps","ReactNode","PaneContext","collapsedPaneWidth","isDefined","PaneHeaderProps","title","backButton","PaneHeader","t0","$","_c","props","style","color","pane","paneSize","rootElement","collapsed","isLast","paneHeight","border","height","collapsedWidth","window","innerHeight","bg","fg","selectable","default","enabled","t1","handleTitleClick","collapse","t2","handleLayoutClick","expand","t3","undefined","t4","lineHeight","position","top","t5","t6","t7","t8","width","transform","transformOrigin","t9","t10","t11","t12","backgroundColor","minWidth","t13","cursor","outline","t14","t15","t16","t17","t18","t19","ArrowLeftIcon","Box","Button","Heading","Stack","Text","useContext","ComponentProps","ReactNode","PaneLayoutContext","PaneContent","PaneHeader","contentPaddingBlockEnd","contentPaddingBlockStart","contentPaddingInline","contentWidth","useHandbookContext","isDefined","ContentPanelProps","Omit","id","title","description","children","ContentPanel","t0","$","_c","props","setSidebarExpanded","paneLayout","t1","collapsed","t2","t3","t4","Symbol","for","maxWidth","boxSizing","marginInline","paddingInline","paddingBlockStart","paddingBlockEnd","t5","t6","t7","t8","t9","t10","Box","Stack","Text","useClickOutsideEvent","Popover","useRef","ComponentProps","ReactNode","FieldHintProps","Omit","label","icon","open","children","onOpen","onClose","FieldHint","t0","$","_c","props","buttonReference","popoverReference","t1","Symbol","for","current","undefined","t2","maxWidth","t3","t4","t5","t6","t7","event","pointerType","t8","event_0","t9","display","alignItems","padding","fontSize","color","background","border","cursor","t10","t11","ComponentProps","ComponentType","InfoIcon","LightbulbIcon","TriangleAlertIcon","SanityHandbookMetadata","HintKind","name","Pick","label","icon","hintKinds","Flex","FlexProps","useState","FieldHint","defaultIconProps","hintKinds","isDefined","SanityHandbookMetadata","FieldHintsProps","Pick","FieldHints","t0","$","_c","caution","info","props","tip","openHint","setOpenHint","undefined","T0","t1","t2","t3","t4","hints","t5","Symbol","for","closeHint","flatMap","t6","name","label","icon","Icon","hint","ComponentProps","ComponentType","ReactNode","createSanityIcon","convertCase","resolveTitle","type","name","title","handbook","resolveDescription","description","undefined","resolveIcon","icon","FieldDefinition","Schema","isDefined","CompiledField","name","type","title","description","fields","of","handbook","NormalisedField","opaqueTypes","Set","inheritedFieldNames","Partial","Record","block","file","geopoint","image","slug","isCompiledField","value","hasFieldsArray","Array","isArray","hasOfArray","getTypeName","undefined","getParentTypeName","resolvedType","String","normaliseField","field","visited","typeName","result","has","shouldTrack","next","fieldSource","ofSource","map","subfield","member","resolveCustomFields","parentName","inherited","customFields","filter","resolveNormalisedFields","items","normalised","item","resolveNormalisedMembers","members","resolveParentName","schema","direct","get","resolveFields","length","memberType","getSubfields","directFields","ChevronDownIcon","ChevronRightIcon","Box","Card","Flex","Stack","Text","StackProps","useState","FieldDefinition","useSchema","FieldHints","useHandbookContext","resolveDescription","resolveTitle","NormalisedField","getSubfields","convertCase","isDefined","FieldProps","field","ancestors","Set","noAncestors","Field","t0","$","_c","props","t1","undefined","schema","undocumentedFieldMessage","expanded","setExpanded","t2","effectiveTitle","t3","effectiveDescription","caution","example","info","t4","tip","handbook","hasHints","t5","type","has","isCycle","t6","subfields","hasSubfields","t7","t8","Symbol","for","marginTop","t9","t10","t11","t12","t13","t14","fontStyle","t15","t16","textAlign","border","cursor","length","marginBottom","paddingLeft","borderLeft","map","subfield","name","Field","contentSpacing","resolveDescription","resolveIcon","resolveTitle","SanityHandbookDocumentRole","documentTypesSections","roles","map","title","documents","entries","document","id","name","description","icon","render","display","flexDirection","gap","section","fields","field","ComponentProps","LayoutGridIconProps","LayoutGridIcon","props","$","_c","t0","t1","t2","t3","Symbol","for","t4","ChevronRightIcon","Box","Card","Flex","Stack","Text","contentSpacing","useHandbookContext","resolveDescription","resolveIcon","resolveTitle","isDefined","DocumentTypesOverview","$","_c","roles","setActiveTab","setSidebarExpanded","t0","Symbol","for","display","flexDirection","gap","section","t1","t2","role","title","description","documents","map","document","Icon","documentDescription","name","width","marginLeft","textAlign","border","cursor","alignItems","justifyContent","height","color","opacity","Flex","Stack","Text","defaultIconProps","hintKinds","contentSpacing","hintDescriptions","tip","info","caution","Record","HowToUse","$","_c","t0","Symbol","for","display","flexDirection","gap","section","t1","t2","t3","t4","t5","map","_temp","t6","t7","name","icon","Icon","alignItems","flexShrink","fontSize","color","BookTextIcon","LayoutGridIcon","createSanityIcon","DocumentTypesOverview","HowToUse","gettingStartedSections","title","entries","id","description","icon","render","ComponentProps","PortableLinkProps","PortableLink","t0","$","_c","children","props","style","t1","color","t2","PortableText","PortableTextComponents","PortableTextMarkComponentProps","ComponentProps","CalloutContent","PortableCode","PortableLink","contentSpacing","SanityHandbookLink","SanityHandbookCallout","CalloutBlockProps","Omit","value","components","block","normal","children","marks","code","link","href","CalloutBlock","t0","$","_c","props","style","t1","marginBlock","callout","t2","body","t3","variant","ComponentProps","CodeContent","contentSpacing","isDefined","SanityHandbookCode","CodeBlockProps","Omit","value","CodeBlock","t0","$","_c","props","style","code","t1","marginBlock","media","t2","language","ComponentProps","HorizontalRuleContent","contentSpacing","SanityHandbookHorizontalRule","HorizontalRuleBlockProps","value","HorizontalRuleBlock","t0","$","_c","props","style","_value","t1","t2","marginBlock","rule","ComponentProps","ImageContent","contentSpacing","isDefined","SanityHandbookImage","ImageBlockProps","Omit","value","ImageBlock","t0","$","_c","props","style","asset","url","t1","marginBlock","media","t2","alt","caption","ComponentProps","VideoContent","contentSpacing","isDefined","SanityHandbookVideo","VideoBlockProps","Omit","value","VideoBlock","t0","$","_c","props","style","asset","url","t1","marginBlock","media","t2","caption","CSSProperties","ComponentProps","PortableListProps","Omit","ordered","PortableList","t0","$","_c","props","style","t1","undefined","t2","display","flexDirection","gap","margin","paddingLeft","listStyle","t3","PortableText","PortableTextReact","PortableTextComponentProps","PortableTextComponents","PortableTextMarkComponentProps","PortableTextTypeComponent","PortableTextTypeComponentProps","ComponentProps","ComponentType","PortableTextBlock","PortableTextListBlock","PortableTextObject","CalloutBlock","CodeBlock","HorizontalRuleBlock","ImageBlock","VideoBlock","PortableBlockquote","PortableCode","PortableHeading","PortableLink","PortableList","PortableParagraph","contentSpacing","useHandbookContext","SanityHandbookLink","calloutTypeName","codeTypeName","horizontalRuleTypeName","imageTypeName","videoTypeName","SanityKeyedArray","listSpacing","level","nestedList","list","components","block","h2","children","marginBlockStart","heading","marginBlockEnd","normal","marginBlock","paragraph","blockquote","bullet","value","number","marks","code","link","href","blockRenderer","Component","Value","Block","PortableTextProps","t0","$","_c","props","blocks","t1","Symbol","for","t2","t3","t4","t5","types","schema","name","component","t6","t7","t8","PortableText","BookOpenTextIcon","createSanityIcon","SanityHandbook","guidesSections","handbook","groups","map","title","guides","entries","guide","id","_key","description","icon","render","content","ComponentType","ReactNode","useHandbookContext","isDefined","documentTypesSections","gettingStartedSections","guidesSections","Entry","id","title","description","icon","render","Section","entries","useSections","$","_c","roles","handbook","loading","t0","ComponentProps","Pane","ContentPanel","contentFlex","contentMinimumWidth","useHandbookContext","useSections","isDefined","ContentProps","Omit","Content","props","$","_c","activeTab","sections","T0","t0","t1","t2","t3","t4","t5","t6","id","entry","flatMap","_temp","find","title","description","render","section","entries","Box","Card","Text","ComponentProps","SidebarHeadingProps","title","SidebarHeading","t0","$","_c","props","t1","Symbol","for","cursor","outline","t2","t3","ChevronRightIcon","Box","Text","CSSProperties","ComponentProps","ComponentType","PreviewCard","SanityDefaultPreview","useHandbookContext","SidebarTabProps","Omit","id","label","icon","style","SidebarTab","t0","$","_c","Icon","props","activeTab","setActiveTab","setSidebarExpanded","selected","t1","t2","cursor","t3","t4","Symbol","for","opacity","t5","t6","t7","ComponentProps","ComponentType","CommandList","Pane","PaneContent","PaneHeader","SidebarHeading","SidebarTab","sidebarItemHeight","sidebarMaximumWidth","sidebarMinimumWidth","sidebarWidth","useHandbookContext","useSections","SidebarHeadingItem","type","title","SidebarTabItem","id","label","icon","SidebarItem","SidebarProps","Omit","Sidebar","props","$","_c","sidebarTitle","sections","t0","flatMap","_temp2","items","t1","getItemDisabled","virtualIndex","t2","t3","_temp3","t4","item","entries","map","_temp","entry","useContext","PaneLayoutContext","useHandbookContext","Content","Sidebar","isDefined","Panes","$","_c","activeTab","sidebarExpanded","paneLayout","t0","hasContent","collapsed","t1","Symbol","for","t2","t3","useTheme_v2","useState","Tool","PaneLayout","toolMinimumWidth","HandbookProvider","HandbookProviderConfig","Panes","isDefined","HandbookToolProps","tool","HandbookTool","t0","$","_c","t1","options","media","layoutCollapsed","setLayoutCollapsed","t2","Symbol","for","handleCollapse","t3","handleExpand","t4","undefined","t5","t6","minHeight","minWidth","t7","t8","isDefined","configuredEditors","undefined","setConfiguredEditors","editors","isPermittedEditor","email","permitted","includes","ComponentType","definePlugin","DocumentDefinition","PortableTextObject","SchemaTypeDefinition","defaultTitle","defaultUndocumentedFieldMessage","documentTypes","singletonTypes","HandbookProviderConfig","BookTextIcon","HandbookTool","isPermittedEditor","setConfiguredEditors","createSanityIcon","calloutType","codeType","horizontalRuleType","imageType","videoType","createGuideType","handbookType","FieldDefinitionBase","handbook","SanityHandbookMetadata","title","description","example","tip","info","caution","SanityHandbookDocumentRole","documents","SanityHandbookBlockDefinition","schema","component","value","SanityHandbookConfig","sidebarTitle","roles","blocks","editors","undocumentedFieldMessage","handbookPlugin","config","resolved","guideType","name","types","map","block","document","newDocumentOptions","templateItems","creationContext","currentUser","type","hiddenTypes","email","filter","templateId","some","startsWith","actions","actionComponents","schemaType","has","action","includes","tools","icon","options","CurrentUser","StructureBuilder","BookOpenTextIcon","BookTextIcon","isPermittedEditor","createSanityIcon","guideTypeName","handbookTypeName","handbookStructure","structureBuilder","context","currentUser","editors","email","listItem","document","documentTypeList","title","icon","child","id","schemaType","useCurrentUser","isPermittedEditor","useIsHandbookEditor","editors","$","_c","user","t0","email","t1"],"sources":["../src/config/defaults.ts","../src/icons/book-open-text.tsx","../src/lib/icons.ts","../src/components/content/portable/code.tsx","../src/components/decorators.tsx","../src/components/lists.tsx","../src/components/content/portable/blockquote.tsx","../src/components/content/portable/heading.tsx","../src/components/content/portable/paragraph.tsx","../src/components/styles.tsx","../src/schemas/annotations/link.ts","../src/icons/info.tsx","../src/icons/lightbulb.tsx","../src/icons/triangle-alert.tsx","../src/blocks/callout/content.tsx","../src/blocks/callout/preview.tsx","../src/icons/message-circle.tsx","../src/schemas/blocks/callout.ts","../src/blocks/code/content.tsx","../src/lib/utils.ts","../src/blocks/code/preview.tsx","../src/icons/code.tsx","../src/schemas/blocks/code.ts","../src/blocks/horizontal-rule/content.tsx","../src/blocks/horizontal-rule/preview.tsx","../src/icons/separator-horizontal.tsx","../src/schemas/blocks/horizontal-rule.ts","../src/components/caption.tsx","../src/blocks/image/content.tsx","../src/blocks/image/preview.tsx","../src/icons/image.tsx","../src/schemas/blocks/image.ts","../src/blocks/video/content.tsx","../src/blocks/video/preview.tsx","../src/icons/film.tsx","../src/schemas/blocks/video.ts","../src/schemas/fields/content.ts","../src/schemas/types/guide.ts","../src/icons/book-text.tsx","../src/icons/list-plus.tsx","../src/schemas/types/handbook.ts","../src/config/documents.ts","../src/config/layout.ts","../src/groq/fragments.ts","../src/lib/groq.ts","../src/groq/documents.ts","../src/hooks/use-handbook-document.ts","../src/contexts/handbook.tsx","../src/components/pane-header.tsx","../src/components/content-panel.tsx","../src/components/field/hint.tsx","../src/config/hints.ts","../src/components/field/hints.tsx","../src/lib/display.ts","../src/lib/schema.ts","../src/components/field/field.tsx","../src/sections/document-types.tsx","../src/icons/layout-grid.tsx","../src/pages/document-types-overview.tsx","../src/pages/how-to-use.tsx","../src/sections/getting-started.tsx","../src/components/content/portable/link.tsx","../src/blocks/callout/block.tsx","../src/blocks/code/block.tsx","../src/blocks/horizontal-rule/block.tsx","../src/blocks/image/block.tsx","../src/blocks/video/block.tsx","../src/components/content/portable/list.tsx","../src/components/content/portable-text.tsx","../src/sections/guides.tsx","../src/hooks/use-sections.ts","../src/layouts/content.tsx","../src/components/sidebar/heading.tsx","../src/components/sidebar/tab.tsx","../src/layouts/sidebar.tsx","../src/layouts/panes.tsx","../src/layouts/tool.tsx","../src/lib/editors.ts","../src/plugin.ts","../src/lib/structure.ts","../src/hooks/use-is-handbook-editor.ts"],"sourcesContent":["import type { ComponentProps } from \"react\";\n\n/** Title shown in the Studio tool navigation and at the top of the sidebar. */\nexport const defaultTitle = \"Handbook\";\n\n/** Fallback title displayed wherever a document has no title of its own. */\nexport const defaultDocumentTitle = \"Untitled\";\n\n/** Fallback message shown when a field has no description. */\nexport const defaultUndocumentedFieldMessage =\n \"This field has not been documented yet. Contact your development team for guidance.\";\n\n/** Properties every icon the plugin draws is rendered with. */\nexport const defaultIconProps: ComponentProps<\"svg\"> = { width: \"1em\", height: \"1em\", strokeWidth: 1.5 };\n","import type { ComponentProps } from \"react\";\n\nexport type BookOpenTextIconProps = ComponentProps<\"svg\">;\n\nexport function BookOpenTextIcon(props: BookOpenTextIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M12 7v14\" />\n <path d=\"M16 12h2\" />\n <path d=\"M16 8h2\" />\n <path d=\"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z\" />\n <path d=\"M6 12h2\" />\n <path d=\"M6 8h2\" />\n </svg>\n );\n}\n","import type { ComponentProps, ComponentType } from \"react\";\nimport { createElement } from \"react\";\n\nimport { defaultIconProps } from \"@/config/defaults\";\n\n/**\n * Creates a Sanity Studio icon component from an SVG icon.\n *\n * @param icon - The icon component to wrap.\n * @param props - Additional props merged over the default properties a Studio icon is drawn with.\n * @returns A Studio icon component.\n */\nexport function createSanityIcon(icon: ComponentType<ComponentProps<\"svg\">>, props?: ComponentProps<\"svg\">) {\n const Icon = icon;\n\n function SanityIcon() {\n return createElement(Icon, { ...defaultIconProps, ...props });\n }\n\n return SanityIcon;\n}\n","import type { ComponentProps } from \"react\";\n\nexport type PortableCodeProps = ComponentProps<\"code\">;\n\nexport function PortableCode({ style, ...props }: PortableCodeProps) {\n return (\n <code\n style={{\n paddingBlock: 2,\n paddingInline: 4,\n fontSize: \"0.875em\",\n backgroundColor: \"var(--card-code-bg-color)\",\n borderRadius: 2,\n ...style,\n }}\n {...props}\n />\n );\n}\n","import type { BlockDecoratorProps } from \"sanity\";\n\nimport { PortableCode } from \"@/components/content/portable/code\";\n\nexport function CodeDecorator({ children }: BlockDecoratorProps) {\n return <PortableCode>{children}</PortableCode>;\n}\n","import { Text } from \"@sanity/ui\";\nimport type { BlockListItemProps } from \"sanity\";\n\nexport function ListItemStyle({ children }: BlockListItemProps) {\n return (\n <Text size={1} style={{ marginTop: \"0.375em\" }}>\n {children}\n </Text>\n );\n}\n","import { Box, Text } from \"@sanity/ui\";\nimport type { BoxProps } from \"@sanity/ui\";\n\nexport type PortableBlockquoteProps = BoxProps & {\n muted?: boolean;\n};\n\nexport function PortableBlockquote({ muted, children, style, ...props }: PortableBlockquoteProps) {\n return (\n <Box paddingY={1} paddingLeft={3} style={{ borderLeft: \"2px solid var(--card-border-color)\", ...style }} {...props}>\n <Text size={1} muted={muted} style={{ fontStyle: \"italic\" }}>\n {children}\n </Text>\n </Box>\n );\n}\n","import { Text } from \"@sanity/ui\";\nimport type { TextProps } from \"@sanity/ui\";\n\nexport type PortableHeadingProps = Omit<TextProps, \"as\">;\n\nexport function PortableHeading(props: PortableHeadingProps) {\n return <Text as=\"h2\" size={1} weight=\"medium\" {...props} />;\n}\n","import { Text } from \"@sanity/ui\";\nimport type { TextProps } from \"@sanity/ui\";\n\nexport type PortableParagraphProps = TextProps;\n\nexport function PortableParagraph(props: PortableParagraphProps) {\n return <Text size={1} {...props} />;\n}\n","import type { BlockStyleProps } from \"sanity\";\n\nimport { PortableBlockquote } from \"@/components/content/portable/blockquote\";\nimport { PortableHeading } from \"@/components/content/portable/heading\";\nimport { PortableParagraph } from \"@/components/content/portable/paragraph\";\n\nexport function ParagraphStyle({ children }: BlockStyleProps) {\n return <PortableParagraph>{children}</PortableParagraph>;\n}\n\nexport function HeadingStyle({ children }: BlockStyleProps) {\n return <PortableHeading>{children}</PortableHeading>;\n}\n\nexport function BlockquoteStyle({ children }: BlockStyleProps) {\n return <PortableBlockquote>{children}</PortableBlockquote>;\n}\n","import { defineArrayMember, defineField } from \"sanity\";\nimport type { PortableTextObject } from \"sanity\";\n\nimport type { Strict } from \"@/types\";\n\n/**\n * A web address applied to a run of guide text.\n *\n * @public\n */\nexport type SanityHandbookLink = Strict<PortableTextObject> & {\n _type: \"link\";\n /** Web address the link points to. */\n href?: string;\n};\n\nexport const linkAnnotation = defineArrayMember({\n name: \"link\" satisfies SanityHandbookLink[\"_type\"],\n type: \"object\",\n description: \"Link applied to the selected text.\",\n preview: {\n select: {\n href: \"href\",\n },\n prepare(selection: { href?: string }) {\n const { href } = selection;\n\n return {\n title: href ?? \"Link\",\n };\n },\n },\n fields: [\n defineField({\n name: \"href\" satisfies keyof SanityHandbookLink,\n title: \"URL\",\n type: \"url\",\n description: \"Web address destination for this link. Supports http, https, mailto, and tel schemes.\",\n validation: (rule) => rule.uri({ scheme: [\"http\", \"https\", \"mailto\", \"tel\"] }),\n }),\n ],\n});\n","import type { ComponentProps } from \"react\";\n\nexport type InfoIconProps = ComponentProps<\"svg\">;\n\nexport function InfoIcon(props: InfoIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d=\"M12 8h.01\" />\n </svg>\n );\n}\n","import type { ComponentProps } from \"react\";\n\nexport type LightbulbIconProps = ComponentProps<\"svg\">;\n\nexport function LightbulbIcon(props: LightbulbIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5\" />\n <path d=\"M9 18h6\" />\n <path d=\"M10 22h4\" />\n </svg>\n );\n}\n","import type { ComponentProps } from \"react\";\n\nexport type TriangleAlertIconProps = ComponentProps<\"svg\">;\n\nexport function TriangleAlertIcon(props: TriangleAlertIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n );\n}\n","import { Card, Flex, Text } from \"@sanity/ui\";\nimport type { CardProps, CardTone } from \"@sanity/ui\";\nimport type { ComponentProps, ComponentType, ReactNode } from \"react\";\n\nimport { defaultIconProps } from \"@/config/defaults\";\nimport { InfoIcon } from \"@/icons/info\";\nimport { LightbulbIcon } from \"@/icons/lightbulb\";\nimport { TriangleAlertIcon } from \"@/icons/triangle-alert\";\n\n/** The intent a callout is drawn with, choosing its icon and tone. */\nexport type CalloutVariant = \"tip\" | \"info\" | \"warning\";\n\n/** How a callout variant is presented, pairing its icon with the tone the card is drawn in. */\ninterface CalloutVariantStyle {\n /** Icon identifying the variant. */\n icon: ComponentType<ComponentProps<\"svg\">>;\n /** Card tone carrying the variant's intent. */\n tone: CardTone;\n}\n\nexport type CalloutContentProps = Omit<CardProps, \"tone\"> & {\n variant: CalloutVariant;\n children: ReactNode;\n};\n\n/** Presentation for each callout variant. */\nconst presentation: Record<CalloutVariant, CalloutVariantStyle> = {\n tip: { icon: LightbulbIcon, tone: \"positive\" },\n info: { icon: InfoIcon, tone: \"primary\" },\n warning: { icon: TriangleAlertIcon, tone: \"caution\" },\n};\n\nexport function CalloutContent({ variant, children, ...props }: CalloutContentProps) {\n const { icon: Icon, tone } = presentation[variant];\n\n return (\n <Card padding={4} radius={2} tone={tone} {...props}>\n <Flex align=\"flex-start\" gap={3}>\n <div style={{ flexShrink: 0, marginTop: \"-2px\", fontSize: \"16px\", color: \"var(--card-icon-color)\" }}>\n <Icon {...defaultIconProps} />\n </div>\n <Text size={1} style={{ color: \"var(--card-icon-color)\" }}>\n {children}\n </Text>\n </Flex>\n </Card>\n );\n}\n","import type { PreviewProps } from \"sanity\";\n\nimport { CalloutContent } from \"@/blocks/callout/content\";\nimport type { CalloutVariant } from \"@/blocks/callout/content\";\nimport type { SanityHandbookCallout } from \"@/schemas/blocks/callout\";\n\nexport type CalloutPreviewProps = PreviewProps & {\n variant?: CalloutVariant;\n body?: SanityHandbookCallout[\"body\"];\n};\n\nexport function CalloutPreview({ variant, body }: CalloutPreviewProps) {\n return (\n <CalloutContent variant={variant ?? \"tip\"}>\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 12 }}>\n {body?.map(({ _key, children }) => (\n <div key={_key} style={{ whiteSpace: \"pre-wrap\" }}>\n {children.map((child) => child.text).join(\"\")}\n </div>\n ))}\n </div>\n </CalloutContent>\n );\n}\n","import type { ComponentProps } from \"react\";\n\nexport type MessageCircleIconProps = ComponentProps<\"svg\">;\n\nexport function MessageCircleIcon(props: MessageCircleIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719\" />\n </svg>\n );\n}\n","import { defineArrayMember, defineField, defineType } from \"sanity\";\nimport type { PortableTextObject, PortableTextSpan, PortableTextTextBlock } from \"sanity\";\n\nimport type { CalloutVariant } from \"@/blocks/callout/content\";\nimport { CalloutPreview } from \"@/blocks/callout/preview\";\nimport { CodeDecorator } from \"@/components/decorators\";\nimport { ParagraphStyle } from \"@/components/styles\";\nimport { MessageCircleIcon } from \"@/icons/message-circle\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport { linkAnnotation } from \"@/schemas/annotations/link\";\nimport type { SanityKeyedArray, Strict } from \"@/types\";\n\n/**\n * A highlighted message set apart from the surrounding guide text.\n *\n * @public\n */\nexport type SanityHandbookCallout = Strict<PortableTextObject> & {\n _type: typeof calloutTypeName;\n /** Visual style and intent of the callout. */\n variant: CalloutVariant;\n /** Portable Text content displayed inside the callout, which offers no inline objects. */\n body: SanityKeyedArray<PortableTextTextBlock<PortableTextSpan>>;\n};\n\n/** Type name of the callout block. */\nexport const calloutTypeName = \"handbook.callout\";\n\nexport const calloutType = defineType({\n name: calloutTypeName satisfies SanityHandbookCallout[\"_type\"],\n type: \"object\",\n title: \"Callout\",\n icon: createSanityIcon(MessageCircleIcon),\n description: \"Highlighted message block drawing attention to tips, supplementary information, or warnings.\",\n components: {\n preview: CalloutPreview,\n },\n preview: {\n select: {\n variant: \"variant\",\n body: \"body\",\n },\n prepare(selection: { variant?: CalloutVariant; body?: SanityHandbookCallout[\"body\"] }) {\n const { variant, body } = selection;\n\n return {\n title: \"Callout\",\n variant,\n body,\n };\n },\n },\n fields: [\n defineField({\n name: \"variant\" satisfies keyof SanityHandbookCallout,\n type: \"string\",\n description: \"Visual style and intent of the callout.\",\n initialValue: \"tip\",\n validation: (rule) => rule.required(),\n options: {\n list: [\n { title: \"Tip\", value: \"tip\" },\n { title: \"Information\", value: \"info\" },\n { title: \"Warning\", value: \"warning\" },\n ],\n layout: \"radio\",\n direction: \"horizontal\",\n },\n }),\n defineField({\n name: \"body\" satisfies keyof SanityHandbookCallout,\n type: \"array\",\n description: \"Content displayed inside the callout. Supports inline formatting and links.\",\n of: [\n defineArrayMember({\n name: \"block\",\n type: \"block\",\n styles: [{ title: \"Normal\", value: \"normal\", component: ParagraphStyle }],\n lists: [],\n marks: {\n decorators: [\n { title: \"Bold\", value: \"strong\" },\n { title: \"Italic\", value: \"em\" },\n { title: \"Strikethrough\", value: \"strike-through\" },\n { title: \"Code\", value: \"code\", component: CodeDecorator },\n ],\n annotations: [linkAnnotation],\n },\n }),\n ],\n }),\n ],\n});\n","import { Card } from \"@sanity/ui\";\nimport type { CardProps } from \"@sanity/ui\";\nimport { Code } from \"@sanity/ui/code\";\n\nexport type CodeContentProps = CardProps & {\n code: string;\n language?: string;\n};\n\nexport function CodeContent({ code, language, style, ...props }: CodeContentProps) {\n return (\n <Card padding={4} radius={2} tone=\"transparent\" style={{ overflowX: \"auto\", ...style }} {...props}>\n <Code size={1} language={language}>\n {code}\n </Code>\n </Card>\n );\n}\n","import type { Nullable } from \"@/types\";\n\n/**\n * Checks whether a value is defined and non-empty, treating `false`, empty strings, and objects with\n * no keys as absent. An array is absent unless one of its elements is itself present, while anything\n * built from a class counts as present on existence alone. Not intended for boolean flags.\n *\n * @param value - The value to check.\n * @returns True if the value is defined and not empty.\n */\nexport function isDefined<T>(value: Nullable<T> | false): value is T {\n if (value === undefined || value === null || value === false) return false;\n if (typeof value === \"string\") return value.trim() !== \"\";\n if (Array.isArray(value)) return value.some((element) => isDefined(element));\n\n if (typeof value === \"object\") {\n const prototype = Reflect.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) return true;\n\n return Object.keys(value).length > 0;\n }\n\n return true;\n}\n\n/**\n * Converts a string between different casing formats.\n *\n * @param value - The string to convert.\n * @param format - The target casing format.\n * @returns The converted string.\n */\nexport function convertCase(value: string, format: \"kebab\" | \"snake\" | \"camel\" | \"pascal\" | \"title\" | \"sentence\") {\n const words = value\n .replaceAll(/(?<lower>[a-z0-9])(?<upper>[A-Z])/gu, \"$<lower> $<upper>\")\n .replaceAll(/[-_\\s]+/gu, \" \")\n .trim()\n .toLowerCase();\n\n switch (format) {\n case \"kebab\": {\n return words.replaceAll(/\\s+/gu, \"-\");\n }\n case \"snake\": {\n return words.replaceAll(/\\s+/gu, \"_\");\n }\n case \"camel\": {\n return words.replaceAll(/\\s+(?<character>.)/gu, (_match, character: string) => character.toUpperCase());\n }\n case \"pascal\": {\n return words.replaceAll(/(?:^|\\s+)(?<character>.)/gu, (_match, character: string) => character.toUpperCase());\n }\n case \"title\": {\n return words.replaceAll(/\\b\\w/gu, (character) => character.toUpperCase());\n }\n case \"sentence\": {\n return words.replaceAll(/^(?<character>.)/gu, (character) => character.toUpperCase());\n }\n default: {\n return value;\n }\n }\n}\n","import type { PreviewProps } from \"sanity\";\n\nimport { CodeContent } from \"@/blocks/code/content\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport type CodePreviewProps = PreviewProps & {\n code?: string;\n language?: string;\n};\n\nexport function CodePreview({ code, language }: CodePreviewProps) {\n if (!isDefined(code)) return null;\n\n return <CodeContent code={code} language={language} />;\n}\n","import type { ComponentProps } from \"react\";\n\nexport type CodeIconProps = ComponentProps<\"svg\">;\n\nexport function CodeIcon(props: CodeIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m16 18 6-6-6-6\" />\n <path d=\"m8 6-6 6 6 6\" />\n </svg>\n );\n}\n","import { defineField, defineType } from \"sanity\";\nimport type { PortableTextObject } from \"sanity\";\n\nimport { CodePreview } from \"@/blocks/code/preview\";\nimport { CodeIcon } from \"@/icons/code\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport type { Strict } from \"@/types\";\n\n/**\n * A block of source code, rendered with syntax highlighting for its language.\n *\n * @public\n */\nexport type SanityHandbookCode = Strict<PortableTextObject> & {\n _type: typeof codeTypeName;\n /** Source code to display. */\n code?: string;\n /** Programming language used for syntax highlighting. */\n language?: string;\n};\n\n/** Type name of the code block. */\nexport const codeTypeName = \"handbook.code\";\n\nexport const codeType = defineType({\n name: codeTypeName satisfies SanityHandbookCode[\"_type\"],\n type: \"object\",\n title: \"Code\",\n icon: createSanityIcon(CodeIcon),\n description: \"Syntax-highlighted code block with language selection.\",\n components: {\n preview: CodePreview,\n },\n preview: {\n select: {\n code: \"code\",\n language: \"language\",\n },\n },\n fields: [\n defineField({\n name: \"code\" satisfies keyof SanityHandbookCode,\n type: \"text\",\n description: \"The source code to display.\",\n }),\n defineField({\n name: \"language\" satisfies keyof SanityHandbookCode,\n type: \"string\",\n description: \"Programming language used for syntax highlighting.\",\n options: {\n list: [\n { title: \"CSS\", value: \"css\" },\n { title: \"GROQ\", value: \"groq\" },\n { title: \"HTML\", value: \"html\" },\n { title: \"JavaScript\", value: \"javascript\" },\n { title: \"JSON\", value: \"json\" },\n { title: \"Plain Text\", value: \"text\" },\n { title: \"React\", value: \"tsx\" },\n { title: \"Shell\", value: \"shell\" },\n { title: \"TypeScript\", value: \"typescript\" },\n ],\n },\n }),\n ],\n});\n","import type { ComponentProps } from \"react\";\n\nexport type HorizontalRuleContentProps = ComponentProps<\"hr\">;\n\nexport function HorizontalRuleContent({ style, ...props }: HorizontalRuleContentProps) {\n return <hr style={{ border: \"none\", borderTop: \"1px solid var(--card-border-color)\", ...style }} {...props} />;\n}\n","import type { PreviewProps } from \"sanity\";\n\nimport { HorizontalRuleContent } from \"@/blocks/horizontal-rule/content\";\n\nexport type HorizontalRulePreviewProps = PreviewProps;\n\nexport function HorizontalRulePreview(_props: HorizontalRulePreviewProps) {\n return <HorizontalRuleContent style={{ marginBlock: 8 }} />;\n}\n","import type { ComponentProps } from \"react\";\n\nexport type SeparatorHorizontalIconProps = ComponentProps<\"svg\">;\n\nexport function SeparatorHorizontalIcon(props: SeparatorHorizontalIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m16 16-4 4-4-4\" />\n <path d=\"M3 12h18\" />\n <path d=\"m8 8 4-4 4 4\" />\n </svg>\n );\n}\n","import { defineField, defineType } from \"sanity\";\nimport type { PortableTextObject } from \"sanity\";\n\nimport { HorizontalRulePreview } from \"@/blocks/horizontal-rule/preview\";\nimport { SeparatorHorizontalIcon } from \"@/icons/separator-horizontal\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport type { Strict } from \"@/types\";\n\n/**\n * A divider between sections of a guide, carrying no authored content of its own.\n *\n * @public\n */\nexport type SanityHandbookHorizontalRule = Strict<PortableTextObject> & {\n _type: typeof horizontalRuleTypeName;\n};\n\n/** Type name of the horizontal rule block. */\nexport const horizontalRuleTypeName = \"handbook.horizontalRule\";\n\nexport const horizontalRuleType = defineType({\n name: horizontalRuleTypeName satisfies SanityHandbookHorizontalRule[\"_type\"],\n type: \"object\",\n title: \"Horizontal Rule\",\n icon: createSanityIcon(SeparatorHorizontalIcon),\n description: \"Visual divider between sections of content.\",\n components: {\n preview: HorizontalRulePreview,\n },\n preview: {\n prepare() {\n return {\n title: \"Horizontal Rule\",\n };\n },\n },\n fields: [\n // Sanity rejects an object type declaring no fields, and a rule has nothing of its own to store.\n defineField({\n name: \"style\",\n type: \"string\",\n description: \"Reserved. A horizontal rule carries no authored content.\",\n hidden: true,\n }),\n ],\n});\n","import { Text } from \"@sanity/ui\";\nimport type { ComponentProps } from \"react\";\n\nexport type CaptionProps = ComponentProps<\"div\"> & {\n children: string;\n};\n\nexport function Caption({ children, style, ...props }: CaptionProps) {\n return (\n <div style={{ marginBlockStart: 12, ...style }} {...props}>\n <Text size={1} muted style={{ fontStyle: \"italic\" }}>\n {children}\n </Text>\n </div>\n );\n}\n","import type { ComponentProps } from \"react\";\n\nimport { Caption } from \"@/components/caption\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport type ImageContentProps = ComponentProps<\"div\"> & {\n url: string;\n alt?: string;\n caption?: string;\n};\n\nexport function ImageContent({ url, alt, caption, ...props }: ImageContentProps) {\n return (\n <div {...props}>\n <img src={url} alt={alt ?? \"\"} style={{ display: \"block\", maxWidth: \"100%\", borderRadius: 4 }} />\n {isDefined(caption) && <Caption>{caption}</Caption>}\n </div>\n );\n}\n","import type { PreviewProps } from \"sanity\";\n\nimport { ImageContent } from \"@/blocks/image/content\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport type ImagePreviewProps = PreviewProps & {\n url?: string;\n alt?: string;\n caption?: string;\n};\n\nexport function ImagePreview({ url, alt, caption }: ImagePreviewProps) {\n if (!isDefined(url)) return null;\n\n return <ImageContent url={url} alt={alt} caption={caption} style={{ padding: 8 }} />;\n}\n","import type { ComponentProps } from \"react\";\n\nexport type ImageIconProps = ComponentProps<\"svg\">;\n\nexport function ImageIcon(props: ImageIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" ry=\"2\" />\n <circle cx=\"9\" cy=\"9\" r=\"2\" />\n <path d=\"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21\" />\n </svg>\n );\n}\n","import { defineField, defineType } from \"sanity\";\nimport type { PortableTextObject } from \"sanity\";\n\nimport { ImagePreview } from \"@/blocks/image/preview\";\nimport { ImageIcon } from \"@/icons/image\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport type { Strict } from \"@/types\";\n\n/**\n * An image placed in a guide, with the caption and alternative text shown alongside it.\n *\n * @public\n */\nexport type SanityHandbookImage = Strict<PortableTextObject> & {\n _type: typeof imageTypeName;\n /** Uploaded image asset, narrowed by the query to the URL the viewer renders. */\n asset?: { url?: string };\n /** Text displayed beneath the image. */\n caption?: string;\n /** Alternative text for screen readers. */\n alt?: string;\n};\n\n/** Type name of the image block. */\nexport const imageTypeName = \"handbook.image\";\n\nexport const imageType = defineType({\n name: imageTypeName satisfies SanityHandbookImage[\"_type\"],\n type: \"object\",\n title: \"Image\",\n icon: createSanityIcon(ImageIcon),\n description: \"Image with an optional caption and alternative text.\",\n components: {\n preview: ImagePreview,\n },\n preview: {\n select: {\n caption: \"caption\",\n alt: \"alt\",\n url: \"asset.asset.url\",\n },\n },\n fields: [\n defineField({\n name: \"asset\" satisfies keyof SanityHandbookImage,\n title: \"Image\",\n type: \"image\",\n description: \"Upload or select an image from the media library.\",\n options: { hotspot: true },\n }),\n defineField({\n name: \"caption\" satisfies keyof SanityHandbookImage,\n type: \"string\",\n description: \"Caption text displayed below the image, such as a credit or a note.\",\n }),\n defineField({\n name: \"alt\" satisfies keyof SanityHandbookImage,\n title: \"Alternative Text\",\n type: \"string\",\n description: \"Describes what the image shows for people who cannot see it. Don't repeat the caption here.\",\n }),\n ],\n});\n","import type { ComponentProps } from \"react\";\n\nimport { Caption } from \"@/components/caption\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport type VideoContentProps = ComponentProps<\"div\"> & {\n url: string;\n caption?: string;\n};\n\nexport function VideoContent({ url, caption, ...props }: VideoContentProps) {\n return (\n <div {...props}>\n <video\n src={url}\n controls\n style={{ display: \"block\", maxWidth: \"100%\", borderRadius: 4, WebkitTransform: \"translateZ(0)\" }}\n >\n <track kind=\"captions\" label={caption ?? \"Video\"} />\n </video>\n {isDefined(caption) && <Caption>{caption}</Caption>}\n </div>\n );\n}\n","import type { PreviewProps } from \"sanity\";\n\nimport { VideoContent } from \"@/blocks/video/content\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport type VideoPreviewProps = PreviewProps & {\n url?: string;\n caption?: string;\n};\n\nexport function VideoPreview({ url, caption }: VideoPreviewProps) {\n if (!isDefined(url)) return null;\n\n return <VideoContent url={url} caption={caption} style={{ padding: 8 }} />;\n}\n","import type { ComponentProps } from \"react\";\n\nexport type FilmIconProps = ComponentProps<\"svg\">;\n\nexport function FilmIcon(props: FilmIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" />\n <path d=\"M7 3v18\" />\n <path d=\"M3 7.5h4\" />\n <path d=\"M3 12h18\" />\n <path d=\"M3 16.5h4\" />\n <path d=\"M17 3v18\" />\n <path d=\"M17 7.5h4\" />\n <path d=\"M17 16.5h4\" />\n </svg>\n );\n}\n","import { defineField, defineType } from \"sanity\";\nimport type { PortableTextObject } from \"sanity\";\n\nimport { VideoPreview } from \"@/blocks/video/preview\";\nimport { FilmIcon } from \"@/icons/film\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport type { Strict } from \"@/types\";\n\n/**\n * A video placed in a guide, with the caption shown beneath it.\n *\n * @public\n */\nexport type SanityHandbookVideo = Strict<PortableTextObject> & {\n _type: typeof videoTypeName;\n /** Uploaded video asset, narrowed by the query to the URL the viewer renders. */\n asset?: { url?: string };\n /** Text displayed beneath the video. */\n caption?: string;\n};\n\n/** Type name of the video block. */\nexport const videoTypeName = \"handbook.video\";\n\nexport const videoType = defineType({\n name: videoTypeName satisfies SanityHandbookVideo[\"_type\"],\n type: \"object\",\n title: \"Video\",\n icon: createSanityIcon(FilmIcon),\n description: \"Video with an optional caption.\",\n components: {\n preview: VideoPreview,\n },\n preview: {\n select: {\n caption: \"caption\",\n url: \"asset.asset.url\",\n },\n },\n fields: [\n defineField({\n name: \"asset\" satisfies keyof SanityHandbookVideo,\n title: \"Video\",\n type: \"file\",\n description: \"Upload or select a video from the media library.\",\n options: { accept: \"video/*\" },\n }),\n defineField({\n name: \"caption\" satisfies keyof SanityHandbookVideo,\n type: \"string\",\n description: \"Caption text displayed below the video, such as a credit or a note.\",\n }),\n ],\n});\n","import { defineArrayMember, defineField } from \"sanity\";\n\nimport { CodeDecorator } from \"@/components/decorators\";\nimport { ListItemStyle } from \"@/components/lists\";\nimport { BlockquoteStyle, HeadingStyle, ParagraphStyle } from \"@/components/styles\";\nimport type { SanityHandbookBlockDefinition } from \"@/plugin\";\nimport { linkAnnotation } from \"@/schemas/annotations/link\";\nimport { calloutTypeName } from \"@/schemas/blocks/callout\";\nimport { codeTypeName } from \"@/schemas/blocks/code\";\nimport { horizontalRuleTypeName } from \"@/schemas/blocks/horizontal-rule\";\nimport { imageTypeName } from \"@/schemas/blocks/image\";\nimport { videoTypeName } from \"@/schemas/blocks/video\";\nimport type { SanityHandbookGuide } from \"@/schemas/types/guide\";\n\n/**\n * Creates the Portable Text content field for Handbook guides, offering the built-in blocks alongside\n * any a consumer registered.\n *\n * @param customBlocks - Custom block definitions registered by the consumer.\n * @returns A field definition for the guide content array.\n */\nexport function createGuideContentField(customBlocks: SanityHandbookBlockDefinition[] = []) {\n return defineField({\n name: \"content\" satisfies keyof SanityHandbookGuide,\n type: \"array\",\n description: \"Rich text with formatting, headings, lists, images, code blocks, and custom blocks.\",\n of: [\n defineArrayMember({\n name: \"block\",\n type: \"block\",\n styles: [\n { title: \"Paragraph\", value: \"normal\", component: ParagraphStyle },\n { title: \"Heading\", value: \"h2\", component: HeadingStyle },\n { title: \"Blockquote\", value: \"blockquote\", component: BlockquoteStyle },\n ],\n lists: [\n { title: \"Bullet\", value: \"bullet\", component: ListItemStyle },\n { title: \"Number\", value: \"number\", component: ListItemStyle },\n ],\n marks: {\n decorators: [\n { title: \"Bold\", value: \"strong\" },\n { title: \"Italic\", value: \"em\" },\n { title: \"Strikethrough\", value: \"strike-through\" },\n { title: \"Code\", value: \"code\", component: CodeDecorator },\n ],\n annotations: [linkAnnotation],\n },\n }),\n defineArrayMember({ name: imageTypeName, type: imageTypeName }),\n defineArrayMember({ name: videoTypeName, type: videoTypeName }),\n defineArrayMember({ name: codeTypeName, type: codeTypeName }),\n defineArrayMember({ name: calloutTypeName, type: calloutTypeName }),\n defineArrayMember({ name: horizontalRuleTypeName, type: horizontalRuleTypeName }),\n ...customBlocks.map((block) => defineArrayMember({ name: block.schema.name, type: block.schema.name })),\n ],\n });\n}\n","import { defineField, defineType } from \"sanity\";\nimport type { PortableTextBlock, SanityDocument } from \"sanity\";\n\nimport { defaultDocumentTitle } from \"@/config/defaults\";\nimport { BookOpenTextIcon } from \"@/icons/book-open-text\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport type { SanityHandbookBlockDefinition } from \"@/plugin\";\nimport { createGuideContentField } from \"@/schemas/fields/content\";\nimport type { SanityKeyedArray, Strict } from \"@/types\";\n\n/**\n * A single Handbook page, authored as rich text and rendered in the tool.\n *\n * @public\n */\nexport type SanityHandbookGuide = Strict<SanityDocument> & {\n _type: typeof guideTypeName;\n /** Display title for this guide. */\n title: string;\n /** Brief description shown beneath the guide heading. */\n description?: string;\n /** Portable Text content of the guide. */\n content: SanityKeyedArray<PortableTextBlock>;\n};\n\n/** Document type name of an individual guide. */\nexport const guideTypeName = \"handbook.guide\";\n\n/**\n * Creates the document type a single guide is authored as, with its content field offering the\n * built-in blocks alongside any a consumer registered.\n *\n * @param customBlocks - Custom block definitions registered by the consumer.\n * @returns A document type definition for Handbook guides.\n */\nexport function createGuideType(customBlocks: SanityHandbookBlockDefinition[] = []) {\n return defineType({\n name: guideTypeName satisfies SanityHandbookGuide[\"_type\"],\n type: \"document\",\n title: \"Handbook Guide\",\n icon: createSanityIcon(BookOpenTextIcon),\n description: \"Handbook page authored with rich text, images, and custom blocks.\",\n preview: {\n select: {\n title: \"title\",\n description: \"description\",\n },\n prepare(selection: { title?: string; description?: string }) {\n const { title, description } = selection;\n\n return {\n title: title ?? defaultDocumentTitle,\n subtitle: description,\n };\n },\n },\n fields: [\n defineField({\n name: \"title\" satisfies keyof SanityHandbookGuide,\n type: \"string\",\n description: \"Appears in the Handbook sidebar and as the guide heading.\",\n validation: (rule) => rule.required(),\n }),\n defineField({\n name: \"description\" satisfies keyof SanityHandbookGuide,\n type: \"string\",\n description: \"Short introduction text displayed below the guide heading.\",\n }),\n createGuideContentField(customBlocks),\n ],\n });\n}\n","import type { ComponentProps } from \"react\";\n\nexport type BookTextIconProps = ComponentProps<\"svg\">;\n\nexport function BookTextIcon(props: BookTextIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20\" />\n <path d=\"M8 11h8\" />\n <path d=\"M8 7h6\" />\n </svg>\n );\n}\n","import type { ComponentProps } from \"react\";\n\nexport type ListPlusIconProps = ComponentProps<\"svg\">;\n\nexport function ListPlusIcon(props: ListPlusIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M16 5H3\" />\n <path d=\"M11 12H3\" />\n <path d=\"M16 19H3\" />\n <path d=\"M18 9v6\" />\n <path d=\"M21 12h-6\" />\n </svg>\n );\n}\n","import { defineArrayMember, defineField, defineType } from \"sanity\";\nimport type { SanityDocument } from \"sanity\";\n\nimport { BookTextIcon } from \"@/icons/book-text\";\nimport { ListPlusIcon } from \"@/icons/list-plus\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport { isDefined } from \"@/lib/utils\";\nimport type { SanityHandbookGuide } from \"@/schemas/types/guide\";\nimport { guideTypeName } from \"@/schemas/types/guide\";\nimport type { SanityKeyedArray, Strict } from \"@/types\";\n\n/**\n * A titled run of guides in the sidebar, holding them in the order they appear.\n *\n * @public\n */\nexport interface SanityHandbookGuideGroup {\n /** Display title for this group in the sidebar. */\n title: string;\n /** Ordered array of guide references. */\n guides: SanityKeyedArray<SanityHandbookGuide>;\n}\n\n/**\n * The singleton naming every guide group and the order the sidebar lists them in.\n *\n * @public\n */\nexport type SanityHandbook = Strict<SanityDocument> & {\n _type: typeof handbookTypeName;\n /** Ordered array of groups, each containing a title and guide references. */\n groups: SanityKeyedArray<SanityHandbookGuideGroup>;\n};\n\n/** Document type name of the Handbook singleton. */\nexport const handbookTypeName = \"handbook.handbook\";\n\nexport const handbookType = defineType({\n name: handbookTypeName satisfies SanityHandbook[\"_type\"],\n type: \"document\",\n title: \"Handbook\",\n icon: createSanityIcon(BookTextIcon),\n description: \"Defines the groups of guides shown in the Handbook sidebar, and the order they appear in.\",\n preview: {\n prepare() {\n return {\n title: \"Handbook\",\n };\n },\n },\n fields: [\n defineField({\n name: \"groups\" satisfies keyof SanityHandbook,\n type: \"array\",\n description:\n \"Ordered list of groups displayed in the Handbook sidebar. Each group contains a title and an ordered list of guide references.\",\n of: [\n defineArrayMember({\n name: \"group\",\n type: \"object\",\n icon: createSanityIcon(ListPlusIcon),\n description: \"Named section of the Handbook sidebar holding an ordered list of guides.\",\n fields: [\n defineField({\n name: \"title\" satisfies keyof SanityHandbookGuideGroup,\n type: \"string\",\n description: \"Heading displayed above this group of guides in the sidebar.\",\n validation: (rule) => rule.required(),\n }),\n defineField({\n name: \"guides\" satisfies keyof SanityHandbookGuideGroup,\n type: \"array\",\n description: \"Ordered list of guides within this group. Drag to reorder.\",\n of: [\n defineArrayMember({\n name: \"guide\",\n type: \"reference\",\n to: [{ type: guideTypeName }],\n }),\n ],\n }),\n ],\n preview: {\n select: {\n title: \"title\",\n guide0: \"guides.0.title\",\n guide1: \"guides.1.title\",\n guide2: \"guides.2.title\",\n },\n prepare(selection: { title?: string; guide0?: string; guide1?: string; guide2?: string }) {\n const { title, guide0, guide1, guide2 } = selection;\n\n const all = [guide0, guide1, guide2].filter((guide): guide is string => isDefined(guide));\n const shown = all.slice(0, 2);\n const hasMore = isDefined(guide2);\n\n function formatSubtitle() {\n if (!isDefined(shown)) return \"No guides selected\";\n if (hasMore) return `${shown.join(\", \")}, and others`;\n return shown.join(\" and \");\n }\n\n return {\n title: title ?? \"Group\",\n subtitle: formatSubtitle(),\n };\n },\n },\n }),\n ],\n }),\n ],\n});\n","import { guideTypeName } from \"@/schemas/types/guide\";\nimport { handbookTypeName } from \"@/schemas/types/handbook\";\n\n/** Document types that should not appear in the \"create new\" menu. */\nexport const singletonTypes = new Set<string>([handbookTypeName]);\n\n/** All Handbook document types used to filter template items for non-editors. */\nexport const documentTypes = new Set<string>([handbookTypeName, guideTypeName]);\n","/** Width in pixels the sidebar pane settles at until it is resized. */\nexport const sidebarWidth = 350;\n\n/** Minimum width in pixels the sidebar pane occupies before collapsing to a vertical label. */\nexport const sidebarMinimumWidth = 320;\n\n/** Maximum width in pixels the sidebar pane can be resized to. */\nexport const sidebarMaximumWidth = 640;\n\n/** Minimum width in pixels the content pane occupies. */\nexport const contentMinimumWidth = 320;\n\n/** Share of the available space the content pane takes relative to the sidebar. */\nexport const contentFlex = 2.5;\n\n/** Width in pixels of a pane collapsed to a vertical label. */\nexport const collapsedPaneWidth = 51;\n\n/** Estimated height in pixels of a sidebar row, refined once the rows are measured. */\nexport const sidebarItemHeight = 37;\n\n/** Minimum width in pixels the tool occupies before the Studio scrolls horizontally. */\nexport const toolMinimumWidth = 320;\n\n/** Maximum width in pixels of the readable column inside the content pane. */\nexport const contentWidth = 640;\n\n/** Horizontal space in pixels between the readable column and the edges of the content pane. */\nexport const contentPaddingInline = 20;\n\n/** Space in pixels above the heading of a content panel. */\nexport const contentPaddingBlockStart = 32;\n\n/** Space in pixels below the last element of a content panel, so the end of long content clears the pane edge. */\nexport const contentPaddingBlockEnd = 220;\n\n/** Vertical rhythm in pixels that guide content and content panels are spaced on. */\nexport const contentSpacing = {\n section: 48,\n paragraph: 16,\n heading: 48,\n media: 24,\n callout: 32,\n blockquote: 32,\n list: 32,\n nestedList: 12,\n rule: 40,\n};\n","import { imageTypeName } from \"@/schemas/blocks/image\";\nimport { videoTypeName } from \"@/schemas/blocks/video\";\n\n/** Resolves a Portable Text asset reference to the single URL the viewer renders it from. */\nexport const assetUrlFragment = `\"asset\": { \"url\": asset.asset->url }`;\n\n/** Expands guide content members with resolved asset URLs. */\nexport const guideContentFragment = `\n _type == \"${imageTypeName}\" => { ..., ${assetUrlFragment} },\n _type == \"${videoTypeName}\" => { ..., ${assetUrlFragment} }\n`;\n\n/** Expands a guide reference with resolved asset URLs throughout its content. */\nexport const guideFragment = `...@-> {\n ...,\n content[] { ..., ${guideContentFragment} }\n}`;\n","import type { SanityClient } from \"sanity\";\n\n/** A GROQ query string branded with the shape of the data it returns. */\nexport type TypedQuery<T> = string & { readonly __result?: T };\n\n/**\n * Brands a GROQ query with the shape of the data it returns, so a fetch can infer its result type\n * instead of being told it at every call site.\n *\n * @param query - The GROQ query string.\n * @returns The query, typed to the given result shape.\n */\nexport function defineTypedQuery<T>(query: string): TypedQuery<T> {\n return query;\n}\n\n/**\n * Runs a branded query against the dataset, resolving a missing document to undefined.\n *\n * @param client - The Sanity client to query with.\n * @param query - The branded query to run.\n * @returns The result, or undefined when the query matched nothing.\n */\nexport async function fetchQuery<T>(client: SanityClient, query: TypedQuery<T>) {\n return (await client.fetch<T | null>(query)) ?? undefined;\n}\n","import { guideFragment } from \"@/groq/fragments\";\nimport { defineTypedQuery } from \"@/lib/groq\";\nimport type { SanityHandbookGuide } from \"@/schemas/types/guide\";\nimport { guideTypeName } from \"@/schemas/types/guide\";\nimport type { SanityHandbook } from \"@/schemas/types/handbook\";\nimport { handbookTypeName } from \"@/schemas/types/handbook\";\n\n/** Fetches the Handbook singleton with expanded guide references. */\nexport const handbookQuery = defineTypedQuery<SanityHandbook>(`\n *[_type == \"${handbookTypeName}\"][0] {\n ...,\n groups[] {\n ...,\n guides[] {\n ...,\n ${guideFragment}\n }\n }\n }\n`);\n\n/** Matches the documents whose changes the Handbook tool refetches on. */\nexport const handbookDocumentsQuery = defineTypedQuery<SanityHandbook | SanityHandbookGuide>(\n `*[_type == \"${handbookTypeName}\" || _type == \"${guideTypeName}\"]`,\n);\n","import { useEffect, useState } from \"react\";\nimport { useClient } from \"sanity\";\n\nimport { handbookDocumentsQuery, handbookQuery } from \"@/groq/documents\";\nimport { fetchQuery } from \"@/lib/groq\";\nimport type { SanityHandbook } from \"@/schemas/types/handbook\";\n\n/**\n * Fetches the Handbook singleton from the dataset with its guide references expanded, refetching\n * whenever one of the documents it draws on changes.\n *\n * @returns The Handbook and a flag for whether it is still loading.\n */\nexport function useHandbookDocument() {\n const client = useClient({ apiVersion: \"2026-01-01\" });\n const [handbook, setHandbook] = useState<SanityHandbook | undefined>(undefined);\n const [loading, setLoading] = useState(true);\n\n useEffect(() => {\n async function fetchHandbook() {\n setHandbook(await fetchQuery(client, handbookQuery));\n setLoading(false);\n }\n\n void fetchHandbook();\n\n const subscription = client.listen(handbookDocumentsQuery).subscribe(() => {\n void fetchHandbook();\n });\n\n return () => {\n subscription.unsubscribe();\n };\n }, [client]);\n\n return { handbook, loading };\n}\n","import { createContext, useContext, useState } from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport { useHandbookDocument } from \"@/hooks/use-handbook-document\";\nimport { isDefined } from \"@/lib/utils\";\nimport type { SanityHandbookBlockDefinition, SanityHandbookDocumentRole } from \"@/plugin\";\nimport type { SanityHandbook } from \"@/schemas/types/handbook\";\n\n/** Plugin configuration with every optional value already resolved to a concrete one. */\nexport interface HandbookProviderConfig {\n /** Heading displayed at the top of the sidebar. */\n sidebarTitle: string;\n /** Document roles from the plugin configuration. */\n roles: SanityHandbookDocumentRole[];\n /** Custom block definitions registered by the consumer. */\n blocks: SanityHandbookBlockDefinition[];\n /** Fallback message shown when a field has no description. */\n undocumentedFieldMessage: string;\n}\n\n/** Provider configuration alongside the tab and sidebar state the panes share. */\ntype HandbookContextValues = HandbookProviderConfig & {\n /** Identifier of the currently selected tab, or undefined when none is selected. */\n activeTab: string | undefined;\n /** Whether the sidebar is currently expanded. */\n sidebarExpanded: boolean;\n /** Whether Handbook data is still loading from the dataset. */\n loading: boolean;\n /** Handbook singleton fetched from the dataset. */\n handbook: SanityHandbook | undefined;\n /** Sets the active tab by identifier. */\n setActiveTab: (id: string) => void;\n /** Toggles the sidebar expanded state. */\n setSidebarExpanded: (expanded: boolean) => void;\n};\n\nexport type HandbookProviderProps = HandbookProviderConfig & {\n children: ReactNode;\n};\n\nconst HandbookContext = createContext<HandbookContextValues | undefined>(undefined);\n\n/**\n * Accesses the Handbook context for tab state and plugin configuration.\n *\n * @returns The resolved plugin configuration alongside the state the panes share.\n * @throws {Error} If used outside the provider.\n */\nexport function useHandbookContext() {\n const handbookContext = useContext(HandbookContext);\n\n if (!isDefined(handbookContext)) throw new Error(\"useHandbookContext can only be used within <HandbookProvider>\");\n\n return handbookContext;\n}\n\n/**\n * Provides the tab state the sidebar and content panes share, alongside the plugin configuration and\n * the handbook singleton fetched from the dataset.\n *\n * @param props - Configuration from the plugin, and the tool to provide it to.\n * @returns The provider wrapping its children.\n */\nexport function HandbookProvider({\n sidebarTitle,\n roles,\n blocks,\n undocumentedFieldMessage,\n children,\n}: HandbookProviderProps) {\n const [activeTab, setActiveTab] = useState<string | undefined>(undefined);\n const [sidebarExpanded, setSidebarExpanded] = useState(true);\n const { handbook, loading } = useHandbookDocument();\n\n return (\n <HandbookContext\n value={{\n sidebarTitle,\n roles,\n blocks,\n undocumentedFieldMessage,\n activeTab,\n sidebarExpanded,\n loading,\n handbook,\n setActiveTab,\n setSidebarExpanded,\n }}\n >\n {children}\n </HandbookContext>\n );\n}\n","import { Box, Card, Flex, Layer, LayerProvider, Text, useElementSize, useTheme_v2 } from \"@sanity/ui\";\nimport { useContext } from \"react\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { PaneContext } from \"sanity/_singletons\";\n\nimport { collapsedPaneWidth } from \"@/config/layout\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport type PaneHeaderProps = ComponentProps<\"div\"> & {\n title: string;\n backButton?: ReactNode;\n};\n\nexport function PaneHeader({ title, backButton, style, ...props }: PaneHeaderProps) {\n const { color } = useTheme_v2();\n const pane = useContext(PaneContext);\n const paneSize = useElementSize(pane?.rootElement ?? null);\n\n const collapsed = pane?.collapsed ?? false;\n const isLast = pane?.isLast ?? false;\n const paneHeight = paneSize?.border.height ?? 0;\n const collapsedWidth = paneHeight > 0 ? paneHeight : window.innerHeight;\n const { bg, fg } = color.selectable.default.enabled;\n\n function handleTitleClick() {\n if (collapsed) return;\n pane?.collapse();\n }\n\n function handleLayoutClick() {\n if (!collapsed) return;\n pane?.expand();\n }\n\n return (\n <LayerProvider zOffset={100}>\n <Layer\n data-collapsed={collapsed ? \"\" : undefined}\n style={{ lineHeight: 0, position: \"sticky\", top: 0, ...style }}\n {...props}\n >\n <Card tone=\"inherit\" data-collapsed={collapsed ? \"\" : undefined}>\n <Flex\n direction=\"column\"\n gap={3}\n onClick={handleLayoutClick}\n padding={3}\n sizing=\"border\"\n style={{\n width: collapsed ? collapsedWidth : undefined,\n transform: collapsed ? \"rotate(90deg)\" : undefined,\n transformOrigin: `calc(${collapsedPaneWidth}px / 2)`,\n }}\n >\n <Flex align=\"flex-start\" gap={3}>\n {isDefined(backButton) && <Box flex=\"none\">{backButton}</Box>}\n <Card\n flex={1}\n onClick={handleTitleClick}\n padding={2}\n paddingLeft={isDefined(backButton) ? 1 : 2}\n tabIndex={isLast && !collapsed ? -1 : 0}\n style={{ backgroundColor: bg, minWidth: 0 }}\n __unstable_focusRing\n >\n <Flex align=\"center\" gap={1}>\n <Text\n size={1}\n textOverflow=\"ellipsis\"\n weight=\"semibold\"\n style={{ color: fg, cursor: \"default\", minWidth: 0, outline: \"none\" }}\n >\n {title}\n </Text>\n </Flex>\n </Card>\n </Flex>\n </Flex>\n </Card>\n </Layer>\n </LayerProvider>\n );\n}\n","import { ArrowLeftIcon } from \"@sanity/icons/ArrowLeft\";\nimport { Box, Button, Heading, Stack, Text } from \"@sanity/ui\";\nimport { useContext } from \"react\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { PaneLayoutContext } from \"sanity/_singletons\";\nimport { PaneContent } from \"sanity/structure\";\n\nimport { PaneHeader } from \"@/components/pane-header\";\nimport { contentPaddingBlockEnd, contentPaddingBlockStart, contentPaddingInline, contentWidth } from \"@/config/layout\";\nimport { useHandbookContext } from \"@/contexts/handbook\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport type ContentPanelProps = Omit<ComponentProps<typeof PaneContent>, \"id\" | \"title\"> & {\n id: string;\n title: string;\n description?: string;\n children: ReactNode;\n};\n\nexport function ContentPanel({ id, title, description, children, ...props }: ContentPanelProps) {\n const { setSidebarExpanded } = useHandbookContext();\n const paneLayout = useContext(PaneLayoutContext);\n\n return (\n <>\n <PaneHeader\n title={title}\n backButton={\n paneLayout?.collapsed === true && (\n <Button\n aria-label=\"Back\"\n icon={ArrowLeftIcon}\n mode=\"bleed\"\n onClick={() => {\n setSidebarExpanded(true);\n }}\n />\n )\n }\n />\n <PaneContent id={`panel-${id}`} aria-labelledby={id} overflow=\"auto\" {...props}>\n <Box\n style={{\n maxWidth: contentWidth,\n boxSizing: \"border-box\",\n marginInline: \"auto\",\n paddingInline: contentPaddingInline,\n paddingBlockStart: contentPaddingBlockStart,\n paddingBlockEnd: contentPaddingBlockEnd,\n }}\n >\n <Stack marginBottom={6} gap={5}>\n <Heading as=\"h2\" size={4}>\n {title}\n </Heading>\n {isDefined(description) && (\n <Text size={1} muted>\n {description}\n </Text>\n )}\n </Stack>\n {children}\n </Box>\n </PaneContent>\n </>\n );\n}\n","import { Box, Stack, Text, useClickOutsideEvent } from \"@sanity/ui\";\nimport { Popover } from \"@sanity/ui/popover\";\nimport { useRef } from \"react\";\nimport type { ComponentProps, ReactNode } from \"react\";\n\nexport type FieldHintProps = Omit<ComponentProps<typeof Popover>, \"content\" | \"open\" | \"children\"> & {\n label: string;\n icon: ReactNode;\n open: boolean;\n children: string;\n onOpen: () => void;\n onClose: () => void;\n};\n\nexport function FieldHint({ label, icon, open, children, onOpen, onClose, ...props }: FieldHintProps) {\n const buttonReference = useRef<HTMLButtonElement | null>(null);\n const popoverReference = useRef<HTMLDivElement | null>(null);\n\n useClickOutsideEvent(open ? onClose : undefined, () => [buttonReference.current, popoverReference.current]);\n\n return (\n <Popover\n open={open}\n placement=\"top\"\n portal\n radius={2}\n shadow={2}\n content={\n <div ref={popoverReference}>\n <Box padding={3} style={{ maxWidth: 280 }}>\n <Stack gap={3}>\n <Text size={1} weight=\"semibold\">\n {label}\n </Text>\n <Text size={1} muted>\n {children}\n </Text>\n </Stack>\n </Box>\n </div>\n }\n {...props}\n >\n <button\n ref={buttonReference}\n aria-label={label}\n type=\"button\"\n onClick={open ? onClose : onOpen}\n onPointerEnter={(event) => {\n if (event.pointerType === \"mouse\") onOpen();\n }}\n onPointerLeave={(event) => {\n if (event.pointerType === \"mouse\") onClose();\n }}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n padding: 2,\n fontSize: 16,\n color: \"var(--card-icon-color)\",\n background: \"none\",\n border: \"none\",\n cursor: \"pointer\",\n }}\n >\n {icon}\n </button>\n </Popover>\n );\n}\n","import type { ComponentProps, ComponentType } from \"react\";\n\nimport { InfoIcon } from \"@/icons/info\";\nimport { LightbulbIcon } from \"@/icons/lightbulb\";\nimport { TriangleAlertIcon } from \"@/icons/triangle-alert\";\nimport type { SanityHandbookMetadata } from \"@/plugin\";\n\n/** A kind of hint a field can carry, pairing its metadata property with how it is presented. */\ninterface HintKind {\n /** Property on the field's handbook metadata holding the hint text. */\n name: keyof Pick<SanityHandbookMetadata, \"tip\" | \"info\" | \"caution\">;\n /** Heading shown above the hint text, and the icon's accessible label. */\n label: string;\n /** Icon identifying the kind wherever the hint appears. */\n icon: ComponentType<ComponentProps<\"svg\">>;\n}\n\n/** Hint kinds a field can carry, in the order they are displayed. */\nexport const hintKinds: HintKind[] = [\n { name: \"tip\", label: \"Tip\", icon: LightbulbIcon },\n { name: \"info\", label: \"Information\", icon: InfoIcon },\n { name: \"caution\", label: \"Caution\", icon: TriangleAlertIcon },\n];\n","import { Flex } from \"@sanity/ui\";\nimport type { FlexProps } from \"@sanity/ui\";\nimport { useState } from \"react\";\n\nimport { FieldHint } from \"@/components/field/hint\";\nimport { defaultIconProps } from \"@/config/defaults\";\nimport { hintKinds } from \"@/config/hints\";\nimport { isDefined } from \"@/lib/utils\";\nimport type { SanityHandbookMetadata } from \"@/plugin\";\n\nexport type FieldHintsProps = FlexProps & Pick<SanityHandbookMetadata, \"tip\" | \"info\" | \"caution\">;\n\nexport function FieldHints({ tip, info, caution, ...props }: FieldHintsProps) {\n const [openHint, setOpenHint] = useState<string | undefined>(undefined);\n\n const hints = { tip, info, caution };\n\n function closeHint() {\n setOpenHint(undefined);\n }\n\n return (\n <Flex align=\"center\" gap={2} {...props}>\n {hintKinds.flatMap(({ name, label, icon: Icon }) => {\n const hint = hints[name];\n if (!isDefined(hint)) return [];\n\n return (\n <FieldHint\n key={name}\n label={label}\n icon={<Icon {...defaultIconProps} />}\n open={openHint === name}\n onOpen={() => {\n setOpenHint(name);\n }}\n onClose={closeHint}\n >\n {hint}\n </FieldHint>\n );\n })}\n </Flex>\n );\n}\n","import type { ComponentProps, ComponentType, ReactNode } from \"react\";\n\nimport { createSanityIcon } from \"@/lib/icons\";\nimport { convertCase } from \"@/lib/utils\";\n\n/**\n * Resolves the label shown for a schema type, preferring Handbook metadata over the schema's own\n * title and falling back to a title-cased name.\n *\n * @param type - The schema type or field to resolve a label for.\n * @returns The label.\n */\nexport function resolveTitle(type: { name: string; title?: string; handbook?: { title?: string } }) {\n const { name, title, handbook } = type;\n\n return handbook?.title ?? title ?? convertCase(name, \"title\");\n}\n\n/**\n * Resolves the description shown for a schema type, preferring Handbook metadata and ignoring the\n * non-string descriptions a schema may carry.\n *\n * @param type - The schema type or field to resolve a description for.\n * @returns The description, or undefined when neither source provides one.\n */\nexport function resolveDescription(type: { description?: unknown; handbook?: { description?: string } }) {\n const { description, handbook } = type;\n\n return handbook?.description ?? (typeof description === \"string\" ? description : undefined);\n}\n\n/**\n * Narrows a schema type's icon to a renderable component, discarding the string form a schema may\n * carry instead. A consumer's icon is redrawn at the plugin's own weight, so it sits beside the\n * built-in ones rather than at its own library's default size.\n *\n * @param type - The schema type to read an icon from.\n * @returns The icon component, or undefined when none is set.\n */\nexport function resolveIcon(type: { icon?: ReactNode | ComponentType<ComponentProps<\"svg\">> }) {\n return typeof type.icon === \"function\" ? createSanityIcon(type.icon) : undefined;\n}\n","import type { FieldDefinition, Schema } from \"sanity\";\n\nimport { isDefined } from \"@/lib/utils\";\n\n/** A schema field as Sanity compiles it, with its type resolved to an object rather than a name. */\ninterface CompiledField {\n /** Field identifier in the schema. */\n name: string;\n /** Resolved type object containing the type name and base type metadata. */\n type: { name: string; title?: string; description?: string; fields?: unknown[]; of?: unknown[] };\n /** Custom title set directly on inline object definitions. */\n title?: string;\n /** Custom description set directly on inline object definitions. */\n description?: string;\n /** Fields defined directly on inline object definitions. */\n fields?: unknown[];\n /** Array members defined directly on inline array definitions. */\n of?: unknown[];\n /** Optional Handbook metadata annotations for this field. */\n handbook?: FieldDefinition[\"handbook\"];\n}\n\n/** A schema field flattened into the shape the Handbook renders, with its type collapsed to a name. */\nexport interface NormalisedField {\n /** Field identifier in the schema. */\n name: string;\n /** Resolved type name. */\n type: string;\n /** Display title, falling back to the one declared on the base type. */\n title?: string;\n /** Description, falling back to the one declared on the base type. */\n description?: string;\n /** Optional Handbook metadata annotations for this field. */\n handbook?: FieldDefinition[\"handbook\"];\n /** Normalised subfields, present on object types. */\n fields?: NormalisedField[];\n /** Normalised members, present on array types. */\n of?: NormalisedField[];\n}\n\n/** Schema type names treated as leaf types whose subfields are not displayed. */\nconst opaqueTypes = new Set([\n \"block\",\n \"boolean\",\n \"crossDatasetReference\",\n \"date\",\n \"datetime\",\n \"file\",\n \"geopoint\",\n \"image\",\n \"number\",\n \"reference\",\n \"slug\",\n \"string\",\n \"text\",\n \"url\",\n]);\n\n/** Fields injected by Sanity's built-in opaque types during schema compilation. */\nconst inheritedFieldNames: Partial<Record<string, Set<string>>> = {\n block: new Set([\"children\", \"level\", \"listItem\", \"markDefs\", \"style\"]),\n file: new Set([\"asset\", \"media\"]),\n geopoint: new Set([\"alt\", \"lat\", \"lng\"]),\n image: new Set([\"asset\", \"crop\", \"hotspot\", \"media\"]),\n slug: new Set([\"current\", \"source\"]),\n};\n\n/**\n * Checks whether a value is a compiled schema field with a nested type object.\n *\n * @param value - The value to check.\n * @returns True if the value is a compiled field.\n */\nfunction isCompiledField(value: unknown): value is CompiledField {\n if (typeof value !== \"object\" || value === null) return false;\n if (!(\"name\" in value) || !(\"type\" in value)) return false;\n\n return typeof value.type === \"object\" && value.type !== null;\n}\n\n/**\n * Checks whether a value has a `fields` array property.\n *\n * @param value - The value to check.\n * @returns True if the value contains a `fields` array.\n */\nfunction hasFieldsArray(value: unknown): value is { fields: unknown[] } {\n if (typeof value !== \"object\" || value === null || !(\"fields\" in value)) return false;\n\n return Array.isArray(value.fields);\n}\n\n/**\n * Checks whether a value has an `of` array property.\n *\n * @param value - The value to check.\n * @returns True if the value contains an `of` array.\n */\nfunction hasOfArray(value: unknown): value is { of: unknown[] } {\n if (typeof value !== \"object\" || value === null || !(\"of\" in value)) return false;\n\n return Array.isArray(value.of);\n}\n\n/**\n * Extracts the type name a value declares, where it names one at all.\n *\n * @param value - The value to inspect.\n * @returns The type name, or undefined when the value declares none.\n */\nfunction getTypeName(value: unknown) {\n if (typeof value !== \"object\" || value === null || !(\"type\" in value)) return undefined;\n\n return typeof value.type === \"string\" ? value.type : undefined;\n}\n\n/**\n * Extracts the parent type name from a compiled schema type, if present.\n *\n * @param resolvedType - The compiled schema type to inspect.\n * @returns The parent type name, or undefined when the type extends none.\n */\nfunction getParentTypeName(resolvedType: unknown) {\n if (typeof resolvedType !== \"object\" || resolvedType === null || !(\"type\" in resolvedType)) return undefined;\n if (typeof resolvedType.type !== \"object\" || resolvedType.type === null || !(\"name\" in resolvedType.type)) {\n return undefined;\n }\n\n return String(resolvedType.type.name);\n}\n\n/**\n * Normalises a compiled schema field into the shape the Handbook renders. Type names already seen are\n * tracked so a type that refers back to itself does not recurse forever.\n *\n * @param field - A compiled schema field or plain field definition.\n * @param visited - Type names already seen in this normalisation chain.\n * @returns The normalised field.\n */\nfunction normaliseField(field: unknown, visited = new Set<string>()) {\n if (isCompiledField(field)) {\n const typeName = field.type.name;\n\n const result: NormalisedField = {\n name: field.name,\n type: typeName,\n title: field.title ?? field.type.title,\n description: field.description ?? field.type.description,\n handbook: field.handbook,\n };\n\n if (!visited.has(typeName)) {\n const shouldTrack = !opaqueTypes.has(typeName) && typeName !== \"object\" && typeName !== \"array\";\n const next = shouldTrack ? new Set([...visited, typeName]) : visited;\n const fieldSource = hasFieldsArray(field) ? field : field.type;\n const ofSource = hasOfArray(field) ? field : field.type;\n\n if (hasFieldsArray(fieldSource)) {\n result.fields = fieldSource.fields.map((subfield) => normaliseField(subfield, next));\n }\n if (hasOfArray(ofSource)) result.of = ofSource.of.map((member) => normaliseField(member, next));\n }\n\n return result;\n }\n\n // oxlint-disable-next-line no-unsafe-type-assertion -- Schema values that are already normalised carry no marker to narrow on.\n return field as NormalisedField;\n}\n\n/**\n * Resolves only the fields a custom type adds on top of an opaque base type, leaving out the ones the\n * base type contributes of its own accord.\n *\n * @param resolvedType - The compiled or normalised schema type.\n * @param parentName - The opaque base type name.\n * @returns The custom fields, or undefined when the type adds none.\n */\nfunction resolveCustomFields(resolvedType: unknown, parentName: string) {\n if (!hasFieldsArray(resolvedType)) return undefined;\n\n const inherited = inheritedFieldNames[parentName];\n\n const customFields = resolvedType.fields\n .map((field: unknown) => normaliseField(field))\n .filter((field) => !isDefined(inherited) || !inherited.has(field.name));\n\n return isDefined(customFields) ? customFields : undefined;\n}\n\n/**\n * Normalises a list of raw field values into the shape the Handbook renders.\n *\n * @param items - Raw field values to normalise.\n * @returns The normalised fields, or undefined when the list holds none.\n */\nfunction resolveNormalisedFields(items: unknown[]) {\n const normalised = items.map((item) => normaliseField(item));\n\n return isDefined(normalised) ? normalised : undefined;\n}\n\n/**\n * Normalises array members and filters out opaque types that have no meaningful subfields.\n *\n * @param members - Raw array member values to normalise.\n * @returns The normalised non-opaque members, or undefined when none remain.\n */\nfunction resolveNormalisedMembers(members: unknown[]) {\n const normalised = members.map((member) => normaliseField(member)).filter((member) => !opaqueTypes.has(member.type));\n\n return isDefined(normalised) ? normalised : undefined;\n}\n\n/**\n * Resolves the name of the type a value extends, reaching into the schema registry when the value\n * carries nothing but a type name of its own.\n *\n * @param value - The value to inspect.\n * @param schema - The Sanity schema registry.\n * @returns The parent type name, or undefined when the value extends none.\n */\nfunction resolveParentName(value: unknown, schema: Schema) {\n const direct = getParentTypeName(value);\n if (isDefined(direct)) return direct;\n\n const typeName = getTypeName(value);\n if (!isDefined(typeName)) return undefined;\n\n const resolvedType = schema.get(typeName);\n return isDefined(resolvedType) ? getParentTypeName(resolvedType) : undefined;\n}\n\n/**\n * Extracts the fields a value displays, whether it carries them directly, carries array members that\n * do, or names a type that does.\n *\n * @param value - The value to extract fields from.\n * @param schema - The Sanity schema registry.\n * @returns The resolved fields, or undefined when the value has none.\n */\nfunction resolveFields(value: unknown, schema: Schema) {\n if (hasFieldsArray(value)) {\n const parentName = resolveParentName(value, schema);\n if (isDefined(parentName) && opaqueTypes.has(parentName)) return resolveCustomFields(value, parentName);\n\n return resolveNormalisedFields(value.fields);\n }\n\n if (hasOfArray(value)) {\n const members = value.of;\n\n if (members.length === 1) {\n const [member] = members;\n const normalised = normaliseField(member);\n\n if (opaqueTypes.has(normalised.type)) return undefined;\n\n if (hasFieldsArray(normalised)) {\n const parentName = resolveParentName(normalised, schema);\n if (isDefined(parentName) && opaqueTypes.has(parentName)) return resolveCustomFields(normalised, parentName);\n\n return resolveNormalisedFields(normalised.fields);\n }\n\n const memberType = schema.get(normalised.type);\n if (isDefined(memberType)) return resolveFields(memberType, schema);\n }\n\n return resolveNormalisedMembers(members);\n }\n\n return undefined;\n}\n\n/**\n * Resolves the displayable subfields of a field definition by traversing the schema.\n *\n * @param field - The parent field definition.\n * @param schema - The Sanity schema registry.\n * @returns The non-opaque subfields, or undefined when the field has none.\n */\nexport function getSubfields(field: FieldDefinition | NormalisedField, schema: Schema) {\n if (opaqueTypes.has(field.type)) return undefined;\n\n const directFields = resolveFields(field, schema);\n if (isDefined(directFields)) return directFields;\n\n const resolvedType = schema.get(field.type);\n if (!isDefined(resolvedType)) return undefined;\n\n const parentName = getParentTypeName(resolvedType);\n if (isDefined(parentName) && opaqueTypes.has(parentName)) {\n return resolveCustomFields(resolvedType, parentName);\n }\n\n return resolveFields(resolvedType, schema);\n}\n","import { ChevronDownIcon } from \"@sanity/icons/ChevronDown\";\nimport { ChevronRightIcon } from \"@sanity/icons/ChevronRight\";\nimport { Box, Card, Flex, Stack, Text } from \"@sanity/ui\";\nimport type { StackProps } from \"@sanity/ui\";\nimport { useState } from \"react\";\nimport type { FieldDefinition } from \"sanity\";\nimport { useSchema } from \"sanity\";\n\nimport { FieldHints } from \"@/components/field/hints\";\nimport { useHandbookContext } from \"@/contexts/handbook\";\nimport { resolveDescription, resolveTitle } from \"@/lib/display\";\nimport type { NormalisedField } from \"@/lib/schema\";\nimport { getSubfields } from \"@/lib/schema\";\nimport { convertCase, isDefined } from \"@/lib/utils\";\n\nexport type FieldProps = StackProps & {\n field: FieldDefinition | NormalisedField;\n ancestors?: Set<string>;\n};\n\n/** Shared empty ancestor set, so the default prop keeps a stable reference across renders. */\nconst noAncestors = new Set<string>();\n\nexport function Field({ field, ancestors = noAncestors, ...props }: FieldProps) {\n const schema = useSchema();\n const { undocumentedFieldMessage } = useHandbookContext();\n const [expanded, setExpanded] = useState(false);\n\n const effectiveTitle = resolveTitle(field);\n const effectiveDescription = resolveDescription(field) ?? undocumentedFieldMessage;\n\n const { example, tip, info, caution } = field.handbook ?? {};\n const hasHints = isDefined([tip, info, caution]);\n\n const isCycle = ancestors.has(field.type);\n const subfields = isCycle ? undefined : getSubfields(field, schema);\n const hasSubfields = isDefined(subfields);\n\n return (\n <Stack gap={2} {...props}>\n <Stack gap={3}>\n <Flex align=\"center\" paddingY={1} gap={2}>\n <Box flex={1}>\n <Flex align=\"center\" gap={2}>\n <Text size={1} weight=\"medium\">\n {effectiveTitle}\n </Text>\n <Text size={0} muted style={{ marginTop: 2 }}>\n {field.type}\n </Text>\n </Flex>\n </Box>\n {hasHints && <FieldHints tip={tip} info={info} caution={caution} />}\n </Flex>\n {isDefined(effectiveDescription) && (\n <Text size={1} muted>\n {effectiveDescription}\n </Text>\n )}\n {isDefined(example) && (\n <Box marginTop={1}>\n <Text size={1} muted style={{ fontStyle: \"italic\" }}>\n e.g. {example}\n </Text>\n </Box>\n )}\n </Stack>\n {isCycle && (\n <Box marginTop={2}>\n <Text size={1} muted style={{ fontStyle: \"italic\" }}>\n See {convertCase(field.type, \"title\")} above.\n </Text>\n </Box>\n )}\n {hasSubfields && (\n <>\n <Card\n as=\"button\"\n padding={3}\n radius={2}\n sizing=\"border\"\n tone=\"transparent\"\n onClick={() => {\n setExpanded(!expanded);\n }}\n style={{ marginTop: 16, textAlign: \"left\", border: \"none\", cursor: \"pointer\" }}\n >\n <Flex align=\"center\" gap={2}>\n <Text size={0}>{expanded ? <ChevronDownIcon /> : <ChevronRightIcon />}</Text>\n <Text size={1} muted weight=\"medium\">\n {subfields.length} subfield{subfields.length === 1 ? \"\" : \"s\"}\n </Text>\n </Flex>\n </Card>\n {expanded && (\n <div\n style={{\n marginTop: 16,\n marginBottom: 8,\n paddingLeft: 16,\n borderLeft: \"1px solid var(--card-border-color)\",\n }}\n >\n <Stack gap={5}>\n {subfields.map((subfield) => (\n <Field key={subfield.name} field={subfield} ancestors={new Set([...ancestors, field.type])} />\n ))}\n </Stack>\n </div>\n )}\n </>\n )}\n </Stack>\n );\n}\n","import { Field } from \"@/components/field/field\";\nimport { contentSpacing } from \"@/config/layout\";\nimport { resolveDescription, resolveIcon, resolveTitle } from \"@/lib/display\";\nimport type { SanityHandbookDocumentRole } from \"@/plugin\";\n\n/**\n * Builds a section for each configured document role.\n *\n * @param roles - Document roles from the plugin configuration.\n * @returns One section per role, holding an entry per document type.\n */\nexport function documentTypesSections(roles: SanityHandbookDocumentRole[]) {\n return roles.map(({ title, documents }) => ({\n title,\n entries: documents.map((document) => ({\n id: document.name,\n title: resolveTitle(document),\n description: resolveDescription(document),\n icon: resolveIcon(document),\n render: () => (\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: contentSpacing.section }}>\n {document.fields.map((field) => (\n <Field key={field.name} field={field} />\n ))}\n </div>\n ),\n })),\n }));\n}\n","import type { ComponentProps } from \"react\";\n\nexport type LayoutGridIconProps = ComponentProps<\"svg\">;\n\nexport function LayoutGridIcon(props: LayoutGridIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"14\" rx=\"1\" />\n </svg>\n );\n}\n","import { ChevronRightIcon } from \"@sanity/icons/ChevronRight\";\nimport { Box, Card, Flex, Stack, Text } from \"@sanity/ui\";\n\nimport { contentSpacing } from \"@/config/layout\";\nimport { useHandbookContext } from \"@/contexts/handbook\";\nimport { resolveDescription, resolveIcon, resolveTitle } from \"@/lib/display\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport function DocumentTypesOverview() {\n const { roles, setActiveTab, setSidebarExpanded } = useHandbookContext();\n\n return (\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: contentSpacing.section }}>\n {roles.map((role) => {\n const { title, description, documents } = role;\n\n return (\n <Stack key={title} gap={2}>\n <Stack gap={3}>\n <Flex align=\"center\" paddingY={1}>\n <Text size={1} weight=\"medium\">\n {title}\n </Text>\n </Flex>\n {isDefined(description) && (\n <Text size={1} muted>\n {description}\n </Text>\n )}\n </Stack>\n <Box marginTop={1}>\n <Stack gap={2}>\n {documents.map((document) => {\n const Icon = resolveIcon(document);\n const documentDescription = resolveDescription(document);\n\n return (\n <Card\n key={document.name}\n as=\"button\"\n padding={3}\n radius={2}\n sizing=\"border\"\n tone=\"inherit\"\n onClick={() => {\n setActiveTab(document.name);\n setSidebarExpanded(false);\n }}\n style={{\n width: \"calc(100% + 24px)\",\n marginLeft: \"-12px\",\n textAlign: \"left\",\n border: \"none\",\n cursor: \"pointer\",\n }}\n >\n <Flex align=\"center\" gap={3}>\n <Box flex={1}>\n <Stack gap={3}>\n <Flex align=\"center\" gap={2} style={{ marginLeft: \"-4px\" }}>\n {isDefined(Icon) && (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: 25,\n height: 25,\n color: \"var(--card-icon-color)\",\n }}\n >\n <Icon />\n </div>\n )}\n <Text size={1} weight=\"medium\">\n {resolveTitle(document)}\n </Text>\n </Flex>\n {isDefined(documentDescription) && (\n <Box paddingBottom={1}>\n <Text size={1} muted>\n {documentDescription}\n </Text>\n </Box>\n )}\n </Stack>\n </Box>\n <Box flex=\"none\" style={{ opacity: 0.5 }}>\n <Text muted size={1}>\n <ChevronRightIcon />\n </Text>\n </Box>\n </Flex>\n </Card>\n );\n })}\n </Stack>\n </Box>\n </Stack>\n );\n })}\n </div>\n );\n}\n","import { Flex, Stack, Text } from \"@sanity/ui\";\n\nimport { defaultIconProps } from \"@/config/defaults\";\nimport { hintKinds } from \"@/config/hints\";\nimport { contentSpacing } from \"@/config/layout\";\n\n/** What each hint kind signals to an editor, shown as a legend alongside its icon. */\nconst hintDescriptions = {\n tip: \"Helpful tips and best practices for content editors.\",\n info: \"Additional context about how the field is used.\",\n caution: \"Important warnings about constraints or potential issues.\",\n} satisfies Record<(typeof hintKinds)[number][\"name\"], string>;\n\nexport function HowToUse() {\n return (\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: contentSpacing.section }}>\n <Stack gap={3}>\n <Flex align=\"center\" paddingY={1}>\n <Text size={1} weight=\"medium\">\n Navigating the Handbook\n </Text>\n </Flex>\n <Text size={1} muted>\n The sidebar lists everything the Handbook holds: these introductory pages, then the document types you can\n create, grouped by the role they play on the site, and finally any guides your team has written. Selecting an\n entry opens it here.\n </Text>\n </Stack>\n <Stack gap={3}>\n <Flex align=\"center\" paddingY={1}>\n <Text size={1} weight=\"medium\">\n Understanding Fields\n </Text>\n </Flex>\n <Text size={1} muted>\n Selecting a document type lists its fields, each showing its name, the kind of value it holds, and what the\n field is for. The documentation is generated from the content model, so what you read always matches what you\n see while editing.\n </Text>\n </Stack>\n <Stack gap={3}>\n <Flex align=\"center\" paddingY={1}>\n <Text size={1} weight=\"medium\">\n Hints and Warnings\n </Text>\n </Flex>\n <Text size={1} muted>\n Icons beside a field name carry the guidance that would crowd its description if written into it. Hover or\n click one to read what it says, and use the key below to tell the three kinds apart.\n </Text>\n <Stack gap={3} marginTop={2}>\n {hintKinds.map(({ name, icon: Icon }) => (\n <Flex key={name} align=\"center\" gap={3}>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n flexShrink: 0,\n fontSize: \"16px\",\n color: \"var(--card-icon-color)\",\n }}\n >\n <Icon {...defaultIconProps} />\n </div>\n <Text size={1} muted>\n {hintDescriptions[name]}\n </Text>\n </Flex>\n ))}\n </Stack>\n </Stack>\n <Stack gap={3}>\n <Flex align=\"center\" paddingY={1}>\n <Text size={1} weight=\"medium\">\n Nested Fields\n </Text>\n </Flex>\n <Text size={1} muted>\n Some fields hold subfields of their own, such as a content block pairing a heading with body text. A control\n beneath the description counts them and expands to show each one, documented exactly as a top-level field is.\n </Text>\n </Stack>\n <Stack gap={3}>\n <Flex align=\"center\" paddingY={1}>\n <Text size={1} weight=\"medium\">\n Guides\n </Text>\n </Flex>\n <Text size={1} muted>\n Beneath the document types you may find guides, written by your team rather than generated from the content\n model. They carry what a field description cannot: house style, editorial process, and how all the pieces fit\n together.\n </Text>\n </Stack>\n </div>\n );\n}\n","import { BookTextIcon } from \"@/icons/book-text\";\nimport { LayoutGridIcon } from \"@/icons/layout-grid\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport { DocumentTypesOverview } from \"@/pages/document-types-overview\";\nimport { HowToUse } from \"@/pages/how-to-use\";\n\n/**\n * Builds the section holding the plugin's own introductory pages.\n *\n * @returns A single section listing the built-in pages, in the order they are shown.\n */\nexport function gettingStartedSections() {\n return [\n {\n title: \"Getting Started\",\n entries: [\n {\n id: \"how-to-use-this-handbook\",\n title: \"How to use the Handbook\",\n description:\n \"A guide to navigating the Handbook, reading the documentation for each field, and making sense of its examples, hints, and nested structure.\",\n icon: createSanityIcon(BookTextIcon),\n render: () => <HowToUse />,\n },\n {\n id: \"document-types\",\n title: \"Document Types\",\n description:\n \"An overview of all document types, organised by role. Select a document type to view its fields, descriptions, and examples.\",\n icon: createSanityIcon(LayoutGridIcon),\n render: () => <DocumentTypesOverview />,\n },\n ],\n },\n ];\n}\n","import type { ComponentProps } from \"react\";\n\nexport type PortableLinkProps = ComponentProps<\"a\">;\n\nexport function PortableLink({ children, style, ...props }: PortableLinkProps) {\n return (\n <a target=\"_blank\" rel=\"noopener noreferrer\" style={{ color: \"var(--card-link-fg-color)\", ...style }} {...props}>\n {children}\n </a>\n );\n}\n","import { PortableText } from \"@portabletext/react\";\nimport type { PortableTextComponents, PortableTextMarkComponentProps } from \"@portabletext/react\";\nimport type { ComponentProps } from \"react\";\n\nimport { CalloutContent } from \"@/blocks/callout/content\";\nimport { PortableCode } from \"@/components/content/portable/code\";\nimport { PortableLink } from \"@/components/content/portable/link\";\nimport { contentSpacing } from \"@/config/layout\";\nimport type { SanityHandbookLink } from \"@/schemas/annotations/link\";\nimport type { SanityHandbookCallout } from \"@/schemas/blocks/callout\";\n\nexport type CalloutBlockProps = Omit<ComponentProps<typeof CalloutContent>, \"variant\" | \"children\"> & {\n value: SanityHandbookCallout;\n};\n\n/** Overrides for a callout body, which takes the card's own text styling and leaves paragraphs unwrapped. */\nconst components: PortableTextComponents = {\n block: { normal: ({ children }) => <>{children}</> },\n marks: {\n code: ({ children }) => <PortableCode>{children}</PortableCode>,\n link: ({ children, value }: PortableTextMarkComponentProps<SanityHandbookLink>) => (\n <PortableLink href={value?.href}>{children}</PortableLink>\n ),\n },\n};\n\nexport function CalloutBlock({ value, style, ...props }: CalloutBlockProps) {\n return (\n <CalloutContent variant={value.variant} style={{ marginBlock: contentSpacing.callout, ...style }} {...props}>\n <PortableText value={value.body} components={components} />\n </CalloutContent>\n );\n}\n","import type { ComponentProps } from \"react\";\n\nimport { CodeContent } from \"@/blocks/code/content\";\nimport { contentSpacing } from \"@/config/layout\";\nimport { isDefined } from \"@/lib/utils\";\nimport type { SanityHandbookCode } from \"@/schemas/blocks/code\";\n\nexport type CodeBlockProps = Omit<ComponentProps<typeof CodeContent>, \"code\" | \"language\"> & {\n value: SanityHandbookCode;\n};\n\nexport function CodeBlock({ value, style, ...props }: CodeBlockProps) {\n if (!isDefined(value.code)) return null;\n\n return (\n <CodeContent\n code={value.code}\n language={value.language}\n style={{ marginBlock: contentSpacing.media, ...style }}\n {...props}\n />\n );\n}\n","import type { ComponentProps } from \"react\";\n\nimport { HorizontalRuleContent } from \"@/blocks/horizontal-rule/content\";\nimport { contentSpacing } from \"@/config/layout\";\nimport type { SanityHandbookHorizontalRule } from \"@/schemas/blocks/horizontal-rule\";\n\nexport type HorizontalRuleBlockProps = ComponentProps<typeof HorizontalRuleContent> & {\n value: SanityHandbookHorizontalRule;\n};\n\nexport function HorizontalRuleBlock({ value: _value, style, ...props }: HorizontalRuleBlockProps) {\n return <HorizontalRuleContent style={{ marginBlock: contentSpacing.rule, ...style }} {...props} />;\n}\n","import type { ComponentProps } from \"react\";\n\nimport { ImageContent } from \"@/blocks/image/content\";\nimport { contentSpacing } from \"@/config/layout\";\nimport { isDefined } from \"@/lib/utils\";\nimport type { SanityHandbookImage } from \"@/schemas/blocks/image\";\n\nexport type ImageBlockProps = Omit<ComponentProps<typeof ImageContent>, \"url\" | \"alt\" | \"caption\"> & {\n value: SanityHandbookImage;\n};\n\nexport function ImageBlock({ value, style, ...props }: ImageBlockProps) {\n if (!isDefined(value.asset?.url)) return null;\n\n return (\n <ImageContent\n url={value.asset.url}\n alt={value.alt}\n caption={value.caption}\n style={{ marginBlock: contentSpacing.media, ...style }}\n {...props}\n />\n );\n}\n","import type { ComponentProps } from \"react\";\n\nimport { VideoContent } from \"@/blocks/video/content\";\nimport { contentSpacing } from \"@/config/layout\";\nimport { isDefined } from \"@/lib/utils\";\nimport type { SanityHandbookVideo } from \"@/schemas/blocks/video\";\n\nexport type VideoBlockProps = Omit<ComponentProps<typeof VideoContent>, \"url\" | \"caption\"> & {\n value: SanityHandbookVideo;\n};\n\nexport function VideoBlock({ value, style, ...props }: VideoBlockProps) {\n if (!isDefined(value.asset?.url)) return null;\n\n return (\n <VideoContent\n url={value.asset.url}\n caption={value.caption}\n style={{ marginBlock: contentSpacing.media, ...style }}\n {...props}\n />\n );\n}\n","import type { CSSProperties, ComponentProps } from \"react\";\n\n// `ref` is dropped because the element rendered varies, so a ref typed to either list element would be wrong.\nexport type PortableListProps = Omit<ComponentProps<\"ul\">, \"ref\"> & {\n ordered?: boolean;\n};\n\nexport function PortableList({ ordered = false, style, ...props }: PortableListProps) {\n const listStyle: CSSProperties = {\n display: \"flex\",\n flexDirection: \"column\",\n gap: 6,\n margin: 0,\n paddingLeft: \"1.25em\",\n ...style,\n };\n\n if (ordered) return <ol style={listStyle} {...props} />;\n\n return <ul style={listStyle} {...props} />;\n}\n","import { PortableText as PortableTextReact } from \"@portabletext/react\";\nimport type {\n PortableTextComponentProps,\n PortableTextComponents,\n PortableTextMarkComponentProps,\n PortableTextTypeComponent,\n PortableTextTypeComponentProps,\n} from \"@portabletext/react\";\nimport type { ComponentProps, ComponentType } from \"react\";\nimport type { PortableTextBlock, PortableTextListBlock, PortableTextObject } from \"sanity\";\n\nimport { CalloutBlock } from \"@/blocks/callout/block\";\nimport { CodeBlock } from \"@/blocks/code/block\";\nimport { HorizontalRuleBlock } from \"@/blocks/horizontal-rule/block\";\nimport { ImageBlock } from \"@/blocks/image/block\";\nimport { VideoBlock } from \"@/blocks/video/block\";\nimport { PortableBlockquote } from \"@/components/content/portable/blockquote\";\nimport { PortableCode } from \"@/components/content/portable/code\";\nimport { PortableHeading } from \"@/components/content/portable/heading\";\nimport { PortableLink } from \"@/components/content/portable/link\";\nimport { PortableList } from \"@/components/content/portable/list\";\nimport { PortableParagraph } from \"@/components/content/portable/paragraph\";\nimport { contentSpacing } from \"@/config/layout\";\nimport { useHandbookContext } from \"@/contexts/handbook\";\nimport type { SanityHandbookLink } from \"@/schemas/annotations/link\";\nimport { calloutTypeName } from \"@/schemas/blocks/callout\";\nimport { codeTypeName } from \"@/schemas/blocks/code\";\nimport { horizontalRuleTypeName } from \"@/schemas/blocks/horizontal-rule\";\nimport { imageTypeName } from \"@/schemas/blocks/image\";\nimport { videoTypeName } from \"@/schemas/blocks/video\";\nimport type { SanityKeyedArray } from \"@/types\";\n\n/**\n * Resolves the space around a list, which tightens once the list is nested inside another.\n *\n * @param level - Nesting depth of the list, counted from one.\n * @returns The vertical space in pixels.\n */\nfunction listSpacing(level: number) {\n return level > 1 ? contentSpacing.nestedList : contentSpacing.list;\n}\n\n/**\n * Component rendered for each block style, mark, and embedded type a guide's rich text can hold.\n * The marks and list items left out are deliberate — the library's own defaults already render them\n * as the surrounding text.\n */\nconst components: PortableTextComponents = {\n block: {\n h2: ({ children }) => (\n <PortableHeading style={{ marginBlockStart: contentSpacing.heading, marginBlockEnd: 4 }}>\n {children}\n </PortableHeading>\n ),\n normal: ({ children }) => (\n <PortableParagraph muted style={{ marginBlock: contentSpacing.paragraph }}>\n {children}\n </PortableParagraph>\n ),\n blockquote: ({ children }) => (\n <PortableBlockquote muted style={{ marginBlock: contentSpacing.blockquote }}>\n {children}\n </PortableBlockquote>\n ),\n },\n list: {\n bullet: ({ children, value }: PortableTextComponentProps<PortableTextListBlock>) => (\n <PortableParagraph muted style={{ marginBlock: listSpacing(value.level) }}>\n <PortableList>{children}</PortableList>\n </PortableParagraph>\n ),\n number: ({ children, value }: PortableTextComponentProps<PortableTextListBlock>) => (\n <PortableParagraph muted style={{ marginBlock: listSpacing(value.level) }}>\n <PortableList ordered>{children}</PortableList>\n </PortableParagraph>\n ),\n },\n marks: {\n code: ({ children }) => <PortableCode>{children}</PortableCode>,\n link: ({ children, value }: PortableTextMarkComponentProps<SanityHandbookLink>) => (\n <PortableLink href={value?.href}>{children}</PortableLink>\n ),\n },\n};\n\n/**\n * Adapts a block component to what Portable Text renders an embedded type with, narrowing the props\n * to the block's own value. The rendering props the library also passes would otherwise reach the DOM.\n *\n * @param Component - Component rendering the block.\n * @returns A component Portable Text can render the type with.\n */\nfunction blockRenderer<Value extends PortableTextObject>(Component: ComponentType<{ value: Value }>) {\n return function Block({ value }: PortableTextTypeComponentProps<Value>) {\n return <Component value={value} />;\n };\n}\n\nexport type PortableTextProps = ComponentProps<\"div\"> & {\n value: SanityKeyedArray<PortableTextBlock>;\n};\n\nexport function PortableText({ value, ...props }: PortableTextProps) {\n const { blocks } = useHandbookContext();\n\n const types: Record<string, PortableTextTypeComponent> = {\n [imageTypeName]: blockRenderer(ImageBlock),\n [videoTypeName]: blockRenderer(VideoBlock),\n [codeTypeName]: blockRenderer(CodeBlock),\n [calloutTypeName]: blockRenderer(CalloutBlock),\n [horizontalRuleTypeName]: blockRenderer(HorizontalRuleBlock),\n };\n for (const block of blocks) types[block.schema.name] = blockRenderer(block.component);\n\n return (\n <div {...props}>\n <PortableTextReact value={value} components={{ ...components, types }} />\n </div>\n );\n}\n","import { PortableText } from \"@/components/content/portable-text\";\nimport { BookOpenTextIcon } from \"@/icons/book-open-text\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport type { SanityHandbook } from \"@/schemas/types/handbook\";\n\n/**\n * Builds a section for each guide group authored in the dataset.\n *\n * @param handbook - Handbook singleton holding the authored guide groups.\n * @returns One section per group, holding an entry per guide.\n */\nexport function guidesSections(handbook: SanityHandbook) {\n return handbook.groups.map(({ title, guides }) => ({\n title,\n entries: guides.map((guide) => ({\n id: guide._key,\n title: guide.title,\n description: guide.description,\n icon: createSanityIcon(BookOpenTextIcon),\n render: () => <PortableText value={guide.content} />,\n })),\n }));\n}\n","import type { ComponentType, ReactNode } from \"react\";\n\nimport { useHandbookContext } from \"@/contexts/handbook\";\nimport { isDefined } from \"@/lib/utils\";\nimport { documentTypesSections } from \"@/sections/document-types\";\nimport { gettingStartedSections } from \"@/sections/getting-started\";\nimport { guidesSections } from \"@/sections/guides\";\n\n/** A selectable page, pairing its sidebar row with the panel that row opens. */\nexport interface Entry {\n /** Identifier shared by the sidebar row and its panel. */\n id: string;\n /** Label shown in the sidebar and as the panel heading. */\n title: string;\n /** Description shown beneath the panel heading. */\n description?: string;\n /** Icon component shown beside the sidebar label. */\n icon?: ComponentType;\n /** Builds the panel's content, called only while the entry is active. */\n render: () => ReactNode;\n}\n\n/** A titled run of entries, drawn as a sidebar heading and the rows beneath it. */\nexport interface Section {\n /** Text shown above the entries it introduces. */\n title: string;\n /** Entries belonging to the section. */\n entries: Entry[];\n}\n\n/**\n * Composes every page the Handbook shows, in sidebar order.\n *\n * @returns Sections from the built-in pages, the configured document roles, and the authored guides.\n */\nexport function useSections(): Section[] {\n const { roles, handbook, loading } = useHandbookContext();\n\n return [\n ...gettingStartedSections(),\n ...documentTypesSections(roles),\n ...(loading || !isDefined(handbook) ? [] : guidesSections(handbook)),\n ];\n}\n","import type { ComponentProps } from \"react\";\nimport { Pane } from \"sanity/structure\";\n\nimport { ContentPanel } from \"@/components/content-panel\";\nimport { contentFlex, contentMinimumWidth } from \"@/config/layout\";\nimport { useHandbookContext } from \"@/contexts/handbook\";\nimport { useSections } from \"@/hooks/use-sections\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport type ContentProps = Omit<ComponentProps<typeof Pane>, \"id\">;\n\nexport function Content(props: ContentProps) {\n const { activeTab } = useHandbookContext();\n const sections = useSections();\n\n const entry = sections.flatMap((section) => section.entries).find(({ id }) => id === activeTab);\n\n return (\n <Pane id=\"handbook-content\" flex={contentFlex} minWidth={contentMinimumWidth} {...props}>\n {isDefined(entry) && (\n <ContentPanel id={entry.id} title={entry.title} description={entry.description}>\n {entry.render()}\n </ContentPanel>\n )}\n </Pane>\n );\n}\n","import { Box, Card, Text } from \"@sanity/ui\";\nimport type { ComponentProps } from \"react\";\n\nexport type SidebarHeadingProps = ComponentProps<typeof Box> & {\n title: string;\n};\n\nexport function SidebarHeading({ title, ...props }: SidebarHeadingProps) {\n return (\n <Box paddingY={2} {...props}>\n <Card padding={2}>\n <Text size={1} muted textOverflow=\"ellipsis\" weight=\"semibold\" style={{ cursor: \"default\", outline: \"none\" }}>\n {title}\n </Text>\n </Card>\n </Box>\n );\n}\n","import { ChevronRightIcon } from \"@sanity/icons/ChevronRight\";\nimport { Box, Text } from \"@sanity/ui\";\nimport type { CSSProperties, ComponentProps, ComponentType } from \"react\";\nimport { PreviewCard, SanityDefaultPreview } from \"sanity\";\n\nimport { useHandbookContext } from \"@/contexts/handbook\";\n\nexport type SidebarTabProps = Omit<ComponentProps<typeof PreviewCard>, \"as\" | \"id\" | \"style\"> & {\n id: string;\n label: string;\n icon?: ComponentType;\n style?: CSSProperties;\n};\n\nexport function SidebarTab({ id, label, icon: Icon, style, ...props }: SidebarTabProps) {\n const { activeTab, setActiveTab, setSidebarExpanded } = useHandbookContext();\n const selected = activeTab === id;\n\n return (\n <PreviewCard\n id={id}\n as=\"button\"\n data-as=\"button\"\n selected={selected}\n marginBottom={1}\n radius={2}\n sizing=\"border\"\n tabIndex={-1}\n tone=\"inherit\"\n onClick={() => {\n setActiveTab(id);\n setSidebarExpanded(false);\n }}\n style={{ cursor: \"pointer\", ...style }}\n aria-controls={`panel-${id}`}\n __unstable_focusRing\n {...props}\n >\n <SanityDefaultPreview\n status={\n <Box style={{ opacity: 0.5 }}>\n <Text muted size={1}>\n <ChevronRightIcon />\n </Text>\n </Box>\n }\n icon={Icon}\n layout=\"compact\"\n title={label}\n />\n </PreviewCard>\n );\n}\n","import type { ComponentProps, ComponentType } from \"react\";\nimport { CommandList } from \"sanity\";\nimport { Pane, PaneContent } from \"sanity/structure\";\n\nimport { PaneHeader } from \"@/components/pane-header\";\nimport { SidebarHeading } from \"@/components/sidebar/heading\";\nimport { SidebarTab } from \"@/components/sidebar/tab\";\nimport { sidebarItemHeight, sidebarMaximumWidth, sidebarMinimumWidth, sidebarWidth } from \"@/config/layout\";\nimport { useHandbookContext } from \"@/contexts/handbook\";\nimport { useSections } from \"@/hooks/use-sections\";\n\n/** A non-selectable heading introducing the run of sidebar tabs beneath it. */\ninterface SidebarHeadingItem {\n /** Marks this entry as a heading rather than a tab. */\n type: \"heading\";\n /** Text shown above the tabs it introduces. */\n title: string;\n}\n\n/** A selectable sidebar row bound to a content panel of the same identifier. */\ninterface SidebarTabItem {\n /** Marks this entry as a tab rather than a heading. */\n type: \"tab\";\n /** Identifier shared with the content panel the tab selects. */\n id: string;\n /** Display label in the sidebar. */\n label: string;\n /** Icon component shown beside the label. */\n icon?: ComponentType;\n}\n\n/** An entry in the flat list the sidebar renders. */\ntype SidebarItem = SidebarHeadingItem | SidebarTabItem;\n\nexport type SidebarProps = Omit<ComponentProps<typeof Pane>, \"id\">;\n\nexport function Sidebar(props: SidebarProps) {\n const { sidebarTitle } = useHandbookContext();\n const sections = useSections();\n\n const items = sections.flatMap(({ title, entries }): SidebarItem[] => [\n { type: \"heading\", title },\n ...entries.map((entry): SidebarItem => ({ type: \"tab\", id: entry.id, label: entry.title, icon: entry.icon })),\n ]);\n\n function getItemDisabled(virtualIndex: number) {\n return items[virtualIndex]?.type === \"heading\";\n }\n\n return (\n <Pane\n id=\"handbook-sidebar\"\n currentMaxWidth={sidebarWidth}\n minWidth={sidebarMinimumWidth}\n maxWidth={sidebarMaximumWidth}\n {...props}\n >\n <PaneHeader title={sidebarTitle} />\n <PaneContent overflow=\"auto\">\n <CommandList\n activeItemDataAttr=\"data-hovered\"\n ariaLabel={sidebarTitle}\n canReceiveFocus\n getItemDisabled={getItemDisabled}\n itemHeight={sidebarItemHeight}\n items={items}\n onlyShowSelectionWhenActive\n paddingBottom={1}\n paddingX={3}\n // `CommandList` clones what this returns to set `tabIndex`, so a wrapper component would swallow it.\n renderItem={(item: SidebarItem) =>\n item.type === \"heading\" ? (\n <SidebarHeading title={item.title} />\n ) : (\n <SidebarTab id={item.id} label={item.label} icon={item.icon} />\n )\n }\n wrapAround={false}\n />\n </PaneContent>\n </Pane>\n );\n}\n","import { useContext } from \"react\";\nimport { PaneLayoutContext } from \"sanity/_singletons\";\n\nimport { useHandbookContext } from \"@/contexts/handbook\";\nimport { Content } from \"@/layouts/content\";\nimport { Sidebar } from \"@/layouts/sidebar\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport function Panes() {\n const { activeTab, sidebarExpanded } = useHandbookContext();\n const paneLayout = useContext(PaneLayoutContext);\n\n const hasContent = isDefined(activeTab);\n\n if (paneLayout?.collapsed === true) {\n return sidebarExpanded || !hasContent ? <Sidebar /> : <Content />;\n }\n\n return (\n <>\n <Sidebar />\n {hasContent && <Content />}\n </>\n );\n}\n","import { useTheme_v2 } from \"@sanity/ui\";\nimport { useState } from \"react\";\nimport type { Tool } from \"sanity\";\nimport { PaneLayout } from \"sanity/structure\";\n\nimport { toolMinimumWidth } from \"@/config/layout\";\nimport { HandbookProvider } from \"@/contexts/handbook\";\nimport type { HandbookProviderConfig } from \"@/contexts/handbook\";\nimport { Panes } from \"@/layouts/panes\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport interface HandbookToolProps {\n tool: Tool<HandbookProviderConfig>;\n}\n\nexport function HandbookTool({ tool: { options } }: HandbookToolProps) {\n const { media } = useTheme_v2();\n const [layoutCollapsed, setLayoutCollapsed] = useState(false);\n\n function handleCollapse() {\n setLayoutCollapsed(true);\n }\n\n function handleExpand() {\n setLayoutCollapsed(false);\n }\n\n if (!isDefined(options)) return null;\n\n return (\n <HandbookProvider {...options}>\n <PaneLayout\n flex={1}\n height={layoutCollapsed ? undefined : \"fill\"}\n minWidth={media[1]}\n onCollapse={handleCollapse}\n onExpand={handleExpand}\n style={{ minHeight: \"100%\", minWidth: `${toolMinimumWidth}px` }}\n >\n <Panes />\n </PaneLayout>\n </HandbookProvider>\n );\n}\n","import { isDefined } from \"@/lib/utils\";\n\n/** Editors the plugin was configured with, so the Structure helper need not be handed them a second time. */\nlet configuredEditors: string[] | undefined = undefined;\n\n/**\n * Records the editors a plugin instance was configured with. A Studio running more than one workspace\n * keeps only the list from the workspace configured last, so those cases pass the list explicitly.\n *\n * @param editors - Email addresses permitted to edit Handbook documents.\n */\nexport function setConfiguredEditors(editors: string[] | undefined) {\n configuredEditors = editors;\n}\n\n/**\n * Checks whether an email address is permitted to edit, treating an absent list as unrestricted access.\n *\n * @param editors - Email addresses permitted to edit, defaulting to the configured list.\n * @param email - The email address to check.\n * @returns Whether the email is permitted to edit.\n */\nexport function isPermittedEditor(editors: string[] | undefined, email: string | undefined) {\n const permitted = editors ?? configuredEditors;\n\n if (!isDefined(permitted)) return true;\n if (!isDefined(email)) return false;\n\n return permitted.includes(email);\n}\n","import type { ComponentType } from \"react\";\nimport { definePlugin } from \"sanity\";\nimport type { DocumentDefinition, PortableTextObject, SchemaTypeDefinition } from \"sanity\";\n\nimport { defaultTitle, defaultUndocumentedFieldMessage } from \"@/config/defaults\";\nimport { documentTypes, singletonTypes } from \"@/config/documents\";\nimport type { HandbookProviderConfig } from \"@/contexts/handbook\";\nimport { BookTextIcon } from \"@/icons/book-text\";\nimport { HandbookTool } from \"@/layouts/tool\";\nimport { isPermittedEditor, setConfiguredEditors } from \"@/lib/editors\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport { calloutType } from \"@/schemas/blocks/callout\";\nimport { codeType } from \"@/schemas/blocks/code\";\nimport { horizontalRuleType } from \"@/schemas/blocks/horizontal-rule\";\nimport { imageType } from \"@/schemas/blocks/image\";\nimport { videoType } from \"@/schemas/blocks/video\";\nimport { createGuideType } from \"@/schemas/types/guide\";\nimport { handbookType } from \"@/schemas/types/handbook\";\n\ndeclare module \"@sanity/types\" {\n interface FieldDefinitionBase {\n handbook?: SanityHandbookMetadata;\n }\n\n // oxlint-disable-next-line no-shadow -- Module augmentation intentionally redeclares the imported type.\n interface DocumentDefinition {\n handbook?: SanityHandbookMetadata;\n }\n}\n\n/**\n * Documentation a schema author attaches to a field or document, shown wherever the Handbook renders it.\n *\n * @public\n */\nexport interface SanityHandbookMetadata {\n /** Display title override for the field or document. */\n title?: string;\n /** Description shown beneath the field or document heading. */\n description?: string;\n /** Illustrative example value for the field. */\n example?: string;\n /** Helpful tip displayed as a popover hint. */\n tip?: string;\n /** Informational note displayed as a popover hint. */\n info?: string;\n /** Warning displayed as a popover hint. */\n caution?: string;\n}\n\n/**\n * A named part a set of document types plays in the content model, shown as one sidebar section.\n *\n * @public\n */\nexport interface SanityHandbookDocumentRole {\n /** Display title for the document role. */\n title: string;\n /** Brief description of the role's purpose. */\n description?: string;\n /** Document definitions filling this role. */\n documents: DocumentDefinition[];\n}\n\n/**\n * A Portable Text block a consumer adds to guide content, pairing its schema with how it renders.\n *\n * @public\n */\nexport interface SanityHandbookBlockDefinition {\n /** Sanity schema type definition for the custom block. */\n schema: SchemaTypeDefinition;\n /** React component for rendering the block in the Handbook viewer. */\n component: ComponentType<{ value: PortableTextObject }>;\n}\n\n/**\n * Everything the plugin accepts, of which only the document roles are required.\n *\n * @public\n */\nexport interface SanityHandbookConfig {\n /** Title shown in the Studio tool navigation. */\n title?: string;\n /** Heading displayed at the top of the sidebar. */\n sidebarTitle?: string;\n /** Document roles, each shown as a labelled section in the sidebar. */\n roles: SanityHandbookDocumentRole[];\n /** Custom Portable Text block definitions for guide content. */\n blocks?: SanityHandbookBlockDefinition[];\n /** Email addresses permitted to edit Handbook documents. */\n editors?: string[];\n /** Fallback message shown when a field has no description. */\n undocumentedFieldMessage?: string;\n}\n\n/**\n * Creates a Handbook tool for Sanity Studio, generating documentation from document type schemas\n * alongside the Portable Text guides authored in the dataset.\n *\n * @param config - Plugin configuration.\n * @returns Sanity plugin definition.\n * @public\n */\nexport const handbookPlugin = definePlugin<SanityHandbookConfig>((config) => {\n const { title, sidebarTitle, roles, blocks, editors, undocumentedFieldMessage } = config;\n\n setConfiguredEditors(editors);\n\n const resolved: HandbookProviderConfig = {\n sidebarTitle: sidebarTitle ?? defaultTitle,\n roles,\n blocks: blocks ?? [],\n undocumentedFieldMessage: undocumentedFieldMessage ?? defaultUndocumentedFieldMessage,\n };\n\n const guideType = createGuideType(resolved.blocks);\n\n return {\n name: \"@driftime/sanity-plugin-handbook\",\n schema: {\n types: [\n handbookType,\n guideType,\n imageType,\n videoType,\n codeType,\n calloutType,\n horizontalRuleType,\n ...resolved.blocks.map((block) => block.schema),\n ],\n },\n document: {\n newDocumentOptions: (templateItems, { creationContext, currentUser }) => {\n if (creationContext.type !== \"global\" && creationContext.type !== \"structure\") {\n return templateItems;\n }\n\n const hiddenTypes = isPermittedEditor(editors, currentUser?.email) ? singletonTypes : documentTypes;\n\n return templateItems.filter(\n ({ templateId }) =>\n ![...hiddenTypes].some((type) => templateId === type || templateId.startsWith(`${type}-`)),\n );\n },\n actions: (actionComponents, { schemaType }) => {\n if (singletonTypes.has(schemaType)) {\n return actionComponents.filter(({ action }) => ![\"delete\", \"duplicate\", \"unpublish\"].includes(action ?? \"\"));\n }\n\n return actionComponents;\n },\n },\n tools: [\n {\n name: \"handbook\",\n title: title ?? defaultTitle,\n icon: createSanityIcon(BookTextIcon),\n component: HandbookTool,\n options: resolved,\n },\n ],\n };\n});\n","import type { CurrentUser } from \"sanity\";\nimport type { StructureBuilder } from \"sanity/structure\";\n\nimport { BookOpenTextIcon } from \"@/icons/book-open-text\";\nimport { BookTextIcon } from \"@/icons/book-text\";\nimport { isPermittedEditor } from \"@/lib/editors\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport { guideTypeName } from \"@/schemas/types/guide\";\nimport { handbookTypeName } from \"@/schemas/types/handbook\";\n\n/**\n * Creates the Structure tool items for Handbook documents, yielding nothing when the current user is\n * not permitted to edit them.\n *\n * @param structureBuilder - The Sanity Structure builder instance.\n * @param context - The Structure context carrying the current user.\n * @param editors - Email addresses permitted to edit, defaulting to the configured list.\n * @returns The list items for the Handbook singleton and the guides list.\n * @public\n */\nexport function handbookStructure(\n structureBuilder: StructureBuilder,\n context: { currentUser: CurrentUser | null },\n editors?: string[],\n) {\n if (!isPermittedEditor(editors, context.currentUser?.email)) return [];\n\n const { listItem, document, documentTypeList } = structureBuilder;\n\n return [\n listItem()\n .title(\"Handbook\")\n .icon(createSanityIcon(BookTextIcon))\n .child(document().id(handbookTypeName).schemaType(handbookTypeName).title(\"Handbook\")),\n listItem()\n .title(\"Handbook Guides\")\n .icon(createSanityIcon(BookOpenTextIcon))\n .child(documentTypeList(guideTypeName).title(\"Handbook Guides\")),\n ];\n}\n","import { useCurrentUser } from \"sanity\";\n\nimport { isPermittedEditor } from \"@/lib/editors\";\n\n/**\n * Checks whether the current user is permitted to edit Handbook content, treating an absent list as\n * unrestricted access.\n *\n * @param editors - Email addresses permitted to edit, defaulting to the configured list.\n * @returns Whether the current user can edit Handbook documents.\n * @public\n */\nexport function useIsHandbookEditor(editors?: string[]) {\n const user = useCurrentUser();\n\n return isPermittedEditor(editors, user?.email);\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAaI,mBAA0C;CAAEC,OAAO;CAAOC,QAAQ;CAAOC,aAAa;AAAI;ACTvG,SAAOG,iBAAAC,OAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GAAAC,IAAAC,IAAAC,IAAAC,IAAAC,IAAAC;CAAA,AAAAP,EAAA,OAAAQ,OAAAC,IAAA,2BAAA,KAcDP,KAAA,oBAAA,QAAA,EAAQ,GAAA,WAAU,CAAA,GAClBC,KAAA,oBAAA,QAAA,EAAQ,GAAA,WAAU,CAAA,GAClBC,KAAA,oBAAA,QAAA,EAAQ,GAAA,UAAS,CAAA,GACjBC,KAAA,oBAAA,QAAA,EAAQ,GAAA,qIAAoI,CAAA,GAC5IC,KAAA,oBAAA,QAAA,EAAQ,GAAA,UAAS,CAAA,GACjBC,KAAA,oBAAA,QAAA,EAAQ,GAAA,SAAQ,CAAA,GAAGP,EAAA,KAAAE,IAAAF,EAAA,KAAAG,IAAAH,EAAA,KAAAI,IAAAJ,EAAA,KAAAK,IAAAL,EAAA,KAAAM,IAAAN,EAAA,KAAAO,OAAAL,KAAAF,EAAA,IAAAG,KAAAH,EAAA,IAAAI,KAAAJ,EAAA,IAAAK,KAAAL,EAAA,IAAAM,KAAAN,EAAA,IAAAO,KAAAP,EAAA;CAAA,IAAAU;CACf,OADeV,EAAA,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,UAAU,CAAC,GACvFH,SAAS,CAAC,CACPG,MAAM,iBAAiB,CAAC,CACxBC,KAAKb,iBAAiBH,gBAAgB,CAAC,CAAC,CACxCiB,MAAMH,iBAAiBV,aAAa,CAAC,CAACW,MAAM,iBAAiB,CAAC,CAAC;AAEtE;;;;;;;;;AC3BA,SAAOO,oBAAAC,SAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GAG6BE,KAFrBP,eAEqBM,CAAI,EAAAE,OAAOC;CAAC,OAADL,EAAA,OAAAD,WAAAC,EAAA,OAAAG,MAAtCE,KAAAR,kBAAkBE,SAASI,EAAW,GAACH,EAAA,KAAAD,SAAAC,EAAA,KAAAG,IAAAH,EAAA,KAAAK,MAAAA,KAAAL,EAAA,IAAvCK;AAAuC"}
1
+ {"version":3,"file":"index.js","names":["ComponentProps","defaultTitle","defaultDocumentTitle","defaultUndocumentedFieldMessage","defaultIconProps","width","height","strokeWidth","ComponentProps","BookOpenTextIconProps","BookOpenTextIcon","props","$","_c","t0","t1","t2","t3","t4","t5","Symbol","for","t6","ComponentProps","ComponentType","createElement","defaultIconProps","createSanityIcon","icon","props","Icon","SanityIcon","ComponentProps","PortableCodeProps","PortableCode","t0","$","_c","props","style","t1","paddingBlock","paddingInline","fontSize","backgroundColor","borderRadius","t2","BlockDecoratorProps","PortableCode","CodeDecorator","t0","$","_c","children","t1","Text","BlockListItemProps","ListItemStyle","t0","$","_c","children","t1","Symbol","for","marginTop","t2","Box","Text","BoxProps","PortableBlockquoteProps","muted","PortableBlockquote","t0","$","_c","children","props","style","t1","borderLeft","t2","Symbol","for","fontStyle","t3","t4","Text","TextProps","PortableHeadingProps","Omit","PortableHeading","props","$","_c","t0","Text","TextProps","PortableParagraphProps","PortableParagraph","props","$","_c","t0","BlockStyleProps","PortableBlockquote","PortableHeading","PortableParagraph","ParagraphStyle","t0","$","_c","children","t1","HeadingStyle","BlockquoteStyle","defineArrayMember","defineField","PortableTextObject","Strict","SanityHandbookLink","_type","href","linkAnnotation","name","type","description","preview","select","prepare","selection","title","fields","validation","rule","uri","scheme","ComponentProps","InfoIconProps","InfoIcon","props","$","_c","t0","t1","t2","Symbol","for","t3","ComponentProps","LightbulbIconProps","LightbulbIcon","props","$","_c","t0","t1","t2","Symbol","for","t3","ComponentProps","TriangleAlertIconProps","TriangleAlertIcon","props","$","_c","t0","t1","t2","Symbol","for","t3","Card","Flex","Text","CardProps","CardTone","ComponentProps","ComponentType","ReactNode","defaultIconProps","InfoIcon","LightbulbIcon","TriangleAlertIcon","CalloutVariant","CalloutVariantStyle","icon","tone","CalloutContentProps","Omit","variant","children","presentation","Record","tip","info","warning","CalloutContent","t0","$","_c","props","Icon","t1","Symbol","for","flexShrink","marginTop","fontSize","color","t2","t3","t4","t5","t6","PreviewProps","CalloutContent","CalloutVariant","SanityHandbookCallout","CalloutPreviewProps","variant","body","CalloutPreview","t0","$","_c","t1","t2","Symbol","for","display","flexDirection","gap","t3","map","_temp2","t4","t5","_key","children","whiteSpace","_temp","join","child","text","ComponentProps","MessageCircleIconProps","MessageCircleIcon","props","$","_c","t0","Symbol","for","t1","defineArrayMember","defineField","defineType","PortableTextObject","PortableTextSpan","PortableTextTextBlock","CalloutVariant","CalloutPreview","CodeDecorator","ParagraphStyle","MessageCircleIcon","createSanityIcon","linkAnnotation","SanityKeyedArray","Strict","SanityHandbookCallout","_type","calloutTypeName","variant","body","calloutType","name","type","title","icon","description","components","preview","select","prepare","selection","fields","initialValue","validation","rule","required","options","list","value","layout","direction","of","styles","component","lists","marks","decorators","annotations","Card","CardProps","Code","CodeContentProps","code","language","CodeContent","t0","$","_c","props","style","t1","overflowX","t2","t3","Nullable","isDefined","value","T","undefined","trim","Array","isArray","some","element","prototype","Reflect","getPrototypeOf","Object","keys","length","convertCase","format","words","replaceAll","toLowerCase","_match","character","toUpperCase","PreviewProps","CodeContent","isDefined","CodePreviewProps","code","language","CodePreview","t0","$","_c","t1","ComponentProps","CodeIconProps","CodeIcon","props","$","_c","t0","t1","Symbol","for","t2","defineField","defineType","PortableTextObject","CodePreview","CodeIcon","createSanityIcon","Strict","SanityHandbookCode","_type","codeTypeName","code","language","codeType","name","type","title","icon","description","components","preview","select","fields","options","list","value","ComponentProps","HorizontalRuleContentProps","HorizontalRuleContent","t0","$","_c","props","style","t1","border","borderTop","t2","PreviewProps","HorizontalRuleContent","HorizontalRulePreviewProps","HorizontalRulePreview","_props","$","_c","t0","Symbol","for","marginBlock","ComponentProps","SeparatorHorizontalIconProps","SeparatorHorizontalIcon","props","$","_c","t0","t1","t2","Symbol","for","t3","defineField","defineType","PortableTextObject","HorizontalRulePreview","SeparatorHorizontalIcon","createSanityIcon","Strict","SanityHandbookHorizontalRule","_type","horizontalRuleTypeName","horizontalRuleType","name","type","title","icon","description","components","preview","prepare","fields","hidden","Text","ComponentProps","CaptionProps","children","Caption","t0","$","_c","props","style","t1","marginBlockStart","t2","Symbol","for","fontStyle","t3","t4","ComponentProps","Caption","isDefined","ImageContentProps","url","alt","caption","ImageContent","t0","$","_c","props","t1","t2","Symbol","for","display","maxWidth","borderRadius","t3","t4","t5","PreviewProps","ImageContent","isDefined","ImagePreviewProps","url","alt","caption","ImagePreview","t0","$","_c","t1","Symbol","for","padding","t2","ComponentProps","ImageIconProps","ImageIcon","props","$","_c","t0","t1","t2","Symbol","for","t3","defineField","defineType","PortableTextObject","ImagePreview","ImageIcon","createSanityIcon","Strict","SanityHandbookImage","_type","imageTypeName","asset","url","caption","alt","imageType","name","type","title","icon","description","components","preview","select","fields","options","hotspot","ComponentProps","Caption","isDefined","VideoContentProps","url","caption","VideoContent","t0","$","_c","props","t1","Symbol","for","display","maxWidth","borderRadius","WebkitTransform","t2","t3","t4","t5","t6","PreviewProps","VideoContent","isDefined","VideoPreviewProps","url","caption","VideoPreview","t0","$","_c","t1","Symbol","for","padding","t2","ComponentProps","FilmIconProps","FilmIcon","props","$","_c","t0","t1","t2","t3","t4","t5","t6","t7","Symbol","for","t8","defineField","defineType","PortableTextObject","VideoPreview","FilmIcon","createSanityIcon","Strict","SanityHandbookVideo","_type","videoTypeName","asset","url","caption","videoType","name","type","title","icon","description","components","preview","select","fields","options","accept","defineArrayMember","defineField","CodeDecorator","ListItemStyle","BlockquoteStyle","HeadingStyle","ParagraphStyle","SanityHandbookBlockDefinition","linkAnnotation","calloutTypeName","codeTypeName","horizontalRuleTypeName","imageTypeName","videoTypeName","SanityHandbookGuide","createGuideContentField","customBlocks","name","type","description","of","styles","title","value","component","lists","marks","decorators","annotations","map","block","schema","defineField","defineType","PortableTextBlock","SanityDocument","defaultDocumentTitle","BookOpenTextIcon","createSanityIcon","SanityHandbookBlockDefinition","createGuideContentField","SanityKeyedArray","Strict","SanityHandbookGuide","_type","guideTypeName","title","description","content","createGuideType","customBlocks","name","type","icon","preview","select","prepare","selection","subtitle","fields","validation","rule","required","ComponentProps","BookTextIconProps","BookTextIcon","props","$","_c","t0","t1","t2","Symbol","for","t3","ComponentProps","ListPlusIconProps","ListPlusIcon","props","$","_c","t0","t1","t2","t3","t4","Symbol","for","t5","defineArrayMember","defineField","defineType","SanityDocument","BookTextIcon","ListPlusIcon","createSanityIcon","isDefined","SanityHandbookGuide","guideTypeName","SanityKeyedArray","Strict","SanityHandbookGuideGroup","title","guides","SanityHandbook","_type","handbookTypeName","groups","handbookType","name","type","icon","description","preview","prepare","fields","of","validation","rule","required","to","select","guide0","guide1","guide2","selection","all","filter","guide","shown","slice","hasMore","formatSubtitle","join","subtitle","guideTypeName","handbookTypeName","singletonTypes","Set","documentTypes","sidebarWidth","sidebarMinimumWidth","sidebarMaximumWidth","contentMinimumWidth","contentFlex","collapsedPaneWidth","sidebarItemHeight","toolMinimumWidth","contentWidth","contentPaddingInline","contentPaddingBlockStart","contentPaddingBlockEnd","contentSpacing","section","paragraph","heading","media","callout","blockquote","list","nestedList","rule","imageTypeName","videoTypeName","assetUrlFragment","guideContentFragment","guideFragment","SanityClient","TypedQuery","__result","T","defineTypedQuery","query","fetchQuery","client","fetch","undefined","guideFragment","defineTypedQuery","SanityHandbookGuide","guideTypeName","SanityHandbook","handbookTypeName","handbookQuery","handbookDocumentsQuery","useEffect","useState","useClient","handbookDocumentsQuery","handbookQuery","fetchQuery","SanityHandbook","useHandbookDocument","$","_c","t0","Symbol","for","apiVersion","client","handbook","setHandbook","undefined","loading","setLoading","t1","t2","fetchHandbook","subscription","listen","subscribe","unsubscribe","t3","createContext","useContext","useState","ReactNode","useHandbookDocument","isDefined","SanityHandbookBlockDefinition","SanityHandbookDocumentRole","SanityHandbook","HandbookProviderConfig","sidebarTitle","roles","blocks","undocumentedFieldMessage","HandbookContextValues","activeTab","sidebarExpanded","loading","handbook","setActiveTab","id","setSidebarExpanded","expanded","HandbookProviderProps","children","HandbookContext","undefined","useHandbookContext","handbookContext","Error","HandbookProvider","t0","$","_c","t1","t2","Box","Card","Flex","Layer","LayerProvider","Text","useElementSize","useTheme_v2","useContext","ComponentProps","ReactNode","PaneContext","collapsedPaneWidth","isDefined","PaneHeaderProps","title","backButton","PaneHeader","t0","$","_c","props","style","color","pane","paneSize","rootElement","collapsed","isLast","paneHeight","border","height","collapsedWidth","window","innerHeight","bg","fg","selectable","default","enabled","t1","handleTitleClick","collapse","t2","handleLayoutClick","expand","t3","undefined","t4","lineHeight","position","top","t5","t6","t7","t8","width","transform","transformOrigin","t9","t10","t11","t12","backgroundColor","minWidth","t13","cursor","outline","t14","t15","t16","t17","t18","t19","ArrowLeftIcon","Box","Button","Heading","Stack","Text","useContext","ComponentProps","ReactNode","PaneLayoutContext","PaneContent","PaneHeader","contentPaddingBlockEnd","contentPaddingBlockStart","contentPaddingInline","contentWidth","useHandbookContext","isDefined","ContentPanelProps","Omit","id","title","description","children","ContentPanel","t0","$","_c","props","setSidebarExpanded","paneLayout","t1","collapsed","t2","t3","t4","Symbol","for","maxWidth","boxSizing","marginInline","paddingInline","paddingBlockStart","paddingBlockEnd","t5","t6","t7","t8","t9","t10","Box","Stack","Text","useClickOutsideEvent","Popover","useRef","ComponentProps","ReactNode","FieldHintProps","Omit","label","icon","open","children","onOpen","onClose","FieldHint","t0","$","_c","props","buttonReference","popoverReference","t1","Symbol","for","current","undefined","t2","maxWidth","t3","t4","t5","t6","t7","event","pointerType","t8","event_0","t9","display","alignItems","padding","fontSize","color","background","border","cursor","t10","t11","ComponentProps","ComponentType","InfoIcon","LightbulbIcon","TriangleAlertIcon","SanityHandbookMetadata","HintKind","name","Pick","label","icon","hintKinds","Flex","FlexProps","useState","FieldHint","defaultIconProps","hintKinds","isDefined","SanityHandbookMetadata","FieldHintsProps","Pick","FieldHints","t0","$","_c","caution","info","props","tip","openHint","setOpenHint","undefined","T0","t1","t2","t3","t4","hints","t5","Symbol","for","closeHint","flatMap","t6","name","label","icon","Icon","hint","ComponentProps","ComponentType","ReactNode","createSanityIcon","convertCase","resolveTitle","type","name","title","handbook","resolveDescription","description","undefined","resolveIcon","icon","FieldDefinition","Schema","isDefined","CompiledField","name","type","title","description","fields","of","handbook","NormalisedField","opaqueTypes","Set","inheritedFieldNames","Partial","Record","block","file","geopoint","image","slug","isCompiledField","value","hasFieldsArray","Array","isArray","hasOfArray","getTypeName","undefined","getParentTypeName","resolvedType","String","normaliseField","field","visited","typeName","result","has","shouldTrack","next","fieldSource","ofSource","map","subfield","member","resolveCustomFields","parentName","inherited","customFields","filter","resolveNormalisedFields","items","normalised","item","resolveNormalisedMembers","members","resolveParentName","schema","direct","get","resolveFields","length","memberType","getSubfields","directFields","ChevronDownIcon","ChevronRightIcon","Box","Card","Flex","Stack","Text","StackProps","useState","FieldDefinition","useSchema","FieldHints","useHandbookContext","resolveDescription","resolveTitle","NormalisedField","getSubfields","convertCase","isDefined","FieldProps","field","ancestors","Set","noAncestors","Field","t0","$","_c","props","t1","undefined","schema","undocumentedFieldMessage","expanded","setExpanded","t2","effectiveTitle","t3","effectiveDescription","caution","example","info","t4","tip","handbook","hasHints","t5","type","has","isCycle","t6","subfields","hasSubfields","t7","t8","Symbol","for","marginTop","t9","t10","t11","t12","t13","t14","fontStyle","t15","t16","textAlign","border","cursor","length","marginBottom","paddingLeft","borderLeft","map","subfield","name","Field","contentSpacing","resolveDescription","resolveIcon","resolveTitle","SanityHandbookDocumentRole","documentTypesSections","roles","map","title","documents","entries","document","id","name","description","icon","render","display","flexDirection","gap","section","fields","field","ComponentProps","LayoutGridIconProps","LayoutGridIcon","props","$","_c","t0","t1","t2","t3","Symbol","for","t4","ChevronRightIcon","Box","Card","Flex","Stack","Text","contentSpacing","useHandbookContext","resolveDescription","resolveIcon","resolveTitle","isDefined","DocumentTypesOverview","$","_c","roles","setActiveTab","setSidebarExpanded","t0","Symbol","for","display","flexDirection","gap","section","t1","t2","role","title","description","documents","map","document","Icon","documentDescription","name","width","marginLeft","textAlign","border","cursor","alignItems","justifyContent","height","color","opacity","Flex","Stack","Text","defaultIconProps","hintKinds","contentSpacing","hintDescriptions","tip","info","caution","Record","HowToUse","$","_c","t0","Symbol","for","display","flexDirection","gap","section","t1","t2","t3","t4","t5","map","_temp","t6","t7","name","icon","Icon","alignItems","flexShrink","fontSize","color","BookTextIcon","LayoutGridIcon","createSanityIcon","DocumentTypesOverview","HowToUse","gettingStartedSections","title","entries","id","description","icon","render","ComponentProps","PortableLinkProps","PortableLink","t0","$","_c","children","props","style","t1","color","t2","PortableText","PortableTextComponents","PortableTextMarkComponentProps","ComponentProps","CalloutContent","PortableCode","PortableLink","contentSpacing","SanityHandbookLink","SanityHandbookCallout","CalloutBlockProps","Omit","value","components","block","normal","children","marks","code","link","href","CalloutBlock","t0","$","_c","props","style","t1","marginBlock","callout","t2","body","t3","variant","ComponentProps","CodeContent","contentSpacing","isDefined","SanityHandbookCode","CodeBlockProps","Omit","value","CodeBlock","t0","$","_c","props","style","code","t1","marginBlock","media","t2","language","ComponentProps","HorizontalRuleContent","contentSpacing","SanityHandbookHorizontalRule","HorizontalRuleBlockProps","value","HorizontalRuleBlock","t0","$","_c","props","style","_value","t1","t2","marginBlock","rule","ComponentProps","ImageContent","contentSpacing","isDefined","SanityHandbookImage","ImageBlockProps","Omit","value","ImageBlock","t0","$","_c","props","style","asset","url","t1","marginBlock","media","t2","alt","caption","ComponentProps","VideoContent","contentSpacing","isDefined","SanityHandbookVideo","VideoBlockProps","Omit","value","VideoBlock","t0","$","_c","props","style","asset","url","t1","marginBlock","media","t2","caption","CSSProperties","ComponentProps","PortableListProps","Omit","ordered","PortableList","t0","$","_c","props","style","t1","undefined","t2","display","flexDirection","gap","margin","paddingLeft","listStyle","t3","PortableText","PortableTextReact","PortableTextComponentProps","PortableTextComponents","PortableTextMarkComponentProps","PortableTextTypeComponent","PortableTextTypeComponentProps","ComponentProps","ComponentType","PortableTextBlock","PortableTextListBlock","PortableTextObject","CalloutBlock","CodeBlock","HorizontalRuleBlock","ImageBlock","VideoBlock","PortableBlockquote","PortableCode","PortableHeading","PortableLink","PortableList","PortableParagraph","contentSpacing","useHandbookContext","SanityHandbookLink","calloutTypeName","codeTypeName","horizontalRuleTypeName","imageTypeName","videoTypeName","SanityKeyedArray","listSpacing","level","nestedList","list","components","block","h2","children","marginBlockStart","heading","marginBlockEnd","normal","marginBlock","paragraph","blockquote","bullet","value","number","marks","code","link","href","blockRenderer","Component","Value","Block","PortableTextProps","t0","$","_c","props","blocks","t1","Symbol","for","t2","t3","t4","t5","types","schema","name","component","t6","t7","t8","PortableText","BookOpenTextIcon","createSanityIcon","SanityHandbook","guidesSections","handbook","groups","map","title","guides","entries","guide","id","_key","description","icon","render","content","ComponentType","ReactNode","useHandbookContext","isDefined","documentTypesSections","gettingStartedSections","guidesSections","Entry","id","title","description","icon","render","Section","entries","useSections","$","_c","roles","handbook","loading","t0","ComponentProps","Pane","ContentPanel","contentFlex","contentMinimumWidth","useHandbookContext","useSections","isDefined","ContentProps","Omit","Content","props","$","_c","activeTab","sections","T0","t0","t1","t2","t3","t4","t5","t6","id","entry","flatMap","_temp","find","title","description","render","section","entries","Box","Card","Text","ComponentProps","SidebarHeadingProps","title","SidebarHeading","t0","$","_c","props","t1","Symbol","for","cursor","outline","t2","t3","ChevronRightIcon","Box","Text","CSSProperties","ComponentProps","ComponentType","PreviewCard","SanityDefaultPreview","useHandbookContext","SidebarTabProps","Omit","id","label","icon","style","SidebarTab","t0","$","_c","Icon","props","activeTab","setActiveTab","setSidebarExpanded","selected","t1","t2","cursor","t3","t4","Symbol","for","opacity","t5","t6","t7","ComponentProps","ComponentType","CommandList","Pane","PaneContent","PaneHeader","SidebarHeading","SidebarTab","sidebarItemHeight","sidebarMaximumWidth","sidebarMinimumWidth","sidebarWidth","useHandbookContext","useSections","SidebarHeadingItem","type","title","SidebarTabItem","id","label","icon","SidebarItem","SidebarProps","Omit","Sidebar","props","$","_c","sidebarTitle","sections","t0","flatMap","_temp2","items","t1","getItemDisabled","virtualIndex","t2","t3","_temp3","t4","item","entries","map","_temp","entry","useContext","PaneLayoutContext","useHandbookContext","Content","Sidebar","isDefined","Panes","$","_c","activeTab","sidebarExpanded","paneLayout","t0","hasContent","collapsed","t1","Symbol","for","t2","t3","useTheme_v2","useState","Tool","PaneLayout","toolMinimumWidth","HandbookProvider","HandbookProviderConfig","Panes","isDefined","HandbookToolProps","tool","HandbookTool","t0","$","_c","t1","options","media","layoutCollapsed","setLayoutCollapsed","t2","Symbol","for","handleCollapse","t3","handleExpand","t4","undefined","t5","t6","minHeight","minWidth","t7","t8","isDefined","configuredEditors","undefined","setConfiguredEditors","editors","isPermittedEditor","email","permitted","includes","ComponentType","definePlugin","DocumentDefinition","PortableTextObject","SchemaTypeDefinition","defaultTitle","defaultUndocumentedFieldMessage","documentTypes","singletonTypes","HandbookProviderConfig","BookTextIcon","HandbookTool","isPermittedEditor","setConfiguredEditors","createSanityIcon","calloutType","codeType","horizontalRuleType","imageType","videoType","createGuideType","handbookType","FieldDefinitionBase","handbook","SanityHandbookMetadata","title","description","example","tip","info","caution","SanityHandbookDocumentRole","documents","SanityHandbookBlockDefinition","schema","component","value","SanityHandbookConfig","sidebarTitle","roles","blocks","editors","undocumentedFieldMessage","handbookPlugin","config","resolved","guideType","name","types","map","block","document","newDocumentOptions","templateItems","creationContext","currentUser","type","hiddenTypes","email","filter","templateId","some","startsWith","actions","actionComponents","schemaType","has","action","includes","tools","icon","options","CurrentUser","StructureBuilder","BookOpenTextIcon","BookTextIcon","isPermittedEditor","createSanityIcon","guideTypeName","handbookTypeName","handbookStructure","structureBuilder","context","currentUser","editors","email","listItem","document","documentTypeList","title","icon","child","id","schemaType","useCurrentUser","isPermittedEditor","useIsHandbookEditor","editors","$","_c","user","t0","email","t1"],"sources":["../src/config/defaults.ts","../src/icons/book-open-text.tsx","../src/lib/icons.ts","../src/components/content/portable/code.tsx","../src/components/decorators.tsx","../src/components/lists.tsx","../src/components/content/portable/blockquote.tsx","../src/components/content/portable/heading.tsx","../src/components/content/portable/paragraph.tsx","../src/components/styles.tsx","../src/schemas/annotations/link.ts","../src/icons/info.tsx","../src/icons/lightbulb.tsx","../src/icons/triangle-alert.tsx","../src/blocks/callout/content.tsx","../src/blocks/callout/preview.tsx","../src/icons/message-circle.tsx","../src/schemas/blocks/callout.ts","../src/blocks/code/content.tsx","../src/lib/utils.ts","../src/blocks/code/preview.tsx","../src/icons/code.tsx","../src/schemas/blocks/code.ts","../src/blocks/horizontal-rule/content.tsx","../src/blocks/horizontal-rule/preview.tsx","../src/icons/separator-horizontal.tsx","../src/schemas/blocks/horizontal-rule.ts","../src/components/caption.tsx","../src/blocks/image/content.tsx","../src/blocks/image/preview.tsx","../src/icons/image.tsx","../src/schemas/blocks/image.ts","../src/blocks/video/content.tsx","../src/blocks/video/preview.tsx","../src/icons/film.tsx","../src/schemas/blocks/video.ts","../src/schemas/fields/content.ts","../src/schemas/types/guide.ts","../src/icons/book-text.tsx","../src/icons/list-plus.tsx","../src/schemas/types/handbook.ts","../src/config/documents.ts","../src/config/layout.ts","../src/groq/fragments.ts","../src/lib/groq.ts","../src/groq/documents.ts","../src/hooks/use-handbook-document.ts","../src/contexts/handbook.tsx","../src/components/pane-header.tsx","../src/components/content-panel.tsx","../src/components/field/hint.tsx","../src/config/hints.ts","../src/components/field/hints.tsx","../src/lib/display.ts","../src/lib/schema.ts","../src/components/field/field.tsx","../src/sections/document-types.tsx","../src/icons/layout-grid.tsx","../src/pages/document-types-overview.tsx","../src/pages/how-to-use.tsx","../src/sections/getting-started.tsx","../src/components/content/portable/link.tsx","../src/blocks/callout/block.tsx","../src/blocks/code/block.tsx","../src/blocks/horizontal-rule/block.tsx","../src/blocks/image/block.tsx","../src/blocks/video/block.tsx","../src/components/content/portable/list.tsx","../src/components/content/portable-text.tsx","../src/sections/guides.tsx","../src/hooks/use-sections.ts","../src/layouts/content.tsx","../src/components/sidebar/heading.tsx","../src/components/sidebar/tab.tsx","../src/layouts/sidebar.tsx","../src/layouts/panes.tsx","../src/layouts/tool.tsx","../src/lib/editors.ts","../src/plugin.ts","../src/lib/structure.ts","../src/hooks/use-is-handbook-editor.ts"],"sourcesContent":["import type { ComponentProps } from \"react\";\n\n/** Title shown in the Studio tool navigation and at the top of the sidebar. */\nexport const defaultTitle = \"Handbook\";\n\n/** Fallback title displayed wherever a document has no title of its own. */\nexport const defaultDocumentTitle = \"Untitled\";\n\n/** Fallback message shown when a field has no description. */\nexport const defaultUndocumentedFieldMessage =\n \"This field has not been documented yet. Contact your development team for guidance.\";\n\n/** Properties every icon the plugin draws is rendered with. */\nexport const defaultIconProps: ComponentProps<\"svg\"> = { width: \"1em\", height: \"1em\", strokeWidth: 1.5 };\n","import type { ComponentProps } from \"react\";\n\nexport type BookOpenTextIconProps = ComponentProps<\"svg\">;\n\nexport function BookOpenTextIcon(props: BookOpenTextIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M12 7v14\" />\n <path d=\"M16 12h2\" />\n <path d=\"M16 8h2\" />\n <path d=\"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z\" />\n <path d=\"M6 12h2\" />\n <path d=\"M6 8h2\" />\n </svg>\n );\n}\n","import type { ComponentProps, ComponentType } from \"react\";\nimport { createElement } from \"react\";\n\nimport { defaultIconProps } from \"@/config/defaults\";\n\n/**\n * Creates a Sanity Studio icon component from an SVG icon.\n *\n * @param icon - The icon component to wrap.\n * @param props - Additional props merged over the default properties a Studio icon is drawn with.\n * @returns A Studio icon component.\n */\nexport function createSanityIcon(icon: ComponentType<ComponentProps<\"svg\">>, props?: ComponentProps<\"svg\">) {\n const Icon = icon;\n\n function SanityIcon() {\n return createElement(Icon, { ...defaultIconProps, ...props });\n }\n\n return SanityIcon;\n}\n","import type { ComponentProps } from \"react\";\n\nexport type PortableCodeProps = ComponentProps<\"code\">;\n\nexport function PortableCode({ style, ...props }: PortableCodeProps) {\n return (\n <code\n style={{\n paddingBlock: 2,\n paddingInline: 4,\n fontSize: \"0.875em\",\n backgroundColor: \"var(--card-code-bg-color)\",\n borderRadius: 2,\n ...style,\n }}\n {...props}\n />\n );\n}\n","import type { BlockDecoratorProps } from \"sanity\";\n\nimport { PortableCode } from \"@/components/content/portable/code\";\n\nexport function CodeDecorator({ children }: BlockDecoratorProps) {\n return <PortableCode>{children}</PortableCode>;\n}\n","import { Text } from \"@sanity/ui\";\nimport type { BlockListItemProps } from \"sanity\";\n\nexport function ListItemStyle({ children }: BlockListItemProps) {\n return (\n <Text size={1} style={{ marginTop: \"0.375em\" }}>\n {children}\n </Text>\n );\n}\n","import { Box, Text } from \"@sanity/ui\";\nimport type { BoxProps } from \"@sanity/ui\";\n\nexport type PortableBlockquoteProps = BoxProps & {\n muted?: boolean;\n};\n\nexport function PortableBlockquote({ muted, children, style, ...props }: PortableBlockquoteProps) {\n return (\n <Box paddingY={1} paddingLeft={3} style={{ borderLeft: \"2px solid var(--card-border-color)\", ...style }} {...props}>\n <Text size={1} muted={muted} style={{ fontStyle: \"italic\" }}>\n {children}\n </Text>\n </Box>\n );\n}\n","import { Text } from \"@sanity/ui\";\nimport type { TextProps } from \"@sanity/ui\";\n\nexport type PortableHeadingProps = Omit<TextProps, \"as\">;\n\nexport function PortableHeading(props: PortableHeadingProps) {\n return <Text as=\"h2\" size={1} weight=\"medium\" {...props} />;\n}\n","import { Text } from \"@sanity/ui\";\nimport type { TextProps } from \"@sanity/ui\";\n\nexport type PortableParagraphProps = TextProps;\n\nexport function PortableParagraph(props: PortableParagraphProps) {\n return <Text size={1} {...props} />;\n}\n","import type { BlockStyleProps } from \"sanity\";\n\nimport { PortableBlockquote } from \"@/components/content/portable/blockquote\";\nimport { PortableHeading } from \"@/components/content/portable/heading\";\nimport { PortableParagraph } from \"@/components/content/portable/paragraph\";\n\nexport function ParagraphStyle({ children }: BlockStyleProps) {\n return <PortableParagraph>{children}</PortableParagraph>;\n}\n\nexport function HeadingStyle({ children }: BlockStyleProps) {\n return <PortableHeading>{children}</PortableHeading>;\n}\n\nexport function BlockquoteStyle({ children }: BlockStyleProps) {\n return <PortableBlockquote>{children}</PortableBlockquote>;\n}\n","import { defineArrayMember, defineField } from \"sanity\";\nimport type { PortableTextObject } from \"sanity\";\n\nimport type { Strict } from \"@/types\";\n\n/**\n * A web address applied to a run of guide text.\n *\n * @public\n */\nexport type SanityHandbookLink = Strict<PortableTextObject> & {\n _type: \"link\";\n /** Web address the link points to. */\n href?: string;\n};\n\nexport const linkAnnotation = defineArrayMember({\n name: \"link\" satisfies SanityHandbookLink[\"_type\"],\n type: \"object\",\n description: \"Link applied to the selected text.\",\n preview: {\n select: {\n href: \"href\",\n },\n prepare(selection: { href?: string }) {\n const { href } = selection;\n\n return {\n title: href ?? \"Link\",\n };\n },\n },\n fields: [\n defineField({\n name: \"href\" satisfies keyof SanityHandbookLink,\n title: \"URL\",\n type: \"url\",\n description: \"Web address destination for this link. Supports http, https, mailto, and tel schemes.\",\n validation: (rule) => rule.uri({ scheme: [\"http\", \"https\", \"mailto\", \"tel\"] }),\n }),\n ],\n});\n","import type { ComponentProps } from \"react\";\n\nexport type InfoIconProps = ComponentProps<\"svg\">;\n\nexport function InfoIcon(props: InfoIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d=\"M12 8h.01\" />\n </svg>\n );\n}\n","import type { ComponentProps } from \"react\";\n\nexport type LightbulbIconProps = ComponentProps<\"svg\">;\n\nexport function LightbulbIcon(props: LightbulbIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5\" />\n <path d=\"M9 18h6\" />\n <path d=\"M10 22h4\" />\n </svg>\n );\n}\n","import type { ComponentProps } from \"react\";\n\nexport type TriangleAlertIconProps = ComponentProps<\"svg\">;\n\nexport function TriangleAlertIcon(props: TriangleAlertIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n );\n}\n","import { Card, Flex, Text } from \"@sanity/ui\";\nimport type { CardProps, CardTone } from \"@sanity/ui\";\nimport type { ComponentProps, ComponentType, ReactNode } from \"react\";\n\nimport { defaultIconProps } from \"@/config/defaults\";\nimport { InfoIcon } from \"@/icons/info\";\nimport { LightbulbIcon } from \"@/icons/lightbulb\";\nimport { TriangleAlertIcon } from \"@/icons/triangle-alert\";\n\n/** The intent a callout is drawn with, choosing its icon and tone. */\nexport type CalloutVariant = \"tip\" | \"info\" | \"warning\";\n\n/** How a callout variant is presented, pairing its icon with the tone the card is drawn in. */\ninterface CalloutVariantStyle {\n /** Icon identifying the variant. */\n icon: ComponentType<ComponentProps<\"svg\">>;\n /** Card tone carrying the variant's intent. */\n tone: CardTone;\n}\n\nexport type CalloutContentProps = Omit<CardProps, \"tone\"> & {\n variant: CalloutVariant;\n children: ReactNode;\n};\n\n/** Presentation for each callout variant. */\nconst presentation: Record<CalloutVariant, CalloutVariantStyle> = {\n tip: { icon: LightbulbIcon, tone: \"positive\" },\n info: { icon: InfoIcon, tone: \"primary\" },\n warning: { icon: TriangleAlertIcon, tone: \"caution\" },\n};\n\nexport function CalloutContent({ variant, children, ...props }: CalloutContentProps) {\n const { icon: Icon, tone } = presentation[variant];\n\n return (\n <Card padding={4} radius={2} tone={tone} {...props}>\n <Flex align=\"flex-start\" gap={3}>\n <div style={{ flexShrink: 0, marginTop: \"-2px\", fontSize: \"16px\", color: \"var(--card-icon-color)\" }}>\n <Icon {...defaultIconProps} />\n </div>\n <Text size={1} style={{ color: \"var(--card-icon-color)\" }}>\n {children}\n </Text>\n </Flex>\n </Card>\n );\n}\n","import type { PreviewProps } from \"sanity\";\n\nimport { CalloutContent } from \"@/blocks/callout/content\";\nimport type { CalloutVariant } from \"@/blocks/callout/content\";\nimport type { SanityHandbookCallout } from \"@/schemas/blocks/callout\";\n\nexport type CalloutPreviewProps = PreviewProps & {\n variant?: CalloutVariant;\n body?: SanityHandbookCallout[\"body\"];\n};\n\nexport function CalloutPreview({ variant, body }: CalloutPreviewProps) {\n return (\n <CalloutContent variant={variant ?? \"tip\"}>\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 12 }}>\n {body?.map(({ _key, children }) => (\n <div key={_key} style={{ whiteSpace: \"pre-wrap\" }}>\n {children.map((child) => child.text).join(\"\")}\n </div>\n ))}\n </div>\n </CalloutContent>\n );\n}\n","import type { ComponentProps } from \"react\";\n\nexport type MessageCircleIconProps = ComponentProps<\"svg\">;\n\nexport function MessageCircleIcon(props: MessageCircleIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719\" />\n </svg>\n );\n}\n","import { defineArrayMember, defineField, defineType } from \"sanity\";\nimport type { PortableTextObject, PortableTextSpan, PortableTextTextBlock } from \"sanity\";\n\nimport type { CalloutVariant } from \"@/blocks/callout/content\";\nimport { CalloutPreview } from \"@/blocks/callout/preview\";\nimport { CodeDecorator } from \"@/components/decorators\";\nimport { ParagraphStyle } from \"@/components/styles\";\nimport { MessageCircleIcon } from \"@/icons/message-circle\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport { linkAnnotation } from \"@/schemas/annotations/link\";\nimport type { SanityKeyedArray, Strict } from \"@/types\";\n\n/**\n * A highlighted message set apart from the surrounding guide text.\n *\n * @public\n */\nexport type SanityHandbookCallout = Strict<PortableTextObject> & {\n _type: typeof calloutTypeName;\n /** Visual style and intent of the callout. */\n variant: CalloutVariant;\n /** Portable Text content displayed inside the callout, which offers no inline objects. */\n body: SanityKeyedArray<PortableTextTextBlock<PortableTextSpan>>;\n};\n\n/** Type name of the callout block. */\nexport const calloutTypeName = \"handbook.callout\";\n\nexport const calloutType = defineType({\n name: calloutTypeName satisfies SanityHandbookCallout[\"_type\"],\n type: \"object\",\n title: \"Callout\",\n icon: createSanityIcon(MessageCircleIcon),\n description: \"Highlighted message block drawing attention to tips, supplementary information, or warnings.\",\n components: {\n preview: CalloutPreview,\n },\n preview: {\n select: {\n variant: \"variant\",\n body: \"body\",\n },\n prepare(selection: { variant?: CalloutVariant; body?: SanityHandbookCallout[\"body\"] }) {\n const { variant, body } = selection;\n\n return {\n title: \"Callout\",\n variant,\n body,\n };\n },\n },\n fields: [\n defineField({\n name: \"variant\" satisfies keyof SanityHandbookCallout,\n type: \"string\",\n description: \"Visual style and intent of the callout.\",\n initialValue: \"tip\",\n validation: (rule) => rule.required(),\n options: {\n list: [\n { title: \"Tip\", value: \"tip\" },\n { title: \"Information\", value: \"info\" },\n { title: \"Warning\", value: \"warning\" },\n ],\n layout: \"radio\",\n direction: \"horizontal\",\n },\n }),\n defineField({\n name: \"body\" satisfies keyof SanityHandbookCallout,\n type: \"array\",\n description: \"Content displayed inside the callout. Supports inline formatting and links.\",\n of: [\n defineArrayMember({\n name: \"block\",\n type: \"block\",\n styles: [{ title: \"Normal\", value: \"normal\", component: ParagraphStyle }],\n lists: [],\n marks: {\n decorators: [\n { title: \"Bold\", value: \"strong\" },\n { title: \"Italic\", value: \"em\" },\n { title: \"Strikethrough\", value: \"strike-through\" },\n { title: \"Code\", value: \"code\", component: CodeDecorator },\n ],\n annotations: [linkAnnotation],\n },\n }),\n ],\n }),\n ],\n});\n","import { Card } from \"@sanity/ui\";\nimport type { CardProps } from \"@sanity/ui\";\nimport { Code } from \"@sanity/ui/code\";\n\nexport type CodeContentProps = CardProps & {\n code: string;\n language?: string;\n};\n\nexport function CodeContent({ code, language, style, ...props }: CodeContentProps) {\n return (\n <Card padding={4} radius={2} tone=\"transparent\" style={{ overflowX: \"auto\", ...style }} {...props}>\n <Code size={1} language={language}>\n {code}\n </Code>\n </Card>\n );\n}\n","import type { Nullable } from \"@/types\";\n\n/**\n * Checks whether a value is defined and non-empty, treating `false`, empty strings, and objects with\n * no keys as absent. An array is absent unless one of its elements is itself present, while anything\n * built from a class counts as present on existence alone. Not intended for boolean flags.\n *\n * @param value - The value to check.\n * @returns True if the value is defined and not empty.\n */\nexport function isDefined<T>(value: Nullable<T> | false): value is T {\n if (value === undefined || value === null || value === false) return false;\n if (typeof value === \"string\") return value.trim() !== \"\";\n if (Array.isArray(value)) return value.some((element) => isDefined(element));\n\n if (typeof value === \"object\") {\n const prototype = Reflect.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) return true;\n\n return Object.keys(value).length > 0;\n }\n\n return true;\n}\n\n/**\n * Converts a string between different casing formats.\n *\n * @param value - The string to convert.\n * @param format - The target casing format.\n * @returns The converted string.\n */\nexport function convertCase(value: string, format: \"kebab\" | \"snake\" | \"camel\" | \"pascal\" | \"title\" | \"sentence\") {\n const words = value\n .replaceAll(/(?<lower>[a-z0-9])(?<upper>[A-Z])/gu, \"$<lower> $<upper>\")\n .replaceAll(/[-_\\s]+/gu, \" \")\n .trim()\n .toLowerCase();\n\n switch (format) {\n case \"kebab\": {\n return words.replaceAll(/\\s+/gu, \"-\");\n }\n case \"snake\": {\n return words.replaceAll(/\\s+/gu, \"_\");\n }\n case \"camel\": {\n return words.replaceAll(/\\s+(?<character>.)/gu, (_match, character: string) => character.toUpperCase());\n }\n case \"pascal\": {\n return words.replaceAll(/(?:^|\\s+)(?<character>.)/gu, (_match, character: string) => character.toUpperCase());\n }\n case \"title\": {\n return words.replaceAll(/\\b\\w/gu, (character) => character.toUpperCase());\n }\n case \"sentence\": {\n return words.replaceAll(/^(?<character>.)/gu, (character) => character.toUpperCase());\n }\n default: {\n return value;\n }\n }\n}\n","import type { PreviewProps } from \"sanity\";\n\nimport { CodeContent } from \"@/blocks/code/content\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport type CodePreviewProps = PreviewProps & {\n code?: string;\n language?: string;\n};\n\nexport function CodePreview({ code, language }: CodePreviewProps) {\n if (!isDefined(code)) return null;\n\n return <CodeContent code={code} language={language} />;\n}\n","import type { ComponentProps } from \"react\";\n\nexport type CodeIconProps = ComponentProps<\"svg\">;\n\nexport function CodeIcon(props: CodeIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m16 18 6-6-6-6\" />\n <path d=\"m8 6-6 6 6 6\" />\n </svg>\n );\n}\n","import { defineField, defineType } from \"sanity\";\nimport type { PortableTextObject } from \"sanity\";\n\nimport { CodePreview } from \"@/blocks/code/preview\";\nimport { CodeIcon } from \"@/icons/code\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport type { Strict } from \"@/types\";\n\n/**\n * A block of source code, rendered with syntax highlighting for its language.\n *\n * @public\n */\nexport type SanityHandbookCode = Strict<PortableTextObject> & {\n _type: typeof codeTypeName;\n /** Source code to display. */\n code?: string;\n /** Programming language used for syntax highlighting. */\n language?: string;\n};\n\n/** Type name of the code block. */\nexport const codeTypeName = \"handbook.code\";\n\nexport const codeType = defineType({\n name: codeTypeName satisfies SanityHandbookCode[\"_type\"],\n type: \"object\",\n title: \"Code\",\n icon: createSanityIcon(CodeIcon),\n description: \"Syntax-highlighted code block with language selection.\",\n components: {\n preview: CodePreview,\n },\n preview: {\n select: {\n code: \"code\",\n language: \"language\",\n },\n },\n fields: [\n defineField({\n name: \"code\" satisfies keyof SanityHandbookCode,\n type: \"text\",\n description: \"The source code to display.\",\n }),\n defineField({\n name: \"language\" satisfies keyof SanityHandbookCode,\n type: \"string\",\n description: \"Programming language used for syntax highlighting.\",\n options: {\n list: [\n { title: \"CSS\", value: \"css\" },\n { title: \"GROQ\", value: \"groq\" },\n { title: \"HTML\", value: \"html\" },\n { title: \"JavaScript\", value: \"javascript\" },\n { title: \"JSON\", value: \"json\" },\n { title: \"Plain Text\", value: \"text\" },\n { title: \"React\", value: \"tsx\" },\n { title: \"Shell\", value: \"shell\" },\n { title: \"TypeScript\", value: \"typescript\" },\n ],\n },\n }),\n ],\n});\n","import type { ComponentProps } from \"react\";\n\nexport type HorizontalRuleContentProps = ComponentProps<\"hr\">;\n\nexport function HorizontalRuleContent({ style, ...props }: HorizontalRuleContentProps) {\n return <hr style={{ border: \"none\", borderTop: \"1px solid var(--card-border-color)\", ...style }} {...props} />;\n}\n","import type { PreviewProps } from \"sanity\";\n\nimport { HorizontalRuleContent } from \"@/blocks/horizontal-rule/content\";\n\nexport type HorizontalRulePreviewProps = PreviewProps;\n\nexport function HorizontalRulePreview(_props: HorizontalRulePreviewProps) {\n return <HorizontalRuleContent style={{ marginBlock: 8 }} />;\n}\n","import type { ComponentProps } from \"react\";\n\nexport type SeparatorHorizontalIconProps = ComponentProps<\"svg\">;\n\nexport function SeparatorHorizontalIcon(props: SeparatorHorizontalIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m16 16-4 4-4-4\" />\n <path d=\"M3 12h18\" />\n <path d=\"m8 8 4-4 4 4\" />\n </svg>\n );\n}\n","import { defineField, defineType } from \"sanity\";\nimport type { PortableTextObject } from \"sanity\";\n\nimport { HorizontalRulePreview } from \"@/blocks/horizontal-rule/preview\";\nimport { SeparatorHorizontalIcon } from \"@/icons/separator-horizontal\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport type { Strict } from \"@/types\";\n\n/**\n * A divider between sections of a guide, carrying no authored content of its own.\n *\n * @public\n */\nexport type SanityHandbookHorizontalRule = Strict<PortableTextObject> & {\n _type: typeof horizontalRuleTypeName;\n};\n\n/** Type name of the horizontal rule block. */\nexport const horizontalRuleTypeName = \"handbook.horizontalRule\";\n\nexport const horizontalRuleType = defineType({\n name: horizontalRuleTypeName satisfies SanityHandbookHorizontalRule[\"_type\"],\n type: \"object\",\n title: \"Horizontal Rule\",\n icon: createSanityIcon(SeparatorHorizontalIcon),\n description: \"Visual divider between sections of content.\",\n components: {\n preview: HorizontalRulePreview,\n },\n preview: {\n prepare() {\n return {\n title: \"Horizontal Rule\",\n };\n },\n },\n fields: [\n // Sanity rejects an object type declaring no fields, and a rule has nothing of its own to store.\n defineField({\n name: \"style\",\n type: \"string\",\n description: \"Reserved. A horizontal rule carries no authored content.\",\n hidden: true,\n }),\n ],\n});\n","import { Text } from \"@sanity/ui\";\nimport type { ComponentProps } from \"react\";\n\nexport type CaptionProps = ComponentProps<\"div\"> & {\n children: string;\n};\n\nexport function Caption({ children, style, ...props }: CaptionProps) {\n return (\n <div style={{ marginBlockStart: 12, ...style }} {...props}>\n <Text size={1} muted style={{ fontStyle: \"italic\" }}>\n {children}\n </Text>\n </div>\n );\n}\n","import type { ComponentProps } from \"react\";\n\nimport { Caption } from \"@/components/caption\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport type ImageContentProps = ComponentProps<\"div\"> & {\n url: string;\n alt?: string;\n caption?: string;\n};\n\nexport function ImageContent({ url, alt, caption, ...props }: ImageContentProps) {\n return (\n <div {...props}>\n <img src={url} alt={alt ?? \"\"} style={{ display: \"block\", maxWidth: \"100%\", borderRadius: 4 }} />\n {isDefined(caption) && <Caption>{caption}</Caption>}\n </div>\n );\n}\n","import type { PreviewProps } from \"sanity\";\n\nimport { ImageContent } from \"@/blocks/image/content\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport type ImagePreviewProps = PreviewProps & {\n url?: string;\n alt?: string;\n caption?: string;\n};\n\nexport function ImagePreview({ url, alt, caption }: ImagePreviewProps) {\n if (!isDefined(url)) return null;\n\n return <ImageContent url={url} alt={alt} caption={caption} style={{ padding: 8 }} />;\n}\n","import type { ComponentProps } from \"react\";\n\nexport type ImageIconProps = ComponentProps<\"svg\">;\n\nexport function ImageIcon(props: ImageIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" ry=\"2\" />\n <circle cx=\"9\" cy=\"9\" r=\"2\" />\n <path d=\"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21\" />\n </svg>\n );\n}\n","import { defineField, defineType } from \"sanity\";\nimport type { PortableTextObject } from \"sanity\";\n\nimport { ImagePreview } from \"@/blocks/image/preview\";\nimport { ImageIcon } from \"@/icons/image\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport type { Strict } from \"@/types\";\n\n/**\n * An image placed in a guide, with the caption and alternative text shown alongside it.\n *\n * @public\n */\nexport type SanityHandbookImage = Strict<PortableTextObject> & {\n _type: typeof imageTypeName;\n /** Uploaded image asset, narrowed by the query to the URL the viewer renders. */\n asset?: { url?: string };\n /** Text displayed beneath the image. */\n caption?: string;\n /** Alternative text for screen readers. */\n alt?: string;\n};\n\n/** Type name of the image block. */\nexport const imageTypeName = \"handbook.image\";\n\nexport const imageType = defineType({\n name: imageTypeName satisfies SanityHandbookImage[\"_type\"],\n type: \"object\",\n title: \"Image\",\n icon: createSanityIcon(ImageIcon),\n description: \"Image with an optional caption and alternative text.\",\n components: {\n preview: ImagePreview,\n },\n preview: {\n select: {\n caption: \"caption\",\n alt: \"alt\",\n url: \"asset.asset.url\",\n },\n },\n fields: [\n defineField({\n name: \"asset\" satisfies keyof SanityHandbookImage,\n title: \"Image\",\n type: \"image\",\n description: \"Upload or select an image from the media library.\",\n options: { hotspot: true },\n }),\n defineField({\n name: \"caption\" satisfies keyof SanityHandbookImage,\n type: \"string\",\n description: \"Caption text displayed below the image, such as a credit or a note.\",\n }),\n defineField({\n name: \"alt\" satisfies keyof SanityHandbookImage,\n title: \"Alternative Text\",\n type: \"string\",\n description: \"Describes what the image shows for people who cannot see it. Don't repeat the caption here.\",\n }),\n ],\n});\n","import type { ComponentProps } from \"react\";\n\nimport { Caption } from \"@/components/caption\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport type VideoContentProps = ComponentProps<\"div\"> & {\n url: string;\n caption?: string;\n};\n\nexport function VideoContent({ url, caption, ...props }: VideoContentProps) {\n return (\n <div {...props}>\n <video\n src={url}\n controls\n style={{ display: \"block\", maxWidth: \"100%\", borderRadius: 4, WebkitTransform: \"translateZ(0)\" }}\n >\n <track kind=\"captions\" label={caption ?? \"Video\"} />\n </video>\n {isDefined(caption) && <Caption>{caption}</Caption>}\n </div>\n );\n}\n","import type { PreviewProps } from \"sanity\";\n\nimport { VideoContent } from \"@/blocks/video/content\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport type VideoPreviewProps = PreviewProps & {\n url?: string;\n caption?: string;\n};\n\nexport function VideoPreview({ url, caption }: VideoPreviewProps) {\n if (!isDefined(url)) return null;\n\n return <VideoContent url={url} caption={caption} style={{ padding: 8 }} />;\n}\n","import type { ComponentProps } from \"react\";\n\nexport type FilmIconProps = ComponentProps<\"svg\">;\n\nexport function FilmIcon(props: FilmIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" />\n <path d=\"M7 3v18\" />\n <path d=\"M3 7.5h4\" />\n <path d=\"M3 12h18\" />\n <path d=\"M3 16.5h4\" />\n <path d=\"M17 3v18\" />\n <path d=\"M17 7.5h4\" />\n <path d=\"M17 16.5h4\" />\n </svg>\n );\n}\n","import { defineField, defineType } from \"sanity\";\nimport type { PortableTextObject } from \"sanity\";\n\nimport { VideoPreview } from \"@/blocks/video/preview\";\nimport { FilmIcon } from \"@/icons/film\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport type { Strict } from \"@/types\";\n\n/**\n * A video placed in a guide, with the caption shown beneath it.\n *\n * @public\n */\nexport type SanityHandbookVideo = Strict<PortableTextObject> & {\n _type: typeof videoTypeName;\n /** Uploaded video asset, narrowed by the query to the URL the viewer renders. */\n asset?: { url?: string };\n /** Text displayed beneath the video. */\n caption?: string;\n};\n\n/** Type name of the video block. */\nexport const videoTypeName = \"handbook.video\";\n\nexport const videoType = defineType({\n name: videoTypeName satisfies SanityHandbookVideo[\"_type\"],\n type: \"object\",\n title: \"Video\",\n icon: createSanityIcon(FilmIcon),\n description: \"Video with an optional caption.\",\n components: {\n preview: VideoPreview,\n },\n preview: {\n select: {\n caption: \"caption\",\n url: \"asset.asset.url\",\n },\n },\n fields: [\n defineField({\n name: \"asset\" satisfies keyof SanityHandbookVideo,\n title: \"Video\",\n type: \"file\",\n description: \"Upload or select a video from the media library.\",\n options: { accept: \"video/*\" },\n }),\n defineField({\n name: \"caption\" satisfies keyof SanityHandbookVideo,\n type: \"string\",\n description: \"Caption text displayed below the video, such as a credit or a note.\",\n }),\n ],\n});\n","import { defineArrayMember, defineField } from \"sanity\";\n\nimport { CodeDecorator } from \"@/components/decorators\";\nimport { ListItemStyle } from \"@/components/lists\";\nimport { BlockquoteStyle, HeadingStyle, ParagraphStyle } from \"@/components/styles\";\nimport type { SanityHandbookBlockDefinition } from \"@/plugin\";\nimport { linkAnnotation } from \"@/schemas/annotations/link\";\nimport { calloutTypeName } from \"@/schemas/blocks/callout\";\nimport { codeTypeName } from \"@/schemas/blocks/code\";\nimport { horizontalRuleTypeName } from \"@/schemas/blocks/horizontal-rule\";\nimport { imageTypeName } from \"@/schemas/blocks/image\";\nimport { videoTypeName } from \"@/schemas/blocks/video\";\nimport type { SanityHandbookGuide } from \"@/schemas/types/guide\";\n\n/**\n * Creates the Portable Text content field for Handbook guides, offering the built-in blocks alongside\n * any a consumer registered.\n *\n * @param customBlocks - Custom block definitions registered by the consumer.\n * @returns A field definition for the guide content array.\n */\nexport function createGuideContentField(customBlocks: SanityHandbookBlockDefinition[] = []) {\n return defineField({\n name: \"content\" satisfies keyof SanityHandbookGuide,\n type: \"array\",\n description: \"Rich text with formatting, headings, lists, images, code blocks, and custom blocks.\",\n of: [\n defineArrayMember({\n name: \"block\",\n type: \"block\",\n styles: [\n { title: \"Paragraph\", value: \"normal\", component: ParagraphStyle },\n { title: \"Heading\", value: \"h2\", component: HeadingStyle },\n { title: \"Blockquote\", value: \"blockquote\", component: BlockquoteStyle },\n ],\n lists: [\n { title: \"Bullet\", value: \"bullet\", component: ListItemStyle },\n { title: \"Number\", value: \"number\", component: ListItemStyle },\n ],\n marks: {\n decorators: [\n { title: \"Bold\", value: \"strong\" },\n { title: \"Italic\", value: \"em\" },\n { title: \"Strikethrough\", value: \"strike-through\" },\n { title: \"Code\", value: \"code\", component: CodeDecorator },\n ],\n annotations: [linkAnnotation],\n },\n }),\n defineArrayMember({ name: imageTypeName, type: imageTypeName }),\n defineArrayMember({ name: videoTypeName, type: videoTypeName }),\n defineArrayMember({ name: codeTypeName, type: codeTypeName }),\n defineArrayMember({ name: calloutTypeName, type: calloutTypeName }),\n defineArrayMember({ name: horizontalRuleTypeName, type: horizontalRuleTypeName }),\n ...customBlocks.map((block) => defineArrayMember({ name: block.schema.name, type: block.schema.name })),\n ],\n });\n}\n","import { defineField, defineType } from \"sanity\";\nimport type { PortableTextBlock, SanityDocument } from \"sanity\";\n\nimport { defaultDocumentTitle } from \"@/config/defaults\";\nimport { BookOpenTextIcon } from \"@/icons/book-open-text\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport type { SanityHandbookBlockDefinition } from \"@/plugin\";\nimport { createGuideContentField } from \"@/schemas/fields/content\";\nimport type { SanityKeyedArray, Strict } from \"@/types\";\n\n/**\n * A single Handbook page, authored as rich text and rendered in the tool.\n *\n * @public\n */\nexport type SanityHandbookGuide = Strict<SanityDocument> & {\n _type: typeof guideTypeName;\n /** Display title for this guide. */\n title: string;\n /** Brief description shown beneath the guide heading. */\n description?: string;\n /** Portable Text content of the guide. */\n content: SanityKeyedArray<PortableTextBlock>;\n};\n\n/** Document type name of an individual guide. */\nexport const guideTypeName = \"handbook.guide\";\n\n/**\n * Creates the document type a single guide is authored as, with its content field offering the\n * built-in blocks alongside any a consumer registered.\n *\n * @param customBlocks - Custom block definitions registered by the consumer.\n * @returns A document type definition for Handbook guides.\n */\nexport function createGuideType(customBlocks: SanityHandbookBlockDefinition[] = []) {\n return defineType({\n name: guideTypeName satisfies SanityHandbookGuide[\"_type\"],\n type: \"document\",\n title: \"Handbook Guide\",\n icon: createSanityIcon(BookOpenTextIcon),\n description: \"Handbook page authored with rich text, images, and custom blocks.\",\n preview: {\n select: {\n title: \"title\",\n description: \"description\",\n },\n prepare(selection: { title?: string; description?: string }) {\n const { title, description } = selection;\n\n return {\n title: title ?? defaultDocumentTitle,\n subtitle: description,\n };\n },\n },\n fields: [\n defineField({\n name: \"title\" satisfies keyof SanityHandbookGuide,\n type: \"string\",\n description: \"Appears in the Handbook sidebar and as the guide heading.\",\n validation: (rule) => rule.required(),\n }),\n defineField({\n name: \"description\" satisfies keyof SanityHandbookGuide,\n type: \"string\",\n description: \"Short introduction text displayed below the guide heading.\",\n }),\n createGuideContentField(customBlocks),\n ],\n });\n}\n","import type { ComponentProps } from \"react\";\n\nexport type BookTextIconProps = ComponentProps<\"svg\">;\n\nexport function BookTextIcon(props: BookTextIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20\" />\n <path d=\"M8 11h8\" />\n <path d=\"M8 7h6\" />\n </svg>\n );\n}\n","import type { ComponentProps } from \"react\";\n\nexport type ListPlusIconProps = ComponentProps<\"svg\">;\n\nexport function ListPlusIcon(props: ListPlusIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M16 5H3\" />\n <path d=\"M11 12H3\" />\n <path d=\"M16 19H3\" />\n <path d=\"M18 9v6\" />\n <path d=\"M21 12h-6\" />\n </svg>\n );\n}\n","import { defineArrayMember, defineField, defineType } from \"sanity\";\nimport type { SanityDocument } from \"sanity\";\n\nimport { BookTextIcon } from \"@/icons/book-text\";\nimport { ListPlusIcon } from \"@/icons/list-plus\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport { isDefined } from \"@/lib/utils\";\nimport type { SanityHandbookGuide } from \"@/schemas/types/guide\";\nimport { guideTypeName } from \"@/schemas/types/guide\";\nimport type { SanityKeyedArray, Strict } from \"@/types\";\n\n/**\n * A titled run of guides in the sidebar, holding them in the order they appear.\n *\n * @public\n */\nexport interface SanityHandbookGuideGroup {\n /** Display title for this group in the sidebar. */\n title: string;\n /** Ordered array of guide references. */\n guides: SanityKeyedArray<SanityHandbookGuide>;\n}\n\n/**\n * The singleton naming every guide group and the order the sidebar lists them in.\n *\n * @public\n */\nexport type SanityHandbook = Strict<SanityDocument> & {\n _type: typeof handbookTypeName;\n /** Ordered array of groups, each containing a title and guide references. */\n groups: SanityKeyedArray<SanityHandbookGuideGroup>;\n};\n\n/** Document type name of the Handbook singleton. */\nexport const handbookTypeName = \"handbook.handbook\";\n\nexport const handbookType = defineType({\n name: handbookTypeName satisfies SanityHandbook[\"_type\"],\n type: \"document\",\n title: \"Handbook\",\n icon: createSanityIcon(BookTextIcon),\n description: \"Defines the groups of guides shown in the Handbook sidebar, and the order they appear in.\",\n preview: {\n prepare() {\n return {\n title: \"Handbook\",\n };\n },\n },\n fields: [\n defineField({\n name: \"groups\" satisfies keyof SanityHandbook,\n type: \"array\",\n description:\n \"Ordered list of groups displayed in the Handbook sidebar. Each group contains a title and an ordered list of guide references.\",\n of: [\n defineArrayMember({\n name: \"group\",\n type: \"object\",\n icon: createSanityIcon(ListPlusIcon),\n description: \"Named section of the Handbook sidebar holding an ordered list of guides.\",\n fields: [\n defineField({\n name: \"title\" satisfies keyof SanityHandbookGuideGroup,\n type: \"string\",\n description: \"Heading displayed above this group of guides in the sidebar.\",\n validation: (rule) => rule.required(),\n }),\n defineField({\n name: \"guides\" satisfies keyof SanityHandbookGuideGroup,\n type: \"array\",\n description: \"Ordered list of guides within this group. Drag to reorder.\",\n of: [\n defineArrayMember({\n name: \"guide\",\n type: \"reference\",\n to: [{ type: guideTypeName }],\n }),\n ],\n }),\n ],\n preview: {\n select: {\n title: \"title\",\n guide0: \"guides.0.title\",\n guide1: \"guides.1.title\",\n guide2: \"guides.2.title\",\n },\n prepare(selection: { title?: string; guide0?: string; guide1?: string; guide2?: string }) {\n const { title, guide0, guide1, guide2 } = selection;\n\n const all = [guide0, guide1, guide2].filter((guide): guide is string => isDefined(guide));\n const shown = all.slice(0, 2);\n const hasMore = isDefined(guide2);\n\n function formatSubtitle() {\n if (!isDefined(shown)) return \"No guides selected\";\n if (hasMore) return `${shown.join(\", \")}, and others`;\n return shown.join(\" and \");\n }\n\n return {\n title: title ?? \"Group\",\n subtitle: formatSubtitle(),\n };\n },\n },\n }),\n ],\n }),\n ],\n});\n","import { guideTypeName } from \"@/schemas/types/guide\";\nimport { handbookTypeName } from \"@/schemas/types/handbook\";\n\n/** Document types that should not appear in the \"create new\" menu. */\nexport const singletonTypes = new Set<string>([handbookTypeName]);\n\n/** All Handbook document types used to filter template items for non-editors. */\nexport const documentTypes = new Set<string>([handbookTypeName, guideTypeName]);\n","/** Width in pixels the sidebar pane settles at until it is resized. */\nexport const sidebarWidth = 350;\n\n/** Minimum width in pixels the sidebar pane occupies before collapsing to a vertical label. */\nexport const sidebarMinimumWidth = 320;\n\n/** Maximum width in pixels the sidebar pane can be resized to. */\nexport const sidebarMaximumWidth = 640;\n\n/** Minimum width in pixels the content pane occupies. */\nexport const contentMinimumWidth = 320;\n\n/** Share of the available space the content pane takes relative to the sidebar. */\nexport const contentFlex = 2.5;\n\n/** Width in pixels of a pane collapsed to a vertical label. */\nexport const collapsedPaneWidth = 51;\n\n/** Estimated height in pixels of a sidebar row, refined once the rows are measured. */\nexport const sidebarItemHeight = 37;\n\n/** Minimum width in pixels the tool occupies before the Studio scrolls horizontally. */\nexport const toolMinimumWidth = 320;\n\n/** Maximum width in pixels of the readable column inside the content pane. */\nexport const contentWidth = 640;\n\n/** Horizontal space in pixels between the readable column and the edges of the content pane. */\nexport const contentPaddingInline = 20;\n\n/** Space in pixels above the heading of a content panel. */\nexport const contentPaddingBlockStart = 32;\n\n/** Space in pixels below the last element of a content panel, so the end of long content clears the pane edge. */\nexport const contentPaddingBlockEnd = 220;\n\n/** Vertical rhythm in pixels that guide content and content panels are spaced on. */\nexport const contentSpacing = {\n section: 48,\n paragraph: 16,\n heading: 48,\n media: 24,\n callout: 32,\n blockquote: 32,\n list: 32,\n nestedList: 12,\n rule: 40,\n};\n","import { imageTypeName } from \"@/schemas/blocks/image\";\nimport { videoTypeName } from \"@/schemas/blocks/video\";\n\n/** Resolves a Portable Text asset reference to the single URL the viewer renders it from. */\nexport const assetUrlFragment = `\"asset\": { \"url\": asset.asset->url }`;\n\n/** Expands guide content members with resolved asset URLs. */\nexport const guideContentFragment = `\n _type == \"${imageTypeName}\" => { ..., ${assetUrlFragment} },\n _type == \"${videoTypeName}\" => { ..., ${assetUrlFragment} }\n`;\n\n/** Expands a guide reference with resolved asset URLs throughout its content. */\nexport const guideFragment = `...@-> {\n ...,\n content[] { ..., ${guideContentFragment} }\n}`;\n","import type { SanityClient } from \"sanity\";\n\n/** A GROQ query string branded with the shape of the data it returns. */\nexport type TypedQuery<T> = string & { readonly __result?: T };\n\n/**\n * Brands a GROQ query with the shape of the data it returns, so a fetch can infer its result type\n * instead of being told it at every call site.\n *\n * @param query - The GROQ query string.\n * @returns The query, typed to the given result shape.\n */\nexport function defineTypedQuery<T>(query: string): TypedQuery<T> {\n return query;\n}\n\n/**\n * Runs a branded query against the dataset, resolving a missing document to undefined.\n *\n * @param client - The Sanity client to query with.\n * @param query - The branded query to run.\n * @returns The result, or undefined when the query matched nothing.\n */\nexport async function fetchQuery<T>(client: SanityClient, query: TypedQuery<T>) {\n return (await client.fetch<T | null>(query)) ?? undefined;\n}\n","import { guideFragment } from \"@/groq/fragments\";\nimport { defineTypedQuery } from \"@/lib/groq\";\nimport type { SanityHandbookGuide } from \"@/schemas/types/guide\";\nimport { guideTypeName } from \"@/schemas/types/guide\";\nimport type { SanityHandbook } from \"@/schemas/types/handbook\";\nimport { handbookTypeName } from \"@/schemas/types/handbook\";\n\n/** Fetches the Handbook singleton with expanded guide references. */\nexport const handbookQuery = defineTypedQuery<SanityHandbook>(`\n *[_type == \"${handbookTypeName}\"][0] {\n ...,\n groups[] {\n ...,\n guides[] {\n ...,\n ${guideFragment}\n }\n }\n }\n`);\n\n/** Matches the documents whose changes the Handbook tool refetches on. */\nexport const handbookDocumentsQuery = defineTypedQuery<SanityHandbook | SanityHandbookGuide>(\n `*[_type == \"${handbookTypeName}\" || _type == \"${guideTypeName}\"]`,\n);\n","import { useEffect, useState } from \"react\";\nimport { useClient } from \"sanity\";\n\nimport { handbookDocumentsQuery, handbookQuery } from \"@/groq/documents\";\nimport { fetchQuery } from \"@/lib/groq\";\nimport type { SanityHandbook } from \"@/schemas/types/handbook\";\n\n/**\n * Fetches the Handbook singleton from the dataset with its guide references expanded, refetching\n * whenever one of the documents it draws on changes.\n *\n * @returns The Handbook and a flag for whether it is still loading.\n */\nexport function useHandbookDocument() {\n const client = useClient({ apiVersion: \"2026-01-01\" });\n const [handbook, setHandbook] = useState<SanityHandbook | undefined>(undefined);\n const [loading, setLoading] = useState(true);\n\n useEffect(() => {\n async function fetchHandbook() {\n setHandbook(await fetchQuery(client, handbookQuery));\n setLoading(false);\n }\n\n void fetchHandbook();\n\n const subscription = client.listen(handbookDocumentsQuery).subscribe(() => {\n void fetchHandbook();\n });\n\n return () => {\n subscription.unsubscribe();\n };\n }, [client]);\n\n return { handbook, loading };\n}\n","import { createContext, useContext, useState } from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport { useHandbookDocument } from \"@/hooks/use-handbook-document\";\nimport { isDefined } from \"@/lib/utils\";\nimport type { SanityHandbookBlockDefinition, SanityHandbookDocumentRole } from \"@/plugin\";\nimport type { SanityHandbook } from \"@/schemas/types/handbook\";\n\n/** Plugin configuration with every optional value already resolved to a concrete one. */\nexport interface HandbookProviderConfig {\n /** Heading displayed at the top of the sidebar. */\n sidebarTitle: string;\n /** Document roles from the plugin configuration. */\n roles: SanityHandbookDocumentRole[];\n /** Custom block definitions registered by the consumer. */\n blocks: SanityHandbookBlockDefinition[];\n /** Fallback message shown when a field has no description. */\n undocumentedFieldMessage: string;\n}\n\n/** Provider configuration alongside the tab and sidebar state the panes share. */\ntype HandbookContextValues = HandbookProviderConfig & {\n /** Identifier of the currently selected tab, or undefined when none is selected. */\n activeTab: string | undefined;\n /** Whether the sidebar is currently expanded. */\n sidebarExpanded: boolean;\n /** Whether Handbook data is still loading from the dataset. */\n loading: boolean;\n /** Handbook singleton fetched from the dataset. */\n handbook: SanityHandbook | undefined;\n /** Sets the active tab by identifier. */\n setActiveTab: (id: string) => void;\n /** Toggles the sidebar expanded state. */\n setSidebarExpanded: (expanded: boolean) => void;\n};\n\nexport type HandbookProviderProps = HandbookProviderConfig & {\n children: ReactNode;\n};\n\nconst HandbookContext = createContext<HandbookContextValues | undefined>(undefined);\n\n/**\n * Accesses the Handbook context for tab state and plugin configuration.\n *\n * @returns The resolved plugin configuration alongside the state the panes share.\n * @throws {Error} If used outside the provider.\n */\nexport function useHandbookContext() {\n const handbookContext = useContext(HandbookContext);\n\n if (!isDefined(handbookContext)) throw new Error(\"useHandbookContext can only be used within <HandbookProvider>\");\n\n return handbookContext;\n}\n\n/**\n * Provides the tab state the sidebar and content panes share, alongside the plugin configuration and\n * the handbook singleton fetched from the dataset.\n *\n * @param props - Configuration from the plugin, and the tool to provide it to.\n * @returns The provider wrapping its children.\n */\nexport function HandbookProvider({\n sidebarTitle,\n roles,\n blocks,\n undocumentedFieldMessage,\n children,\n}: HandbookProviderProps) {\n const [activeTab, setActiveTab] = useState<string | undefined>(undefined);\n const [sidebarExpanded, setSidebarExpanded] = useState(true);\n const { handbook, loading } = useHandbookDocument();\n\n return (\n <HandbookContext\n value={{\n sidebarTitle,\n roles,\n blocks,\n undocumentedFieldMessage,\n activeTab,\n sidebarExpanded,\n loading,\n handbook,\n setActiveTab,\n setSidebarExpanded,\n }}\n >\n {children}\n </HandbookContext>\n );\n}\n","import { Box, Card, Flex, Layer, LayerProvider, Text, useElementSize, useTheme_v2 } from \"@sanity/ui\";\nimport { useContext } from \"react\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { PaneContext } from \"sanity/_singletons\";\n\nimport { collapsedPaneWidth } from \"@/config/layout\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport type PaneHeaderProps = ComponentProps<\"div\"> & {\n title: string;\n backButton?: ReactNode;\n};\n\nexport function PaneHeader({ title, backButton, style, ...props }: PaneHeaderProps) {\n const { color } = useTheme_v2();\n const pane = useContext(PaneContext);\n const paneSize = useElementSize(pane?.rootElement ?? null);\n\n const collapsed = pane?.collapsed ?? false;\n const isLast = pane?.isLast ?? false;\n const paneHeight = paneSize?.border.height ?? 0;\n const collapsedWidth = paneHeight > 0 ? paneHeight : window.innerHeight;\n const { bg, fg } = color.selectable.default.enabled;\n\n function handleTitleClick() {\n if (collapsed) return;\n pane?.collapse();\n }\n\n function handleLayoutClick() {\n if (!collapsed) return;\n pane?.expand();\n }\n\n return (\n <LayerProvider zOffset={100}>\n <Layer\n data-collapsed={collapsed ? \"\" : undefined}\n style={{ lineHeight: 0, position: \"sticky\", top: 0, ...style }}\n {...props}\n >\n <Card tone=\"inherit\" data-collapsed={collapsed ? \"\" : undefined}>\n <Flex\n direction=\"column\"\n gap={3}\n onClick={handleLayoutClick}\n padding={3}\n sizing=\"border\"\n style={{\n width: collapsed ? collapsedWidth : undefined,\n transform: collapsed ? \"rotate(90deg)\" : undefined,\n transformOrigin: `calc(${collapsedPaneWidth}px / 2)`,\n }}\n >\n <Flex align=\"flex-start\" gap={3}>\n {isDefined(backButton) && <Box flex=\"none\">{backButton}</Box>}\n <Card\n flex={1}\n onClick={handleTitleClick}\n padding={2}\n paddingLeft={isDefined(backButton) ? 1 : 2}\n tabIndex={isLast && !collapsed ? -1 : 0}\n style={{ backgroundColor: bg, minWidth: 0 }}\n __unstable_focusRing\n >\n <Flex align=\"center\" gap={1}>\n <Text\n size={1}\n textOverflow=\"ellipsis\"\n weight=\"semibold\"\n style={{ color: fg, cursor: \"default\", minWidth: 0, outline: \"none\" }}\n >\n {title}\n </Text>\n </Flex>\n </Card>\n </Flex>\n </Flex>\n </Card>\n </Layer>\n </LayerProvider>\n );\n}\n","import { ArrowLeftIcon } from \"@sanity/icons/ArrowLeft\";\nimport { Box, Button, Heading, Stack, Text } from \"@sanity/ui\";\nimport { useContext } from \"react\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { PaneLayoutContext } from \"sanity/_singletons\";\nimport { PaneContent } from \"sanity/structure\";\n\nimport { PaneHeader } from \"@/components/pane-header\";\nimport { contentPaddingBlockEnd, contentPaddingBlockStart, contentPaddingInline, contentWidth } from \"@/config/layout\";\nimport { useHandbookContext } from \"@/contexts/handbook\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport type ContentPanelProps = Omit<ComponentProps<typeof PaneContent>, \"id\" | \"title\"> & {\n id: string;\n title: string;\n description?: string;\n children: ReactNode;\n};\n\nexport function ContentPanel({ id, title, description, children, ...props }: ContentPanelProps) {\n const { setSidebarExpanded } = useHandbookContext();\n const paneLayout = useContext(PaneLayoutContext);\n\n return (\n <>\n <PaneHeader\n title={title}\n backButton={\n paneLayout?.collapsed === true && (\n <Button\n aria-label=\"Back\"\n icon={ArrowLeftIcon}\n mode=\"bleed\"\n onClick={() => {\n setSidebarExpanded(true);\n }}\n />\n )\n }\n />\n <PaneContent id={`panel-${id}`} aria-labelledby={id} overflow=\"auto\" {...props}>\n <Box\n style={{\n maxWidth: contentWidth,\n boxSizing: \"border-box\",\n marginInline: \"auto\",\n paddingInline: contentPaddingInline,\n paddingBlockStart: contentPaddingBlockStart,\n paddingBlockEnd: contentPaddingBlockEnd,\n }}\n >\n <Stack marginBottom={6} gap={5}>\n <Heading as=\"h2\" size={4}>\n {title}\n </Heading>\n {isDefined(description) && (\n <Text size={1} muted>\n {description}\n </Text>\n )}\n </Stack>\n {children}\n </Box>\n </PaneContent>\n </>\n );\n}\n","import { Box, Stack, Text, useClickOutsideEvent } from \"@sanity/ui\";\nimport { Popover } from \"@sanity/ui/popover\";\nimport { useRef } from \"react\";\nimport type { ComponentProps, ReactNode } from \"react\";\n\nexport type FieldHintProps = Omit<ComponentProps<typeof Popover>, \"content\" | \"open\" | \"children\"> & {\n label: string;\n icon: ReactNode;\n open: boolean;\n children: string;\n onOpen: () => void;\n onClose: () => void;\n};\n\nexport function FieldHint({ label, icon, open, children, onOpen, onClose, ...props }: FieldHintProps) {\n const buttonReference = useRef<HTMLButtonElement | null>(null);\n const popoverReference = useRef<HTMLDivElement | null>(null);\n\n useClickOutsideEvent(open ? onClose : undefined, () => [buttonReference.current, popoverReference.current]);\n\n return (\n <Popover\n open={open}\n placement=\"top\"\n portal\n radius={2}\n shadow={2}\n content={\n <div ref={popoverReference}>\n <Box padding={3} style={{ maxWidth: 280 }}>\n <Stack gap={3}>\n <Text size={1} weight=\"semibold\">\n {label}\n </Text>\n <Text size={1} muted>\n {children}\n </Text>\n </Stack>\n </Box>\n </div>\n }\n {...props}\n >\n <button\n ref={buttonReference}\n aria-label={label}\n type=\"button\"\n onClick={open ? onClose : onOpen}\n onPointerEnter={(event) => {\n if (event.pointerType === \"mouse\") onOpen();\n }}\n onPointerLeave={(event) => {\n if (event.pointerType === \"mouse\") onClose();\n }}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n padding: 2,\n fontSize: 16,\n color: \"var(--card-icon-color)\",\n background: \"none\",\n border: \"none\",\n cursor: \"pointer\",\n }}\n >\n {icon}\n </button>\n </Popover>\n );\n}\n","import type { ComponentProps, ComponentType } from \"react\";\n\nimport { InfoIcon } from \"@/icons/info\";\nimport { LightbulbIcon } from \"@/icons/lightbulb\";\nimport { TriangleAlertIcon } from \"@/icons/triangle-alert\";\nimport type { SanityHandbookMetadata } from \"@/plugin\";\n\n/** A kind of hint a field can carry, pairing its metadata property with how it is presented. */\ninterface HintKind {\n /** Property on the field's handbook metadata holding the hint text. */\n name: keyof Pick<SanityHandbookMetadata, \"tip\" | \"info\" | \"caution\">;\n /** Heading shown above the hint text, and the icon's accessible label. */\n label: string;\n /** Icon identifying the kind wherever the hint appears. */\n icon: ComponentType<ComponentProps<\"svg\">>;\n}\n\n/** Hint kinds a field can carry, in the order they are displayed. */\nexport const hintKinds: HintKind[] = [\n { name: \"tip\", label: \"Tip\", icon: LightbulbIcon },\n { name: \"info\", label: \"Information\", icon: InfoIcon },\n { name: \"caution\", label: \"Caution\", icon: TriangleAlertIcon },\n];\n","import { Flex } from \"@sanity/ui\";\nimport type { FlexProps } from \"@sanity/ui\";\nimport { useState } from \"react\";\n\nimport { FieldHint } from \"@/components/field/hint\";\nimport { defaultIconProps } from \"@/config/defaults\";\nimport { hintKinds } from \"@/config/hints\";\nimport { isDefined } from \"@/lib/utils\";\nimport type { SanityHandbookMetadata } from \"@/plugin\";\n\nexport type FieldHintsProps = FlexProps & Pick<SanityHandbookMetadata, \"tip\" | \"info\" | \"caution\">;\n\nexport function FieldHints({ tip, info, caution, ...props }: FieldHintsProps) {\n const [openHint, setOpenHint] = useState<string | undefined>(undefined);\n\n const hints = { tip, info, caution };\n\n function closeHint() {\n setOpenHint(undefined);\n }\n\n return (\n <Flex align=\"center\" gap={2} {...props}>\n {hintKinds.flatMap(({ name, label, icon: Icon }) => {\n const hint = hints[name];\n if (!isDefined(hint)) return [];\n\n return (\n <FieldHint\n key={name}\n label={label}\n icon={<Icon {...defaultIconProps} />}\n open={openHint === name}\n onOpen={() => {\n setOpenHint(name);\n }}\n onClose={closeHint}\n >\n {hint}\n </FieldHint>\n );\n })}\n </Flex>\n );\n}\n","import type { ComponentProps, ComponentType, ReactNode } from \"react\";\n\nimport { createSanityIcon } from \"@/lib/icons\";\nimport { convertCase } from \"@/lib/utils\";\n\n/**\n * Resolves the label shown for a schema type, preferring Handbook metadata over the schema's own\n * title and falling back to a title-cased name.\n *\n * @param type - The schema type or field to resolve a label for.\n * @returns The label.\n */\nexport function resolveTitle(type: { name: string; title?: string; handbook?: { title?: string } }) {\n const { name, title, handbook } = type;\n\n return handbook?.title ?? title ?? convertCase(name, \"title\");\n}\n\n/**\n * Resolves the description shown for a schema type, preferring Handbook metadata and ignoring the\n * non-string descriptions a schema may carry.\n *\n * @param type - The schema type or field to resolve a description for.\n * @returns The description, or undefined when neither source provides one.\n */\nexport function resolveDescription(type: { description?: unknown; handbook?: { description?: string } }) {\n const { description, handbook } = type;\n\n return handbook?.description ?? (typeof description === \"string\" ? description : undefined);\n}\n\n/**\n * Narrows a schema type's icon to a renderable component, discarding the string form a schema may\n * carry instead. A consumer's icon is redrawn at the plugin's own weight, so it sits beside the\n * built-in ones rather than at its own library's default size.\n *\n * @param type - The schema type to read an icon from.\n * @returns The icon component, or undefined when none is set.\n */\nexport function resolveIcon(type: { icon?: ReactNode | ComponentType<ComponentProps<\"svg\">> }) {\n return typeof type.icon === \"function\" ? createSanityIcon(type.icon) : undefined;\n}\n","import type { FieldDefinition, Schema } from \"sanity\";\n\nimport { isDefined } from \"@/lib/utils\";\n\n/** A schema field as Sanity compiles it, with its type resolved to an object rather than a name. */\ninterface CompiledField {\n /** Field identifier in the schema. */\n name: string;\n /** Resolved type object containing the type name and base type metadata. */\n type: { name: string; title?: string; description?: string; fields?: unknown[]; of?: unknown[] };\n /** Custom title set directly on inline object definitions. */\n title?: string;\n /** Custom description set directly on inline object definitions. */\n description?: string;\n /** Fields defined directly on inline object definitions. */\n fields?: unknown[];\n /** Array members defined directly on inline array definitions. */\n of?: unknown[];\n /** Optional Handbook metadata annotations for this field. */\n handbook?: FieldDefinition[\"handbook\"];\n}\n\n/** A schema field flattened into the shape the Handbook renders, with its type collapsed to a name. */\nexport interface NormalisedField {\n /** Field identifier in the schema. */\n name: string;\n /** Resolved type name. */\n type: string;\n /** Display title, falling back to the one declared on the base type. */\n title?: string;\n /** Description, falling back to the one declared on the base type. */\n description?: string;\n /** Optional Handbook metadata annotations for this field. */\n handbook?: FieldDefinition[\"handbook\"];\n /** Normalised subfields, present on object types. */\n fields?: NormalisedField[];\n /** Normalised members, present on array types. */\n of?: NormalisedField[];\n}\n\n/** Schema type names treated as leaf types whose subfields are not displayed. */\nconst opaqueTypes = new Set([\n \"block\",\n \"boolean\",\n \"crossDatasetReference\",\n \"date\",\n \"datetime\",\n \"file\",\n \"geopoint\",\n \"image\",\n \"number\",\n \"reference\",\n \"slug\",\n \"string\",\n \"text\",\n \"url\",\n]);\n\n/** Fields injected by Sanity's built-in opaque types during schema compilation. */\nconst inheritedFieldNames: Partial<Record<string, Set<string>>> = {\n block: new Set([\"children\", \"level\", \"listItem\", \"markDefs\", \"style\"]),\n file: new Set([\"asset\", \"media\"]),\n geopoint: new Set([\"alt\", \"lat\", \"lng\"]),\n image: new Set([\"asset\", \"crop\", \"hotspot\", \"media\"]),\n slug: new Set([\"current\", \"source\"]),\n};\n\n/**\n * Checks whether a value is a compiled schema field with a nested type object.\n *\n * @param value - The value to check.\n * @returns True if the value is a compiled field.\n */\nfunction isCompiledField(value: unknown): value is CompiledField {\n if (typeof value !== \"object\" || value === null) return false;\n if (!(\"name\" in value) || !(\"type\" in value)) return false;\n\n return typeof value.type === \"object\" && value.type !== null;\n}\n\n/**\n * Checks whether a value has a `fields` array property.\n *\n * @param value - The value to check.\n * @returns True if the value contains a `fields` array.\n */\nfunction hasFieldsArray(value: unknown): value is { fields: unknown[] } {\n if (typeof value !== \"object\" || value === null || !(\"fields\" in value)) return false;\n\n return Array.isArray(value.fields);\n}\n\n/**\n * Checks whether a value has an `of` array property.\n *\n * @param value - The value to check.\n * @returns True if the value contains an `of` array.\n */\nfunction hasOfArray(value: unknown): value is { of: unknown[] } {\n if (typeof value !== \"object\" || value === null || !(\"of\" in value)) return false;\n\n return Array.isArray(value.of);\n}\n\n/**\n * Extracts the type name a value declares, where it names one at all.\n *\n * @param value - The value to inspect.\n * @returns The type name, or undefined when the value declares none.\n */\nfunction getTypeName(value: unknown) {\n if (typeof value !== \"object\" || value === null || !(\"type\" in value)) return undefined;\n\n return typeof value.type === \"string\" ? value.type : undefined;\n}\n\n/**\n * Extracts the parent type name from a compiled schema type, if present.\n *\n * @param resolvedType - The compiled schema type to inspect.\n * @returns The parent type name, or undefined when the type extends none.\n */\nfunction getParentTypeName(resolvedType: unknown) {\n if (typeof resolvedType !== \"object\" || resolvedType === null || !(\"type\" in resolvedType)) return undefined;\n if (typeof resolvedType.type !== \"object\" || resolvedType.type === null || !(\"name\" in resolvedType.type)) {\n return undefined;\n }\n\n return String(resolvedType.type.name);\n}\n\n/**\n * Normalises a compiled schema field into the shape the Handbook renders. Type names already seen are\n * tracked so a type that refers back to itself does not recurse forever.\n *\n * @param field - A compiled schema field or plain field definition.\n * @param visited - Type names already seen in this normalisation chain.\n * @returns The normalised field.\n */\nfunction normaliseField(field: unknown, visited = new Set<string>()) {\n if (isCompiledField(field)) {\n const typeName = field.type.name;\n\n const result: NormalisedField = {\n name: field.name,\n type: typeName,\n title: field.title ?? field.type.title,\n description: field.description ?? field.type.description,\n handbook: field.handbook,\n };\n\n if (!visited.has(typeName)) {\n const shouldTrack = !opaqueTypes.has(typeName) && typeName !== \"object\" && typeName !== \"array\";\n const next = shouldTrack ? new Set([...visited, typeName]) : visited;\n const fieldSource = hasFieldsArray(field) ? field : field.type;\n const ofSource = hasOfArray(field) ? field : field.type;\n\n if (hasFieldsArray(fieldSource)) {\n result.fields = fieldSource.fields.map((subfield) => normaliseField(subfield, next));\n }\n if (hasOfArray(ofSource)) result.of = ofSource.of.map((member) => normaliseField(member, next));\n }\n\n return result;\n }\n\n // oxlint-disable-next-line no-unsafe-type-assertion -- Schema values that are already normalised carry no marker to narrow on.\n return field as NormalisedField;\n}\n\n/**\n * Resolves only the fields a custom type adds on top of an opaque base type, leaving out the ones the\n * base type contributes of its own accord.\n *\n * @param resolvedType - The compiled or normalised schema type.\n * @param parentName - The opaque base type name.\n * @returns The custom fields, or undefined when the type adds none.\n */\nfunction resolveCustomFields(resolvedType: unknown, parentName: string) {\n if (!hasFieldsArray(resolvedType)) return undefined;\n\n const inherited = inheritedFieldNames[parentName];\n\n const customFields = resolvedType.fields\n .map((field: unknown) => normaliseField(field))\n .filter((field) => !isDefined(inherited) || !inherited.has(field.name));\n\n return isDefined(customFields) ? customFields : undefined;\n}\n\n/**\n * Normalises a list of raw field values into the shape the Handbook renders.\n *\n * @param items - Raw field values to normalise.\n * @returns The normalised fields, or undefined when the list holds none.\n */\nfunction resolveNormalisedFields(items: unknown[]) {\n const normalised = items.map((item) => normaliseField(item));\n\n return isDefined(normalised) ? normalised : undefined;\n}\n\n/**\n * Normalises array members and filters out opaque types that have no meaningful subfields.\n *\n * @param members - Raw array member values to normalise.\n * @returns The normalised non-opaque members, or undefined when none remain.\n */\nfunction resolveNormalisedMembers(members: unknown[]) {\n const normalised = members.map((member) => normaliseField(member)).filter((member) => !opaqueTypes.has(member.type));\n\n return isDefined(normalised) ? normalised : undefined;\n}\n\n/**\n * Resolves the name of the type a value extends, reaching into the schema registry when the value\n * carries nothing but a type name of its own.\n *\n * @param value - The value to inspect.\n * @param schema - The Sanity schema registry.\n * @returns The parent type name, or undefined when the value extends none.\n */\nfunction resolveParentName(value: unknown, schema: Schema) {\n const direct = getParentTypeName(value);\n if (isDefined(direct)) return direct;\n\n const typeName = getTypeName(value);\n if (!isDefined(typeName)) return undefined;\n\n const resolvedType = schema.get(typeName);\n return isDefined(resolvedType) ? getParentTypeName(resolvedType) : undefined;\n}\n\n/**\n * Extracts the fields a value displays, whether it carries them directly, carries array members that\n * do, or names a type that does.\n *\n * @param value - The value to extract fields from.\n * @param schema - The Sanity schema registry.\n * @returns The resolved fields, or undefined when the value has none.\n */\nfunction resolveFields(value: unknown, schema: Schema) {\n if (hasFieldsArray(value)) {\n const parentName = resolveParentName(value, schema);\n if (isDefined(parentName) && opaqueTypes.has(parentName)) return resolveCustomFields(value, parentName);\n\n return resolveNormalisedFields(value.fields);\n }\n\n if (hasOfArray(value)) {\n const members = value.of;\n\n if (members.length === 1) {\n const [member] = members;\n const normalised = normaliseField(member);\n\n if (opaqueTypes.has(normalised.type)) return undefined;\n\n if (hasFieldsArray(normalised)) {\n const parentName = resolveParentName(normalised, schema);\n if (isDefined(parentName) && opaqueTypes.has(parentName)) return resolveCustomFields(normalised, parentName);\n\n return resolveNormalisedFields(normalised.fields);\n }\n\n const memberType = schema.get(normalised.type);\n if (isDefined(memberType)) return resolveFields(memberType, schema);\n }\n\n return resolveNormalisedMembers(members);\n }\n\n return undefined;\n}\n\n/**\n * Resolves the displayable subfields of a field definition by traversing the schema.\n *\n * @param field - The parent field definition.\n * @param schema - The Sanity schema registry.\n * @returns The non-opaque subfields, or undefined when the field has none.\n */\nexport function getSubfields(field: FieldDefinition | NormalisedField, schema: Schema) {\n if (opaqueTypes.has(field.type)) return undefined;\n\n const directFields = resolveFields(field, schema);\n if (isDefined(directFields)) return directFields;\n\n const resolvedType = schema.get(field.type);\n if (!isDefined(resolvedType)) return undefined;\n\n const parentName = getParentTypeName(resolvedType);\n if (isDefined(parentName) && opaqueTypes.has(parentName)) {\n return resolveCustomFields(resolvedType, parentName);\n }\n\n return resolveFields(resolvedType, schema);\n}\n","import { ChevronDownIcon } from \"@sanity/icons/ChevronDown\";\nimport { ChevronRightIcon } from \"@sanity/icons/ChevronRight\";\nimport { Box, Card, Flex, Stack, Text } from \"@sanity/ui\";\nimport type { StackProps } from \"@sanity/ui\";\nimport { useState } from \"react\";\nimport type { FieldDefinition } from \"sanity\";\nimport { useSchema } from \"sanity\";\n\nimport { FieldHints } from \"@/components/field/hints\";\nimport { useHandbookContext } from \"@/contexts/handbook\";\nimport { resolveDescription, resolveTitle } from \"@/lib/display\";\nimport type { NormalisedField } from \"@/lib/schema\";\nimport { getSubfields } from \"@/lib/schema\";\nimport { convertCase, isDefined } from \"@/lib/utils\";\n\nexport type FieldProps = StackProps & {\n field: FieldDefinition | NormalisedField;\n ancestors?: Set<string>;\n};\n\n/** Shared empty ancestor set, so the default prop keeps a stable reference across renders. */\nconst noAncestors = new Set<string>();\n\nexport function Field({ field, ancestors = noAncestors, ...props }: FieldProps) {\n const schema = useSchema();\n const { undocumentedFieldMessage } = useHandbookContext();\n const [expanded, setExpanded] = useState(false);\n\n const effectiveTitle = resolveTitle(field);\n const effectiveDescription = resolveDescription(field) ?? undocumentedFieldMessage;\n\n const { example, tip, info, caution } = field.handbook ?? {};\n const hasHints = isDefined([tip, info, caution]);\n\n const isCycle = ancestors.has(field.type);\n const subfields = isCycle ? undefined : getSubfields(field, schema);\n const hasSubfields = isDefined(subfields);\n\n return (\n <Stack gap={2} {...props}>\n <Stack gap={3}>\n <Flex align=\"center\" paddingY={1} gap={2}>\n <Box flex={1}>\n <Flex align=\"center\" gap={2}>\n <Text size={1} weight=\"medium\">\n {effectiveTitle}\n </Text>\n <Text size={0} muted style={{ marginTop: 2 }}>\n {field.type}\n </Text>\n </Flex>\n </Box>\n {hasHints && <FieldHints tip={tip} info={info} caution={caution} />}\n </Flex>\n {isDefined(effectiveDescription) && (\n <Text size={1} muted>\n {effectiveDescription}\n </Text>\n )}\n {isDefined(example) && (\n <Box marginTop={1}>\n <Text size={1} muted style={{ fontStyle: \"italic\" }}>\n e.g. {example}\n </Text>\n </Box>\n )}\n </Stack>\n {isCycle && (\n <Box marginTop={2}>\n <Text size={1} muted style={{ fontStyle: \"italic\" }}>\n See {convertCase(field.type, \"title\")} above.\n </Text>\n </Box>\n )}\n {hasSubfields && (\n <>\n <Card\n as=\"button\"\n padding={3}\n radius={2}\n sizing=\"border\"\n tone=\"transparent\"\n onClick={() => {\n setExpanded(!expanded);\n }}\n style={{ marginTop: 16, textAlign: \"left\", border: \"none\", cursor: \"pointer\" }}\n >\n <Flex align=\"center\" gap={2}>\n <Text size={0}>{expanded ? <ChevronDownIcon /> : <ChevronRightIcon />}</Text>\n <Text size={1} muted weight=\"medium\">\n {subfields.length} subfield{subfields.length === 1 ? \"\" : \"s\"}\n </Text>\n </Flex>\n </Card>\n {expanded && (\n <div\n style={{\n marginTop: 16,\n marginBottom: 8,\n paddingLeft: 16,\n borderLeft: \"1px solid var(--card-border-color)\",\n }}\n >\n <Stack gap={5}>\n {subfields.map((subfield) => (\n <Field key={subfield.name} field={subfield} ancestors={new Set([...ancestors, field.type])} />\n ))}\n </Stack>\n </div>\n )}\n </>\n )}\n </Stack>\n );\n}\n","import { Field } from \"@/components/field/field\";\nimport { contentSpacing } from \"@/config/layout\";\nimport { resolveDescription, resolveIcon, resolveTitle } from \"@/lib/display\";\nimport type { SanityHandbookDocumentRole } from \"@/plugin\";\n\n/**\n * Builds a section for each configured document role.\n *\n * @param roles - Document roles from the plugin configuration.\n * @returns One section per role, holding an entry per document type.\n */\nexport function documentTypesSections(roles: SanityHandbookDocumentRole[]) {\n return roles.map(({ title, documents }) => ({\n title,\n entries: documents.map((document) => ({\n id: document.name,\n title: resolveTitle(document),\n description: resolveDescription(document),\n icon: resolveIcon(document),\n render: () => (\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: contentSpacing.section }}>\n {document.fields.map((field) => (\n <Field key={field.name} field={field} />\n ))}\n </div>\n ),\n })),\n }));\n}\n","import type { ComponentProps } from \"react\";\n\nexport type LayoutGridIconProps = ComponentProps<\"svg\">;\n\nexport function LayoutGridIcon(props: LayoutGridIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={24}\n height={24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"14\" rx=\"1\" />\n </svg>\n );\n}\n","import { ChevronRightIcon } from \"@sanity/icons/ChevronRight\";\nimport { Box, Card, Flex, Stack, Text } from \"@sanity/ui\";\n\nimport { contentSpacing } from \"@/config/layout\";\nimport { useHandbookContext } from \"@/contexts/handbook\";\nimport { resolveDescription, resolveIcon, resolveTitle } from \"@/lib/display\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport function DocumentTypesOverview() {\n const { roles, setActiveTab, setSidebarExpanded } = useHandbookContext();\n\n return (\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: contentSpacing.section }}>\n {roles.map((role) => {\n const { title, description, documents } = role;\n\n return (\n <Stack key={title} gap={2}>\n <Stack gap={3}>\n <Flex align=\"center\" paddingY={1}>\n <Text size={1} weight=\"medium\">\n {title}\n </Text>\n </Flex>\n {isDefined(description) && (\n <Text size={1} muted>\n {description}\n </Text>\n )}\n </Stack>\n <Box marginTop={1}>\n <Stack gap={2}>\n {documents.map((document) => {\n const Icon = resolveIcon(document);\n const documentDescription = resolveDescription(document);\n\n return (\n <Card\n key={document.name}\n as=\"button\"\n padding={3}\n radius={2}\n sizing=\"border\"\n tone=\"inherit\"\n onClick={() => {\n setActiveTab(document.name);\n setSidebarExpanded(false);\n }}\n style={{\n width: \"calc(100% + 24px)\",\n marginLeft: \"-12px\",\n textAlign: \"left\",\n border: \"none\",\n cursor: \"pointer\",\n }}\n >\n <Flex align=\"center\" gap={3}>\n <Box flex={1}>\n <Stack gap={3}>\n <Flex align=\"center\" gap={2} style={{ marginLeft: \"-4px\" }}>\n {isDefined(Icon) && (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: 25,\n height: 25,\n color: \"var(--card-icon-color)\",\n }}\n >\n <Icon />\n </div>\n )}\n <Text size={1} weight=\"medium\">\n {resolveTitle(document)}\n </Text>\n </Flex>\n {isDefined(documentDescription) && (\n <Box paddingBottom={1}>\n <Text size={1} muted>\n {documentDescription}\n </Text>\n </Box>\n )}\n </Stack>\n </Box>\n <Box flex=\"none\" style={{ opacity: 0.5 }}>\n <Text muted size={1}>\n <ChevronRightIcon />\n </Text>\n </Box>\n </Flex>\n </Card>\n );\n })}\n </Stack>\n </Box>\n </Stack>\n );\n })}\n </div>\n );\n}\n","import { Flex, Stack, Text } from \"@sanity/ui\";\n\nimport { defaultIconProps } from \"@/config/defaults\";\nimport { hintKinds } from \"@/config/hints\";\nimport { contentSpacing } from \"@/config/layout\";\n\n/** What each hint kind signals to an editor, shown as a legend alongside its icon. */\nconst hintDescriptions = {\n tip: \"Helpful tips and best practices for content editors.\",\n info: \"Additional context about how the field is used.\",\n caution: \"Important warnings about constraints or potential issues.\",\n} satisfies Record<(typeof hintKinds)[number][\"name\"], string>;\n\nexport function HowToUse() {\n return (\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: contentSpacing.section }}>\n <Stack gap={3}>\n <Flex align=\"center\" paddingY={1}>\n <Text size={1} weight=\"medium\">\n Navigating the Handbook\n </Text>\n </Flex>\n <Text size={1} muted>\n The sidebar lists everything the Handbook holds: these introductory pages, then the document types you can\n create, grouped by the role they play on the site, and finally any guides your team has written. Selecting an\n entry opens it here.\n </Text>\n </Stack>\n <Stack gap={3}>\n <Flex align=\"center\" paddingY={1}>\n <Text size={1} weight=\"medium\">\n Understanding Fields\n </Text>\n </Flex>\n <Text size={1} muted>\n Selecting a document type lists its fields, each showing its name, the kind of value it holds, and what the\n field is for. The documentation is generated from the content model, so what you read always matches what you\n see while editing.\n </Text>\n </Stack>\n <Stack gap={3}>\n <Flex align=\"center\" paddingY={1}>\n <Text size={1} weight=\"medium\">\n Hints and Warnings\n </Text>\n </Flex>\n <Text size={1} muted>\n Icons beside a field name carry the guidance that would crowd its description if written into it. Hover or\n click one to read what it says, and use the key below to tell the three kinds apart.\n </Text>\n <Stack gap={3} marginTop={2}>\n {hintKinds.map(({ name, icon: Icon }) => (\n <Flex key={name} align=\"center\" gap={3}>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n flexShrink: 0,\n fontSize: \"16px\",\n color: \"var(--card-icon-color)\",\n }}\n >\n <Icon {...defaultIconProps} />\n </div>\n <Text size={1} muted>\n {hintDescriptions[name]}\n </Text>\n </Flex>\n ))}\n </Stack>\n </Stack>\n <Stack gap={3}>\n <Flex align=\"center\" paddingY={1}>\n <Text size={1} weight=\"medium\">\n Nested Fields\n </Text>\n </Flex>\n <Text size={1} muted>\n Some fields hold subfields of their own, such as a content block pairing a heading with body text. A control\n beneath the description counts them and expands to show each one, documented exactly as a top-level field is.\n </Text>\n </Stack>\n <Stack gap={3}>\n <Flex align=\"center\" paddingY={1}>\n <Text size={1} weight=\"medium\">\n Guides\n </Text>\n </Flex>\n <Text size={1} muted>\n Beneath the document types you may find guides, written by your team rather than generated from the content\n model. They carry what a field description cannot: house style, editorial process, and how all the pieces fit\n together.\n </Text>\n </Stack>\n </div>\n );\n}\n","import { BookTextIcon } from \"@/icons/book-text\";\nimport { LayoutGridIcon } from \"@/icons/layout-grid\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport { DocumentTypesOverview } from \"@/pages/document-types-overview\";\nimport { HowToUse } from \"@/pages/how-to-use\";\n\n/**\n * Builds the section holding the plugin's own introductory pages.\n *\n * @returns A single section listing the built-in pages, in the order they are shown.\n */\nexport function gettingStartedSections() {\n return [\n {\n title: \"Getting Started\",\n entries: [\n {\n id: \"how-to-use-this-handbook\",\n title: \"How to use the Handbook\",\n description:\n \"A guide to navigating the Handbook, reading the documentation for each field, and making sense of its examples, hints, and nested structure.\",\n icon: createSanityIcon(BookTextIcon),\n render: () => <HowToUse />,\n },\n {\n id: \"document-types\",\n title: \"Document Types\",\n description:\n \"An overview of all document types, organised by role. Select a document type to view its fields, descriptions, and examples.\",\n icon: createSanityIcon(LayoutGridIcon),\n render: () => <DocumentTypesOverview />,\n },\n ],\n },\n ];\n}\n","import type { ComponentProps } from \"react\";\n\nexport type PortableLinkProps = ComponentProps<\"a\">;\n\nexport function PortableLink({ children, style, ...props }: PortableLinkProps) {\n return (\n <a target=\"_blank\" rel=\"noopener noreferrer\" style={{ color: \"var(--card-link-fg-color)\", ...style }} {...props}>\n {children}\n </a>\n );\n}\n","import { PortableText } from \"@portabletext/react\";\nimport type { PortableTextComponents, PortableTextMarkComponentProps } from \"@portabletext/react\";\nimport type { ComponentProps } from \"react\";\n\nimport { CalloutContent } from \"@/blocks/callout/content\";\nimport { PortableCode } from \"@/components/content/portable/code\";\nimport { PortableLink } from \"@/components/content/portable/link\";\nimport { contentSpacing } from \"@/config/layout\";\nimport type { SanityHandbookLink } from \"@/schemas/annotations/link\";\nimport type { SanityHandbookCallout } from \"@/schemas/blocks/callout\";\n\nexport type CalloutBlockProps = Omit<ComponentProps<typeof CalloutContent>, \"variant\" | \"children\"> & {\n value: SanityHandbookCallout;\n};\n\n/** Overrides for a callout body, which takes the card's own text styling and leaves paragraphs unwrapped. */\nconst components: PortableTextComponents = {\n block: { normal: ({ children }) => <>{children}</> },\n marks: {\n code: ({ children }) => <PortableCode>{children}</PortableCode>,\n link: ({ children, value }: PortableTextMarkComponentProps<SanityHandbookLink>) => (\n <PortableLink href={value?.href}>{children}</PortableLink>\n ),\n },\n};\n\nexport function CalloutBlock({ value, style, ...props }: CalloutBlockProps) {\n return (\n <CalloutContent variant={value.variant} style={{ marginBlock: contentSpacing.callout, ...style }} {...props}>\n <PortableText value={value.body} components={components} />\n </CalloutContent>\n );\n}\n","import type { ComponentProps } from \"react\";\n\nimport { CodeContent } from \"@/blocks/code/content\";\nimport { contentSpacing } from \"@/config/layout\";\nimport { isDefined } from \"@/lib/utils\";\nimport type { SanityHandbookCode } from \"@/schemas/blocks/code\";\n\nexport type CodeBlockProps = Omit<ComponentProps<typeof CodeContent>, \"code\" | \"language\"> & {\n value: SanityHandbookCode;\n};\n\nexport function CodeBlock({ value, style, ...props }: CodeBlockProps) {\n if (!isDefined(value.code)) return null;\n\n return (\n <CodeContent\n code={value.code}\n language={value.language}\n style={{ marginBlock: contentSpacing.media, ...style }}\n {...props}\n />\n );\n}\n","import type { ComponentProps } from \"react\";\n\nimport { HorizontalRuleContent } from \"@/blocks/horizontal-rule/content\";\nimport { contentSpacing } from \"@/config/layout\";\nimport type { SanityHandbookHorizontalRule } from \"@/schemas/blocks/horizontal-rule\";\n\nexport type HorizontalRuleBlockProps = ComponentProps<typeof HorizontalRuleContent> & {\n value: SanityHandbookHorizontalRule;\n};\n\nexport function HorizontalRuleBlock({ value: _value, style, ...props }: HorizontalRuleBlockProps) {\n return <HorizontalRuleContent style={{ marginBlock: contentSpacing.rule, ...style }} {...props} />;\n}\n","import type { ComponentProps } from \"react\";\n\nimport { ImageContent } from \"@/blocks/image/content\";\nimport { contentSpacing } from \"@/config/layout\";\nimport { isDefined } from \"@/lib/utils\";\nimport type { SanityHandbookImage } from \"@/schemas/blocks/image\";\n\nexport type ImageBlockProps = Omit<ComponentProps<typeof ImageContent>, \"url\" | \"alt\" | \"caption\"> & {\n value: SanityHandbookImage;\n};\n\nexport function ImageBlock({ value, style, ...props }: ImageBlockProps) {\n if (!isDefined(value.asset?.url)) return null;\n\n return (\n <ImageContent\n url={value.asset.url}\n alt={value.alt}\n caption={value.caption}\n style={{ marginBlock: contentSpacing.media, ...style }}\n {...props}\n />\n );\n}\n","import type { ComponentProps } from \"react\";\n\nimport { VideoContent } from \"@/blocks/video/content\";\nimport { contentSpacing } from \"@/config/layout\";\nimport { isDefined } from \"@/lib/utils\";\nimport type { SanityHandbookVideo } from \"@/schemas/blocks/video\";\n\nexport type VideoBlockProps = Omit<ComponentProps<typeof VideoContent>, \"url\" | \"caption\"> & {\n value: SanityHandbookVideo;\n};\n\nexport function VideoBlock({ value, style, ...props }: VideoBlockProps) {\n if (!isDefined(value.asset?.url)) return null;\n\n return (\n <VideoContent\n url={value.asset.url}\n caption={value.caption}\n style={{ marginBlock: contentSpacing.media, ...style }}\n {...props}\n />\n );\n}\n","import type { CSSProperties, ComponentProps } from \"react\";\n\n// `ref` is dropped because the element rendered varies, so a ref typed to either list element would be wrong.\nexport type PortableListProps = Omit<ComponentProps<\"ul\">, \"ref\"> & {\n ordered?: boolean;\n};\n\nexport function PortableList({ ordered = false, style, ...props }: PortableListProps) {\n const listStyle: CSSProperties = {\n display: \"flex\",\n flexDirection: \"column\",\n gap: 6,\n margin: 0,\n paddingLeft: \"1.25em\",\n ...style,\n };\n\n if (ordered) return <ol style={listStyle} {...props} />;\n\n return <ul style={listStyle} {...props} />;\n}\n","import { PortableText as PortableTextReact } from \"@portabletext/react\";\nimport type {\n PortableTextComponentProps,\n PortableTextComponents,\n PortableTextMarkComponentProps,\n PortableTextTypeComponent,\n PortableTextTypeComponentProps,\n} from \"@portabletext/react\";\nimport type { ComponentProps, ComponentType } from \"react\";\nimport type { PortableTextBlock, PortableTextListBlock, PortableTextObject } from \"sanity\";\n\nimport { CalloutBlock } from \"@/blocks/callout/block\";\nimport { CodeBlock } from \"@/blocks/code/block\";\nimport { HorizontalRuleBlock } from \"@/blocks/horizontal-rule/block\";\nimport { ImageBlock } from \"@/blocks/image/block\";\nimport { VideoBlock } from \"@/blocks/video/block\";\nimport { PortableBlockquote } from \"@/components/content/portable/blockquote\";\nimport { PortableCode } from \"@/components/content/portable/code\";\nimport { PortableHeading } from \"@/components/content/portable/heading\";\nimport { PortableLink } from \"@/components/content/portable/link\";\nimport { PortableList } from \"@/components/content/portable/list\";\nimport { PortableParagraph } from \"@/components/content/portable/paragraph\";\nimport { contentSpacing } from \"@/config/layout\";\nimport { useHandbookContext } from \"@/contexts/handbook\";\nimport type { SanityHandbookLink } from \"@/schemas/annotations/link\";\nimport { calloutTypeName } from \"@/schemas/blocks/callout\";\nimport { codeTypeName } from \"@/schemas/blocks/code\";\nimport { horizontalRuleTypeName } from \"@/schemas/blocks/horizontal-rule\";\nimport { imageTypeName } from \"@/schemas/blocks/image\";\nimport { videoTypeName } from \"@/schemas/blocks/video\";\nimport type { SanityKeyedArray } from \"@/types\";\n\n/**\n * Resolves the space around a list, which tightens once the list is nested inside another.\n *\n * @param level - Nesting depth of the list, counted from one.\n * @returns The vertical space in pixels.\n */\nfunction listSpacing(level: number) {\n return level > 1 ? contentSpacing.nestedList : contentSpacing.list;\n}\n\n/**\n * Component rendered for each block style, mark, and embedded type a guide's rich text can hold.\n * The marks and list items left out are deliberate — the library's own defaults already render them\n * as the surrounding text.\n */\nconst components: PortableTextComponents = {\n block: {\n h2: ({ children }) => (\n <PortableHeading style={{ marginBlockStart: contentSpacing.heading, marginBlockEnd: 4 }}>\n {children}\n </PortableHeading>\n ),\n normal: ({ children }) => (\n <PortableParagraph muted style={{ marginBlock: contentSpacing.paragraph }}>\n {children}\n </PortableParagraph>\n ),\n blockquote: ({ children }) => (\n <PortableBlockquote muted style={{ marginBlock: contentSpacing.blockquote }}>\n {children}\n </PortableBlockquote>\n ),\n },\n list: {\n bullet: ({ children, value }: PortableTextComponentProps<PortableTextListBlock>) => (\n <PortableParagraph muted style={{ marginBlock: listSpacing(value.level) }}>\n <PortableList>{children}</PortableList>\n </PortableParagraph>\n ),\n number: ({ children, value }: PortableTextComponentProps<PortableTextListBlock>) => (\n <PortableParagraph muted style={{ marginBlock: listSpacing(value.level) }}>\n <PortableList ordered>{children}</PortableList>\n </PortableParagraph>\n ),\n },\n marks: {\n code: ({ children }) => <PortableCode>{children}</PortableCode>,\n link: ({ children, value }: PortableTextMarkComponentProps<SanityHandbookLink>) => (\n <PortableLink href={value?.href}>{children}</PortableLink>\n ),\n },\n};\n\n/**\n * Adapts a block component to what Portable Text renders an embedded type with, narrowing the props\n * to the block's own value. The rendering props the library also passes would otherwise reach the DOM.\n *\n * @param Component - Component rendering the block.\n * @returns A component Portable Text can render the type with.\n */\nfunction blockRenderer<Value extends PortableTextObject>(Component: ComponentType<{ value: Value }>) {\n return function Block({ value }: PortableTextTypeComponentProps<Value>) {\n return <Component value={value} />;\n };\n}\n\nexport type PortableTextProps = ComponentProps<\"div\"> & {\n value: SanityKeyedArray<PortableTextBlock>;\n};\n\nexport function PortableText({ value, ...props }: PortableTextProps) {\n const { blocks } = useHandbookContext();\n\n const types: Record<string, PortableTextTypeComponent> = {\n [imageTypeName]: blockRenderer(ImageBlock),\n [videoTypeName]: blockRenderer(VideoBlock),\n [codeTypeName]: blockRenderer(CodeBlock),\n [calloutTypeName]: blockRenderer(CalloutBlock),\n [horizontalRuleTypeName]: blockRenderer(HorizontalRuleBlock),\n };\n for (const block of blocks) types[block.schema.name] = blockRenderer(block.component);\n\n return (\n <div {...props}>\n <PortableTextReact value={value} components={{ ...components, types }} />\n </div>\n );\n}\n","import { PortableText } from \"@/components/content/portable-text\";\nimport { BookOpenTextIcon } from \"@/icons/book-open-text\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport type { SanityHandbook } from \"@/schemas/types/handbook\";\n\n/**\n * Builds a section for each guide group authored in the dataset.\n *\n * @param handbook - Handbook singleton holding the authored guide groups.\n * @returns One section per group, holding an entry per guide.\n */\nexport function guidesSections(handbook: SanityHandbook) {\n return handbook.groups.map(({ title, guides }) => ({\n title,\n entries: guides.map((guide) => ({\n id: guide._key,\n title: guide.title,\n description: guide.description,\n icon: createSanityIcon(BookOpenTextIcon),\n render: () => <PortableText value={guide.content} />,\n })),\n }));\n}\n","import type { ComponentType, ReactNode } from \"react\";\n\nimport { useHandbookContext } from \"@/contexts/handbook\";\nimport { isDefined } from \"@/lib/utils\";\nimport { documentTypesSections } from \"@/sections/document-types\";\nimport { gettingStartedSections } from \"@/sections/getting-started\";\nimport { guidesSections } from \"@/sections/guides\";\n\n/** A selectable page, pairing its sidebar row with the panel that row opens. */\nexport interface Entry {\n /** Identifier shared by the sidebar row and its panel. */\n id: string;\n /** Label shown in the sidebar and as the panel heading. */\n title: string;\n /** Description shown beneath the panel heading. */\n description?: string;\n /** Icon component shown beside the sidebar label. */\n icon?: ComponentType;\n /** Builds the panel's content, called only while the entry is active. */\n render: () => ReactNode;\n}\n\n/** A titled run of entries, drawn as a sidebar heading and the rows beneath it. */\nexport interface Section {\n /** Text shown above the entries it introduces. */\n title: string;\n /** Entries belonging to the section. */\n entries: Entry[];\n}\n\n/**\n * Composes every page the Handbook shows, in sidebar order.\n *\n * @returns Sections from the built-in pages, the configured document roles, and the authored guides.\n */\nexport function useSections(): Section[] {\n const { roles, handbook, loading } = useHandbookContext();\n\n return [\n ...gettingStartedSections(),\n ...documentTypesSections(roles),\n ...(loading || !isDefined(handbook) ? [] : guidesSections(handbook)),\n ];\n}\n","import type { ComponentProps } from \"react\";\nimport { Pane } from \"sanity/structure\";\n\nimport { ContentPanel } from \"@/components/content-panel\";\nimport { contentFlex, contentMinimumWidth } from \"@/config/layout\";\nimport { useHandbookContext } from \"@/contexts/handbook\";\nimport { useSections } from \"@/hooks/use-sections\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport type ContentProps = Omit<ComponentProps<typeof Pane>, \"id\">;\n\nexport function Content(props: ContentProps) {\n const { activeTab } = useHandbookContext();\n const sections = useSections();\n\n const entry = sections.flatMap((section) => section.entries).find(({ id }) => id === activeTab);\n\n return (\n <Pane id=\"handbook-content\" flex={contentFlex} minWidth={contentMinimumWidth} {...props}>\n {isDefined(entry) && (\n <ContentPanel id={entry.id} title={entry.title} description={entry.description}>\n {entry.render()}\n </ContentPanel>\n )}\n </Pane>\n );\n}\n","import { Box, Card, Text } from \"@sanity/ui\";\nimport type { ComponentProps } from \"react\";\n\nexport type SidebarHeadingProps = ComponentProps<typeof Box> & {\n title: string;\n};\n\nexport function SidebarHeading({ title, ...props }: SidebarHeadingProps) {\n return (\n <Box paddingY={2} {...props}>\n <Card padding={2}>\n <Text size={1} muted textOverflow=\"ellipsis\" weight=\"semibold\" style={{ cursor: \"default\", outline: \"none\" }}>\n {title}\n </Text>\n </Card>\n </Box>\n );\n}\n","import { ChevronRightIcon } from \"@sanity/icons/ChevronRight\";\nimport { Box, Text } from \"@sanity/ui\";\nimport type { CSSProperties, ComponentProps, ComponentType } from \"react\";\nimport { PreviewCard, SanityDefaultPreview } from \"sanity\";\n\nimport { useHandbookContext } from \"@/contexts/handbook\";\n\nexport type SidebarTabProps = Omit<ComponentProps<typeof PreviewCard>, \"as\" | \"id\" | \"style\"> & {\n id: string;\n label: string;\n icon?: ComponentType;\n style?: CSSProperties;\n};\n\nexport function SidebarTab({ id, label, icon: Icon, style, ...props }: SidebarTabProps) {\n const { activeTab, setActiveTab, setSidebarExpanded } = useHandbookContext();\n const selected = activeTab === id;\n\n return (\n <PreviewCard\n id={id}\n as=\"button\"\n data-as=\"button\"\n selected={selected}\n marginBottom={1}\n radius={2}\n sizing=\"border\"\n tabIndex={-1}\n tone=\"inherit\"\n onClick={() => {\n setActiveTab(id);\n setSidebarExpanded(false);\n }}\n style={{ cursor: \"pointer\", ...style }}\n aria-controls={`panel-${id}`}\n __unstable_focusRing\n {...props}\n >\n <SanityDefaultPreview\n status={\n <Box style={{ opacity: 0.5 }}>\n <Text muted size={1}>\n <ChevronRightIcon />\n </Text>\n </Box>\n }\n icon={Icon}\n layout=\"compact\"\n title={label}\n />\n </PreviewCard>\n );\n}\n","import type { ComponentProps, ComponentType } from \"react\";\nimport { CommandList } from \"sanity\";\nimport { Pane, PaneContent } from \"sanity/structure\";\n\nimport { PaneHeader } from \"@/components/pane-header\";\nimport { SidebarHeading } from \"@/components/sidebar/heading\";\nimport { SidebarTab } from \"@/components/sidebar/tab\";\nimport { sidebarItemHeight, sidebarMaximumWidth, sidebarMinimumWidth, sidebarWidth } from \"@/config/layout\";\nimport { useHandbookContext } from \"@/contexts/handbook\";\nimport { useSections } from \"@/hooks/use-sections\";\n\n/** A non-selectable heading introducing the run of sidebar tabs beneath it. */\ninterface SidebarHeadingItem {\n /** Marks this entry as a heading rather than a tab. */\n type: \"heading\";\n /** Text shown above the tabs it introduces. */\n title: string;\n}\n\n/** A selectable sidebar row bound to a content panel of the same identifier. */\ninterface SidebarTabItem {\n /** Marks this entry as a tab rather than a heading. */\n type: \"tab\";\n /** Identifier shared with the content panel the tab selects. */\n id: string;\n /** Display label in the sidebar. */\n label: string;\n /** Icon component shown beside the label. */\n icon?: ComponentType;\n}\n\n/** An entry in the flat list the sidebar renders. */\ntype SidebarItem = SidebarHeadingItem | SidebarTabItem;\n\nexport type SidebarProps = Omit<ComponentProps<typeof Pane>, \"id\">;\n\nexport function Sidebar(props: SidebarProps) {\n const { sidebarTitle } = useHandbookContext();\n const sections = useSections();\n\n const items = sections.flatMap(({ title, entries }): SidebarItem[] => [\n { type: \"heading\", title },\n ...entries.map((entry): SidebarItem => ({ type: \"tab\", id: entry.id, label: entry.title, icon: entry.icon })),\n ]);\n\n function getItemDisabled(virtualIndex: number) {\n return items[virtualIndex]?.type === \"heading\";\n }\n\n return (\n <Pane\n id=\"handbook-sidebar\"\n currentMaxWidth={sidebarWidth}\n minWidth={sidebarMinimumWidth}\n maxWidth={sidebarMaximumWidth}\n {...props}\n >\n <PaneHeader title={sidebarTitle} />\n <PaneContent overflow=\"auto\">\n <CommandList\n activeItemDataAttr=\"data-hovered\"\n ariaLabel={sidebarTitle}\n canReceiveFocus\n getItemDisabled={getItemDisabled}\n itemHeight={sidebarItemHeight}\n items={items}\n onlyShowSelectionWhenActive\n paddingBottom={1}\n paddingX={3}\n // `CommandList` clones what this returns to set `tabIndex`, so a wrapper component would swallow it.\n renderItem={(item: SidebarItem) =>\n item.type === \"heading\" ? (\n <SidebarHeading title={item.title} />\n ) : (\n <SidebarTab id={item.id} label={item.label} icon={item.icon} />\n )\n }\n wrapAround={false}\n />\n </PaneContent>\n </Pane>\n );\n}\n","import { useContext } from \"react\";\nimport { PaneLayoutContext } from \"sanity/_singletons\";\n\nimport { useHandbookContext } from \"@/contexts/handbook\";\nimport { Content } from \"@/layouts/content\";\nimport { Sidebar } from \"@/layouts/sidebar\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport function Panes() {\n const { activeTab, sidebarExpanded } = useHandbookContext();\n const paneLayout = useContext(PaneLayoutContext);\n\n const hasContent = isDefined(activeTab);\n\n if (paneLayout?.collapsed === true) {\n return sidebarExpanded || !hasContent ? <Sidebar /> : <Content />;\n }\n\n return (\n <>\n <Sidebar />\n {hasContent && <Content />}\n </>\n );\n}\n","import { useTheme_v2 } from \"@sanity/ui\";\nimport { useState } from \"react\";\nimport type { Tool } from \"sanity\";\nimport { PaneLayout } from \"sanity/structure\";\n\nimport { toolMinimumWidth } from \"@/config/layout\";\nimport { HandbookProvider } from \"@/contexts/handbook\";\nimport type { HandbookProviderConfig } from \"@/contexts/handbook\";\nimport { Panes } from \"@/layouts/panes\";\nimport { isDefined } from \"@/lib/utils\";\n\nexport interface HandbookToolProps {\n tool: Tool<HandbookProviderConfig>;\n}\n\nexport function HandbookTool({ tool: { options } }: HandbookToolProps) {\n const { media } = useTheme_v2();\n const [layoutCollapsed, setLayoutCollapsed] = useState(false);\n\n function handleCollapse() {\n setLayoutCollapsed(true);\n }\n\n function handleExpand() {\n setLayoutCollapsed(false);\n }\n\n if (!isDefined(options)) return null;\n\n return (\n <HandbookProvider {...options}>\n <PaneLayout\n flex={1}\n height={layoutCollapsed ? undefined : \"fill\"}\n minWidth={media[1]}\n onCollapse={handleCollapse}\n onExpand={handleExpand}\n style={{ minHeight: \"100%\", minWidth: `${toolMinimumWidth}px` }}\n >\n <Panes />\n </PaneLayout>\n </HandbookProvider>\n );\n}\n","import { isDefined } from \"@/lib/utils\";\n\n/** Editors the plugin was configured with, so the Structure helper need not be handed them a second time. */\nlet configuredEditors: string[] | undefined = undefined;\n\n/**\n * Records the editors a plugin instance was configured with. A Studio running more than one workspace\n * keeps only the list from the workspace configured last, so those cases pass the list explicitly.\n *\n * @param editors - Email addresses permitted to edit Handbook documents.\n */\nexport function setConfiguredEditors(editors: string[] | undefined) {\n configuredEditors = editors;\n}\n\n/**\n * Checks whether an email address is permitted to edit, treating an absent list as unrestricted access.\n *\n * @param editors - Email addresses permitted to edit, defaulting to the configured list.\n * @param email - The email address to check.\n * @returns Whether the email is permitted to edit.\n */\nexport function isPermittedEditor(editors: string[] | undefined, email: string | undefined) {\n const permitted = editors ?? configuredEditors;\n\n if (!isDefined(permitted)) return true;\n if (!isDefined(email)) return false;\n\n return permitted.includes(email);\n}\n","import type { ComponentType } from \"react\";\nimport { definePlugin } from \"sanity\";\nimport type { DocumentDefinition, PortableTextObject, SchemaTypeDefinition } from \"sanity\";\n\nimport { defaultTitle, defaultUndocumentedFieldMessage } from \"@/config/defaults\";\nimport { documentTypes, singletonTypes } from \"@/config/documents\";\nimport type { HandbookProviderConfig } from \"@/contexts/handbook\";\nimport { BookTextIcon } from \"@/icons/book-text\";\nimport { HandbookTool } from \"@/layouts/tool\";\nimport { isPermittedEditor, setConfiguredEditors } from \"@/lib/editors\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport { calloutType } from \"@/schemas/blocks/callout\";\nimport { codeType } from \"@/schemas/blocks/code\";\nimport { horizontalRuleType } from \"@/schemas/blocks/horizontal-rule\";\nimport { imageType } from \"@/schemas/blocks/image\";\nimport { videoType } from \"@/schemas/blocks/video\";\nimport { createGuideType } from \"@/schemas/types/guide\";\nimport { handbookType } from \"@/schemas/types/handbook\";\n\ndeclare module \"@sanity/types\" {\n interface FieldDefinitionBase {\n handbook?: SanityHandbookMetadata;\n }\n\n // oxlint-disable-next-line no-shadow -- Module augmentation intentionally redeclares the imported type.\n interface DocumentDefinition {\n handbook?: SanityHandbookMetadata;\n }\n}\n\n/**\n * Documentation a schema author attaches to a field or document, shown wherever the Handbook renders it.\n *\n * @public\n */\nexport interface SanityHandbookMetadata {\n /** Display title override for the field or document. */\n title?: string;\n /** Description shown beneath the field or document heading. */\n description?: string;\n /** Illustrative example value for the field. */\n example?: string;\n /** Helpful tip displayed as a popover hint. */\n tip?: string;\n /** Informational note displayed as a popover hint. */\n info?: string;\n /** Warning displayed as a popover hint. */\n caution?: string;\n}\n\n/**\n * A named part a set of document types plays in the content model, shown as one sidebar section.\n *\n * @public\n */\nexport interface SanityHandbookDocumentRole {\n /** Display title for the document role. */\n title: string;\n /** Brief description of the role's purpose. */\n description?: string;\n /** Document definitions filling this role. */\n documents: DocumentDefinition[];\n}\n\n/**\n * A Portable Text block a consumer adds to guide content, pairing its schema with how it renders.\n *\n * @public\n */\nexport interface SanityHandbookBlockDefinition {\n /** Sanity schema type definition for the custom block. */\n schema: SchemaTypeDefinition;\n /** React component for rendering the block in the Handbook viewer. */\n component: ComponentType<{ value: PortableTextObject }>;\n}\n\n/**\n * Everything the plugin accepts, of which only the document roles are required.\n *\n * @public\n */\nexport interface SanityHandbookConfig {\n /** Title shown in the Studio tool navigation. */\n title?: string;\n /** Heading displayed at the top of the sidebar. */\n sidebarTitle?: string;\n /** Document roles, each shown as a labelled section in the sidebar. */\n roles: SanityHandbookDocumentRole[];\n /** Custom Portable Text block definitions for guide content. */\n blocks?: SanityHandbookBlockDefinition[];\n /** Email addresses permitted to edit Handbook documents. */\n editors?: string[];\n /** Fallback message shown when a field has no description. */\n undocumentedFieldMessage?: string;\n}\n\n/**\n * Creates a Handbook tool for Sanity Studio, generating documentation from document type schemas\n * alongside the Portable Text guides authored in the dataset.\n *\n * @param config - Plugin configuration.\n * @returns Sanity plugin definition.\n * @public\n */\nexport const handbookPlugin = definePlugin<SanityHandbookConfig>((config) => {\n const { title, sidebarTitle, roles, blocks, editors, undocumentedFieldMessage } = config;\n\n setConfiguredEditors(editors);\n\n const resolved: HandbookProviderConfig = {\n sidebarTitle: sidebarTitle ?? defaultTitle,\n roles,\n blocks: blocks ?? [],\n undocumentedFieldMessage: undocumentedFieldMessage ?? defaultUndocumentedFieldMessage,\n };\n\n const guideType = createGuideType(resolved.blocks);\n\n return {\n name: \"@driftime/sanity-plugin-handbook\",\n schema: {\n types: [\n handbookType,\n guideType,\n imageType,\n videoType,\n codeType,\n calloutType,\n horizontalRuleType,\n ...resolved.blocks.map((block) => block.schema),\n ],\n },\n document: {\n newDocumentOptions: (templateItems, { creationContext, currentUser }) => {\n if (creationContext.type !== \"global\" && creationContext.type !== \"structure\") {\n return templateItems;\n }\n\n const hiddenTypes = isPermittedEditor(editors, currentUser?.email) ? singletonTypes : documentTypes;\n\n return templateItems.filter(\n ({ templateId }) =>\n ![...hiddenTypes].some((type) => templateId === type || templateId.startsWith(`${type}-`)),\n );\n },\n actions: (actionComponents, { schemaType }) => {\n if (singletonTypes.has(schemaType)) {\n return actionComponents.filter(({ action }) => ![\"delete\", \"duplicate\", \"unpublish\"].includes(action ?? \"\"));\n }\n\n return actionComponents;\n },\n },\n tools: [\n {\n name: \"handbook\",\n title: title ?? defaultTitle,\n icon: createSanityIcon(BookTextIcon),\n component: HandbookTool,\n options: resolved,\n },\n ],\n };\n});\n","import type { CurrentUser } from \"sanity\";\nimport type { StructureBuilder } from \"sanity/structure\";\n\nimport { BookOpenTextIcon } from \"@/icons/book-open-text\";\nimport { BookTextIcon } from \"@/icons/book-text\";\nimport { isPermittedEditor } from \"@/lib/editors\";\nimport { createSanityIcon } from \"@/lib/icons\";\nimport { guideTypeName } from \"@/schemas/types/guide\";\nimport { handbookTypeName } from \"@/schemas/types/handbook\";\n\n/**\n * Creates the Structure tool items for Handbook documents, yielding nothing when the current user is\n * not permitted to edit them.\n *\n * @param structureBuilder - The Sanity Structure builder instance.\n * @param context - The Structure context carrying the current user.\n * @param editors - Email addresses permitted to edit, defaulting to the configured list.\n * @returns The list items for the Handbook singleton and the guides list.\n * @public\n */\nexport function handbookStructure(\n structureBuilder: StructureBuilder,\n context: { currentUser: CurrentUser | null },\n editors?: string[],\n) {\n if (!isPermittedEditor(editors, context.currentUser?.email)) return [];\n\n const { listItem, document, documentTypeList } = structureBuilder;\n\n return [\n listItem()\n .title(\"Handbook\")\n .icon(createSanityIcon(BookTextIcon))\n .child(document().id(handbookTypeName).schemaType(handbookTypeName).title(\"Handbook\")),\n listItem()\n .title(\"Handbook Guides\")\n .icon(createSanityIcon(BookOpenTextIcon))\n .child(documentTypeList(guideTypeName).title(\"Handbook Guides\")),\n ];\n}\n","import { useCurrentUser } from \"sanity\";\n\nimport { isPermittedEditor } from \"@/lib/editors\";\n\n/**\n * Checks whether the current user is permitted to edit Handbook content, treating an absent list as\n * unrestricted access.\n *\n * @param editors - Email addresses permitted to edit, defaulting to the configured list.\n * @returns Whether the current user can edit Handbook documents.\n * @public\n */\nexport function useIsHandbookEditor(editors?: string[]) {\n const user = useCurrentUser();\n\n return isPermittedEditor(editors, user?.email);\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAaI,mBAA0C;CAAEC,OAAO;CAAOC,QAAQ;CAAOC,aAAa;AAAI;ACTvG,SAAOG,iBAAAC,OAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GAAAC,IAAAC,IAAAC,IAAAC,IAAAC,IAAAC;CAAA,AAAAP,EAAA,OAAAQ,OAAAC,IAAA,2BAAA,KAcDP,KAAA,oBAAA,QAAA,EAAQ,GAAA,WAAU,CAAA,GAClBC,KAAA,oBAAA,QAAA,EAAQ,GAAA,WAAU,CAAA,GAClBC,KAAA,oBAAA,QAAA,EAAQ,GAAA,UAAS,CAAA,GACjBC,KAAA,oBAAA,QAAA,EAAQ,GAAA,qIAAoI,CAAA,GAC5IC,KAAA,oBAAA,QAAA,EAAQ,GAAA,UAAS,CAAA,GACjB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