@djangocfg/ui-tools 2.1.310 → 2.1.313
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/README.md +38 -22
- package/dist/{DocsLayout-W5JLRNSZ.mjs → DocsLayout-ESVQZO3V.mjs} +3 -3
- package/dist/{DocsLayout-W5JLRNSZ.mjs.map → DocsLayout-ESVQZO3V.mjs.map} +1 -1
- package/dist/{DocsLayout-ZXD2CUOH.cjs → DocsLayout-KUPDWJ3G.cjs} +48 -48
- package/dist/{DocsLayout-ZXD2CUOH.cjs.map → DocsLayout-KUPDWJ3G.cjs.map} +1 -1
- package/dist/Player-M3GC3VPE.mjs +4 -0
- package/dist/Player-M3GC3VPE.mjs.map +1 -0
- package/dist/Player-ZGQKKOWI.css +65 -0
- package/dist/Player-ZGQKKOWI.css.map +1 -0
- package/dist/Player-ZL2X5LGG.cjs +13 -0
- package/dist/Player-ZL2X5LGG.cjs.map +1 -0
- package/dist/{chunk-CXVGN6ZW.cjs → chunk-DFTVB66S.cjs} +7 -6
- package/dist/chunk-DFTVB66S.cjs.map +1 -0
- package/dist/{chunk-2QY3LJR6.mjs → chunk-EUADAUBQ.mjs} +5 -4
- package/dist/chunk-EUADAUBQ.mjs.map +1 -0
- package/dist/chunk-FX2QFYWF.mjs +2059 -0
- package/dist/chunk-FX2QFYWF.mjs.map +1 -0
- package/dist/{chunk-6HNAPVZ2.mjs → chunk-GBLQTHWT.mjs} +11 -13
- package/dist/chunk-GBLQTHWT.mjs.map +1 -0
- package/dist/{chunk-FYLR232K.cjs → chunk-S44PW6NK.cjs} +11 -13
- package/dist/chunk-S44PW6NK.cjs.map +1 -0
- package/dist/chunk-ZLQHUZDU.cjs +2061 -0
- package/dist/chunk-ZLQHUZDU.cjs.map +1 -0
- package/dist/components-WYEZL5TE.cjs +26 -0
- package/dist/{components-3RTH76CV.cjs.map → components-WYEZL5TE.cjs.map} +1 -1
- package/dist/components-ZAGG2PBO.mjs +5 -0
- package/dist/{components-5GVVL2Q6.mjs.map → components-ZAGG2PBO.mjs.map} +1 -1
- package/dist/index.cjs +36 -220
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +65 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +44 -500
- package/dist/index.d.ts +44 -500
- package/dist/index.mjs +16 -62
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/components/markdown/MarkdownMessage/ActionRow.tsx +48 -0
- package/src/components/markdown/MarkdownMessage/ChatMessageRow.tsx +97 -0
- package/src/components/markdown/MarkdownMessage/CodeBlock.tsx +9 -13
- package/src/components/markdown/MarkdownMessage/MarkdownMessage.story.tsx +77 -2
- package/src/components/markdown/MarkdownMessage/MarkdownMessage.tsx +2 -3
- package/src/components/markdown/MarkdownMessage/README.md +72 -0
- package/src/components/markdown/MarkdownMessage/components.tsx +3 -3
- package/src/components/markdown/MarkdownMessage/index.ts +6 -0
- package/src/index.ts +2 -11
- package/src/tools/AudioPlayer/AudioPlayer.story.tsx +454 -107
- package/src/tools/AudioPlayer/Player.tsx +80 -0
- package/src/tools/AudioPlayer/PlayerShell.tsx +122 -0
- package/src/tools/AudioPlayer/README.md +139 -204
- package/src/tools/AudioPlayer/audio/audioContext.ts +39 -0
- package/src/tools/AudioPlayer/audio/decodePeaks.ts +36 -0
- package/src/tools/AudioPlayer/audio/index.ts +4 -0
- package/src/tools/AudioPlayer/audio/mediaElementSourceCache.ts +20 -0
- package/src/tools/AudioPlayer/audio/peaksCache.ts +37 -0
- package/src/tools/AudioPlayer/context/AudioRefContext.tsx +9 -0
- package/src/tools/AudioPlayer/context/ControlsContext.tsx +7 -0
- package/src/tools/AudioPlayer/context/LevelsContext.tsx +7 -0
- package/src/tools/AudioPlayer/context/MetaContext.tsx +16 -0
- package/src/tools/AudioPlayer/context/PlayerProvider.tsx +314 -0
- package/src/tools/AudioPlayer/context/StateContext.tsx +7 -0
- package/src/tools/AudioPlayer/context/index.ts +16 -15
- package/src/tools/AudioPlayer/context/selectors.ts +36 -0
- package/src/tools/AudioPlayer/hooks/index.ts +12 -39
- package/src/tools/AudioPlayer/hooks/useActivePlayer.ts +31 -0
- package/src/tools/AudioPlayer/hooks/useAnalyser.ts +62 -0
- package/src/tools/AudioPlayer/hooks/useAudioElementEvents.ts +102 -0
- package/src/tools/AudioPlayer/hooks/useKeyboardShortcuts.ts +91 -0
- package/src/tools/AudioPlayer/hooks/useMediaSession.ts +74 -0
- package/src/tools/AudioPlayer/hooks/usePeaks.ts +83 -0
- package/src/tools/AudioPlayer/hooks/usePlayerPreferences.ts +21 -0
- package/src/tools/AudioPlayer/hooks/usePlayheadLoop.ts +77 -0
- package/src/tools/AudioPlayer/hooks/useResizeObserver.ts +20 -0
- package/src/tools/AudioPlayer/hooks/useThemeWatcher.ts +22 -0
- package/src/tools/AudioPlayer/index.ts +63 -134
- package/src/tools/AudioPlayer/lazy.tsx +8 -97
- package/src/tools/AudioPlayer/parts/Controls/ControlsRow.tsx +30 -0
- package/src/tools/AudioPlayer/parts/Controls/IconButton.tsx +62 -0
- package/src/tools/AudioPlayer/parts/Controls/LoopButton.tsx +33 -0
- package/src/tools/AudioPlayer/parts/Controls/PlayButton.tsx +86 -0
- package/src/tools/AudioPlayer/parts/Controls/SkipButton.tsx +17 -0
- package/src/tools/AudioPlayer/parts/Controls/VolumeControl.tsx +171 -0
- package/src/tools/AudioPlayer/parts/Controls/index.ts +6 -0
- package/src/tools/AudioPlayer/parts/Cover/Cover.tsx +24 -0
- package/src/tools/AudioPlayer/parts/Cover/CoverPlaceholder.tsx +27 -0
- package/src/tools/AudioPlayer/parts/Cover/ReactivePulse.tsx +66 -0
- package/src/tools/AudioPlayer/parts/Cover/index.ts +3 -0
- package/src/tools/AudioPlayer/parts/ErrorState/ErrorState.tsx +35 -0
- package/src/tools/AudioPlayer/parts/ErrorState/index.ts +1 -0
- package/src/tools/AudioPlayer/parts/Layout/CompactLayout.tsx +25 -0
- package/src/tools/AudioPlayer/parts/Layout/DefaultLayout.tsx +48 -0
- package/src/tools/AudioPlayer/parts/Layout/index.ts +2 -0
- package/src/tools/AudioPlayer/parts/Meta/Artist.tsx +14 -0
- package/src/tools/AudioPlayer/parts/Meta/TimeDisplay.tsx +49 -0
- package/src/tools/AudioPlayer/parts/Meta/Title.tsx +13 -0
- package/src/tools/AudioPlayer/parts/Meta/index.ts +3 -0
- package/src/tools/AudioPlayer/parts/Skeleton/CoverSkeleton.tsx +13 -0
- package/src/tools/AudioPlayer/parts/Skeleton/MetaSkeleton.tsx +10 -0
- package/src/tools/AudioPlayer/parts/Skeleton/index.ts +2 -0
- package/src/tools/AudioPlayer/parts/Waveform/BarsWaveform.tsx +48 -0
- package/src/tools/AudioPlayer/parts/Waveform/LiveWaveform.tsx +95 -0
- package/src/tools/AudioPlayer/parts/Waveform/PeaksWaveform.tsx +100 -0
- package/src/tools/AudioPlayer/parts/Waveform/ProgressBar.tsx +76 -0
- package/src/tools/AudioPlayer/parts/Waveform/Waveform.tsx +74 -0
- package/src/tools/AudioPlayer/parts/Waveform/WaveformSkeleton.tsx +16 -0
- package/src/tools/AudioPlayer/parts/Waveform/index.ts +8 -0
- package/src/tools/AudioPlayer/parts/Waveform/waveformInteraction.ts +106 -0
- package/src/tools/AudioPlayer/parts/Waveform/waveformRenderer.ts +91 -0
- package/src/tools/AudioPlayer/parts/index.ts +1 -0
- package/src/tools/AudioPlayer/store/activePlayerBus.ts +63 -0
- package/src/tools/AudioPlayer/store/createLevelsStore.ts +37 -0
- package/src/tools/AudioPlayer/store/index.ts +16 -0
- package/src/tools/AudioPlayer/store/preferencesStore.ts +104 -0
- package/src/tools/AudioPlayer/styles/webview-safe.css +77 -0
- package/src/tools/AudioPlayer/types.ts +95 -0
- package/src/tools/AudioPlayer/utils/bucketize.ts +27 -0
- package/src/tools/AudioPlayer/utils/clamp.ts +5 -0
- package/src/tools/AudioPlayer/utils/dpr.ts +19 -0
- package/src/tools/AudioPlayer/utils/formatTime.ts +12 -8
- package/src/tools/AudioPlayer/utils/index.ts +4 -5
- package/src/tools/AudioPlayer/utils/readCssVar.ts +7 -0
- package/src/tools/AudioPlayer/utils/resolveCanvasColor.ts +28 -0
- package/src/tools/index.ts +5 -75
- package/dist/chunk-2QY3LJR6.mjs.map +0 -1
- package/dist/chunk-6HNAPVZ2.mjs.map +0 -1
- package/dist/chunk-CXVGN6ZW.cjs.map +0 -1
- package/dist/chunk-F2N7P5XU.cjs +0 -30
- package/dist/chunk-F2N7P5XU.cjs.map +0 -1
- package/dist/chunk-FYLR232K.cjs.map +0 -1
- package/dist/chunk-HMHIVEMS.mjs +0 -1619
- package/dist/chunk-HMHIVEMS.mjs.map +0 -1
- package/dist/chunk-JWB2EWQO.mjs +0 -5
- package/dist/chunk-JWB2EWQO.mjs.map +0 -1
- package/dist/chunk-YZX6FH3H.cjs +0 -1656
- package/dist/chunk-YZX6FH3H.cjs.map +0 -1
- package/dist/components-3RTH76CV.cjs +0 -27
- package/dist/components-5GVVL2Q6.mjs +0 -5
- package/dist/components-CPHOUQ5F.cjs +0 -46
- package/dist/components-CPHOUQ5F.cjs.map +0 -1
- package/dist/components-OTK43IMD.mjs +0 -6
- package/dist/components-OTK43IMD.mjs.map +0 -1
- package/src/tools/AudioPlayer/components/HybridAudioPlayer.tsx +0 -225
- package/src/tools/AudioPlayer/components/HybridCompactPlayer.tsx +0 -163
- package/src/tools/AudioPlayer/components/HybridSimplePlayer.tsx +0 -284
- package/src/tools/AudioPlayer/components/HybridWaveform.tsx +0 -286
- package/src/tools/AudioPlayer/components/ReactiveCover/AudioReactiveCover.tsx +0 -151
- package/src/tools/AudioPlayer/components/ReactiveCover/effects/GlowEffect.tsx +0 -110
- package/src/tools/AudioPlayer/components/ReactiveCover/effects/MeshEffect.tsx +0 -58
- package/src/tools/AudioPlayer/components/ReactiveCover/effects/OrbsEffect.tsx +0 -45
- package/src/tools/AudioPlayer/components/ReactiveCover/effects/SpotlightEffect.tsx +0 -82
- package/src/tools/AudioPlayer/components/ReactiveCover/effects/index.ts +0 -8
- package/src/tools/AudioPlayer/components/ReactiveCover/index.ts +0 -6
- package/src/tools/AudioPlayer/components/index.ts +0 -23
- package/src/tools/AudioPlayer/context/HybridAudioProvider.tsx +0 -158
- package/src/tools/AudioPlayer/effects/index.ts +0 -412
- package/src/tools/AudioPlayer/hooks/useAudioBus.ts +0 -76
- package/src/tools/AudioPlayer/hooks/useHybridAudio.ts +0 -403
- package/src/tools/AudioPlayer/hooks/useHybridAudioAnalysis.ts +0 -96
- package/src/tools/AudioPlayer/hooks/useVisualization.tsx +0 -207
- package/src/tools/AudioPlayer/types/effects.ts +0 -73
- package/src/tools/AudioPlayer/types/index.ts +0 -27
- package/src/tools/AudioPlayer/utils/debug.ts +0 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tools/OpenapiViewer/hooks/useOpenApiSchema.ts","../src/tools/OpenapiViewer/hooks/useDocsUrlSync.ts","../src/tools/OpenapiViewer/hooks/useEndpointDraft.ts","../src/tools/OpenapiViewer/components/shared/EndpointDraftSync.tsx","../src/tools/OpenapiViewer/components/DocsLayout/anchor.ts","../src/tools/OpenapiViewer/components/shared/ui.tsx","../src/tools/OpenapiViewer/components/DocsLayout/SchemaCopyMenu.tsx","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/BrandHeader.tsx","../src/tools/OpenapiViewer/components/DocsLayout/sidebarLabel.ts","../src/tools/OpenapiViewer/components/DocsLayout/grouping.ts","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/buildVM.ts","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/EndpointRow.tsx","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/CategoryBlock.tsx","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/SchemaSection.tsx","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/SidebarBody.tsx","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/types.ts","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/MethodChips.tsx","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/SearchInput.tsx","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/Toolbar.tsx","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/useDebouncedValue.ts","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/index.tsx","../src/tools/OpenapiViewer/utils/scrollParent.ts","../src/tools/OpenapiViewer/components/DocsLayout/ApiIntroSection.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/context.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/store/index.ts","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/store/selectors.ts","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/CodeSamples/LanguageTabs.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/CodeSamples/useCodeSnippet.ts","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/CodeSamples/index.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Header/MetaActions.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Header/PathDisplay.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Header/index.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Parameters/ParamRow.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Parameters/ParamGroup.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Parameters/index.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/SchemaFields/buildTree.ts","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/SchemaFields/FieldRow.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/SchemaFields/index.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/RequestBody/index.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Responses/ResponseBody.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Responses/StatusTag.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Responses/ResponseRow.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Responses/index.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Section/defaults.ts","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/types.ts","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/hooks/useSectionHash.ts","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Section/SectionHeader.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Section/index.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/index.tsx","../src/tools/OpenapiViewer/components/DocsLayout/DocsView.tsx","../src/tools/OpenapiViewer/components/shared/BodyFormEditor.tsx","../src/tools/OpenapiViewer/components/shared/EndpointResetButton.tsx","../src/tools/OpenapiViewer/components/shared/RequestPanel.tsx","../src/tools/OpenapiViewer/components/shared/ResponsePanel/PreviewView.tsx","../src/tools/OpenapiViewer/components/shared/ResponsePanel/PrettyView.tsx","../src/tools/OpenapiViewer/components/shared/ResponsePanel/RawView.tsx","../src/tools/OpenapiViewer/components/shared/ResponsePanel/StatusBar.tsx","../src/tools/OpenapiViewer/components/shared/ResponsePanel/detectContent.ts","../src/tools/OpenapiViewer/components/shared/ResponsePanel/useResponseView.ts","../src/tools/OpenapiViewer/components/shared/ResponsePanel/ViewTabs.tsx","../src/tools/OpenapiViewer/components/shared/ResponsePanel/index.tsx","../src/tools/OpenapiViewer/components/shared/SendButton.tsx","../src/tools/OpenapiViewer/components/DocsLayout/SlideInPlayground.tsx","../src/tools/OpenapiViewer/components/DocsLayout/TryItSheet.tsx","../src/tools/OpenapiViewer/components/DocsLayout/index.tsx"],"names":["__name","sampleSchemaJson","joinUrl","useState","useMemo","dereferenceSchema","resolveBaseUrl","useEffect","consola","useCallback","useRef","usePlaygroundContext","jsx","cn","jsxs","React","ChevronRight","toMarkdown","toCompactJson","toRawJson","formatBytes","toast","DropdownMenu","DropdownMenuTrigger","Button","Sparkles","ChevronDown","DropdownMenuContent","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuItem","Check","relativePath","groupBy","orderBy","partition","sortBy","deduplicateEndpoints","EndpointRow","Tooltip","TooltipTrigger","TooltipContent","CategoryBlock","Search","Input","X","Combobox","MarkdownMessage","createContext","useContext","create","persist","createJSONStorage","CODE_SAMPLE_TARGETS","buildHarRequest","resolveAbsolute","renderSnippet","PrettyCode_default","SafeTooltipProvider","Link2","FileCode2","ChevronsDownUp","ChevronsUpDown","endpointToMarkdown","Play","CopyButton","JsonTree_default","DocsView","SchemaSectionView","MAX_DEPTH","Switch","Textarea","Minus","Plus","RotateCcw","isValidJson","findApiKeyById","parseRequestHeaders","Send","Fragment","Key","Terminal","Info","ShieldCheck","Loader2","WifiOff","UrlBuilder","AlertCircle","SidePanel","ResponsiveSheet","ResponsiveSheetContent","ResponsiveSheetHeader","ResponsiveSheetTitle","useMediaQuery","keyBy","Skeleton","TooltipProvider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAaA,IAAM,eAAe,CAAC,KAAA,EAAO,MAAA,EAAQ,KAAA,EAAO,SAAS,QAAQ,CAAA;AAY7D,IAAM,gBAAA,mBAAmBA,wBAAA,CAAA,CACvB,MAAA,EACA,OAAA,EACA,UACA,QAAA,KACkB;AAClB,EAAA,MAAM,YAA2B,EAAC;AAElC,EAAA,IAAI,CAAC,MAAA,CAAO,KAAA,EAAO,OAAO,EAAC;AAE3B,EAAA,KAAA,MAAW,CAAC,MAAM,OAAO,CAAA,IAAK,OAAO,OAAA,CAAQ,MAAA,CAAO,KAAK,CAAA,EAAG;AAC1D,IAAA,KAAA,MAAW,UAAU,YAAA,EAAc;AACjC,MAAA,MAAM,EAAA,GAAM,QAAgB,MAAM,CAAA;AAClC,MAAA,IAAI,CAAC,EAAA,EAAI;AAET,MAAA,MAAM,WAAA,GAAc,OAAO,WAAA,EAAY;AACvC,MAAA,MAAM,OAA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,SAAA;AAAA,YACA;AAAA;AAAA;AACJ;AAAA,KACJ;AAAA,IACC,QAAA,KAAa,6BACVA,cAAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACG,GAAA,EAAK,OAAA;AAAA,QACL,QAAA,EAAS,UAAA;AAAA,QACT,WAAA;AAAA,QACA,iBAAiB,KAAA,CAAM,eAAA;AAAA,QACvB,gBAAgB,KAAA,CAAM,gBAAA;AAAA,QACtB,aAAA,EAAe,SAAA;AAAA,QACf,cAAA,EAAgB;AAAA;AAAA,wBAGpBA,cAAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACG,GAAA,EAAK,OAAA;AAAA,QACL,IAAA,EAAM,UAAA;AAAA,QACN,SAAA;AAAA,QACA,eAAA;AAAA,QACA,SAAA;AAAA,QACA,iBAAiB,KAAA,CAAM,eAAA;AAAA,QACvB,gBAAgB,KAAA,CAAM,gBAAA;AAAA,QACtB,aAAA,EAAe,SAAA;AAAA,QACf,cAAA,EAAgB;AAAA;AAAA,KACpB;AAAA,oBAIJA,cAAAA,CAAC,iBAAA,EAAA,EAAkB,IAAA,EAAM,SAAA,EAAW,SAAS,gBAAA,EAAkB;AAAA,GAAA,EACnE,CAAA,EACJ,CAAA;AAER,CAAA,EA1QoC,YAAA","file":"DocsLayout-ZXD2CUOH.cjs","sourcesContent":["'use client';\n\nimport consola from 'consola';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { ApiEndpoint, LoadedSchemaEntry, OpenApiInfo, OpenApiSchema, SchemaSource, UseOpenApiSchemaReturn } from '../types';\nimport { sampleSchemaJson } from '../utils/sampler';\nimport { dereferenceSchema } from '../utils/schemaExport';\nimport { joinUrl, resolveBaseUrl } from '../utils/url';\n\ntype JsonSchemaNode = Record<string, unknown>;\n\n// HTTP methods to extract from OpenAPI schema\nconst HTTP_METHODS = ['get', 'post', 'put', 'patch', 'delete'] as const;\n\n// Extract endpoints from OpenAPI schema (all methods). ``baseUrl`` is\n// resolved by the caller via ``resolveBaseUrl`` — we just paste it onto\n// the front of each path here. ``schemaId`` is tagged onto every\n// endpoint so downstream consumers (sections-mode sidebar, anchors, URL\n// sync) can correlate endpoints back to their source schema.\n//\n// ``specRoot`` is the raw, un-dereferenced schema — passed to\n// ``openapi-sampler`` so it can resolve any ``$ref`` nodes our own\n// ``dereferenceSchema`` left behind (depth-limited, external, or\n// circular). Without it the sampler throws on deep ref chains.\nconst extractEndpoints = (\n schema: OpenApiSchema,\n baseUrl: string,\n schemaId?: string,\n specRoot?: OpenApiSchema,\n): ApiEndpoint[] => {\n const endpoints: ApiEndpoint[] = [];\n\n if (!schema.paths) return [];\n\n for (const [path, methods] of Object.entries(schema.paths)) {\n for (const method of HTTP_METHODS) {\n const op = (methods as any)[method];\n if (!op) continue;\n\n const methodUpper = method.toUpperCase();\n const summary = (op.summary || '').trim();\n const description = op.description || summary || `${methodUpper} ${path}`;\n const category = op.tags?.[0] || 'Other';\n\n const parameters: Array<{\n name: string;\n type: string;\n required: boolean;\n description?: string;\n }> = [];\n\n // Collect parameters (path-level + operation-level)\n const allParams = [...((methods as any).parameters || []), ...(op.parameters || [])];\n for (const param of allParams) {\n parameters.push({\n name: param.name,\n type: param.schema?.type || 'string',\n required: param.required || false,\n description: param.description,\n });\n }\n\n // Collect responses. We also extract the ``application/json``\n // schema (preferring it, falling back to whatever media type is\n // present) and generate a sampled example — the docs layout\n // renders it as a collapsible \"Example response\" block under the\n // status-code table. ``writeOnly`` fields are skipped so secrets\n // declared ``writeOnly: true`` don't leak into response samples.\n const responses: NonNullable<ApiEndpoint['responses']> = [];\n\n if (op.responses) {\n for (const [code, response] of Object.entries(op.responses)) {\n const respContent = (response as any).content as Record<string, any> | undefined;\n const contentKeys = respContent ? Object.keys(respContent) : [];\n const chosenContentType = respContent?.['application/json']\n ? 'application/json'\n : contentKeys[0];\n const chosen = chosenContentType ? respContent?.[chosenContentType] : undefined;\n const respSchema = chosen?.schema as JsonSchemaNode | undefined;\n\n responses.push({\n code,\n description: (response as any).description || `Response ${code}`,\n contentType: chosenContentType,\n schema: respSchema,\n example: respSchema\n ? sampleSchemaJson(respSchema, { skipWriteOnly: true }, specRoot)\n : undefined,\n });\n }\n }\n\n // Extract request body info — keep the dereferenced schema so\n // downstream UI can render a fields table and generate a starter\n // example instead of showing an opaque ``object`` / ``array`` tag.\n // ``readOnly`` fields are skipped: the body is what the client\n // *sends*, so server-owned fields (id, created_at, …) must not\n // pre-fill the editor.\n let requestBody: ApiEndpoint['requestBody'];\n if (op.requestBody) {\n const content = op.requestBody.content;\n const mediaType = content?.['application/json'] || content?.[Object.keys(content || {})[0]];\n const rawSchema = mediaType?.schema as JsonSchemaNode | undefined;\n requestBody = {\n type: (rawSchema?.type as string | undefined) || 'object',\n description: op.requestBody.description,\n schema: rawSchema,\n example: rawSchema\n ? sampleSchemaJson(rawSchema, { skipReadOnly: true }, specRoot)\n : undefined,\n };\n }\n\n const endpoint: ApiEndpoint = {\n name: path.split('/').pop() || path,\n method: methodUpper,\n path: baseUrl ? joinUrl(baseUrl, path) : path,\n summary,\n description,\n category,\n parameters: parameters.length > 0 ? parameters : undefined,\n requestBody,\n responses: responses.length > 0 ? responses : undefined,\n schemaId,\n };\n\n endpoints.push(endpoint);\n }\n }\n\n return endpoints;\n};\n\n// Get unique categories from endpoints\nconst getCategories = (endpoints: ApiEndpoint[]): string[] => {\n const categories = new Set<string>();\n endpoints.forEach((endpoint) => categories.add(endpoint.category));\n return Array.from(categories).sort();\n};\n\n// Fetch schema from URL\nconst fetchSchema = async (url: string): Promise<OpenApiSchema> => {\n const response = await fetch(url, {\n headers: {\n 'Accept': 'application/json',\n },\n });\n if (!response.ok) {\n throw new Error(`Failed to fetch schema: ${response.statusText}`);\n }\n return response.json();\n};\n\ninterface UseOpenApiSchemaProps {\n schemas: SchemaSource[];\n defaultSchemaId?: string;\n /** Global base URL override from ``PlaygroundConfig.baseUrl``.\n * Per-schema ``SchemaSource.baseUrl`` takes precedence over this. */\n baseUrl?: string;\n /** When ``true`` the hook fetches every schema in ``schemas`` (not just\n * the active one) and exposes them via ``schemasData``. Used by the\n * ``sections`` grouping mode — the docs column concatenates endpoints\n * from every schema, so they all need to be on the client. Default\n * is ``false`` to preserve the original lazy behaviour. */\n preloadAll?: boolean;\n}\n\ninterface SchemaLoadState {\n loading: boolean;\n error: string | null;\n}\n\nexport default function useOpenApiSchema({\n schemas,\n defaultSchemaId,\n baseUrl: configBaseUrl,\n preloadAll = false,\n}: UseOpenApiSchemaProps): UseOpenApiSchemaReturn {\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<string | null>(null);\n const [currentSchemaId, setCurrentSchemaId] = useState<string>(\n defaultSchemaId || schemas[0]?.id\n );\n const [loadedSchemas, setLoadedSchemas] = useState<Map<string, OpenApiSchema>>(\n new Map()\n );\n // Per-schema loading/error state for ``preloadAll`` — each schema may\n // succeed or fail independently, and the UI wants to render partial\n // results while slow/broken ones are still resolving.\n const [loadStates, setLoadStates] = useState<Map<string, SchemaLoadState>>(new Map());\n\n const currentSchema = useMemo(\n () => schemas.find((s) => s.id === currentSchemaId) || null,\n [schemas, currentSchemaId]\n );\n\n const currentOpenApiSchema = useMemo(\n () => (currentSchemaId ? loadedSchemas.get(currentSchemaId) : null),\n [loadedSchemas, currentSchemaId]\n );\n\n // Dereference once per schema load so endpoint extraction sees fully\n // resolved ``$ref`` graphs. The raw schema is still exposed via\n // ``rawSchema`` for Copy-for-AI (juniors may want to hand the raw\n // document to an LLM and have it resolve refs itself).\n const dereferencedSchema = useMemo(\n () => (currentOpenApiSchema ? dereferenceSchema(currentOpenApiSchema) : null),\n [currentOpenApiSchema],\n );\n\n // Resolve base URL with priority chain. Centralised in ``resolveBaseUrl``\n // so the same logic is reused by the schema-export utilities.\n const resolvedBaseUrl = useMemo(\n () =>\n resolveBaseUrl({\n schemaSource: currentSchema?.baseUrl,\n config: configBaseUrl,\n fromServers: currentOpenApiSchema?.servers?.[0]?.url,\n }),\n [currentSchema?.baseUrl, configBaseUrl, currentOpenApiSchema],\n );\n\n const endpoints = useMemo(\n () =>\n dereferencedSchema\n ? extractEndpoints(dereferencedSchema, resolvedBaseUrl, currentSchemaId, currentOpenApiSchema ?? undefined)\n : [],\n [dereferencedSchema, resolvedBaseUrl, currentSchemaId, currentOpenApiSchema]\n );\n\n const categories = useMemo(() => getCategories(endpoints), [endpoints]);\n\n const schemaInfo = useMemo<OpenApiInfo | null>(() => {\n if (!currentOpenApiSchema?.info) return null;\n const { title, version, description } = currentOpenApiSchema.info;\n return {\n title,\n version,\n description,\n servers: currentOpenApiSchema.servers,\n };\n }, [currentOpenApiSchema]);\n\n // Load schema when current schema changes (single-schema mode)\n useEffect(() => {\n if (preloadAll) return;\n if (!currentSchema) return;\n\n // Skip if already loaded\n if (loadedSchemas.has(currentSchema.id)) {\n setLoading(false);\n return;\n }\n\n setLoading(true);\n setError(null);\n\n fetchSchema(currentSchema.url)\n .then((schema) => {\n setLoadedSchemas((prev) => new Map(prev).set(currentSchema.id, schema));\n consola.success(`Schema loaded: ${currentSchema.name}`);\n setLoading(false);\n })\n .catch((err) => {\n consola.error(`Error loading schema from ${currentSchema.url}:`, err);\n setError(err instanceof Error ? err.message : 'Failed to load schema');\n setLoading(false);\n });\n }, [currentSchema, loadedSchemas, preloadAll]);\n\n // Preload every schema (sections-grouping mode). Each schema is fetched\n // independently — a slow or broken source doesn't block the rest.\n useEffect(() => {\n if (!preloadAll) return;\n if (schemas.length === 0) {\n setLoading(false);\n return;\n }\n\n let cancelled = false;\n const pending = schemas.filter((s) => !loadedSchemas.has(s.id));\n if (pending.length === 0) {\n setLoading(false);\n return;\n }\n\n setLoading(true);\n setLoadStates((prev) => {\n const next = new Map(prev);\n for (const s of pending) next.set(s.id, { loading: true, error: null });\n return next;\n });\n\n Promise.allSettled(\n pending.map((s) =>\n fetchSchema(s.url).then((schema) => ({ id: s.id, name: s.name, schema })),\n ),\n ).then((results) => {\n if (cancelled) return;\n\n setLoadedSchemas((prev) => {\n const next = new Map(prev);\n for (const r of results) {\n if (r.status === 'fulfilled') {\n next.set(r.value.id, r.value.schema);\n consola.success(`Schema loaded: ${r.value.name}`);\n }\n }\n return next;\n });\n\n setLoadStates((prev) => {\n const next = new Map(prev);\n results.forEach((r, i) => {\n const src = pending[i]!;\n if (r.status === 'fulfilled') {\n next.set(src.id, { loading: false, error: null });\n } else {\n const msg = r.reason instanceof Error ? r.reason.message : 'Failed to load schema';\n consola.error(`Error loading schema from ${src.url}:`, r.reason);\n next.set(src.id, { loading: false, error: msg });\n }\n });\n return next;\n });\n\n setLoading(false);\n });\n\n return () => {\n cancelled = true;\n };\n }, [preloadAll, schemas, loadedSchemas]);\n\n const schemasData = useMemo<LoadedSchemaEntry[]>(() => {\n if (!preloadAll) return [];\n return schemas.map((src) => {\n const raw = loadedSchemas.get(src.id) ?? null;\n const deref = raw ? dereferenceSchema(raw) : null;\n const resolved = resolveBaseUrl({\n schemaSource: src.baseUrl,\n config: configBaseUrl,\n fromServers: raw?.servers?.[0]?.url,\n });\n const info: OpenApiInfo | null = raw?.info\n ? {\n title: raw.info.title,\n version: raw.info.version,\n description: raw.info.description,\n servers: raw.servers,\n }\n : null;\n const eps = deref ? extractEndpoints(deref, resolved, src.id, raw ?? undefined) : [];\n const state = loadStates.get(src.id) ?? { loading: !raw, error: null };\n return {\n source: src,\n info,\n rawSchema: raw,\n endpoints: eps,\n resolvedBaseUrl: resolved || undefined,\n loading: state.loading,\n error: state.error,\n };\n });\n }, [preloadAll, schemas, loadedSchemas, loadStates, configBaseUrl]);\n\n const setCurrentSchema = useCallback((schemaId: string) => {\n setCurrentSchemaId(schemaId);\n }, []);\n\n const refresh = useCallback(() => {\n if (!currentSchema) return;\n\n setLoading(true);\n setError(null);\n\n // Remove from cache to force reload\n setLoadedSchemas((prev) => {\n const next = new Map(prev);\n next.delete(currentSchema.id);\n return next;\n });\n\n fetchSchema(currentSchema.url)\n .then((schema) => {\n setLoadedSchemas((prev) => new Map(prev).set(currentSchema.id, schema));\n consola.success(`Schema refreshed: ${currentSchema.name}`);\n setLoading(false);\n })\n .catch((err) => {\n consola.error(`Error refreshing schema from ${currentSchema.url}:`, err);\n setError(err instanceof Error ? err.message : 'Failed to refresh schema');\n setLoading(false);\n });\n }, [currentSchema]);\n\n return {\n loading,\n error,\n endpoints,\n categories,\n schemas,\n currentSchema,\n schemaInfo,\n rawSchema: currentOpenApiSchema ?? null,\n // Consumers expect ``undefined`` when no base URL was resolved (for\n // conditional ``{ baseUrl?: … }`` plumbing). Turn the empty-string\n // convention from the resolver into undefined at the API boundary.\n resolvedBaseUrl: resolvedBaseUrl || undefined,\n setCurrentSchema,\n refresh,\n schemasData,\n };\n}\n","'use client';\n\nimport { useCallback, useEffect, useRef } from 'react';\n\n/** Hash format: ``#<schemaId>/<anchor>``.\n * - ``#catalog/ep-get-users`` — specific endpoint in ``catalog`` schema\n * - ``#catalog`` — open ``catalog`` schema at its top\n * - empty — no initial target, leave viewer at its default\n *\n * We intentionally keep this opinionated and stringly-typed: the host app\n * already controls which schemas exist, so there is no room for ambiguity\n * beyond the two segments. */\nexport interface ParsedHash {\n schemaId: string | null;\n anchor: string | null;\n}\n\nexport function parseDocsHash(hash: string): ParsedHash {\n const raw = hash.startsWith('#') ? hash.slice(1) : hash;\n if (!raw) return { schemaId: null, anchor: null };\n const [schemaId = null, ...rest] = raw.split('/');\n const anchor = rest.length > 0 ? rest.join('/') : null;\n return {\n schemaId: schemaId || null,\n anchor: anchor || null,\n };\n}\n\nexport function buildDocsHash(schemaId: string | null, anchor: string | null): string {\n if (!schemaId && !anchor) return '';\n if (schemaId && anchor) return `#${schemaId}/${anchor}`;\n if (schemaId) return `#${schemaId}`;\n return anchor ? `#${anchor}` : '';\n}\n\ninterface UseDocsUrlSyncProps {\n enabled: boolean;\n currentSchemaId: string | null;\n activeAnchor: string | null;\n /** Called on mount / ``popstate`` / ``hashchange`` with the hash state.\n * The consumer is responsible for dispatching into its own handlers\n * (switching schema, scrolling to endpoint) in the right order. */\n onHashTarget: (target: ParsedHash) => void;\n}\n\n/** Two-way sync between browser hash and docs viewer state.\n *\n * - Writes use ``history.replaceState`` so scrollspy-driven updates don't\n * pollute the back/forward stack. User-initiated navigation (click on\n * sidebar row, schema switch) still lands in history because the click\n * itself already did ``pushState`` — or will, via plain anchor hrefs.\n * - Reads happen on mount (initial target) and on ``popstate`` /\n * ``hashchange`` (Back/Forward / external anchor clicks).\n * - When ``enabled`` is false, the hook is a no-op — the viewer stays\n * hash-free so you can embed it inside a larger page. */\nexport function useDocsUrlSync({\n enabled,\n currentSchemaId,\n activeAnchor,\n onHashTarget,\n}: UseDocsUrlSyncProps) {\n // Ignore the very first write — otherwise on mount we'd clobber the\n // incoming hash with the viewer's empty defaults before ``onHashTarget``\n // has a chance to apply it.\n const primedRef = useRef(false);\n const onHashTargetRef = useRef(onHashTarget);\n useEffect(() => {\n onHashTargetRef.current = onHashTarget;\n }, [onHashTarget]);\n\n // Read: mount + hashchange/popstate\n useEffect(() => {\n if (!enabled || typeof window === 'undefined') return;\n\n const apply = () => {\n onHashTargetRef.current(parseDocsHash(window.location.hash));\n };\n apply();\n primedRef.current = true;\n\n window.addEventListener('hashchange', apply);\n window.addEventListener('popstate', apply);\n return () => {\n window.removeEventListener('hashchange', apply);\n window.removeEventListener('popstate', apply);\n };\n }, [enabled]);\n\n // Write: whenever the viewer's state changes\n useEffect(() => {\n if (!enabled || typeof window === 'undefined') return;\n if (!primedRef.current) return;\n\n const next = buildDocsHash(currentSchemaId, activeAnchor);\n const current = window.location.hash;\n if (next === current) return;\n\n // replaceState keeps Back/Forward meaningful — a single scroll-through\n // the page shouldn't create 50 history entries.\n const url = next\n ? `${window.location.pathname}${window.location.search}${next}`\n : `${window.location.pathname}${window.location.search}`;\n window.history.replaceState(window.history.state, '', url);\n }, [enabled, currentSchemaId, activeAnchor]);\n\n const pushTarget = useCallback(\n (schemaId: string | null, anchor: string | null) => {\n if (!enabled || typeof window === 'undefined') return;\n const next = buildDocsHash(schemaId, anchor);\n const url = next\n ? `${window.location.pathname}${window.location.search}${next}`\n : `${window.location.pathname}${window.location.search}`;\n window.history.pushState(window.history.state, '', url);\n },\n [enabled],\n );\n\n return { pushTarget };\n}\n","'use client';\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nimport type { ApiEndpoint } from '../types';\n\n/**\n * Per-endpoint draft kept in localStorage so user input survives across\n * reloads and across switching back-and-forth between endpoints.\n *\n * Scoped by ``schemaId`` + ``method`` + ``path`` — two endpoints on the\n * same path with different methods don't share drafts. Two different\n * APIs don't collide either.\n *\n * Storage shape:\n * { parameters: { [name]: string }, requestBody: string }\n *\n * Implementation note: we deliberately DO NOT build on top of\n * ``useLocalStorage`` here. That hook's ``setValue`` callback reference\n * changes whenever its internal state changes, and when EndpointDraftSync\n * mirrors context → draft, the chain\n * state change ⇒ persist call ⇒ hook state change ⇒ new callback ⇒\n * effect rerun ⇒ persist call …\n * blew up into a maximum-update-depth loop. Writing straight to\n * ``localStorage`` with a stable ref-based writer breaks the cycle.\n */\nexport interface EndpointDraft {\n parameters: Record<string, string>;\n requestBody: string;\n}\n\nconst EMPTY_DRAFT: EndpointDraft = { parameters: {}, requestBody: '' };\n\nfunction storageKey(schemaId: string | null, ep: ApiEndpoint | null): string | null {\n if (!schemaId || !ep) return null;\n return `openapi-playground:draft:${schemaId}:${ep.method}:${ep.path}`;\n}\n\nfunction readDraft(key: string | null): EndpointDraft {\n if (!key || typeof window === 'undefined') return EMPTY_DRAFT;\n try {\n const raw = window.localStorage.getItem(key);\n if (!raw) return EMPTY_DRAFT;\n const parsed = JSON.parse(raw) as Partial<EndpointDraft>;\n return {\n parameters: parsed?.parameters ?? {},\n requestBody: typeof parsed?.requestBody === 'string' ? parsed.requestBody : '',\n };\n } catch {\n return EMPTY_DRAFT;\n }\n}\n\nfunction writeDraft(key: string | null, value: EndpointDraft): void {\n if (!key || typeof window === 'undefined') return;\n try {\n // Skip writes for empty drafts — reduces storage noise and keeps\n // \"never edited\" endpoints out of storage entirely.\n if (Object.keys(value.parameters).length === 0 && !value.requestBody) {\n window.localStorage.removeItem(key);\n return;\n }\n window.localStorage.setItem(key, JSON.stringify(value));\n } catch {\n // Quota / private mode — silently drop; UI state still works.\n }\n}\n\nexport interface UseEndpointDraftResult {\n /** Draft snapshot loaded on mount / endpoint change. Does not update\n * as the user types — the caller owns the \"live\" state (context). */\n draft: EndpointDraft;\n /** Persist the current parameters. Safe to call on every change;\n * writes skip when the endpoint has no key yet. */\n setParameters: (params: Record<string, string>) => void;\n setRequestBody: (body: string) => void;\n /** Wipe the persisted draft for the current endpoint. */\n reset: () => void;\n}\n\nexport function useEndpointDraft(\n schemaId: string | null,\n endpoint: ApiEndpoint | null,\n): UseEndpointDraftResult {\n const key = storageKey(schemaId, endpoint);\n\n // ``draft`` is reloaded from storage only when the key changes —\n // not when we write. Writes don't need to come back to us because\n // the caller keeps the live state and re-reads on key change.\n const [draft, setDraftSnapshot] = useState<EndpointDraft>(() => readDraft(key));\n\n // Track the last loaded key so we reload exactly once per endpoint.\n const loadedKeyRef = useRef<string | null>(key);\n useEffect(() => {\n if (loadedKeyRef.current === key) return;\n loadedKeyRef.current = key;\n setDraftSnapshot(readDraft(key));\n }, [key]);\n\n // Keep a ref of the current key so the writers below stay stable\n // across renders — React callback identity was the root cause of\n // the infinite render loop we had before.\n const keyRef = useRef(key);\n useEffect(() => {\n keyRef.current = key;\n }, [key]);\n\n // Same for the latest full draft value — both writers need to merge\n // their field into the last known shape before writing.\n const latestRef = useRef<EndpointDraft>(draft);\n useEffect(() => {\n latestRef.current = draft;\n }, [draft]);\n\n const setParameters = useCallback((params: Record<string, string>) => {\n const next: EndpointDraft = {\n parameters: params,\n requestBody: latestRef.current.requestBody,\n };\n latestRef.current = next;\n writeDraft(keyRef.current, next);\n }, []);\n\n const setRequestBody = useCallback((body: string) => {\n const next: EndpointDraft = {\n parameters: latestRef.current.parameters,\n requestBody: body,\n };\n latestRef.current = next;\n writeDraft(keyRef.current, next);\n }, []);\n\n const reset = useCallback(() => {\n latestRef.current = EMPTY_DRAFT;\n if (keyRef.current && typeof window !== 'undefined') {\n try { window.localStorage.removeItem(keyRef.current); } catch { /* noop */ }\n }\n setDraftSnapshot(EMPTY_DRAFT);\n }, []);\n\n return { draft, setParameters, setRequestBody, reset };\n}\n","'use client';\n\nimport React, { useEffect, useRef } from 'react';\n\nimport { usePlaygroundContext } from '../../context/PlaygroundContext';\nimport { useEndpointDraft } from '../../hooks/useEndpointDraft';\n\ninterface EndpointDraftSyncProps {\n /** Active schema id (so drafts don't bleed between different APIs).\n * When null — drafts are disabled (hook returns empty draft, writes\n * are no-ops). Pass the current schema's ``id`` from useOpenApiSchema. */\n schemaId: string | null;\n}\n\n/**\n * Headless component: keeps ``RequestPanel`` state mirrored with a\n * per-endpoint draft in localStorage.\n *\n * Flow:\n * 1. On endpoint change ⇒ read draft ⇒ push into context state.\n * 2. On context state change (user edits params/body) ⇒ write draft.\n *\n * Step 1 is gated by a ref so \"just-loaded\" drafts don't immediately\n * trigger step 2. Step 2 additionally compares against a serialised\n * snapshot of the last persisted value so a re-render without a real\n * value change doesn't touch storage.\n *\n * Had an infinite-render-loop bug here earlier: the persist callbacks\n * were driven by ``useLocalStorage`` whose setter identity changed on\n * every internal state update, so depending on them from an effect\n * created a cycle. Fixed by making ``useEndpointDraft``'s writers\n * stable (ref-based), and by gating writes with value comparison below.\n */\nexport function EndpointDraftSync({ schemaId }: EndpointDraftSyncProps) {\n const { state, setParameters, setRequestBody, setActiveSchemaId } = usePlaygroundContext();\n const ep = state.selectedEndpoint;\n\n // Mirror schemaId into context so other components (e.g. the Reset\n // button in RequestPanel) can read it without receiving props from\n // a parent they don't own.\n useEffect(() => {\n setActiveSchemaId(schemaId);\n }, [schemaId, setActiveSchemaId]);\n\n const { draft, setParameters: persistParams, setRequestBody: persistBody } =\n useEndpointDraft(schemaId, ep);\n\n const lastLoadedKeyRef = useRef<string | null>(null);\n const lastPersistedParamsRef = useRef<string>('');\n const lastPersistedBodyRef = useRef<string>('');\n const currentKey = ep ? `${ep.method}|${ep.path}` : null;\n\n // Step 1 — hydrate context from draft on endpoint switch.\n //\n // IMPORTANT: only apply fields that actually exist in the saved draft.\n // SELECT_ENDPOINT in the reducer pre-fills ``requestBody`` with an\n // auto-generated schema example, and ``parameters`` with ``{}``.\n // If we blindly overwrite those with an empty draft we wipe the\n // example before the user ever sees it. Tracked via a bug: opening\n // POST /pet showed ``{\"key\":\"value\"}`` instead of the Pet example.\n useEffect(() => {\n if (!ep || !currentKey) {\n lastLoadedKeyRef.current = null;\n return;\n }\n if (lastLoadedKeyRef.current === currentKey) return;\n lastLoadedKeyRef.current = currentKey;\n\n const hasStoredParams =\n draft.parameters && Object.keys(draft.parameters).length > 0;\n const hasStoredBody = typeof draft.requestBody === 'string' && draft.requestBody !== '';\n\n if (hasStoredParams) {\n setParameters(draft.parameters);\n lastPersistedParamsRef.current = JSON.stringify(draft.parameters);\n } else {\n // Keep whatever the reducer put there; mirror it into the\n // \"last persisted\" ref so step-2 treats it as a baseline.\n lastPersistedParamsRef.current = JSON.stringify(state.parameters);\n }\n\n if (hasStoredBody) {\n setRequestBody(draft.requestBody);\n lastPersistedBodyRef.current = draft.requestBody;\n } else {\n lastPersistedBodyRef.current = state.requestBody;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [currentKey]);\n\n // Step 2 — persist user edits.\n useEffect(() => {\n if (!ep || lastLoadedKeyRef.current !== currentKey) return;\n const serialised = JSON.stringify(state.parameters);\n if (serialised === lastPersistedParamsRef.current) return;\n lastPersistedParamsRef.current = serialised;\n persistParams(state.parameters);\n }, [state.parameters, ep, currentKey, persistParams]);\n\n useEffect(() => {\n if (!ep || lastLoadedKeyRef.current !== currentKey) return;\n if (state.requestBody === lastPersistedBodyRef.current) return;\n lastPersistedBodyRef.current = state.requestBody;\n persistBody(state.requestBody);\n }, [state.requestBody, ep, currentKey, persistBody]);\n\n return null;\n}\n","import type { ApiEndpoint } from '../../types';\n\n/** DOM-safe anchor for a single endpoint.\n *\n * Two forms:\n * - Scoped (``schemaId`` provided) — ``ep-<schema>-<method>-<slug>``.\n * Used in ``sections`` mode where endpoints from different schemas\n * coexist on one page and would otherwise collide.\n * - Flat — ``ep-<method>-<slug>``. Used in ``selector`` mode where\n * only one schema is mounted at a time. */\nexport function endpointAnchor(\n ep: Pick<ApiEndpoint, 'method' | 'path'>,\n schemaId?: string | null,\n): string {\n const slug = ep.path\n .replace(/^https?:\\/\\/[^/]+/, '')\n .replace(/[{}]/g, '')\n .replace(/[^a-zA-Z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .toLowerCase();\n const schemaSlug = schemaId ? `${slugifySchemaId(schemaId)}-` : '';\n return `ep-${schemaSlug}${ep.method.toLowerCase()}-${slug}`;\n}\n\n/** Canonical slug for a schema id — safe for anchors and hash fragments. */\nexport function slugifySchemaId(id: string): string {\n return id.replace(/[^a-zA-Z0-9_-]+/g, '-').replace(/^-+|-+$/g, '');\n}\n","'use client';\n\n/**\n * Shared primitive UI components used by the playground panels\n * (Request, Response) in both the slide-in and mobile-sheet surfaces.\n * Keep this file free of any business logic or context reads.\n */\n\nimport { ChevronRight } from 'lucide-react';\nimport React from 'react';\n\nimport { cn } from '@djangocfg/ui-core/lib';\n\n// ─── Style helpers ────────────────────────────────────────────────────────────\n\nconst METHOD_STYLES: Record<string, string> = {\n GET: 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/25',\n POST: 'bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/25',\n PUT: 'bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/25',\n PATCH: 'bg-orange-500/10 text-orange-600 dark:text-orange-400 border-orange-500/25',\n DELETE: 'bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/25',\n} as const;\n\nconst METHOD_FALLBACK = 'bg-muted text-muted-foreground border-border';\n\nexport function getMethodStyle(method: string): string {\n return METHOD_STYLES[method.toUpperCase()] ?? METHOD_FALLBACK;\n}\n\nexport function getStatusStyle(status: number): string {\n if (status >= 500) return 'bg-red-500/10 text-red-500 dark:text-red-400 border-red-500/25';\n if (status >= 400) return 'bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/25';\n if (status >= 300) return 'bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/25';\n return 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/25';\n}\n\n// ``relativePath`` lives in utils/url.ts now — re-exported here so every\n// component that used to import it from ``./ui`` keeps working.\nexport { relativePath } from '../../utils/url';\n\n// ─── Atoms ────────────────────────────────────────────────────────────────────\n\nexport function MethodBadge({ method }: { method: string }) {\n return (\n <span className={cn(\n 'inline-flex shrink-0 items-center rounded border px-1.5 py-px',\n 'font-mono text-[10px] font-bold uppercase tracking-wider leading-none',\n getMethodStyle(method),\n )}>\n {method}\n </span>\n );\n}\n\nexport function StatusBadge({ status }: { status: number }) {\n return (\n <span className={cn(\n 'inline-flex items-center rounded border px-1.5 py-px',\n 'font-mono text-[11px] font-bold leading-none',\n getStatusStyle(status),\n )}>\n {status}\n </span>\n );\n}\n\nexport function SectionLabel({ children }: { children: React.ReactNode }) {\n return (\n <p className=\"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60 select-none\">\n {children}\n </p>\n );\n}\n\nexport function Panel({ children, className }: { children: React.ReactNode; className?: string }) {\n return (\n <div className={cn('flex flex-col min-h-0 overflow-hidden', className)}>\n {children}\n </div>\n );\n}\n\nexport function ScrollArea({ children, className }: { children: React.ReactNode; className?: string }) {\n return (\n <div className={cn('flex-1 overflow-y-auto min-h-0', className)}>\n {children}\n </div>\n );\n}\n\nexport function PanelHeader({ title }: { title: string }) {\n return (\n <div className=\"shrink-0 border-b px-4 h-10 flex items-center\">\n <span className=\"text-[11px] font-semibold uppercase tracking-widest text-muted-foreground/50\">\n {title}\n </span>\n </div>\n );\n}\n\nexport function EmptyState({\n icon: Icon,\n text,\n className,\n}: {\n icon: React.ElementType;\n text: string;\n className?: string;\n}) {\n return (\n <div\n className={cn(\n 'flex flex-col items-center justify-center h-full gap-3 px-6 text-center',\n className,\n )}\n >\n <Icon className=\"h-7 w-7 text-muted-foreground/25\" />\n <p className=\"text-xs text-muted-foreground\">{text}</p>\n </div>\n );\n}\n\nexport function CollapsibleSection({\n label,\n action,\n children,\n defaultOpen = false,\n}: {\n label: React.ReactNode;\n action?: React.ReactNode;\n children: React.ReactNode;\n defaultOpen?: boolean;\n}) {\n const [open, setOpen] = React.useState(defaultOpen);\n return (\n <div className=\"space-y-0\">\n <div className=\"flex items-center justify-between\">\n <button\n type=\"button\"\n onClick={() => setOpen((v) => !v)}\n className=\"flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60 hover:text-muted-foreground transition-colors py-1\"\n >\n <ChevronRight className={cn('h-3 w-3 transition-transform', open && 'rotate-90')} />\n {label}\n </button>\n {action && <div className=\"shrink-0\">{action}</div>}\n </div>\n {open && <div>{children}</div>}\n </div>\n );\n}\n","'use client';\n\nimport { Check, ChevronDown, Sparkles } from 'lucide-react';\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport {\n Button,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@djangocfg/ui-core/components';\nimport { toast } from '@djangocfg/ui-core/hooks';\n\nimport type { ApiEndpoint, OpenApiSchema } from '../../types';\nimport {\n formatBytes,\n toCompactJson,\n toMarkdown,\n toRawJson,\n} from '../../utils/schemaExport';\n\ntype Flavour = 'markdown' | 'compact' | 'raw';\n\nconst FLAVOUR_LABELS: Record<Flavour, { title: string; hint: string }> = {\n markdown: {\n title: 'Markdown for LLM',\n hint: 'Endpoints + params as prose. Smallest.',\n },\n compact: {\n title: 'Compact JSON',\n hint: 'Dereferenced, no examples, minified.',\n },\n raw: {\n title: 'Raw JSON',\n hint: 'Full OpenAPI document with $refs.',\n },\n};\n\ninterface SchemaCopyMenuProps {\n schema: OpenApiSchema | null;\n endpoints: ApiEndpoint[];\n /** Resolved base URL that gets embedded into the copy so the AI\n * receives working URLs, not the ones originally in ``schema.servers``. */\n baseUrl?: string;\n /** Trigger appearance.\n * - ``button`` (default) — labelled pill with icon + chevron.\n * - ``icon`` — square ghost button, used in tight spots like the\n * sidebar header where there is no room for \"Copy for AI\". */\n variant?: 'button' | 'icon';\n}\n\n/**\n * Per-schema copy dropdown. Shows three flavours tuned for different LLM\n * use-cases. We compute each flavour lazily (only on click) because\n * dereferencing + stringifying a large schema can be non-trivial — sizes\n * are displayed after the first successful copy, via a tiny cache.\n */\nexport function SchemaCopyMenu({ schema, endpoints, baseUrl, variant = 'button' }: SchemaCopyMenuProps) {\n const [sizeCache, setSizeCache] = useState<Partial<Record<Flavour, string>>>({});\n const [justCopied, setJustCopied] = useState<Flavour | null>(null);\n const [open, setOpen] = useState(false);\n\n const isReady = schema !== null && endpoints.length > 0;\n\n const build = useCallback(\n (flavour: Flavour): string => {\n if (!schema) return '';\n if (flavour === 'markdown') return toMarkdown(schema, endpoints, baseUrl);\n if (flavour === 'compact') return toCompactJson(schema, baseUrl);\n return toRawJson(schema, baseUrl);\n },\n [schema, endpoints, baseUrl],\n );\n\n const handleCopy = useCallback(\n async (flavour: Flavour) => {\n if (!isReady) return;\n const text = build(flavour);\n const label = FLAVOUR_LABELS[flavour].title;\n try {\n await navigator.clipboard.writeText(text);\n const size = formatBytes(text);\n setSizeCache((prev) => ({ ...prev, [flavour]: size }));\n setJustCopied(flavour);\n setTimeout(() => setJustCopied(null), 1500);\n setOpen(false);\n toast.success(`Copied ${label}`, { description: size });\n } catch (err) {\n const message = err instanceof Error ? err.message : 'Clipboard permission denied';\n toast.error('Copy failed', { description: message });\n }\n },\n [build, isReady],\n );\n\n const flavours = useMemo<Flavour[]>(() => ['markdown', 'compact', 'raw'], []);\n\n return (\n <DropdownMenu open={open} onOpenChange={setOpen}>\n <DropdownMenuTrigger asChild>\n {variant === 'icon' ? (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-7 w-7 shrink-0\"\n disabled={!isReady}\n title=\"Copy schema for AI\"\n aria-label=\"Copy schema for AI\"\n >\n <Sparkles className=\"h-3.5 w-3.5\" />\n </Button>\n ) : (\n <Button variant=\"outline\" size=\"sm\" className=\"h-8 gap-1.5 text-xs\" disabled={!isReady}>\n <Sparkles className=\"h-3 w-3\" />\n Copy for AI\n <ChevronDown className=\"h-3 w-3 opacity-60\" />\n </Button>\n )}\n </DropdownMenuTrigger>\n <DropdownMenuContent\n side=\"right\"\n align=\"start\"\n sideOffset={6}\n collisionPadding={8}\n className=\"w-60 max-w-[calc(100vw-16px)]\"\n >\n <DropdownMenuLabel className=\"text-[10px] uppercase tracking-wider text-muted-foreground/70\">\n Copy schema\n </DropdownMenuLabel>\n <DropdownMenuSeparator />\n {flavours.map((f) => {\n const label = FLAVOUR_LABELS[f];\n const size = sizeCache[f];\n const isDone = justCopied === f;\n return (\n <DropdownMenuItem\n key={f}\n onClick={(e) => {\n e.preventDefault();\n void handleCopy(f);\n }}\n className=\"flex flex-col items-start gap-0.5 py-2 cursor-pointer\"\n >\n <div className=\"flex w-full items-center gap-2\">\n <span className=\"text-xs font-medium flex-1\">{label.title}</span>\n {isDone ? (\n <span className=\"inline-flex items-center gap-1 text-[10px] text-emerald-500\">\n <Check className=\"h-3 w-3\" /> Copied\n </span>\n ) : size ? (\n <span className=\"text-[10px] font-mono text-muted-foreground/70 tabular-nums\">\n {size}\n </span>\n ) : null}\n </div>\n <span className=\"text-[10px] text-muted-foreground/70 leading-snug line-clamp-1\">\n {label.hint}\n </span>\n </DropdownMenuItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n","'use client';\n\nimport type { ApiEndpoint, OpenApiInfo, OpenApiSchema } from '../../../types';\nimport { SchemaCopyMenu } from '../SchemaCopyMenu';\n\ninterface BrandHeaderProps {\n info: OpenApiInfo | null;\n /** Used only by ``SchemaCopyMenu`` — displayed label comes from ``info``. */\n endpoints: ApiEndpoint[];\n rawSchema?: OpenApiSchema | null;\n resolvedBaseUrl?: string;\n}\n\n/** Topmost row of the sidebar: API title on the left, tiny version\n * tag below it, and the Copy-for-AI menu on the right. The version\n * used to sit inline with the title and fought it for space on narrow\n * panels — stacking them vertically keeps the title at a readable\n * size and the version as quiet metadata. */\nexport function BrandHeader({ info, endpoints, rawSchema, resolvedBaseUrl }: BrandHeaderProps) {\n const apiTitle = info?.title ?? 'API Reference';\n const copyReady = rawSchema !== null && rawSchema !== undefined && endpoints.length > 0;\n\n return (\n <div className=\"shrink-0 border-b px-3 py-2.5 flex items-start gap-2\">\n <div className=\"flex-1 min-w-0\">\n <div\n className=\"text-[13px] font-semibold text-foreground leading-tight truncate\"\n title={apiTitle}\n >\n {apiTitle}\n </div>\n {info?.version && (\n <div className=\"font-mono text-[10px] text-muted-foreground/60 leading-tight mt-0.5\">\n v{info.version}\n </div>\n )}\n </div>\n {copyReady && (\n <SchemaCopyMenu\n schema={rawSchema ?? null}\n endpoints={endpoints}\n baseUrl={resolvedBaseUrl}\n variant=\"icon\"\n />\n )}\n </div>\n );\n}\n","import type { ApiEndpoint } from '../../types';\n\n/**\n * Given a list of full endpoint paths, return the longest ``/``-aligned\n * prefix they all share. Used to strip the redundant group prefix\n * (``/api/v3/pet``) from sidebar labels so the meaningful tail is visible.\n *\n * Works on full URLs too — if every path begins with the same origin,\n * the origin is part of the common prefix and gets stripped.\n */\nexport function longestCommonPrefix(paths: string[]): string {\n if (paths.length === 0) return '';\n if (paths.length === 1) return '';\n\n const segments = paths.map((p) => p.split('/'));\n const minLen = Math.min(...segments.map((s) => s.length));\n\n const shared: string[] = [];\n for (let i = 0; i < minLen; i++) {\n const first = segments[0]![i];\n if (segments.every((s) => s[i] === first)) {\n shared.push(first!);\n } else {\n break;\n }\n }\n // Don't strip everything — we always want at least a leading \"/\" or\n // the method on the visible side. If the group has one endpoint,\n // the caller guards with paths.length check already.\n const joined = shared.join('/');\n // Trim trailing slash so the tail is clean (``/foo`` not ``foo``).\n return joined;\n}\n\n/**\n * Compute the label to show in the sidebar for a given endpoint.\n *\n * Priority:\n * 1. ``ep.summary`` — human-readable, from OpenAPI ``operation.summary``.\n * 2. The tail of ``ep.path`` after stripping the group's common prefix.\n * 3. Full ``ep.path`` if the group has a single endpoint (no prefix to strip).\n */\nexport function sidebarLabel(ep: ApiEndpoint, groupCommonPrefix: string): string {\n if (ep.summary) return ep.summary;\n\n if (groupCommonPrefix && ep.path.startsWith(groupCommonPrefix)) {\n const tail = ep.path.slice(groupCommonPrefix.length) || '/';\n return tail;\n }\n return relativePath(ep.path);\n}\n\nfunction relativePath(full: string): string {\n try { return new URL(full).pathname; } catch { return full; }\n}\n\n/** Tooltip text: always the definitive ``METHOD relative/path``. */\nexport function sidebarTooltip(ep: ApiEndpoint): string {\n return `${ep.method} ${relativePath(ep.path)}`;\n}\n","/**\n * Shared grouping / sort for the docs layout.\n *\n * Sidebar and the docs longread MUST use the same order — otherwise\n * scrollspy highlights jump around as the user scrolls (the sidebar's\n * ordered list doesn't match the visual order of sections in the docs).\n * This module is the single source of truth for that ordering.\n */\n\nimport { groupBy, orderBy, partition, sortBy } from 'lodash-es';\n\nimport type { ApiEndpoint, SchemaSource } from '../../types';\nimport { longestCommonPrefix } from './sidebarLabel';\n\nexport type EndpointGroup = {\n category: string;\n endpoints: ApiEndpoint[];\n /** Longest ``/``-aligned prefix shared by every endpoint in this\n * group. Used by the sidebar to strip the redundant group prefix\n * from fallback labels. */\n commonPrefix: string;\n};\n\n/** A schema's worth of categorised endpoints. The outer level of the\n * ``sections`` sidebar iterates over these. */\nexport type SchemaSection = {\n source: SchemaSource;\n groups: EndpointGroup[];\n};\n\nconst METHOD_ORDER: Record<string, number> = {\n GET: 0,\n POST: 1,\n PUT: 2,\n PATCH: 3,\n DELETE: 4,\n};\n\nconst methodRank = (ep: ApiEndpoint) => METHOD_ORDER[ep.method] ?? 99;\n\n/**\n * Stable, deterministic ordering so two different renders with the\n * same endpoint list always produce the same visual sequence.\n *\n * Groups: alphabetical by tag/category, with ``Other`` pinned to the\n * bottom (spec-less endpoints should not steal the top slot).\n *\n * Within a group: endpoints sorted by path first (so related resources\n * cluster), then by HTTP method (read → write → delete).\n */\nexport function groupEndpoints(list: ApiEndpoint[]): EndpointGroup[] {\n const byCategory = groupBy(list, 'category');\n const all: EndpointGroup[] = Object.entries(byCategory).map(([category, endpoints]) => ({\n category,\n endpoints: orderBy(endpoints, ['path', methodRank], ['asc', 'asc']),\n commonPrefix: longestCommonPrefix(endpoints.map((e) => e.path)),\n }));\n // \"Other\" sinks to the bottom regardless of alphabet.\n const [other, named] = partition(all, (g) => g.category === 'Other');\n return [...sortBy(named, (g) => g.category.toLowerCase()), ...other];\n}\n\n/** Flatten grouped endpoints back into a linear list that preserves\n * group order + within-group order. This is the canonical order for\n * both the sidebar and the docs longread. */\nexport function flattenGrouped(groups: EndpointGroup[]): ApiEndpoint[] {\n return groups.flatMap((g) => g.endpoints);\n}\n\n/** Build per-schema sections in the same order as the original\n * ``schemas`` array. Schemas with zero endpoints are kept so users see\n * an empty-state placeholder instead of \"the section silently vanished\". */\nexport function buildSchemaSections(\n sources: SchemaSource[],\n endpointsBySchema: Record<string, ApiEndpoint[]>,\n): SchemaSection[] {\n return sources.map((source) => ({\n source,\n groups: groupEndpoints(endpointsBySchema[source.id] ?? []),\n }));\n}\n\n/** Flatten schema-sections into a linear endpoint list. Used by scrollspy\n * and by the docs longread to render endpoints in the exact same order\n * as the sidebar. */\nexport function flattenSchemaSections(sections: SchemaSection[]): ApiEndpoint[] {\n return sections.flatMap((s) => flattenGrouped(s.groups));\n}\n","import type { ApiEndpoint, OpenApiSchema, SchemaSource } from '../../../types';\nimport { deduplicateEndpoints } from '../../../utils/versionManager';\nimport { endpointAnchor } from '../anchor';\nimport { buildSchemaSections, groupEndpoints, type EndpointGroup } from '../grouping';\nimport { sidebarLabel, sidebarTooltip } from '../sidebarLabel';\nimport type {\n CategoryVM,\n EndpointRowVM,\n MethodFilter,\n SchemaSectionVM,\n SidebarBodyVM,\n} from './types';\n\n// ``OpenApiSchema`` is imported to satisfy the build VM signatures even\n// though we never read it here — re-exported so consumers can reuse\n// the same type surface without another import.\nexport type { OpenApiSchema };\n\nexport function filterEndpoints(\n list: ApiEndpoint[],\n query: string,\n method: MethodFilter,\n): ApiEndpoint[] {\n let out = list;\n if (method !== 'ALL') {\n out = out.filter((e) => e.method === method);\n }\n if (query) {\n const q = query.toLowerCase();\n out = out.filter(\n (e) =>\n e.summary.toLowerCase().includes(q) ||\n e.name.toLowerCase().includes(q) ||\n e.description.toLowerCase().includes(q) ||\n e.path.toLowerCase().includes(q),\n );\n }\n return out;\n}\n\nfunction buildCategory(\n group: EndpointGroup,\n activeEndpointId: string | null,\n schemaId: string | null,\n keyPrefix: string,\n): CategoryVM {\n const rows: EndpointRowVM[] = group.endpoints.map((ep) => {\n const anchor = endpointAnchor(ep, schemaId ?? ep.schemaId ?? null);\n return {\n key: `${ep.method}-${ep.path}`,\n anchor,\n schemaId: schemaId ?? ep.schemaId ?? null,\n label: sidebarLabel(ep, group.commonPrefix),\n tooltip: sidebarTooltip(ep),\n method: ep.method,\n useMono: !ep.summary,\n isActive: activeEndpointId === anchor,\n };\n });\n return {\n key: `${keyPrefix}${group.category}`,\n category: group.category,\n rows,\n };\n}\n\nfunction emptyTextFor(query: string, method: MethodFilter, defaultText: string): string {\n if (query && method !== 'ALL') return `No ${method} endpoints match \"${query}\"`;\n if (query) return `No endpoints match \"${query}\"`;\n if (method !== 'ALL') return `No ${method} endpoints`;\n return defaultText;\n}\n\nexport function buildFlatVM(\n endpoints: ApiEndpoint[],\n selectedVersion: string,\n query: string,\n method: MethodFilter,\n activeEndpointId: string | null,\n): SidebarBodyVM {\n const filtered = filterEndpoints(\n deduplicateEndpoints(endpoints, selectedVersion),\n query,\n method,\n );\n const groups = groupEndpoints(filtered);\n return {\n kind: 'flat',\n categories: groups.map((g) => buildCategory(g, activeEndpointId, null, '')),\n emptyText: emptyTextFor(query, method, 'No endpoints in this schema'),\n };\n}\n\nexport function buildSectionsVM(\n schemas: SchemaSource[],\n endpointsBySchema: Record<string, ApiEndpoint[]>,\n selectedVersion: string,\n query: string,\n method: MethodFilter,\n activeEndpointId: string | null,\n): SidebarBodyVM {\n const filteredMap: Record<string, ApiEndpoint[]> = {};\n for (const src of schemas) {\n const raw = endpointsBySchema[src.id] ?? [];\n filteredMap[src.id] = filterEndpoints(\n deduplicateEndpoints(raw, selectedVersion),\n query,\n method,\n );\n }\n const rawSections = buildSchemaSections(schemas, filteredMap);\n const sections: SchemaSectionVM[] = rawSections\n .filter((s) => s.groups.length > 0)\n .map((s) => ({\n sourceId: s.source.id,\n sourceName: s.source.name,\n categories: s.groups.map((g) =>\n buildCategory(g, activeEndpointId, s.source.id, `${s.source.id}-`),\n ),\n }));\n return {\n kind: 'sections',\n sections,\n emptyText: emptyTextFor(query, method, 'No endpoints in any schema'),\n };\n}\n","'use client';\n\nimport React, { useEffect, useRef } from 'react';\n\nimport { Tooltip, TooltipContent, TooltipTrigger } from '@djangocfg/ui-core/components';\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport { MethodBadge } from '../../shared/ui';\nimport type { EndpointRowVM, NavigateFn } from './types';\n\ninterface EndpointRowProps {\n row: EndpointRowVM;\n onNavigate: NavigateFn;\n}\n\n/** One endpoint in the sidebar list. Layout decisions worth calling out:\n * - Fixed 52px badge column via CSS grid so ``GET`` / ``POST`` /\n * ``PATCH`` all take the same horizontal slot and labels align\n * vertically on the left edge. Without this the list looks ragged\n * because ``POST`` is wider than ``GET`` and each label starts at\n * a different x offset.\n * - ``items-baseline`` so the method badge sits on the same visual\n * line as the label text, not in its vertical centre.\n * - ``py-1`` (not the old ``py-1.5``) for higher list density.\n * - Trailing full-stops are trimmed from the label. OpenAPI\n * summaries often end in ``.`` which looks like noise in a list.\n * - Active state is a single left-edge accent bar + soft tint — no\n * big filled background so the method badge still carries the\n * colour semantics of the row. */\nexport const EndpointRow = React.memo(function EndpointRow({\n row,\n onNavigate,\n}: EndpointRowProps) {\n // Strip a trailing full-stop — OpenAPI ``summary`` routinely ends\n // in ``.`` which looks like punctuation noise when stacked in a list.\n const displayLabel = row.label.replace(/\\.$/, '');\n\n // Keep the active row visible inside the sidebar's scroll container.\n // ``block: 'nearest'`` is a no-op when the row is already in view,\n // so this only fires when the user scrolled the docs far enough to\n // push the highlighted endpoint above/below the sidebar viewport.\n const buttonRef = useRef<HTMLButtonElement | null>(null);\n useEffect(() => {\n if (!row.isActive || !buttonRef.current) return;\n buttonRef.current.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }, [row.isActive]);\n\n return (\n <Tooltip delayDuration={350}>\n <TooltipTrigger asChild>\n <button\n ref={buttonRef}\n onClick={() => onNavigate(row.anchor, row.schemaId)}\n aria-current={row.isActive ? 'location' : undefined}\n className={cn(\n 'relative w-full text-left grid grid-cols-[52px_minmax(0,1fr)] items-baseline gap-2 pl-3 pr-3 py-1 transition-colors',\n row.isActive\n ? 'bg-primary/10 text-foreground'\n : 'hover:bg-muted/40 text-foreground/75 hover:text-foreground',\n )}\n >\n {row.isActive && (\n <span className=\"absolute left-0 top-1 bottom-1 w-0.5 rounded-r bg-primary\" />\n )}\n <span className=\"justify-self-start\">\n <MethodBadge method={row.method} />\n </span>\n <span\n className={cn(\n 'line-clamp-2 leading-snug min-w-0',\n row.useMono ? 'font-mono text-[11px] break-all' : 'text-[12px]',\n row.isActive && 'text-foreground font-medium',\n )}\n >\n {displayLabel}\n </span>\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"right\" align=\"center\" className=\"font-mono text-[11px]\">\n {row.tooltip}\n </TooltipContent>\n </Tooltip>\n );\n});\n","'use client';\n\nimport React from 'react';\n\nimport { EndpointRow } from './EndpointRow';\nimport type { CategoryVM, NavigateFn } from './types';\n\ninterface CategoryBlockProps {\n category: CategoryVM;\n onNavigate: NavigateFn;\n}\n\n/** A labelled group of endpoint rows. The category header is\n * deliberately tiny (text-[10px] tracking-wider) — it's a divider, not\n * a call to attention. Users who are reading the list want to see the\n * endpoint names, not the category prose. */\nexport const CategoryBlock = React.memo(function CategoryBlock({\n category,\n onNavigate,\n}: CategoryBlockProps) {\n return (\n <div className=\"mb-2.5 last:mb-1\">\n <div className=\"px-3 pt-3 pb-1 text-[10px] font-semibold uppercase tracking-[0.14em] text-muted-foreground/50 select-none\">\n {category.category}\n </div>\n <div>\n {category.rows.map((row) => (\n <EndpointRow key={row.key} row={row} onNavigate={onNavigate} />\n ))}\n </div>\n </div>\n );\n});\n","'use client';\n\nimport { CategoryBlock } from './CategoryBlock';\nimport type { NavigateFn, SchemaSectionVM } from './types';\n\ninterface SchemaSectionProps {\n section: SchemaSectionVM;\n onNavigate: NavigateFn;\n}\n\n/** One schema block inside ``sections`` grouping mode. Renders a\n * sticky header with the schema name so users can tell which API\n * they're looking at while scrolling, then the categories below. */\nexport function SchemaSection({ section, onNavigate }: SchemaSectionProps) {\n return (\n <div className=\"mb-4 last:mb-2\">\n <div className=\"px-3 py-1.5 sticky top-0 z-[1] bg-background/95 backdrop-blur-[2px] border-b border-border/40\">\n <span className=\"text-[11px] font-bold uppercase tracking-[0.12em] text-foreground/80\">\n {section.sourceName}\n </span>\n </div>\n {section.categories.map((cat) => (\n <CategoryBlock key={cat.key} category={cat} onNavigate={onNavigate} />\n ))}\n </div>\n );\n}\n","'use client';\n\nimport { CategoryBlock } from './CategoryBlock';\nimport { SchemaSection } from './SchemaSection';\nimport type { NavigateFn, SidebarBodyVM } from './types';\n\ninterface SidebarBodyProps {\n body: SidebarBodyVM;\n onNavigate: NavigateFn;\n}\n\n/** Scrollable body of the sidebar. Picks the rendering strategy based\n * on ``body.kind`` — flat category list for single-schema mode,\n * nested schema sections for multi-schema mode — and falls back to\n * a centred empty-state message when the filter pipeline yields no\n * rows. */\nexport function SidebarBody({ body, onNavigate }: SidebarBodyProps) {\n if (body.kind === 'flat') {\n if (body.categories.length === 0) {\n return (\n <div className=\"py-10 px-4 text-center text-xs text-muted-foreground\">\n {body.emptyText}\n </div>\n );\n }\n return (\n <nav className=\"pt-1.5 pb-[10vh]\">\n {body.categories.map((cat) => (\n <CategoryBlock key={cat.key} category={cat} onNavigate={onNavigate} />\n ))}\n </nav>\n );\n }\n\n if (body.sections.length === 0) {\n return (\n <div className=\"py-10 px-4 text-center text-xs text-muted-foreground\">\n {body.emptyText}\n </div>\n );\n }\n\n return (\n <nav className=\"py-1.5\">\n {body.sections.map((section) => (\n <SchemaSection key={section.sourceId} section={section} onNavigate={onNavigate} />\n ))}\n </nav>\n );\n}\n","import type { ApiEndpoint } from '../../../types';\n\n/** HTTP method filter. ``ALL`` is a sentinel for no filter — using a\n * string union (rather than ``string | null``) keeps the filter chips\n * and reducer logic type-safe without null juggling. */\nexport const METHOD_FILTERS = ['ALL', 'GET', 'POST', 'PUT', 'PATCH', 'DELETE'] as const;\nexport type MethodFilter = (typeof METHOD_FILTERS)[number];\n\nexport interface EndpointRowVM {\n key: string;\n anchor: string;\n schemaId: string | null;\n label: string;\n tooltip: string;\n method: string;\n /** Summary-less endpoints get a monospace font for the path-tail\n * label so the tech string is readable against a sea of prose. */\n useMono: boolean;\n isActive: boolean;\n}\n\nexport interface CategoryVM {\n key: string;\n category: string;\n rows: EndpointRowVM[];\n}\n\nexport interface SchemaSectionVM {\n sourceId: string;\n sourceName: string;\n categories: CategoryVM[];\n}\n\nexport type SidebarBodyVM =\n | { kind: 'flat'; categories: CategoryVM[]; emptyText: string }\n | { kind: 'sections'; sections: SchemaSectionVM[]; emptyText: string };\n\nexport type NavigateFn = (anchor: string, schemaId?: string | null) => void;\n\n// Re-exported here so downstream files don't all re-import from the\n// outer ``types`` module for every component prop.\nexport type { ApiEndpoint };\n","'use client';\n\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport { METHOD_FILTERS, type MethodFilter } from './types';\n\ninterface MethodChipsProps {\n value: MethodFilter;\n onChange: (v: MethodFilter) => void;\n}\n\n/** Horizontal filter strip. Scrolls horizontally on narrow widths\n * rather than wrapping to a second line — the toolbar stays a fixed\n * height so the endpoint list below gets every pixel it can.\n *\n * Active chips use a solid fill (not the outlined-with-tint style\n * from the old design) so \"this filter is on\" reads at a glance\n * without the eye having to resolve subtle border colour shifts. */\nexport function MethodChips({ value, onChange }: MethodChipsProps) {\n return (\n <div className=\"flex items-center gap-1 overflow-x-auto -mx-1 px-1 pb-px\">\n {METHOD_FILTERS.map((m) => {\n const active = value === m;\n return (\n <button\n key={m}\n type=\"button\"\n onClick={() => onChange(m)}\n aria-pressed={active}\n className={cn(\n 'shrink-0 px-2 h-6 rounded font-mono text-[10px] font-semibold tracking-wide uppercase transition-colors',\n active\n ? 'bg-foreground text-background'\n : 'text-muted-foreground/70 hover:text-foreground hover:bg-muted',\n )}\n >\n {m}\n </button>\n );\n })}\n </div>\n );\n}\n","'use client';\n\nimport { Search, X } from 'lucide-react';\nimport React from 'react';\n\nimport { Input } from '@djangocfg/ui-core/components';\nimport { cn } from '@djangocfg/ui-core/lib';\n\ninterface SearchInputProps {\n value: string;\n onChange: (v: string) => void;\n placeholder?: string;\n}\n\n/** Search field with a leading icon and a trailing clear button. The\n * clear button only appears when there's something to clear so the\n * idle state reads as a single clean input rather than \"icon + input\n * + mystery button\". */\nexport function SearchInput({ value, onChange, placeholder }: SearchInputProps) {\n return (\n <div className=\"relative\">\n <Search className=\"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground/50 pointer-events-none\" />\n <Input\n placeholder={placeholder ?? 'Search endpoints…'}\n value={value}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => onChange(e.target.value)}\n className=\"pl-8 pr-7 h-8 text-xs\"\n />\n {value && (\n <button\n type=\"button\"\n onClick={() => onChange('')}\n aria-label=\"Clear search\"\n className={cn(\n 'absolute right-1.5 top-1/2 -translate-y-1/2 h-5 w-5 rounded',\n 'inline-flex items-center justify-center',\n 'text-muted-foreground/50 hover:text-foreground hover:bg-muted transition-colors',\n )}\n >\n <X className=\"h-3 w-3\" />\n </button>\n )}\n </div>\n );\n}\n","'use client';\n\nimport React from 'react';\n\nimport { Combobox } from '@djangocfg/ui-core/components';\n\nimport type { SchemaSource } from '../../../types';\nimport { MethodChips } from './MethodChips';\nimport { SearchInput } from './SearchInput';\nimport type { MethodFilter } from './types';\n\ninterface ToolbarProps {\n schemas: SchemaSource[];\n currentSchemaId: string | null;\n onSchemaChange: (id: string) => void;\n showSchemaSelector: boolean;\n\n search: string;\n onSearchChange: (v: string) => void;\n\n methodFilter: MethodFilter;\n onMethodFilterChange: (v: MethodFilter) => void;\n}\n\n/** Filter / control panel of the sidebar. Groups the schema selector,\n * search box, and HTTP method chips into a single visually cohesive\n * block so they read as \"one toolbar\" rather than three separate\n * affordances stacked on top of each other.\n *\n * Each row is optional in the sense that we only render the schema\n * selector when there are multiple schemas to choose between. */\nexport function Toolbar({\n schemas,\n currentSchemaId,\n onSchemaChange,\n showSchemaSelector,\n search,\n onSearchChange,\n methodFilter,\n onMethodFilterChange,\n}: ToolbarProps) {\n const schemaOptions = React.useMemo(\n () => schemas.map((s) => ({ value: s.id, label: s.name })),\n [schemas],\n );\n\n return (\n <div className=\"shrink-0 border-b px-3 py-2.5 space-y-2\">\n {showSchemaSelector && (\n <Combobox\n options={schemaOptions}\n value={currentSchemaId ?? ''}\n onValueChange={(id) => id && onSchemaChange(id)}\n placeholder=\"Select API\"\n searchPlaceholder=\"Search APIs…\"\n emptyText=\"No APIs found\"\n className=\"w-full h-8 text-xs\"\n />\n )}\n <SearchInput value={search} onChange={onSearchChange} />\n <MethodChips value={methodFilter} onChange={onMethodFilterChange} />\n </div>\n );\n}\n","import { useEffect, useState } from 'react';\n\n/** Debounce a fast-changing value. Used for the sidebar search box so\n * each keystroke doesn't re-run the filter pipeline (endpoint list\n * can be hundreds of items long in some specs). 120ms is short\n * enough to feel instant while still batching rapid typing. */\nexport function useDebouncedValue<T>(value: T, delayMs = 120): T {\n const [debounced, setDebounced] = useState(value);\n useEffect(() => {\n const id = setTimeout(() => setDebounced(value), delayMs);\n return () => clearTimeout(id);\n }, [value, delayMs]);\n return debounced;\n}\n","'use client';\n\nimport React, { useMemo, useState } from 'react';\n\nimport type { ApiEndpoint, OpenApiInfo, OpenApiSchema, SchemaSource } from '../../../types';\nimport { ScrollArea } from '../../shared/ui';\nimport { BrandHeader } from './BrandHeader';\nimport { buildFlatVM, buildSectionsVM } from './buildVM';\nimport { SidebarBody } from './SidebarBody';\nimport { Toolbar } from './Toolbar';\nimport type { MethodFilter, SidebarBodyVM } from './types';\nimport { useDebouncedValue } from './useDebouncedValue';\n\nexport interface DocsSidebarProps {\n info: OpenApiInfo | null;\n /** Active-schema endpoints — used by ``selector`` mode. */\n endpoints: ApiEndpoint[];\n /** All configured schemas (used by both modes). */\n schemas: SchemaSource[];\n currentSchemaId: string | null;\n onSchemaChange: (id: string) => void;\n activeEndpointId: string | null;\n selectedVersion: string;\n onNavigate: (anchor: string, schemaId?: string | null) => void;\n /** Presentation mode. Default: ``selector`` (back-compat). */\n grouping?: 'selector' | 'sections';\n /** Required for ``sections`` mode — endpoints grouped by their source\n * schema id. The sidebar renders them as two-level sections. */\n endpointsBySchema?: Record<string, ApiEndpoint[]>;\n /** Raw active schema + resolved base URL — used by the Copy-for-AI\n * dropdown in the brand row. ``null`` disables the button. */\n rawSchema?: OpenApiSchema | null;\n resolvedBaseUrl?: string;\n}\n\n/** Docs sidebar orchestrator. Thin — each child folder owns its own\n * rendering; this file wires props, debounces search, and decides\n * which view-model builder to call. */\nexport function DocsSidebar({\n info,\n endpoints,\n schemas,\n currentSchemaId,\n onSchemaChange,\n activeEndpointId,\n selectedVersion,\n onNavigate,\n grouping = 'selector',\n endpointsBySchema,\n rawSchema,\n resolvedBaseUrl,\n}: DocsSidebarProps) {\n const [search, setSearch] = useState('');\n const [methodFilter, setMethodFilter] = useState<MethodFilter>('ALL');\n const debouncedSearch = useDebouncedValue(search);\n\n const body = useMemo<SidebarBodyVM>(() => {\n if (grouping === 'sections') {\n return buildSectionsVM(\n schemas,\n endpointsBySchema ?? {},\n selectedVersion,\n debouncedSearch,\n methodFilter,\n activeEndpointId,\n );\n }\n return buildFlatVM(\n endpoints,\n selectedVersion,\n debouncedSearch,\n methodFilter,\n activeEndpointId,\n );\n }, [\n grouping,\n schemas,\n endpointsBySchema,\n endpoints,\n selectedVersion,\n debouncedSearch,\n methodFilter,\n activeEndpointId,\n ]);\n\n const hasMultipleSchemas = schemas.length > 1;\n const showSchemaSelector = grouping === 'selector' && hasMultipleSchemas;\n\n return (\n <aside className=\"flex flex-col h-full min-h-0 border-r bg-muted/10\">\n <BrandHeader\n info={info}\n endpoints={endpoints}\n rawSchema={rawSchema}\n resolvedBaseUrl={resolvedBaseUrl}\n />\n <Toolbar\n schemas={schemas}\n currentSchemaId={currentSchemaId}\n onSchemaChange={onSchemaChange}\n showSchemaSelector={showSchemaSelector}\n search={search}\n onSearchChange={setSearch}\n methodFilter={methodFilter}\n onMethodFilterChange={setMethodFilter}\n />\n <ScrollArea>\n <SidebarBody body={body} onNavigate={onNavigate} />\n </ScrollArea>\n </aside>\n );\n}\n","/**\n * Find the nearest ancestor that actually scrolls vertically, or\n * ``window`` when none exists. Handles the common embed scenarios:\n *\n * - Standalone page: nothing in the chain scrolls → caller scrolls\n * ``window`` and listens to ``window.scroll``.\n * - Dev playground / modal shell: an intermediate ``overflow-auto``\n * container scrolls → caller scrolls that element and listens to\n * *its* ``scroll`` events (which do NOT bubble to window).\n *\n * A \"scrollable\" ancestor is one whose computed ``overflow-y`` is\n * ``auto`` or ``scroll`` AND whose content actually overflows. We bail\n * before ``document.body`` — ``documentElement`` is represented by\n * ``window`` in the caller's hot path, so returning the body itself\n * would double-count the scroll surface.\n */\nexport type ScrollTarget = HTMLElement | Window;\n\nexport function getScrollParent(el: HTMLElement | null): ScrollTarget {\n if (typeof window === 'undefined') return (null as unknown) as Window;\n if (!el) return window;\n\n let cur: HTMLElement | null = el.parentElement;\n while (cur && cur !== document.body && cur !== document.documentElement) {\n const style = getComputedStyle(cur);\n const overflowY = style.overflowY;\n const canScroll =\n (overflowY === 'auto' || overflowY === 'scroll' || overflowY === 'overlay') &&\n cur.scrollHeight > cur.clientHeight;\n if (canScroll) return cur;\n cur = cur.parentElement;\n }\n return window;\n}\n\n/** Top-relative scroll position of the target. */\nexport function getScrollTop(target: ScrollTarget): number {\n return target === window ? window.scrollY : (target as HTMLElement).scrollTop;\n}\n\n/** Visible viewport height of the target. */\nexport function getViewportHeight(target: ScrollTarget): number {\n return target === window ? window.innerHeight : (target as HTMLElement).clientHeight;\n}\n\n/** Y coordinate of the target's top edge, in viewport space. Used to\n * translate ``getBoundingClientRect().top`` into target-relative\n * coordinates. For ``window`` this is always ``0``. */\nexport function getTargetTop(target: ScrollTarget): number {\n return target === window ? 0 : (target as HTMLElement).getBoundingClientRect().top;\n}\n\n/** Scroll the target so that the given absolute Y lands at its top.\n *\n * For ``window`` we ask the browser to animate smoothly — every engine\n * honours that path. Nested ``overflow-auto`` elements are a different\n * story: some layouts (e.g. dev-playground shells with flex parents)\n * silently drop the animation, leaving the user stuck. Direct\n * ``scrollTop`` writes always work, so we use them there — loss of\n * animation beats broken navigation. Consumers who want animated\n * scrolling inside a custom shell can wrap this function themselves. */\nexport function scrollTargetTo(target: ScrollTarget, top: number) {\n if (target === window) {\n window.scrollTo({ top, behavior: 'smooth' });\n return;\n }\n (target as HTMLElement).scrollTop = top;\n}\n","'use client';\n\nimport React from 'react';\n\nimport { MarkdownMessage } from '../../../../components/markdown';\nimport type { ApiEndpoint, OpenApiInfo, OpenApiSchema } from '../../types';\nimport { SchemaCopyMenu } from './SchemaCopyMenu';\n\ninterface ApiIntroSectionProps {\n info: OpenApiInfo;\n schema: OpenApiSchema | null;\n endpoints: ApiEndpoint[];\n resolvedBaseUrl?: string;\n}\n\ninterface BaseUrlRow {\n url: string;\n description?: string;\n}\n\nexport function ApiIntroSection({ info, schema, endpoints, resolvedBaseUrl }: ApiIntroSectionProps) {\n // Prefer the *resolved* base URL whenever we have one — that's the\n // URL actual requests target, not the raw ``servers[0].url`` from\n // the spec (which can be a bare path like ``/api/v3``). Fall back\n // to the spec's ``servers`` list so specs that document multiple\n // servers keep showing all of them.\n const baseUrlRows: BaseUrlRow[] = resolvedBaseUrl\n ? [{ url: resolvedBaseUrl, description: info.servers?.[0]?.description }]\n : (info.servers ?? []).map((s) => ({ url: s.url, description: s.description }));\n\n return (\n <section className=\"pb-10 mb-10 border-b\">\n <div className=\"flex items-start justify-between gap-4 flex-wrap\">\n <div className=\"flex items-center gap-3 flex-wrap min-w-0\">\n <h1 className=\"text-3xl font-semibold tracking-tight text-foreground leading-tight\">\n {info.title}\n </h1>\n <span className=\"inline-flex items-center rounded-full bg-muted px-2 py-0.5 font-mono text-[11px] text-muted-foreground\">\n v{info.version}\n </span>\n </div>\n <SchemaCopyMenu\n schema={schema}\n endpoints={endpoints}\n baseUrl={resolvedBaseUrl}\n />\n </div>\n\n {info.description && (\n <div className=\"mt-4 text-muted-foreground\">\n <MarkdownMessage content={info.description} />\n </div>\n )}\n\n {baseUrlRows.length > 0 && (\n <div className=\"mt-6 space-y-2\">\n <h4 className=\"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\">\n Base URL\n </h4>\n <div className=\"space-y-1.5\">\n {baseUrlRows.map((row, i) => (\n <div key={`${row.url}-${i}`} className=\"flex items-baseline gap-2 flex-wrap\">\n <code className=\"font-mono text-xs px-2 py-1 rounded bg-muted border\">\n {row.url}\n </code>\n {row.description && (\n <span className=\"text-xs text-muted-foreground\">\n {row.description}\n </span>\n )}\n </div>\n ))}\n </div>\n </div>\n )}\n </section>\n );\n}\n","'use client';\n\nimport React, { createContext, useContext, useMemo } from 'react';\n\n/** Identity context for a single EndpointDoc subtree.\n *\n * This is NOT a state container — state lives in the zustand store at\n * ``./store``. The context only carries per-endpoint *identity* values\n * so children (Section, CodeSamples, future ExpandAll button) don't\n * have to re-derive them or receive them as repeated props.\n *\n * Why identity-only:\n * - One zustand singleton handles state for *all* endpoints on the\n * page, keyed by ``endpointId``. Wrapping zustand itself in a\n * Provider would defeat that composite-key design.\n * - Identity (anchor, HTTP method) is invariant inside an endpoint\n * card; deriving it per-child is wasted work and makes the props\n * table look noisier than the logic actually is. */\ninterface EndpointDocContextValue {\n /** DOM-safe anchor id for this endpoint — used as the store key\n * prefix (``openSections[`${endpointId}:${sectionId}`]``) and as\n * the URL hash target for shareable links. */\n endpointId: string;\n /** HTTP method (``GET`` / ``POST`` / …). Drives per-method default\n * open state for Section. Kept in context so ``defaultSectionOpen``\n * doesn't need to be threaded as a prop through every subtree. */\n method: string;\n}\n\nconst EndpointDocContext = createContext<EndpointDocContextValue | null>(null);\n\ninterface EndpointDocProviderProps extends EndpointDocContextValue {\n children: React.ReactNode;\n}\n\nexport function EndpointDocProvider({ endpointId, method, children }: EndpointDocProviderProps) {\n // Memoise the value so every re-render of the parent orchestrator\n // doesn't invalidate children reading the context — the common\n // hover/focus state on the header row re-renders EndpointDoc often.\n const value = useMemo(() => ({ endpointId, method }), [endpointId, method]);\n return <EndpointDocContext.Provider value={value}>{children}</EndpointDocContext.Provider>;\n}\n\nexport function useEndpointDocContext(): EndpointDocContextValue {\n const ctx = useContext(EndpointDocContext);\n if (!ctx) {\n // Treated as a programming error, not a runtime one — if this\n // fires, something rendered EndpointDoc internals outside the\n // provider, which means the store keys will collide or be\n // missing entirely. Loud failure beats silent corruption.\n throw new Error(\n '[OpenapiViewer] useEndpointDocContext must be used inside <EndpointDocProvider>.',\n );\n }\n return ctx;\n}\n","'use client';\n\nimport { create } from 'zustand';\nimport { persist, createJSONStorage } from 'zustand/middleware';\n\nimport type { CodeSampleTargetId } from '../../../../utils/codeSamples';\nimport type { SectionId } from '../types';\n\n/** Composite key so the same section id (``responses``) can have\n * distinct state per endpoint on the page. We don't use Map because\n * zustand+persist serialises state to JSON and Map survival there\n * requires extra replacer/reviver boilerplate for no real gain. */\nexport const sectionKey = (endpointId: string, sectionId: SectionId): string =>\n `${endpointId}:${sectionId}`;\n\nexport interface EndpointDocState {\n /** ``${endpointId}:${sectionId}`` → open? — ``undefined`` means\n * \"use the component's ``defaultOpen``\"; the store only stores\n * user-driven overrides so defaults can change later without\n * stale persisted state overriding them. */\n openSections: Record<string, boolean>;\n /** Active code-sample tab per endpoint. Keyed on endpoint id only;\n * users tend to pick one language and stick with it across the\n * whole page, so sharing between endpoints is acceptable UX. */\n activeCodeTab: Record<string, CodeSampleTargetId>;\n}\n\nexport interface EndpointDocActions {\n toggleSection: (endpointId: string, sectionId: SectionId) => void;\n setSectionOpen: (endpointId: string, sectionId: SectionId, open: boolean) => void;\n setCodeTab: (endpointId: string, tab: CodeSampleTargetId) => void;\n /** Bulk ops — \"expand all\" / \"collapse all\" on a single endpoint.\n * The component calls these from an action button in the header. */\n expandAll: (endpointId: string, sectionIds: readonly SectionId[]) => void;\n collapseAll: (endpointId: string, sectionIds: readonly SectionId[]) => void;\n}\n\nexport type EndpointDocStore = EndpointDocState & EndpointDocActions;\n\nconst initialState: EndpointDocState = {\n openSections: {},\n activeCodeTab: {},\n};\n\n/** Zustand store with sessionStorage persistence. Using sessionStorage\n * (not localStorage) so closing the tab clears state — the viewer is\n * often embedded in a dashboard and persisting forever would surprise\n * users who switched schemas. */\nexport const useEndpointDocStore = create<EndpointDocStore>()(\n persist(\n (set) => ({\n ...initialState,\n\n toggleSection: (endpointId, sectionId) =>\n set((state) => {\n const key = sectionKey(endpointId, sectionId);\n const current = state.openSections[key];\n return {\n openSections: {\n ...state.openSections,\n // If there's no explicit override yet, the user's\n // first click means \"flip from the default\". We\n // assume the default was ``true`` for the most\n // common case (bodies/responses) and ``false``\n // otherwise; the Section component tracks this\n // via its ``defaultOpen`` prop and never calls\n // toggle on sections whose defaults match the\n // next state.\n [key]: current === undefined ? false : !current,\n },\n };\n }),\n\n setSectionOpen: (endpointId, sectionId, open) =>\n set((state) => ({\n openSections: {\n ...state.openSections,\n [sectionKey(endpointId, sectionId)]: open,\n },\n })),\n\n setCodeTab: (endpointId, tab) =>\n set((state) => ({\n activeCodeTab: {\n ...state.activeCodeTab,\n [endpointId]: tab,\n },\n })),\n\n expandAll: (endpointId, sectionIds) =>\n set((state) => {\n const next = { ...state.openSections };\n for (const sid of sectionIds) {\n next[sectionKey(endpointId, sid)] = true;\n }\n return { openSections: next };\n }),\n\n collapseAll: (endpointId, sectionIds) =>\n set((state) => {\n const next = { ...state.openSections };\n for (const sid of sectionIds) {\n next[sectionKey(endpointId, sid)] = false;\n }\n return { openSections: next };\n }),\n }),\n {\n name: 'openapi-viewer:endpoint-doc',\n storage: createJSONStorage(() => {\n // Guard for SSR / non-browser environments — zustand's\n // persist middleware calls storage.getItem synchronously\n // during hydration, and ``sessionStorage`` is undefined\n // there. Returning a noop keeps SSR snapshots stable.\n if (typeof window === 'undefined') {\n return {\n getItem: () => null,\n setItem: () => {},\n removeItem: () => {},\n };\n }\n return window.sessionStorage;\n }),\n // Only persist user overrides, not the functions. Zustand\n // serialises everything by default and logs a warning on\n // non-serialisable values; partialize keeps the payload lean.\n partialize: (state) => ({\n openSections: state.openSections,\n activeCodeTab: state.activeCodeTab,\n }),\n },\n ),\n);\n","'use client';\n\nimport type { CodeSampleTargetId } from '../../../../utils/codeSamples';\nimport type { SectionId } from '../types';\nimport { sectionKey, useEndpointDocStore } from './index';\n\n/** Read whether a section is open, falling back to ``defaultOpen`` when\n * the user hasn't explicitly toggled it. Returning a raw boolean makes\n * the caller's conditional rendering trivial. */\nexport function useIsSectionOpen(\n endpointId: string,\n sectionId: SectionId,\n defaultOpen: boolean,\n): boolean {\n return useEndpointDocStore((s) => {\n const explicit = s.openSections[sectionKey(endpointId, sectionId)];\n return explicit === undefined ? defaultOpen : explicit;\n });\n}\n\n/** Read the active code-sample tab for this endpoint, falling back to\n * a shared default (``curl``). Falls back at read time rather than at\n * write time so changing the default later doesn't require store\n * migration. */\nexport function useActiveCodeTab(\n endpointId: string,\n fallback: CodeSampleTargetId = 'curl',\n): CodeSampleTargetId {\n return useEndpointDocStore((s) => s.activeCodeTab[endpointId] ?? fallback);\n}\n\nexport function useEndpointDocActions() {\n return useEndpointDocStore((s) => ({\n toggleSection: s.toggleSection,\n setSectionOpen: s.setSectionOpen,\n setCodeTab: s.setCodeTab,\n expandAll: s.expandAll,\n collapseAll: s.collapseAll,\n }));\n}\n","'use client';\n\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport { CODE_SAMPLE_TARGETS, type CodeSampleTargetId } from '../../../../utils/codeSamples';\n\ninterface LanguageTabsProps {\n activeId: CodeSampleTargetId;\n onChange: (id: CodeSampleTargetId) => void;\n}\n\n/** Horizontal tab strip for switching between cURL/JS/Python/… The\n * strip scrolls horizontally on narrow viewports rather than wrapping\n * to a second line so the adjacent code block keeps its vertical\n * rhythm. */\nexport function LanguageTabs({ activeId, onChange }: LanguageTabsProps) {\n return (\n <div className=\"flex items-center gap-1 overflow-x-auto -mx-1 px-1\">\n {CODE_SAMPLE_TARGETS.map((t) => (\n <button\n key={t.id}\n type=\"button\"\n onClick={() => onChange(t.id)}\n className={cn(\n 'shrink-0 h-7 px-2.5 rounded text-xs font-medium transition-colors',\n activeId === t.id\n ? 'bg-muted text-foreground'\n : 'text-muted-foreground/70 hover:text-foreground hover:bg-muted/50',\n )}\n >\n {t.label}\n </button>\n ))}\n </div>\n );\n}\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport type { ApiEndpoint } from '../../../../types';\nimport {\n CODE_SAMPLE_TARGETS,\n renderSnippet,\n type CodeSampleTargetId,\n} from '../../../../utils/codeSamples';\nimport { buildHarRequest } from '../../../../utils/operationToHar';\nimport { resolveAbsolute } from '../../../../utils/url';\n\ninterface UseCodeSnippetInput {\n endpoint: ApiEndpoint;\n body?: string;\n parameters?: Record<string, string>;\n headers?: Record<string, string>;\n baseUrl?: string;\n activeId: CodeSampleTargetId;\n}\n\ninterface UseCodeSnippetResult {\n /** Fully-rendered snippet string. Always present — falls back to an\n * \"unavailable\" message if the generator returns null, so the\n * consumer can always mount ``PrettyCode``. */\n snippet: string;\n /** Prism language id matching ``activeId`` — passed to PrettyCode so\n * it picks the right highlighter. */\n prism: string;\n}\n\n/** Encapsulates HAR build + snippet render + memoisation for the Code\n * Samples block. Kept as a hook (rather than inline ``useMemo`` blocks\n * in the component) so unit tests can exercise the snippet pipeline\n * independently of React rendering. */\nexport function useCodeSnippet({\n endpoint,\n body,\n parameters,\n headers,\n baseUrl,\n activeId,\n}: UseCodeSnippetInput): UseCodeSnippetResult {\n const effectiveBody = body ?? endpoint.requestBody?.example;\n\n // Build the HAR once per input change — every tab rebuilds its\n // snippet from this shared request shape.\n //\n // ``endpoint.path`` already carries the schema's ``servers[0].url``\n // (joined upstream in ``useOpenApiSchema``). Usually that's a path\n // like ``/api/v3/pet`` — good enough for same-origin fetch, wrong\n // for curl/python/go which need a runnable absolute URL. We hand\n // off to ``resolveAbsolute`` so the snippet is copy-pasteable from\n // a terminal without the user having to edit the host in manually.\n //\n // Priority: explicit ``baseUrl`` prop > resolved origin > bare path.\n const har = useMemo(() => {\n const h = buildHarRequest({\n endpoint,\n body: effectiveBody,\n parameters,\n headers,\n baseUrl,\n });\n return baseUrl ? h : { ...h, url: resolveAbsolute(h.url) };\n }, [endpoint, effectiveBody, parameters, headers, baseUrl]);\n\n return useMemo(() => {\n const target = CODE_SAMPLE_TARGETS.find((t) => t.id === activeId)!;\n const code = renderSnippet(har, activeId);\n return {\n snippet: code ?? `// Snippet for ${target.label} is unavailable for this request.`,\n prism: target.prism,\n };\n }, [har, activeId]);\n}\n","'use client';\n\nimport PrettyCode from '../../../../../PrettyCode';\nimport type { ApiEndpoint } from '../../../../types';\nimport { useEndpointDocContext } from '../context';\nimport { useEndpointDocStore } from '../store';\nimport { useActiveCodeTab } from '../store/selectors';\nimport { LanguageTabs } from './LanguageTabs';\nimport { useCodeSnippet } from './useCodeSnippet';\n\ninterface CodeSamplesProps {\n endpoint: ApiEndpoint;\n /** Optional body to include in generated snippets. When omitted we\n * use ``endpoint.requestBody?.example`` if present, so the snippet\n * shows a realistic payload out of the box. */\n body?: string;\n /** Parameter values to substitute into the URL. Missing path params\n * fall back to ``{name}`` placeholders so the snippet still\n * illustrates the shape. */\n parameters?: Record<string, string>;\n /** Extra headers to include in snippets (e.g. a picked API key). */\n headers?: Record<string, string>;\n /** Base URL override — falls back to ``endpoint.path`` which\n * already has the resolved base URL prepended by the extractor. */\n baseUrl?: string;\n}\n\n/** Code samples block: language tab bar + highlighted snippet. The\n * outer Section wrapper (collapsible) lives one level up; this\n * component is always \"open\" from its own perspective. */\nexport function CodeSamples({ endpoint, body, parameters, headers, baseUrl }: CodeSamplesProps) {\n const { endpointId } = useEndpointDocContext();\n const activeId = useActiveCodeTab(endpointId);\n const setCodeTab = useEndpointDocStore((s) => s.setCodeTab);\n\n const { snippet, prism } = useCodeSnippet({\n endpoint,\n body,\n parameters,\n headers,\n baseUrl,\n activeId,\n });\n\n return (\n <div className=\"space-y-2.5\">\n <LanguageTabs activeId={activeId} onChange={(id) => setCodeTab(endpointId, id)} />\n <PrettyCode\n data={snippet}\n language={prism as never}\n isCompact\n maxLines={20}\n />\n </div>\n );\n}\n","'use client';\n\nimport {\n Check,\n ChevronsDownUp,\n ChevronsUpDown,\n FileCode2,\n Link2,\n} from 'lucide-react';\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n SafeTooltipProvider,\n} from '@djangocfg/ui-core/components';\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport { useEndpointDocContext } from '../context';\nimport { sectionKey, useEndpointDocStore } from '../store';\nimport type { SectionId } from '../types';\n\ninterface MetaActionsProps {\n anchor: string;\n endpointMarkdown: string;\n /** Sections present on this endpoint — expand/collapse acts only\n * on visible rows, never on catalogue items the card doesn't render. */\n presentSections: readonly SectionId[];\n}\n\ninterface IconButtonProps {\n label: string;\n onClick: () => void;\n children: React.ReactNode;\n active?: boolean;\n}\n\n/** Tight 24×24 icon button used across the meta row. Keeps the hit\n * target compact so the row reads as a secondary metadata strip, not\n * a toolbar that competes with the path for attention. */\nfunction IconButton({ label, onClick, children, active }: IconButtonProps) {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={onClick}\n aria-label={label}\n className={cn(\n 'shrink-0 h-6 w-6 inline-flex items-center justify-center rounded',\n 'text-muted-foreground/60 hover:text-foreground hover:bg-muted transition-colors',\n active && 'text-emerald-500 hover:text-emerald-500',\n )}\n >\n {children}\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"bottom\" className=\"text-[11px]\">\n {label}\n </TooltipContent>\n </Tooltip>\n );\n}\n\n/** Inline meta-row actions: copy link · copy markdown · expand/collapse\n * all. Actions are always visible (corporate tool pattern) but sized\n * down so the path on the next line stays the visual focal point. */\nexport function MetaActions({ anchor, endpointMarkdown, presentSections }: MetaActionsProps) {\n const { endpointId } = useEndpointDocContext();\n const expandAll = useEndpointDocStore((s) => s.expandAll);\n const collapseAll = useEndpointDocStore((s) => s.collapseAll);\n const openSections = useEndpointDocStore((s) => s.openSections);\n\n const [justCopied, setJustCopied] = useState<'link' | 'md' | null>(null);\n const flash = useCallback((which: 'link' | 'md') => {\n setJustCopied(which);\n setTimeout(() => setJustCopied(null), 1200);\n }, []);\n\n const mostlyOpen = useMemo(() => {\n if (presentSections.length === 0) return false;\n let openCount = 0;\n for (const sid of presentSections) {\n if (openSections[sectionKey(endpointId, sid)]) openCount += 1;\n }\n return openCount > presentSections.length / 2;\n }, [openSections, presentSections, endpointId]);\n\n const copyLink = useCallback(() => {\n if (typeof window === 'undefined') return;\n const url = `${window.location.origin}${window.location.pathname}#${anchor}`;\n void navigator.clipboard?.writeText(url).then(() => flash('link'));\n }, [anchor, flash]);\n\n const copyMarkdown = useCallback(() => {\n if (typeof window === 'undefined') return;\n void navigator.clipboard?.writeText(endpointMarkdown).then(() => flash('md'));\n }, [endpointMarkdown, flash]);\n\n const toggleAll = useCallback(() => {\n if (mostlyOpen) collapseAll(endpointId, presentSections);\n else expandAll(endpointId, presentSections);\n }, [mostlyOpen, collapseAll, expandAll, endpointId, presentSections]);\n\n return (\n <SafeTooltipProvider delayDuration={200}>\n <div className=\"flex items-center gap-0.5\">\n <IconButton\n label={justCopied === 'link' ? 'Copied!' : 'Copy link to endpoint'}\n onClick={copyLink}\n active={justCopied === 'link'}\n >\n {justCopied === 'link' ? (\n <Check className=\"h-3.5 w-3.5\" />\n ) : (\n <Link2 className=\"h-3.5 w-3.5\" />\n )}\n </IconButton>\n <IconButton\n label={justCopied === 'md' ? 'Copied!' : 'Copy as Markdown (for AI)'}\n onClick={copyMarkdown}\n active={justCopied === 'md'}\n >\n {justCopied === 'md' ? (\n <Check className=\"h-3.5 w-3.5\" />\n ) : (\n <FileCode2 className=\"h-3.5 w-3.5\" />\n )}\n </IconButton>\n {presentSections.length >= 2 && (\n <IconButton\n label={mostlyOpen ? 'Collapse all sections' : 'Expand all sections'}\n onClick={toggleAll}\n >\n {mostlyOpen ? (\n <ChevronsDownUp className=\"h-3.5 w-3.5\" />\n ) : (\n <ChevronsUpDown className=\"h-3.5 w-3.5\" />\n )}\n </IconButton>\n )}\n </div>\n </SafeTooltipProvider>\n );\n}\n","'use client';\n\nimport { relativePath } from '../../../shared/ui';\n\ninterface PathDisplayProps {\n path: string;\n}\n\n/** The endpoint path as the visual focal point of the card. Renders in\n * large monospace so readers scanning the page land on it first — the\n * path is what distinguishes one endpoint from another, so it should\n * be the biggest visible element short of the section title hierarchy.\n *\n * ``relativePath`` strips the resolved base URL so the docs always\n * show the API-local path, not an absolute URL cluttered with host\n * noise. */\nexport function PathDisplay({ path }: PathDisplayProps) {\n return (\n <code\n className=\"block font-mono text-lg md:text-xl font-semibold text-foreground leading-tight\"\n style={{ overflowWrap: 'anywhere', wordBreak: 'break-word' }}\n >\n {relativePath(path)}\n </code>\n );\n}\n","'use client';\n\nimport { Play } from 'lucide-react';\nimport React, { useMemo } from 'react';\n\nimport { Button } from '@djangocfg/ui-core/components';\n\nimport { MarkdownMessage } from '../../../../../../components/markdown';\nimport type { ApiEndpoint } from '../../../../types';\nimport { endpointToMarkdown } from '../../../../utils/schemaExport';\nimport type { SectionId } from '../types';\nimport { MetaActions } from './MetaActions';\nimport { MethodBadge } from './MethodBadge';\nimport { PathDisplay } from './PathDisplay';\n\ninterface EndpointHeaderProps {\n endpoint: ApiEndpoint;\n anchor: string;\n isLoadedInPlayground: boolean;\n onTryIt: () => void;\n /** Sections actually rendered on this endpoint — drives the\n * expand/collapse-all icon in the meta row. */\n presentSections: readonly SectionId[];\n}\n\n/** Card header, three stacked rows:\n * 1. Meta — small utility strip: method badge · inline actions · Try-it.\n * 2. Path — large monospace, the visual focus of the card.\n * 3. Description — prose, aligned to the left edge under path.\n *\n * Splitting metadata from the path lets the path itself become the\n * focal point — readers scan paths when scrolling, not badges. The\n * meta row stays compact so it reads as \"info about this endpoint\"\n * rather than \"toolbar that competes for attention\". */\nexport function EndpointHeader({\n endpoint,\n anchor,\n isLoadedInPlayground,\n onTryIt,\n presentSections,\n}: EndpointHeaderProps) {\n // Memoise the markdown dump — only recomputes when the endpoint\n // reference changes, not on unrelated re-renders of the subtree.\n const endpointMd = useMemo(() => endpointToMarkdown(endpoint), [endpoint]);\n\n return (\n <header className=\"space-y-3\">\n {/* Row 1 — meta strip. Badge + inline icon actions on the\n left, primary CTA on the right. Kept tight (24px tall)\n so it doesn't visually compete with the path row below. */}\n <div className=\"flex items-center gap-3 flex-wrap\">\n <div className=\"flex items-center gap-2 min-w-0\">\n <MethodBadge method={endpoint.method} />\n <MetaActions\n anchor={anchor}\n endpointMarkdown={endpointMd}\n presentSections={presentSections}\n />\n </div>\n <Button\n size=\"sm\"\n variant={isLoadedInPlayground ? 'secondary' : 'default'}\n onClick={onTryIt}\n className=\"ml-auto h-7 text-xs gap-1.5 px-2.5\"\n >\n <Play className=\"h-3 w-3\" />\n {isLoadedInPlayground ? 'Loaded' : 'Try it'}\n </Button>\n </div>\n\n {/* Row 2 — path as the visual focal point. Larger and more\n prominent than it was when competing with the badge\n and action icons inline. */}\n <div className=\"min-w-0\">\n <PathDisplay path={endpoint.path} />\n </div>\n\n {/* Row 3 — description, aligned to the left edge under the\n path. Text-sm so it reads as subtitle, not body copy. */}\n {endpoint.description && (\n <div className=\"text-muted-foreground text-sm\">\n <MarkdownMessage content={endpoint.description} />\n </div>\n )}\n </header>\n );\n}\n","'use client';\n\nimport type { ApiEndpoint } from '../../../../types';\n\ntype Param = NonNullable<ApiEndpoint['parameters']>[number];\n\ninterface ParamRowProps {\n param: Param;\n}\n\n/** Single parameter row. Name + required marker + type + (optional)\n * description. Wrapped in ``<div>`` rather than a table row so the\n * list degrades to a stack on narrow widths without losing semantics. */\nexport function ParamRow({ param }: ParamRowProps) {\n return (\n <div className=\"px-3 py-2.5 bg-background space-y-1\">\n <div className=\"flex items-baseline gap-2 flex-wrap\">\n <code className=\"font-mono text-xs font-medium text-foreground\">{param.name}</code>\n {param.required && (\n <span\n title=\"Required\"\n className=\"text-[9px] text-destructive font-bold leading-none\"\n >\n *\n </span>\n )}\n <code className=\"font-mono text-[11px] text-muted-foreground/70\">{param.type}</code>\n </div>\n {param.description && (\n <p className=\"text-xs text-muted-foreground leading-relaxed break-words\">\n {param.description}\n </p>\n )}\n </div>\n );\n}\n","'use client';\n\nimport type { ApiEndpoint } from '../../../../types';\nimport { ParamRow } from './ParamRow';\n\ninterface ParamGroupProps {\n /** Small uppercase label shown above the group (``Path``, ``Query``). */\n label: string;\n params: NonNullable<ApiEndpoint['parameters']>;\n}\n\n/** Labelled block of parameter rows. We split path vs query so the user\n * can tell which values go in the URL template vs the query string at\n * a glance — both are ``parameters`` in OpenAPI terms but they land in\n * different places in the generated request. */\nexport function ParamGroup({ label, params }: ParamGroupProps) {\n if (params.length === 0) return null;\n return (\n <div className=\"space-y-1.5\">\n <div className=\"text-[10px] font-semibold uppercase tracking-[0.1em] text-muted-foreground/60 px-1\">\n {label}\n </div>\n <div className=\"divide-y border rounded-md overflow-hidden\">\n {params.map((p) => (\n <ParamRow key={`${label}-${p.name}`} param={p} />\n ))}\n </div>\n </div>\n );\n}\n","'use client';\n\nimport type { ApiEndpoint } from '../../../../types';\nimport { ParamGroup } from './ParamGroup';\n\ninterface ParametersProps {\n pathParams: NonNullable<ApiEndpoint['parameters']>;\n queryParams: NonNullable<ApiEndpoint['parameters']>;\n}\n\n/** Combined path + query parameters block. Each group renders only\n * when non-empty; when both are empty the parent should not render\n * the Section at all (we check up-stream so the Section badge shows a\n * real count). */\nexport function Parameters({ pathParams, queryParams }: ParametersProps) {\n return (\n <div className=\"space-y-4\">\n <ParamGroup label=\"Path\" params={pathParams} />\n <ParamGroup label=\"Query\" params={queryParams} />\n </div>\n );\n}\n","/**\n * JSON Schema → ``FieldNode`` tree.\n *\n * Handles the OpenAPI 3.x subset we actually see: objects with\n * ``properties`` + ``required``, arrays with ``items``, enums,\n * primitives with ``format``. ``allOf`` / ``oneOf`` / ``anyOf`` are\n * flattened best-effort — we pick the first branch so the UI shows\n * *a* shape rather than an empty row. Upstream dereferencing\n * (``dereferenceSchema``) is expected to have resolved ``$ref`` before\n * this runs.\n */\n\nimport type { FieldKind, FieldNode } from './types';\n\ntype JsonSchemaNode = Record<string, unknown> & {\n type?: string;\n properties?: Record<string, JsonSchemaNode>;\n required?: string[];\n items?: JsonSchemaNode;\n enum?: unknown[];\n description?: string;\n format?: string;\n allOf?: JsonSchemaNode[];\n oneOf?: JsonSchemaNode[];\n anyOf?: JsonSchemaNode[];\n};\n\n/** Hard cap on recursion so self-referential schemas can't blow the\n * call stack. Anything this deep is unreadable in a docs view anyway. */\nconst MAX_DEPTH = 5;\n\n/** Merge ``allOf`` branches into a single pseudo-object. Shallow merge\n * is enough for the display — deep merge would require semantic JSON\n * Schema reasoning that we don't need for a read-only viewer. */\nfunction mergeAllOf(branches: JsonSchemaNode[]): JsonSchemaNode {\n const properties: Record<string, JsonSchemaNode> = {};\n const required: string[] = [];\n for (const b of branches) {\n if (b.properties) Object.assign(properties, b.properties);\n if (Array.isArray(b.required)) required.push(...b.required);\n }\n return { type: 'object', properties, required };\n}\n\nfunction describeType(node: JsonSchemaNode): { label: string; kind: FieldKind } {\n if (node.type === 'array') {\n const itemLabel = node.items ? describeType(node.items).label : 'any';\n return { label: `array<${itemLabel}>`, kind: 'array' };\n }\n if (node.type === 'object' || node.properties) {\n return { label: 'object', kind: 'object' };\n }\n const base = node.type || 'any';\n if (Array.isArray(node.enum) && node.enum.length > 0) {\n return { label: `${base} enum`, kind: 'primitive' };\n }\n if (node.format) {\n return { label: `${base} (${node.format})`, kind: 'primitive' };\n }\n return { label: base, kind: 'primitive' };\n}\n\nfunction resolveCombinators(node: JsonSchemaNode): JsonSchemaNode {\n // ``allOf`` → merge shallowly. Other combinators → pick the first\n // branch (see module docstring rationale).\n if (Array.isArray(node.allOf) && node.allOf.length > 0) {\n return { ...mergeAllOf(node.allOf), description: node.description };\n }\n if (Array.isArray(node.oneOf) && node.oneOf.length > 0) {\n return { ...node.oneOf[0]!, description: node.description ?? node.oneOf[0]!.description };\n }\n if (Array.isArray(node.anyOf) && node.anyOf.length > 0) {\n return { ...node.anyOf[0]!, description: node.description ?? node.anyOf[0]!.description };\n }\n return node;\n}\n\nfunction buildNode(\n name: string,\n schema: JsonSchemaNode,\n isRequired: boolean,\n depth: number,\n): FieldNode {\n const resolved = resolveCombinators(schema);\n const { label, kind } = describeType(resolved);\n const node: FieldNode = {\n name,\n type: label,\n kind,\n required: isRequired,\n description: resolved.description,\n };\n\n if (Array.isArray(resolved.enum) && resolved.enum.length > 0) {\n node.enumValues = resolved.enum.map((v) => String(v));\n }\n\n if (depth >= MAX_DEPTH) return node;\n\n if (kind === 'object' && resolved.properties) {\n const required = new Set(resolved.required ?? []);\n node.children = Object.entries(resolved.properties).map(([key, child]) =>\n buildNode(key, child, required.has(key), depth + 1),\n );\n } else if (kind === 'array' && resolved.items) {\n // Synthesise a single ``[]`` child. If items are objects, the\n // child's own children will appear — so the tree reads as\n // ``tags → [] → { id, name }``.\n node.children = [buildNode('[]', resolved.items, false, depth + 1)];\n }\n\n return node;\n}\n\n/** Top-level entry. The root schema is usually an object or array; we\n * return its children directly so the tree starts one level deep\n * (skipping the redundant \"root\" node). */\nexport function buildSchemaTree(schema: JsonSchemaNode | undefined): FieldNode[] {\n if (!schema) return [];\n const root = buildNode('', schema, false, 0);\n if (root.children && root.children.length > 0) return root.children;\n // Primitive body (rare) — return the root itself as a one-row tree.\n if (root.kind === 'primitive' || (!root.children && root.name === '')) {\n return [{ ...root, name: root.name || '(body)' }];\n }\n return [];\n}\n","'use client';\n\nimport { ChevronRight } from 'lucide-react';\nimport React, { useState } from 'react';\n\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport type { FieldNode } from './types';\n\ninterface FieldRowProps {\n field: FieldNode;\n /** 0-based nesting level. Used to compute left padding so the tree\n * visually expresses hierarchy without relying on a separate tree\n * component (no deps, one file). */\n depth: number;\n /** Parent container nodes render with an extra vertical tick so the\n * tree reads as a rooted graph instead of flat indented rows. */\n showTreeLine?: boolean;\n}\n\n/** Recursive tree row. Object/array nodes are collapsible and default\n * to expanded at shallow depths — readers almost always want to see\n * the first level of nesting, and explicitly collapsing uninteresting\n * subtrees is cheaper than expanding every interesting one. */\nexport function FieldRow({ field, depth, showTreeLine = true }: FieldRowProps) {\n const isExpandable = (field.kind === 'object' || field.kind === 'array') &&\n Array.isArray(field.children) && field.children.length > 0;\n\n // Expand levels 0-1 by default; beyond that the tree can explode\n // visually for deeply-nested objects (think Pet.category.tag.…).\n const [open, setOpen] = useState(depth < 2);\n\n // Inline padding via style so arbitrary depths render without a\n // pile of Tailwind classes. 14px per level matches the chevron gap\n // at smaller text sizes.\n const padLeft = showTreeLine ? depth * 14 : 0;\n\n return (\n <div className=\"bg-background\">\n <div\n className={cn(\n 'grid grid-cols-[16px_minmax(0,1fr)] items-baseline gap-2 px-3 py-2',\n isExpandable && 'cursor-pointer hover:bg-muted/30',\n )}\n style={{ paddingLeft: 12 + padLeft }}\n onClick={() => isExpandable && setOpen((v) => !v)}\n role={isExpandable ? 'button' : undefined}\n aria-expanded={isExpandable ? open : undefined}\n >\n <ChevronRight\n className={cn(\n 'h-3.5 w-3.5 text-muted-foreground/50 shrink-0 transition-transform',\n !isExpandable && 'opacity-0',\n open && 'rotate-90',\n )}\n />\n <div className=\"min-w-0 space-y-1\">\n <div className=\"flex items-baseline gap-2 flex-wrap\">\n <code className=\"font-mono text-xs font-medium text-foreground\">\n {field.name}\n </code>\n {field.required && (\n <span\n title=\"Required\"\n className=\"text-[9px] text-destructive font-bold leading-none\"\n >\n *\n </span>\n )}\n <code className=\"font-mono text-[11px] text-muted-foreground/70\">\n {field.type}\n </code>\n </div>\n {field.description && (\n <p className=\"text-xs text-muted-foreground leading-relaxed break-words\">\n {field.description}\n </p>\n )}\n {field.enumValues && field.enumValues.length > 0 && (\n <div className=\"flex flex-wrap gap-1 pt-0.5\">\n {field.enumValues.map((v) => (\n <code\n key={v}\n className=\"inline-flex items-center rounded border border-border/60 bg-muted/40 px-1.5 py-px font-mono text-[10px] text-muted-foreground\"\n >\n {v}\n </code>\n ))}\n </div>\n )}\n </div>\n </div>\n {isExpandable && open && (\n <div>\n {field.children!.map((child, i) => (\n <FieldRow\n key={`${child.name}-${i}`}\n field={child}\n depth={depth + 1}\n />\n ))}\n </div>\n )}\n </div>\n );\n}\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { buildSchemaTree } from './buildTree';\nimport { FieldRow } from './FieldRow';\n\ninterface SchemaFieldsProps {\n schema: Record<string, unknown>;\n}\n\n/** Tree-view of a JSON schema's fields. Replaces the old flat list\n * where nested objects appeared as ``category.id`` / ``category.name``\n * as siblings — here they nest visually under ``category``.\n *\n * The component is purely presentational; all shape logic lives in\n * ``buildSchemaTree``. That split lets us swap the renderer later\n * (e.g. virtualised rows for huge schemas) without touching the\n * traversal. */\nexport function SchemaFields({ schema }: SchemaFieldsProps) {\n const tree = useMemo(() => buildSchemaTree(schema as never), [schema]);\n if (tree.length === 0) return null;\n\n return (\n <div className=\"divide-y border rounded-md overflow-hidden\">\n {tree.map((node, i) => (\n <FieldRow key={`${node.name}-${i}`} field={node} depth={0} />\n ))}\n </div>\n );\n}\n","'use client';\n\nimport type { ApiEndpoint } from '../../../../types';\nimport { SchemaFields } from '../SchemaFields';\n\ninterface RequestBodyProps {\n body: NonNullable<ApiEndpoint['requestBody']>;\n}\n\n/** Request body preview. Shows a short type summary line (``object``,\n * ``array<object>``, …) alongside the body description, then the\n * tree-view of fields. The example payload is rendered below in its\n * own section (code samples) because the user often wants to copy it\n * independently from inspecting the shape. */\nexport function RequestBody({ body }: RequestBodyProps) {\n const typeLabel = body.schema\n ? body.type === 'array'\n ? `array<${(body.schema as { items?: { type?: string } }).items?.type ?? 'object'}>`\n : body.type\n : body.type;\n\n return (\n <div className=\"space-y-3\">\n <div className=\"flex items-baseline gap-2 flex-wrap\">\n <code className=\"font-mono text-[11px] text-muted-foreground/80\">{typeLabel}</code>\n {body.description && (\n <span className=\"text-xs text-muted-foreground\">{body.description}</span>\n )}\n </div>\n {body.schema && <SchemaFields schema={body.schema} />}\n </div>\n );\n}\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { CopyButton } from '@djangocfg/ui-core/components';\n\nimport JsonTree from '../../../../../JsonTree';\n\n// Compact, read-only JsonTree config. Docs longread is space-constrained\n// so we ship less chrome than the interactive ``ResponsePanel`` — copy\n// button lives outside the tree (on the row header) and collection-info\n// stays on so long arrays don't silently truncate.\nconst EXAMPLE_JSON_TREE_CONFIG = {\n maxAutoExpandDepth: 2,\n maxAutoExpandArrayItems: 5,\n maxAutoExpandObjectKeys: 8,\n maxStringLength: 160,\n collectionLimit: 25,\n showCollectionInfo: true,\n showExpandControls: false,\n showActionButtons: false,\n preserveKeyOrder: true,\n className: 'border-0 rounded-none',\n} as const;\n\ninterface ResponseBodyProps {\n example: string;\n contentType?: string;\n}\n\n/** Render the example response body: content-type strip + copy button\n * header, then the JSON tree (falling back to a ``<pre>`` if the\n * example isn't valid JSON — sampler occasionally emits non-JSON for\n * exotic content types). */\nexport function ResponseBody({ example, contentType }: ResponseBodyProps) {\n // Parse once and cache. ``example`` is pre-stringified by the\n // sampler; JsonTree wants a live object to render nodes with proper\n // folding, so we flip it back here.\n const parsed = useMemo(() => {\n try {\n return JSON.parse(example);\n } catch {\n return null;\n }\n }, [example]);\n\n return (\n <div className=\"border-t bg-muted/20\">\n <div className=\"flex items-center justify-between px-3 py-1.5 border-b border-border/50\">\n <code className=\"font-mono text-[10px] uppercase tracking-wider text-muted-foreground/70\">\n {contentType ?? 'application/json'}\n </code>\n <CopyButton\n value={example}\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-6 px-2 text-[10px] text-muted-foreground\"\n >\n Copy\n </CopyButton>\n </div>\n {parsed != null ? (\n <JsonTree\n title=\"\"\n data={parsed}\n mode=\"compact\"\n config={EXAMPLE_JSON_TREE_CONFIG}\n />\n ) : (\n <pre className=\"p-3 text-[11px] font-mono text-foreground/70 whitespace-pre-wrap break-all leading-relaxed\">\n {example}\n </pre>\n )}\n </div>\n );\n}\n","'use client';\n\nimport { cn } from '@djangocfg/ui-core/lib';\n\ninterface StatusTagProps {\n code: string;\n}\n\n/** HTTP status pill. Colours map to the usual conventions: 2xx green,\n * 3xx blue, 4xx amber, 5xx red, non-numeric (``default``) neutral.\n * Codes that don't parse as integers render in the neutral style so we\n * never flash a wrong-severity colour at the user. */\nexport function StatusTag({ code }: StatusTagProps) {\n const numeric = Number.parseInt(code, 10);\n const cls = !Number.isFinite(numeric)\n ? 'bg-muted text-muted-foreground border-border'\n : numeric >= 500\n ? 'bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/25'\n : numeric >= 400\n ? 'bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/25'\n : numeric >= 300\n ? 'bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/25'\n : 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/25';\n return (\n <span className={cn(\n 'inline-flex items-center justify-center rounded border px-2 py-0.5 font-mono text-[11px] font-bold leading-none shrink-0 tabular-nums',\n cls,\n )}>\n {code}\n </span>\n );\n}\n","'use client';\n\nimport { ChevronRight } from 'lucide-react';\nimport { useState } from 'react';\n\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport type { ApiEndpoint } from '../../../../types';\nimport { ResponseBody } from './ResponseBody';\nimport { StatusTag } from './StatusTag';\n\ninterface ResponseRowProps {\n response: NonNullable<ApiEndpoint['responses']>[number];\n}\n\n/** One status-code row in the Responses section.\n *\n * Layout:\n * - Chevron column only renders when there's an example to expand.\n * Otherwise the row is inert (no button wrapper, no hover state)\n * and the space stays tight instead of reserving an empty gutter\n * under a disabled chevron.\n * - Status tag column is ``48px`` wide — enough for ``default`` and\n * 3-digit codes in the font size we use. Keeps descriptions\n * aligned on their left edge across all rows regardless of code.\n *\n * Expansion defaults:\n * - 2xx with example → open (happy-path is what readers want first).\n * - Everything else → closed, one click to inspect. */\nexport function ResponseRow({ response }: ResponseRowProps) {\n const hasExample = Boolean(response.example);\n const numeric = Number.parseInt(response.code, 10);\n const isSuccess = Number.isFinite(numeric) && numeric >= 200 && numeric < 300;\n const [open, setOpen] = useState(hasExample && isSuccess);\n\n // Inert row (no example available) — render as a plain div so the\n // layout stays identical but without button affordances.\n if (!hasExample) {\n return (\n <div className=\"flex items-center gap-3 px-3 py-2 bg-background\">\n <div className=\"w-12 shrink-0 flex justify-start\">\n <StatusTag code={response.code} />\n </div>\n <span className=\"text-sm text-muted-foreground leading-relaxed break-words min-w-0\">\n {response.description}\n </span>\n </div>\n );\n }\n\n return (\n <div className=\"bg-background\">\n <button\n type=\"button\"\n onClick={() => setOpen((v) => !v)}\n className=\"w-full flex items-center gap-3 px-3 py-2 text-left hover:bg-muted/40 cursor-pointer transition-colors\"\n aria-expanded={open}\n >\n <ChevronRight\n className={cn(\n 'h-3.5 w-3.5 text-muted-foreground/60 transition-transform shrink-0',\n open && 'rotate-90',\n )}\n />\n <div className=\"w-12 shrink-0 flex justify-start\">\n <StatusTag code={response.code} />\n </div>\n <span className=\"text-sm text-muted-foreground leading-relaxed break-words min-w-0 flex-1\">\n {response.description}\n </span>\n </button>\n {open && (\n <ResponseBody\n example={response.example!}\n contentType={response.contentType}\n />\n )}\n </div>\n );\n}\n","'use client';\n\nimport type { ApiEndpoint } from '../../../../types';\nimport { ResponseRow } from './ResponseRow';\n\ninterface ResponsesProps {\n responses: NonNullable<ApiEndpoint['responses']>;\n}\n\n/** Flat list of response rows. Outer collapsible wrapper lives in the\n * ``Section`` component higher up; this component only knows how to\n * arrange the individual rows. */\nexport function Responses({ responses }: ResponsesProps) {\n return (\n <div className=\"divide-y border rounded-md overflow-hidden\">\n {responses.map((r) => (\n <ResponseRow key={r.code} response={r} />\n ))}\n </div>\n );\n}\n","import type { SectionId } from '../types';\n\n/** Per-HTTP-method defaults for which sections start open. The goal is\n * \"the most useful section is already visible\" without burying the\n * less-important ones entirely.\n *\n * Rationale by method:\n * - GET/DELETE: parameters + 2xx response — the request itself has\n * no body, so that's what the reader needs to see first.\n * - POST/PUT/PATCH: request body + 2xx response — the shape to send\n * is the main question; parameters and code samples are\n * secondary, available one click away.\n * - Other (HEAD/OPTIONS/…): be conservative, open nothing extra\n * beyond responses. */\nconst DEFAULTS_BY_METHOD: Record<string, Partial<Record<SectionId, boolean>>> = {\n GET: { parameters: true, responses: true },\n DELETE: { parameters: true, responses: true },\n POST: { requestBody: true, responses: true },\n PUT: { requestBody: true, responses: true },\n PATCH: { requestBody: true, responses: true },\n};\n\n/** Resolve the default open state for a given (method, section). Falls\n * back to ``false`` for unknown combinations. */\nexport function defaultSectionOpen(method: string, sectionId: SectionId): boolean {\n return DEFAULTS_BY_METHOD[method.toUpperCase()]?.[sectionId] ?? false;\n}\n","/**\n * Local types for the EndpointDoc folder. Wider OpenAPI types live in\n * ``../../../types``; this module only declares what's specific to the\n * docs-view rendering (section identifiers, tab ids, etc.).\n */\n\n/** Sections a single endpoint card can contain. Section identity is\n * stable because zustand stores open/close state keyed by it, and the\n * URL hash router references sections by the same id. */\nexport type SectionId = 'parameters' | 'requestBody' | 'responses' | 'codeSamples';\n\nexport const ALL_SECTION_IDS: readonly SectionId[] = [\n 'parameters',\n 'requestBody',\n 'responses',\n 'codeSamples',\n] as const;\n","'use client';\n\nimport { useEffect } from 'react';\n\nimport { useEndpointDocStore } from '../store';\nimport { ALL_SECTION_IDS, type SectionId } from '../types';\n\n/** Parse ``#section=<endpointId>.<sectionId>`` out of a hash string.\n * Returns ``null`` for any other shape (including the plain\n * ``#<endpointId>`` form used elsewhere for scrolling to an endpoint). */\nexport function parseSectionHash(hash: string): { endpointId: string; sectionId: SectionId } | null {\n const raw = hash.startsWith('#') ? hash.slice(1) : hash;\n if (!raw.startsWith('section=')) return null;\n const value = raw.slice('section='.length);\n const dot = value.lastIndexOf('.');\n if (dot <= 0 || dot === value.length - 1) return null;\n const endpointId = value.slice(0, dot);\n const sectionIdCandidate = value.slice(dot + 1);\n if (!(ALL_SECTION_IDS as readonly string[]).includes(sectionIdCandidate)) return null;\n return { endpointId, sectionId: sectionIdCandidate as SectionId };\n}\n\n/** Build the shareable hash that opens a specific section. */\nexport function buildSectionHash(endpointId: string, sectionId: SectionId): string {\n return `section=${endpointId}.${sectionId}`;\n}\n\n/** On mount + on hashchange, read ``#section=...``, open that section\n * in the store, and scroll its endpoint into view. Runs once per\n * hash change, not per endpoint render — the effect lives above the\n * per-endpoint level in the tree.\n *\n * Behaviour:\n * 1. Parse hash. If it isn't our ``section=`` form, bail — the\n * browser's own anchor-scrolling handles ``#ep-…`` URLs already.\n * 2. Open the referenced section in the zustand store so its body\n * is visible the moment the user lands.\n * 3. Scroll the endpoint's ``<section id={endpointId}>`` into view\n * on the next frame (after the section body has mounted). */\nexport function useSectionHashRouter(): void {\n const setSectionOpen = useEndpointDocStore((s) => s.setSectionOpen);\n\n useEffect(() => {\n if (typeof window === 'undefined') return;\n\n function apply() {\n const parsed = parseSectionHash(window.location.hash);\n if (!parsed) return;\n setSectionOpen(parsed.endpointId, parsed.sectionId, true);\n // Defer scroll to let the section body render first —\n // scrolling a collapsed row lands on the wrong offset\n // because the body takes vertical space once expanded.\n requestAnimationFrame(() => {\n const el = document.getElementById(parsed.endpointId);\n el?.scrollIntoView({ behavior: 'smooth', block: 'start' });\n });\n }\n\n apply();\n window.addEventListener('hashchange', apply);\n return () => window.removeEventListener('hashchange', apply);\n }, [setSectionOpen]);\n}\n","'use client';\n\nimport { Check, ChevronDown, Link2 } from 'lucide-react';\nimport { useState } from 'react';\n\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport { useEndpointDocContext } from '../context';\nimport { buildSectionHash } from '../hooks/useSectionHash';\nimport type { SectionId } from '../types';\n\ninterface SectionHeaderProps {\n /** Section identifier — needed to build the shareable hash link. */\n sectionId: SectionId;\n title: string;\n badge?: number;\n open: boolean;\n onToggle: () => void;\n}\n\n/** Clickable header for a collapsible section. The whole row toggles,\n * plus a hover-revealed anchor button copies a ``#section=...`` URL so\n * users can share a link that lands with this exact section already\n * expanded (handled by ``useSectionHashRouter``). */\nexport function SectionHeader({ sectionId, title, badge, open, onToggle }: SectionHeaderProps) {\n const { endpointId } = useEndpointDocContext();\n const [copied, setCopied] = useState(false);\n\n const copyHash = (e: React.MouseEvent) => {\n // Prevent the row toggle — the anchor button must not collapse\n // the section while the user is copying the link.\n e.stopPropagation();\n if (typeof window === 'undefined') return;\n const hash = buildSectionHash(endpointId, sectionId);\n const url = `${window.location.origin}${window.location.pathname}#${hash}`;\n void navigator.clipboard?.writeText(url).then(() => {\n setCopied(true);\n setTimeout(() => setCopied(false), 1200);\n });\n };\n\n return (\n <div\n className={cn(\n 'group/section w-full flex items-center gap-2 py-1.5 -ml-1 px-1 rounded cursor-pointer',\n 'hover:bg-muted/30 transition-colors',\n )}\n onClick={onToggle}\n role=\"button\"\n aria-expanded={open}\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onToggle();\n }\n }}\n >\n <ChevronDown\n className={cn(\n 'h-3.5 w-3.5 text-muted-foreground/50 transition-transform shrink-0',\n !open && '-rotate-90',\n )}\n />\n <h4 className=\"text-[10px] font-semibold uppercase tracking-[0.12em] text-muted-foreground/80\">\n {title}\n </h4>\n {typeof badge === 'number' && badge > 0 && (\n <span className=\"font-mono text-[10px] text-muted-foreground/50 tabular-nums\">\n {badge}\n </span>\n )}\n <button\n type=\"button\"\n onClick={copyHash}\n title=\"Copy link to this section\"\n className={cn(\n 'ml-auto shrink-0 p-1 rounded text-muted-foreground/40 hover:text-foreground hover:bg-muted transition-all',\n 'opacity-0 group-hover/section:opacity-100 focus-visible:opacity-100',\n copied && 'opacity-100 text-emerald-500',\n )}\n >\n {copied ? <Check className=\"h-3 w-3\" /> : <Link2 className=\"h-3 w-3\" />}\n </button>\n </div>\n );\n}\n","'use client';\n\nimport React from 'react';\n\nimport { useEndpointDocContext } from '../context';\nimport { useEndpointDocStore } from '../store';\nimport { useIsSectionOpen } from '../store/selectors';\nimport type { SectionId } from '../types';\nimport { defaultSectionOpen } from './defaults';\nimport { SectionHeader } from './SectionHeader';\n\ninterface SectionProps {\n /** Identifies the section inside the endpoint's card — used as a\n * key in zustand + URL hash routing. Must match one of ``SectionId``. */\n id: SectionId;\n title: string;\n /** Optional count badge shown next to the title. */\n badge?: number;\n children: React.ReactNode;\n}\n\n/** Collapsible section wrapper. Pulls endpoint identity from\n * ``EndpointDocProvider`` so the component API stays at \"id + title\"\n * — the rest is implicit from context. Children render lazily when\n * open; a docs page may mount dozens of endpoints × four sections and\n * mounting everything eagerly would churn on the first scroll pass. */\nexport function Section({ id, title, badge, children }: SectionProps) {\n const { endpointId, method } = useEndpointDocContext();\n const defaultOpen = defaultSectionOpen(method, id);\n const open = useIsSectionOpen(endpointId, id, defaultOpen);\n const toggleSection = useEndpointDocStore((s) => s.toggleSection);\n\n return (\n <div className=\"space-y-2.5\">\n <SectionHeader\n sectionId={id}\n title={title}\n badge={badge}\n open={open}\n onToggle={() => toggleSection(endpointId, id)}\n />\n {open && <div>{children}</div>}\n </div>\n );\n}\n","'use client';\n\nimport React from 'react';\n\nimport type { ApiEndpoint } from '../../../types';\nimport { endpointAnchor } from '../anchor';\nimport { CodeSamples } from './CodeSamples';\nimport { EndpointDocProvider } from './context';\nimport { EndpointHeader } from './Header';\nimport { Parameters } from './Parameters';\nimport { RequestBody } from './RequestBody';\nimport { Responses } from './Responses';\nimport { Section } from './Section';\nimport type { SectionId } from './types';\n\ninterface EndpointDocProps {\n endpoint: ApiEndpoint;\n /** Is this endpoint currently loaded in the sticky playground? */\n isLoadedInPlayground: boolean;\n onTryIt: () => void;\n /** Scoping prefix for the anchor, so endpoints from different schemas\n * don't collide on a single page. Falls back to ``endpoint.schemaId``. */\n schemaId?: string | null;\n}\n\n/** Card that documents one API endpoint: header + a stack of collapsible\n * sections (parameters, request body, responses, code samples). The\n * component itself is a thin orchestrator — each child folder owns its\n * own rendering concerns and reads the endpoint identity from context. */\nexport function EndpointDoc({ endpoint, isLoadedInPlayground, onTryIt, schemaId }: EndpointDocProps) {\n const scopedSchemaId = schemaId ?? endpoint.schemaId ?? null;\n const anchor = endpointAnchor(endpoint, scopedSchemaId);\n const pathParams = endpoint.parameters?.filter((p) => endpoint.path.includes(`{${p.name}}`)) ?? [];\n const queryParams = endpoint.parameters?.filter((p) => !endpoint.path.includes(`{${p.name}}`)) ?? [];\n\n const hasParameters = pathParams.length > 0 || queryParams.length > 0;\n const hasResponses = (endpoint.responses?.length ?? 0) > 0;\n\n // Collect section ids that actually render so the header's\n // expand/collapse-all toggle only touches visible sections.\n // ``codeSamples`` is always present — it synthesises a snippet\n // even for parameter-less endpoints.\n const presentSections: SectionId[] = [];\n if (hasParameters) presentSections.push('parameters');\n if (endpoint.requestBody) presentSections.push('requestBody');\n presentSections.push('codeSamples');\n if (hasResponses) presentSections.push('responses');\n\n return (\n <EndpointDocProvider endpointId={anchor} method={endpoint.method}>\n <section\n id={anchor}\n data-endpoint-anchor={anchor}\n data-schema-id={scopedSchemaId ?? ''}\n className=\"scroll-mt-24 py-10 first:pt-0\"\n >\n <EndpointHeader\n endpoint={endpoint}\n anchor={anchor}\n isLoadedInPlayground={isLoadedInPlayground}\n onTryIt={onTryIt}\n presentSections={presentSections}\n />\n\n <div className=\"mt-8 space-y-5\">\n {hasParameters && (\n <Section\n id=\"parameters\"\n title=\"Parameters\"\n badge={pathParams.length + queryParams.length}\n >\n <Parameters pathParams={pathParams} queryParams={queryParams} />\n </Section>\n )}\n {endpoint.requestBody && (\n <Section id=\"requestBody\" title=\"Request body\">\n <RequestBody body={endpoint.requestBody} />\n </Section>\n )}\n <Section id=\"codeSamples\" title=\"Code samples\">\n <CodeSamples endpoint={endpoint} />\n </Section>\n {hasResponses && (\n <Section\n id=\"responses\"\n title=\"Responses\"\n badge={endpoint.responses!.length}\n >\n <Responses responses={endpoint.responses!} />\n </Section>\n )}\n </div>\n </section>\n </EndpointDocProvider>\n );\n}\n","'use client';\n\nimport React, { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport type { ApiEndpoint, LoadedSchemaEntry, OpenApiInfo, OpenApiSchema } from '../../types';\nimport {\n getScrollParent,\n getScrollTop,\n getTargetTop,\n getViewportHeight,\n scrollTargetTo,\n type ScrollTarget,\n} from '../../utils/scrollParent';\nimport { deduplicateEndpoints } from '../../utils/versionManager';\nimport { ApiIntroSection } from './ApiIntroSection';\nimport { EndpointDoc } from './EndpointDoc';\nimport { useSectionHashRouter } from './EndpointDoc/hooks/useSectionHash';\nimport { SchemaCopyMenu } from './SchemaCopyMenu';\n\nexport interface DocsViewHandle {\n scrollToAnchor: (anchor: string) => void;\n}\n\n// ─── Props ───────────────────────────────────────────────────────────────────\n\ninterface SelectorProps {\n grouping?: 'selector';\n info: OpenApiInfo | null;\n rawSchema: OpenApiSchema | null;\n resolvedBaseUrl?: string;\n endpoints: ApiEndpoint[];\n selectedVersion: string;\n loadedEndpoint: ApiEndpoint | null;\n onTryEndpoint: (ep: ApiEndpoint) => void;\n onActiveChange: (anchor: string | null, schemaId: string | null) => void;\n}\n\ninterface SectionsProps {\n grouping: 'sections';\n /** Per-schema data (info + endpoints). Rendered in order. */\n schemasData: LoadedSchemaEntry[];\n selectedVersion: string;\n loadedEndpoint: ApiEndpoint | null;\n onTryEndpoint: (ep: ApiEndpoint) => void;\n onActiveChange: (anchor: string | null, schemaId: string | null) => void;\n}\n\ntype DocsViewProps = SelectorProps | SectionsProps;\n\n// ─── View-model types ────────────────────────────────────────────────────────\n\ninterface EndpointRow {\n key: string;\n endpoint: ApiEndpoint;\n isLoaded: boolean;\n schemaId: string | null;\n}\n\ntype SectionState =\n | { kind: 'ready'; rows: EndpointRow[] }\n | { kind: 'loading' }\n | { kind: 'error'; message: string }\n | { kind: 'empty' };\n\ninterface SchemaSectionVM {\n schemaId: string;\n title: string;\n version: string | null;\n description: string | null;\n state: SectionState;\n /** Copy-for-AI payload. ``null`` when the section is still loading\n * or failed — the dropdown stays disabled. */\n rawSchema: OpenApiSchema | null;\n baseUrl: string | undefined;\n allEndpoints: ApiEndpoint[];\n}\n\n// ─── Helpers ─────────────────────────────────────────────────────────────────\n\n/** Pixel offset from the top of the scroll container where the viewer\n * should \"park\" sections. Reads ``--navbar-height`` for back-compat\n * with pages that already set it; defaults to ``0`` for embedded /\n * no-navbar setups (the common case when hosted in a shell). */\nconst readNavbarOffset = () => {\n if (typeof document === 'undefined') return 0;\n const raw = getComputedStyle(document.documentElement).getPropertyValue('--navbar-height');\n const parsed = parseInt(raw || '', 10);\n return Number.isFinite(parsed) ? parsed : 0;\n};\n\nconst isSameEndpoint = (a: ApiEndpoint | null, b: ApiEndpoint) =>\n a !== null && a.method === b.method && a.path === b.path;\n\nfunction buildEndpointRow(\n ep: ApiEndpoint,\n loadedEndpoint: ApiEndpoint | null,\n schemaId: string | null,\n): EndpointRow {\n const keySchema = schemaId ? `${schemaId}-` : '';\n return {\n key: `${keySchema}${ep.method}-${ep.path}`,\n endpoint: ep,\n isLoaded: isSameEndpoint(loadedEndpoint, ep),\n schemaId,\n };\n}\n\nfunction buildSchemaSectionVM(\n entry: LoadedSchemaEntry,\n selectedVersion: string,\n loadedEndpoint: ApiEndpoint | null,\n): SchemaSectionVM {\n const title = entry.info?.title ?? entry.source.name;\n const version = entry.info?.version ?? null;\n const description = entry.info?.description ?? null;\n\n let state: SectionState;\n if (entry.loading) {\n state = { kind: 'loading' };\n } else if (entry.error) {\n state = { kind: 'error', message: entry.error };\n } else {\n const visible = deduplicateEndpoints(entry.endpoints, selectedVersion);\n state = visible.length === 0\n ? { kind: 'empty' }\n : {\n kind: 'ready',\n rows: visible.map((ep) => buildEndpointRow(ep, loadedEndpoint, entry.source.id)),\n };\n }\n\n return {\n schemaId: entry.source.id,\n title,\n version,\n description,\n state,\n rawSchema: entry.rawSchema,\n baseUrl: entry.resolvedBaseUrl,\n allEndpoints: entry.endpoints,\n };\n}\n\n// ─── Component ───────────────────────────────────────────────────────────────\n\nexport const DocsView = React.forwardRef<DocsViewHandle, DocsViewProps>(function DocsView(\n props,\n ref,\n) {\n const scrollRef = useRef<HTMLDivElement | null>(null);\n const scrollTargetRef = useRef<ScrollTarget | null>(null);\n const { onActiveChange } = props;\n\n // ``#section=<endpointId>.<sectionId>`` shareable deep-links —\n // opens the referenced section in the store and scrolls it in.\n // Idempotent, attaches a single hashchange listener.\n useSectionHashRouter();\n\n // Resolve the real scroll container once the ref is attached. In\n // standalone pages that's ``window``; inside an ``overflow-auto``\n // shell (dev playground, modal) it's the wrapping DIV.\n const ensureScrollTarget = useCallback((): ScrollTarget | null => {\n if (scrollTargetRef.current) return scrollTargetRef.current;\n if (!scrollRef.current) return null;\n scrollTargetRef.current = getScrollParent(scrollRef.current);\n return scrollTargetRef.current;\n }, []);\n\n // Scroll a given section into view. Works against whichever ancestor\n // actually scrolls — window for standalone, the overflow-auto parent\n // for embedded layouts — so callers don't need to know the difference.\n const scrollToAnchor = useCallback(\n (anchor: string) => {\n const root = scrollRef.current;\n if (!root) return;\n const el = root.querySelector<HTMLElement>(`[data-endpoint-anchor=\"${anchor}\"]`);\n if (!el) return;\n const target = ensureScrollTarget();\n if (!target) return;\n const navbar = readNavbarOffset();\n const top =\n el.getBoundingClientRect().top -\n getTargetTop(target) +\n getScrollTop(target) -\n navbar -\n 8;\n scrollTargetTo(target, top);\n },\n [ensureScrollTarget],\n );\n\n React.useImperativeHandle(ref, () => ({ scrollToAnchor }), [scrollToAnchor]);\n\n // Scrollspy: pick the topmost endpoint section whose top is near the\n // upper quarter of the viewport. Listens on the real scroll container\n // (see ``ensureScrollTarget``) because ``scroll`` events on a nested\n // overflow:auto element do NOT bubble up to window.\n useEffect(() => {\n const root = scrollRef.current;\n if (!root) return;\n const target = ensureScrollTarget();\n if (!target) return;\n\n let rafId = 0;\n let lastActive: string | null = null;\n\n const compute = () => {\n rafId = 0;\n const sections = root.querySelectorAll<HTMLElement>('[data-endpoint-anchor]');\n if (sections.length === 0) return;\n const navbar = readNavbarOffset();\n const viewportTop = getTargetTop(target);\n const threshold = viewportTop + navbar + getViewportHeight(target) * 0.25;\n let active: HTMLElement | null = null;\n for (const s of Array.from(sections)) {\n const top = s.getBoundingClientRect().top;\n if (top <= threshold) {\n active = s;\n } else {\n break;\n }\n }\n const anchor = active?.dataset.endpointAnchor ?? null;\n if (anchor !== lastActive) {\n lastActive = anchor;\n onActiveChange(anchor, active?.dataset.schemaId || null);\n }\n };\n\n const onScroll = () => {\n if (rafId) return;\n rafId = requestAnimationFrame(compute);\n };\n\n compute();\n target.addEventListener('scroll', onScroll, { passive: true });\n // Resize always bubbles to window — listen there regardless of target.\n window.addEventListener('resize', onScroll, { passive: true });\n return () => {\n target.removeEventListener('scroll', onScroll);\n window.removeEventListener('resize', onScroll);\n if (rafId) cancelAnimationFrame(rafId);\n };\n }, [onActiveChange, ensureScrollTarget, props]);\n\n if (props.grouping === 'sections') {\n return <SectionsBody scrollRef={scrollRef} {...props} />;\n }\n\n return <SelectorBody scrollRef={scrollRef} {...props} />;\n});\n\n// ─── Selector body (single active schema) ────────────────────────────────────\n\nfunction SelectorBody({\n scrollRef,\n info,\n rawSchema,\n resolvedBaseUrl,\n endpoints,\n selectedVersion,\n loadedEndpoint,\n onTryEndpoint,\n}: SelectorProps & { scrollRef: React.RefObject<HTMLDivElement | null> }) {\n const visibleEndpoints = useMemo(\n () => deduplicateEndpoints(endpoints, selectedVersion),\n [endpoints, selectedVersion],\n );\n\n const rows = useMemo<EndpointRow[]>(\n () => visibleEndpoints.map((ep) => buildEndpointRow(ep, loadedEndpoint, ep.schemaId ?? null)),\n [visibleEndpoints, loadedEndpoint],\n );\n\n const isEmpty = rows.length === 0;\n\n return (\n <div ref={scrollRef}>\n <div className=\"mx-auto w-full max-w-[860px] px-6 md:px-10 lg:px-14 py-12\">\n {info && (\n <ApiIntroSection\n info={info}\n schema={rawSchema}\n endpoints={visibleEndpoints}\n resolvedBaseUrl={resolvedBaseUrl}\n />\n )}\n {isEmpty ? (\n <div className=\"py-16 text-center text-sm text-muted-foreground\">\n No endpoints to display.\n </div>\n ) : (\n <div className=\"divide-y divide-border/60\">\n {rows.map((row) => (\n <EndpointDoc\n key={row.key}\n endpoint={row.endpoint}\n isLoadedInPlayground={row.isLoaded}\n onTryIt={() => onTryEndpoint(row.endpoint)}\n schemaId={row.schemaId}\n />\n ))}\n </div>\n )}\n </div>\n </div>\n );\n}\n\n// ─── Sections body (all schemas concatenated) ────────────────────────────────\n\nfunction SectionsBody({\n scrollRef,\n schemasData,\n selectedVersion,\n loadedEndpoint,\n onTryEndpoint,\n}: SectionsProps & { scrollRef: React.RefObject<HTMLDivElement | null> }) {\n const sections = useMemo<SchemaSectionVM[]>(\n () => schemasData.map((e) => buildSchemaSectionVM(e, selectedVersion, loadedEndpoint)),\n [schemasData, selectedVersion, loadedEndpoint],\n );\n\n return (\n <div ref={scrollRef}>\n <div className=\"mx-auto w-full max-w-[860px] px-6 md:px-10 lg:px-14 py-12 space-y-16\">\n {sections.map((section) => (\n <SchemaSectionView key={section.schemaId} section={section} onTryEndpoint={onTryEndpoint} />\n ))}\n </div>\n </div>\n );\n}\n\nconst SchemaSectionView = React.memo(function SchemaSectionView({\n section,\n onTryEndpoint,\n}: {\n section: SchemaSectionVM;\n onTryEndpoint: (ep: ApiEndpoint) => void;\n}) {\n const canCopy = section.rawSchema !== null && section.allEndpoints.length > 0;\n return (\n <section data-schema-anchor={section.schemaId} className=\"scroll-mt-20\">\n <header className=\"mb-8 pb-4 border-b\">\n <div className=\"flex items-start justify-between gap-4\">\n <div className=\"flex items-baseline gap-3 min-w-0\">\n <h2 className=\"text-2xl font-semibold tracking-tight\">{section.title}</h2>\n {section.version && (\n <span className=\"font-mono text-xs text-muted-foreground/70\">\n v{section.version}\n </span>\n )}\n </div>\n {canCopy && (\n <SchemaCopyMenu\n schema={section.rawSchema}\n endpoints={section.allEndpoints}\n baseUrl={section.baseUrl}\n />\n )}\n </div>\n {section.description && (\n <p className=\"mt-2 text-sm text-muted-foreground whitespace-pre-wrap\">\n {section.description}\n </p>\n )}\n </header>\n <SchemaSectionStateView section={section} onTryEndpoint={onTryEndpoint} />\n </section>\n );\n});\n\nfunction SchemaSectionStateView({\n section,\n onTryEndpoint,\n}: {\n section: SchemaSectionVM;\n onTryEndpoint: (ep: ApiEndpoint) => void;\n}) {\n switch (section.state.kind) {\n case 'loading':\n return (\n <div className=\"py-8 text-center text-sm text-muted-foreground\">\n Loading {section.title}…\n </div>\n );\n case 'error':\n return (\n <div className=\"py-8 text-center text-sm text-destructive\">\n Failed to load {section.title}: {section.state.message}\n </div>\n );\n case 'empty':\n return (\n <div className=\"py-8 text-center text-sm text-muted-foreground\">\n No endpoints in this schema.\n </div>\n );\n case 'ready':\n return (\n <div className=\"divide-y divide-border/60\">\n {section.state.rows.map((row) => (\n <EndpointDoc\n key={row.key}\n endpoint={row.endpoint}\n isLoadedInPlayground={row.isLoaded}\n onTryIt={() => onTryEndpoint(row.endpoint)}\n schemaId={row.schemaId}\n />\n ))}\n </div>\n );\n }\n}\n","'use client';\n\n/**\n * Form-based request body editor driven by JSON Schema.\n *\n * Replaces the ``{\"key\":\"value\"}`` textarea prompt with a real form:\n * one input per property, typed widgets for primitives, nested objects\n * indented, arrays with add/remove. The component is controlled — the\n * parent owns the body value (as any JSON) and persists to localStorage.\n *\n * Intentionally not a full JSON-Schema-Form: we don't cover oneOf/anyOf,\n * pattern validation, min/max — the playground just needs a usable\n * interactive shape. Users who hit a corner case can flip the ``JSON``\n * toggle in RequestPanel and edit raw.\n */\n\nimport { Minus, Plus } from 'lucide-react';\nimport React, { useCallback } from 'react';\n\nimport { Combobox, Input, Switch, Textarea } from '@djangocfg/ui-core/components';\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport { SectionLabel } from './ui';\n\ntype JsonSchemaNode = Record<string, unknown> & {\n type?: string;\n properties?: Record<string, JsonSchemaNode>;\n required?: string[];\n items?: JsonSchemaNode;\n enum?: unknown[];\n description?: string;\n format?: string;\n};\n\nconst MAX_DEPTH = 6;\n\n// ─── Value helpers ────────────────────────────────────────────────────────────\n\nfunction defaultForSchema(schema: JsonSchemaNode | undefined): unknown {\n if (!schema) return null;\n if (Array.isArray(schema.enum) && schema.enum.length > 0) return schema.enum[0];\n switch (schema.type) {\n case 'object': {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(schema.properties ?? {})) {\n out[k] = defaultForSchema(v);\n }\n return out;\n }\n case 'array':\n return [];\n case 'integer':\n case 'number':\n return 0;\n case 'boolean':\n return false;\n case 'string':\n return '';\n default:\n if (schema.properties) {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(schema.properties)) {\n out[k] = defaultForSchema(v);\n }\n return out;\n }\n return '';\n }\n}\n\n// ─── Root ─────────────────────────────────────────────────────────────────────\n\nexport interface BodyFormEditorProps {\n schema: JsonSchemaNode;\n value: unknown;\n onChange: (next: unknown) => void;\n}\n\nexport function BodyFormEditor({ schema, value, onChange }: BodyFormEditorProps) {\n return (\n <SchemaField\n schema={schema}\n value={value}\n onChange={onChange}\n depth={0}\n required={false}\n />\n );\n}\n\n// ─── Recursive renderer ───────────────────────────────────────────────────────\n\ninterface SchemaFieldProps {\n schema: JsonSchemaNode;\n value: unknown;\n onChange: (next: unknown) => void;\n depth: number;\n required: boolean;\n label?: string;\n}\n\nfunction SchemaField({ schema, value, onChange, depth, required, label }: SchemaFieldProps) {\n // Depth cutoff: collapse further nesting into a raw JSON textarea —\n // deeper forms get impossible to navigate and lose value for the UX\n // we're trying to offer (quick exploration).\n if (depth > MAX_DEPTH) {\n return <RawJsonField label={label} value={value} onChange={onChange} />;\n }\n\n if (Array.isArray(schema.enum) && schema.enum.length > 0) {\n return <EnumField schema={schema} value={value} onChange={onChange} label={label} required={required} />;\n }\n\n switch (schema.type) {\n case 'object':\n return <ObjectField schema={schema} value={value} onChange={onChange} depth={depth} label={label} />;\n case 'array':\n return <ArrayField schema={schema} value={value} onChange={onChange} depth={depth} label={label} required={required} />;\n case 'boolean':\n return <BooleanField value={value} onChange={onChange} label={label} schema={schema} required={required} />;\n case 'integer':\n case 'number':\n return <NumberField value={value} onChange={onChange} label={label} schema={schema} required={required} />;\n case 'string':\n default:\n // Untyped / string-ish — plain text input. Covers the\n // \"body is a free-form string\" case too (e.g. text/plain).\n if (!schema.type && schema.properties) {\n return <ObjectField schema={schema} value={value} onChange={onChange} depth={depth} label={label} />;\n }\n return <StringField value={value} onChange={onChange} label={label} schema={schema} required={required} />;\n }\n}\n\n// ─── Primitive widgets ────────────────────────────────────────────────────────\n\nfunction FieldHeader({\n label,\n type,\n required,\n description,\n}: {\n label?: string;\n type: string;\n required: boolean;\n description?: string;\n}) {\n if (!label) return null;\n return (\n <div className=\"space-y-0.5\">\n <div className=\"flex items-baseline gap-1.5\">\n <span className=\"font-mono text-[11px] text-foreground/80\">{label}</span>\n {required && <span className=\"text-[9px] text-destructive font-bold leading-none\">*</span>}\n <span className=\"font-mono text-[10px] text-muted-foreground/50\">{type}</span>\n </div>\n {description && (\n <p className=\"text-[10px] text-muted-foreground/70 leading-snug\">{description}</p>\n )}\n </div>\n );\n}\n\nfunction StringField({\n value, onChange, label, schema, required,\n}: {\n value: unknown;\n onChange: (next: string) => void;\n label?: string;\n schema: JsonSchemaNode;\n required: boolean;\n}) {\n const stringValue = typeof value === 'string' ? value : value == null ? '' : String(value);\n const placeholder = schema.format ? `${schema.type ?? 'string'} (${schema.format})` : schema.description || schema.type || 'string';\n return (\n <div className=\"space-y-1\">\n <FieldHeader label={label} type={schema.format ? `string (${schema.format})` : 'string'} required={required} description={schema.description} />\n <Input\n value={stringValue}\n onChange={(e) => onChange(e.target.value)}\n placeholder={placeholder}\n className=\"h-8 text-xs font-mono\"\n />\n </div>\n );\n}\n\nfunction NumberField({\n value, onChange, label, schema, required,\n}: {\n value: unknown;\n onChange: (next: number | null) => void;\n label?: string;\n schema: JsonSchemaNode;\n required: boolean;\n}) {\n const raw = value == null ? '' : String(value);\n const type = schema.type === 'integer' ? 'integer' : 'number';\n return (\n <div className=\"space-y-1\">\n <FieldHeader label={label} type={schema.format ? `${type} (${schema.format})` : type} required={required} description={schema.description} />\n <Input\n type=\"number\"\n value={raw}\n onChange={(e) => {\n const v = e.target.value;\n if (v === '') return onChange(null);\n const n = schema.type === 'integer' ? parseInt(v, 10) : parseFloat(v);\n onChange(Number.isNaN(n) ? null : n);\n }}\n placeholder={type}\n className=\"h-8 text-xs font-mono\"\n />\n </div>\n );\n}\n\nfunction BooleanField({\n value, onChange, label, schema, required,\n}: {\n value: unknown;\n onChange: (next: boolean) => void;\n label?: string;\n schema: JsonSchemaNode;\n required: boolean;\n}) {\n const bool = value === true;\n return (\n <div className=\"flex items-start justify-between gap-3\">\n <FieldHeader label={label} type=\"boolean\" required={required} description={schema.description} />\n <Switch checked={bool} onCheckedChange={onChange} className=\"mt-0.5 shrink-0\" />\n </div>\n );\n}\n\nfunction EnumField({\n schema, value, onChange, label, required,\n}: {\n schema: JsonSchemaNode;\n value: unknown;\n onChange: (next: unknown) => void;\n label?: string;\n required: boolean;\n}) {\n const options = (schema.enum ?? []).map((v) => ({\n value: String(v),\n label: String(v),\n }));\n const strValue = value == null ? '' : String(value);\n return (\n <div className=\"space-y-1\">\n <FieldHeader label={label} type={`${schema.type ?? 'enum'} enum`} required={required} description={schema.description} />\n <Combobox\n options={options}\n value={strValue}\n onValueChange={(v) => {\n // Preserve original type if schema declares integer/number.\n if (schema.type === 'integer') onChange(parseInt(v, 10));\n else if (schema.type === 'number') onChange(parseFloat(v));\n else onChange(v);\n }}\n placeholder=\"Select…\"\n searchPlaceholder=\"Search…\"\n className=\"h-8 text-xs\"\n />\n </div>\n );\n}\n\nfunction RawJsonField({\n label, value, onChange,\n}: {\n label?: string;\n value: unknown;\n onChange: (next: unknown) => void;\n}) {\n const [text, setText] = React.useState(() => JSON.stringify(value ?? null, null, 2));\n // Resync when value changes from outside (e.g. endpoint switch).\n React.useEffect(() => {\n setText(JSON.stringify(value ?? null, null, 2));\n }, [value]);\n return (\n <div className=\"space-y-1\">\n {label && <SectionLabel>{label} (raw)</SectionLabel>}\n <Textarea\n value={text}\n onChange={(e) => {\n setText(e.target.value);\n try { onChange(JSON.parse(e.target.value)); } catch { /* keep last valid */ }\n }}\n className=\"font-mono text-[11px] min-h-[80px]\"\n rows={4}\n />\n </div>\n );\n}\n\n// ─── Composite widgets ────────────────────────────────────────────────────────\n\nfunction ObjectField({\n schema, value, onChange, depth, label,\n}: {\n schema: JsonSchemaNode;\n value: unknown;\n onChange: (next: Record<string, unknown>) => void;\n depth: number;\n label?: string;\n}) {\n const obj = (value && typeof value === 'object' && !Array.isArray(value))\n ? (value as Record<string, unknown>)\n : {};\n const required = new Set(schema.required ?? []);\n const entries = Object.entries(schema.properties ?? {});\n\n const setKey = useCallback(\n (key: string) => (next: unknown) => {\n onChange({ ...obj, [key]: next });\n },\n [obj, onChange],\n );\n\n if (entries.length === 0) {\n return <RawJsonField label={label} value={obj} onChange={onChange as (v: unknown) => void} />;\n }\n\n // Root-level object (depth === 0) renders flat; nested gets an\n // indented, bordered group so the hierarchy is visible.\n const wrapperClass = depth === 0\n ? 'space-y-3'\n : 'space-y-2 border-l-2 border-border/60 pl-3 ml-px';\n\n return (\n <div className=\"space-y-1.5\">\n {label && depth > 0 && (\n <div className=\"flex items-baseline gap-1.5\">\n <span className=\"font-mono text-[11px] text-foreground/80\">{label}</span>\n <span className=\"font-mono text-[10px] text-muted-foreground/50\">object</span>\n </div>\n )}\n <div className={cn(wrapperClass)}>\n {entries.map(([key, subSchema]) => (\n <SchemaField\n key={key}\n schema={subSchema}\n value={obj[key]}\n onChange={setKey(key)}\n depth={depth + 1}\n required={required.has(key)}\n label={key}\n />\n ))}\n </div>\n </div>\n );\n}\n\nfunction ArrayField({\n schema, value, onChange, depth, label, required,\n}: {\n schema: JsonSchemaNode;\n value: unknown;\n onChange: (next: unknown[]) => void;\n depth: number;\n label?: string;\n required: boolean;\n}) {\n const arr = Array.isArray(value) ? value : [];\n const items = schema.items ?? { type: 'string' };\n\n const addItem = () => onChange([...arr, defaultForSchema(items)]);\n const removeAt = (i: number) => onChange(arr.filter((_, idx) => idx !== i));\n const setAt = (i: number) => (next: unknown) =>\n onChange(arr.map((v, idx) => (idx === i ? next : v)));\n\n return (\n <div className=\"space-y-1.5\">\n {label && (\n <div className=\"flex items-baseline gap-1.5\">\n <span className=\"font-mono text-[11px] text-foreground/80\">{label}</span>\n {required && <span className=\"text-[9px] text-destructive font-bold leading-none\">*</span>}\n <span className=\"font-mono text-[10px] text-muted-foreground/50\">\n {`array<${items.type ?? 'any'}>`}\n </span>\n </div>\n )}\n <div className=\"space-y-2 border-l-2 border-border/60 pl-3 ml-px\">\n {arr.length === 0 && (\n <p className=\"text-[10px] text-muted-foreground/50 italic\">Empty array</p>\n )}\n {arr.map((v, i) => (\n <div key={i} className=\"flex items-start gap-2\">\n <div className=\"flex-1 min-w-0\">\n <SchemaField\n schema={items}\n value={v}\n onChange={setAt(i)}\n depth={depth + 1}\n required={false}\n label={`${label ?? ''}[${i}]`}\n />\n </div>\n <button\n type=\"button\"\n onClick={() => removeAt(i)}\n title=\"Remove item\"\n className=\"shrink-0 h-7 w-7 inline-flex items-center justify-center rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors\"\n >\n <Minus className=\"h-3.5 w-3.5\" />\n </button>\n </div>\n ))}\n <button\n type=\"button\"\n onClick={addItem}\n className=\"inline-flex items-center gap-1.5 text-[10px] text-muted-foreground hover:text-foreground transition-colors py-1\"\n >\n <Plus className=\"h-3 w-3\" />\n Add item\n </button>\n </div>\n </div>\n );\n}\n","'use client';\n\nimport { RotateCcw } from 'lucide-react';\nimport React, { useCallback } from 'react';\n\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport { usePlaygroundContext } from '../../context/PlaygroundContext';\nimport { useEndpointDraft } from '../../hooks/useEndpointDraft';\n\n/**\n * \"Reset\" ghost button for the current endpoint's draft.\n *\n * Wipes both the in-memory context state (parameters + body) and the\n * persisted localStorage entry. We call reset() *after* clearing the\n * context so the EndpointDraftSync effect that mirrors state → storage\n * doesn't immediately re-create a now-empty draft with an empty object\n * (benign, but uglier in storage).\n */\nexport function EndpointResetButton() {\n const { state, setParameters, setRequestBody } = usePlaygroundContext();\n const ep = state.selectedEndpoint;\n const { reset } = useEndpointDraft(state.activeSchemaId, ep);\n\n const hasDraft =\n Object.keys(state.parameters).length > 0 || state.requestBody.length > 0;\n\n const onClick = useCallback(() => {\n setParameters({});\n setRequestBody('');\n reset();\n }, [setParameters, setRequestBody, reset]);\n\n if (!ep || !hasDraft) return null;\n\n return (\n <button\n type=\"button\"\n onClick={onClick}\n title=\"Reset parameters & body (keeps auth)\"\n className={cn(\n 'inline-flex items-center gap-1 text-[10px] text-muted-foreground',\n 'hover:text-foreground transition-colors',\n )}\n >\n <RotateCcw className=\"h-2.5 w-2.5\" />\n Reset\n </button>\n );\n}\n","'use client';\n\nimport { Key, Send, Sparkles, Terminal } from 'lucide-react';\nimport React, { useCallback, useMemo } from 'react';\n\nimport {\n Combobox,\n type ComboboxOption,\n Input,\n Textarea,\n} from '@djangocfg/ui-core/components';\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport PrettyCode from '../../../PrettyCode';\nimport { usePlaygroundContext } from '../../context/PlaygroundContext';\nimport { findApiKeyById, isValidJson, parseRequestHeaders } from '../../utils';\nimport { resolveAbsolute } from '../../utils/url';\nimport { BodyFormEditor } from './BodyFormEditor';\nimport { EndpointResetButton } from './EndpointResetButton';\nimport {\n CollapsibleSection,\n EmptyState,\n ScrollArea,\n SectionLabel,\n relativePath,\n} from './ui';\n\n// ─── Param fields ─────────────────────────────────────────────────────────────\n\ntype Param = { name: string; type: string; required: boolean; description?: string };\n\nfunction ParamFields({ label, params }: { label: string; params: Param[] }) {\n const { state, setParameters } = usePlaygroundContext();\n\n function handleChange(name: string, value: string) {\n setParameters({ ...state.parameters, [name]: value });\n }\n\n return (\n <div className=\"space-y-2\">\n <SectionLabel>{label}</SectionLabel>\n <div className=\"space-y-2\">\n {params.map((p) => {\n const value = state.parameters[p.name] ?? '';\n const placeholder = p.description || p.name;\n return (\n <div key={p.name} className=\"space-y-1\">\n <div className=\"flex items-center gap-1.5\">\n <span className=\"font-mono text-[11px] text-foreground/80\">{p.name}</span>\n {p.required && (\n <span className=\"text-[9px] text-destructive font-bold leading-none\">*</span>\n )}\n <span className=\"font-mono text-[10px] text-muted-foreground/50\">{p.type}</span>\n </div>\n <Input\n value={value}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) =>\n handleChange(p.name, e.target.value)\n }\n placeholder={placeholder}\n className=\"h-8 text-xs font-mono\"\n />\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\n// ─── RequestPanel ─────────────────────────────────────────────────────────────\n\nexport function RequestPanel() {\n const {\n state,\n apiKeys,\n apiKeysLoading,\n setRequestBody,\n setRequestHeaders,\n setSelectedApiKey,\n setManualApiToken,\n sendRequest,\n } = usePlaygroundContext();\n\n // Pre-compute every per-key view-model so the JSX stays a flat\n // render — no boolean math in the markup.\n const apiKeyOptions: ComboboxOption[] = useMemo(\n () =>\n apiKeys.map((k) => ({\n value: k.id,\n label: k.name || 'Unnamed key',\n // Surface the first 8 chars of the secret so the user\n // can tell two similarly-named keys apart at a glance.\n description: k.secret\n ? `${k.secret.slice(0, 8)}…`\n : undefined,\n })),\n [apiKeys],\n );\n const hasApiKeys = apiKeyOptions.length > 0;\n\n const ep = state.selectedEndpoint;\n\n // ── Data (hooks must not be conditional) ─────────────────────────────────\n const isJsonValid = state.requestBody ? isValidJson(state.requestBody) : true;\n\n const curlCommand = useMemo(() => {\n if (!state.requestUrl) return '';\n // Resolve to an absolute URL so the snippet is runnable from a\n // shell. The live ``fetch`` inside the playground resolves the\n // relative form itself via the browser; copy-pasting to curl\n // doesn't get that treatment.\n const absoluteUrl = resolveAbsolute(state.requestUrl);\n const apiKey = state.selectedApiKey ? findApiKeyById(apiKeys, state.selectedApiKey) : null;\n const hdrs = parseRequestHeaders(state.requestHeaders);\n if (apiKey) hdrs['X-API-Key'] = apiKey.secret || apiKey.id;\n let cmd = `curl -X ${state.requestMethod} \"${absoluteUrl}\"`;\n Object.entries(hdrs).forEach(([k, v]) => { cmd += ` \\\\\\n -H \"${k}: ${v}\"`; });\n if (state.requestBody && state.requestMethod !== 'GET' && isJsonValid) {\n cmd += ` \\\\\\n -d '${state.requestBody}'`;\n }\n return cmd;\n }, [state, apiKeys, isJsonValid]);\n\n const pathParams = useMemo(\n () => ep?.parameters?.filter((p) => ep.path.includes(`{${p.name}}`)) ?? [],\n [ep],\n );\n const queryParams = useMemo(\n () => ep?.parameters?.filter((p) => !ep.path.includes(`{${p.name}}`)) ?? [],\n [ep],\n );\n\n // ── Derived ───────────────────────────────────────────────────────────────\n const isSendDisabled = state.loading || !state.requestUrl || !isJsonValid;\n // Show the absolute URL in the meta row so the user sees exactly\n // what will go over the wire — same rewrite we do for cURL.\n const displayUrl = resolveAbsolute(state.requestUrl || ep?.path || '');\n const hasBody = ep?.method !== 'GET';\n const bodyType = ep?.requestBody?.type ?? '';\n const hasPathParams = pathParams.length > 0;\n const hasQueryParams = queryParams.length > 0;\n const hasCurl = Boolean(curlCommand);\n const epPath = ep ? relativePath(ep.path) : '';\n // Show the URL meta row only when it differs from the endpoint's\n // template shape — i.e. the user has substituted path params or the\n // URL host is worth showing explicitly.\n const urlChanged = displayUrl !== '' && displayUrl !== epPath;\n\n // ── Early return ──────────────────────────────────────────────────────────\n if (!ep) {\n return <EmptyState icon={Send} text=\"Select an endpoint to build a request\" />;\n }\n\n // ── Render ────────────────────────────────────────────────────────────────\n return (\n <>\n {/* Inline meta row — shows the effective URL when it differs\n from the endpoint's path template (e.g. after substituting\n path parameters), plus the Reset action. We dropped the\n full endpoint header because the containing surface (SidePanel\n in docs layout, column header in classic layout) already\n shows the method + path, and duplicating the Send button\n next to a full-width Send at the bottom read as confusing. */}\n {(urlChanged || ep) && (\n <div className=\"shrink-0 border-b px-4 py-2 bg-muted/10 flex items-center gap-2 min-h-[28px]\">\n {urlChanged ? (\n <span className=\"font-mono text-[10px] text-muted-foreground/60 break-all leading-snug truncate min-w-0 flex-1\">\n {displayUrl}\n </span>\n ) : (\n <span className=\"flex-1\" />\n )}\n <EndpointResetButton />\n </div>\n )}\n\n {/* Scrollable fields */}\n <ScrollArea className=\"px-4 py-3 space-y-3\">\n\n {hasPathParams && <ParamFields label=\"Path Parameters\" params={pathParams} />}\n {hasQueryParams && <ParamFields label=\"Query Parameters\" params={queryParams} />}\n\n {/* Body */}\n {hasBody && (\n <BodySection\n schema={ep.requestBody?.schema}\n bodyType={bodyType}\n bodyDescription={ep.requestBody?.description}\n value={state.requestBody}\n onChange={setRequestBody}\n isJsonValid={isJsonValid}\n />\n )}\n\n {/* Auth & Headers — collapsed by default */}\n <CollapsibleSection\n label={\n <span className=\"inline-flex items-center gap-1\">\n <Key className=\"h-2.5 w-2.5\" />\n Auth & Headers\n </span>\n }\n >\n <div className=\"space-y-3 pt-2\">\n <div className=\"space-y-1.5\">\n <SectionLabel>API Key</SectionLabel>\n <Combobox\n options={apiKeyOptions}\n value={state.selectedApiKey ?? ''}\n onValueChange={(v) => setSelectedApiKey(v || null)}\n placeholder={\n apiKeysLoading\n ? 'Loading keys…'\n : hasApiKeys\n ? 'Select an API key'\n : 'No API keys yet'\n }\n searchPlaceholder=\"Search keys…\"\n emptyText=\"No matching key\"\n disabled={apiKeysLoading || !hasApiKeys}\n className=\"h-8\"\n />\n <p className=\"text-[10px] text-muted-foreground\">\n Picks are sent via the{' '}\n <span className=\"font-mono\">X-API-Key</span> header.\n </p>\n </div>\n <div className=\"space-y-1.5\">\n <SectionLabel>Bearer Token</SectionLabel>\n <Input\n type=\"password\"\n placeholder=\"Leave empty to use JWT from localStorage\"\n value={state.manualApiToken}\n onChange={(e) => setManualApiToken(e.target.value)}\n className=\"font-mono text-xs h-8\"\n />\n </div>\n <div className=\"space-y-1.5\">\n <SectionLabel>Headers</SectionLabel>\n <Textarea\n value={state.requestHeaders}\n onChange={(e) => setRequestHeaders(e.target.value)}\n className=\"font-mono text-[11px] min-h-[60px] resize-y\"\n rows={3}\n />\n </div>\n </div>\n </CollapsibleSection>\n\n {/* cURL — collapsed by default. PrettyCode has its own\n hover-toolbar with Copy, so no duplicate action here. */}\n {hasCurl && (\n <CollapsibleSection\n label={\n <span className=\"inline-flex items-center gap-1\">\n <Terminal className=\"h-2.5 w-2.5\" />\n cURL\n </span>\n }\n >\n <div className=\"mt-2\">\n <PrettyCode\n data={curlCommand}\n language=\"bash\"\n isCompact\n maxLines={50}\n />\n </div>\n </CollapsibleSection>\n )}\n\n {/* Bottom breathing room — the Send footer lives outside\n this component (in SlideInPlayground / TryItSheet),\n so we just leave a little space so the last section\n doesn't crash against the container edge. */}\n <div className=\"h-4\" />\n </ScrollArea>\n </>\n );\n}\n\n// ─── Body section ─────────────────────────────────────────────────────────────\n\ninterface BodySectionProps {\n schema: Record<string, unknown> | undefined;\n bodyType: string;\n bodyDescription?: string;\n /** JSON-serialised body kept in context. Form edits are re-serialised\n * before being written back so one source of truth survives across\n * the two view modes. */\n value: string;\n onChange: (raw: string) => void;\n isJsonValid: boolean;\n}\n\ntype BodyViewMode = 'form' | 'json';\n\nfunction BodySection({ schema, bodyType, bodyDescription, value, onChange, isJsonValid }: BodySectionProps) {\n // Default to form view when we have a schema to drive it. Fall back\n // to raw JSON for schemaless endpoints (or binary bodies, etc.).\n const hasSchema = !!schema;\n const [mode, setMode] = React.useState<BodyViewMode>(hasSchema ? 'form' : 'json');\n\n // Parse the context's JSON string once per value change so the form\n // sees a structured object. Invalid JSON is tolerated — the form\n // simply shows empty fields until the user fixes it.\n const parsed = React.useMemo(() => {\n if (!value) return null;\n try { return JSON.parse(value); } catch { return null; }\n }, [value]);\n\n const handleFormChange = useCallback(\n (next: unknown) => {\n onChange(JSON.stringify(next, null, 2));\n },\n [onChange],\n );\n\n return (\n <div className=\"space-y-2\">\n <div className=\"flex items-center justify-between gap-2 flex-wrap\">\n <div className=\"flex items-baseline gap-2 min-w-0\">\n <SectionLabel>Body</SectionLabel>\n {bodyType && (\n <span className=\"text-[10px] text-muted-foreground/40 font-mono\">{bodyType}</span>\n )}\n {bodyDescription && (\n <span className=\"text-[10px] text-muted-foreground/60 truncate\">{bodyDescription}</span>\n )}\n </div>\n {hasSchema && (\n <div className=\"inline-flex rounded-md border overflow-hidden text-[10px]\">\n <ModeButton active={mode === 'form'} onClick={() => setMode('form')}>Form</ModeButton>\n <ModeButton active={mode === 'json'} onClick={() => setMode('json')}>JSON</ModeButton>\n </div>\n )}\n {mode === 'json' && isJsonValid && value && (\n <button\n type=\"button\"\n onClick={() => {\n try { onChange(JSON.stringify(JSON.parse(value), null, 2)); } catch { /* noop */ }\n }}\n className=\"inline-flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors\"\n >\n <Sparkles className=\"h-2.5 w-2.5\" />\n Format\n </button>\n )}\n </div>\n\n {mode === 'form' && hasSchema ? (\n <BodyFormEditor\n schema={schema as Record<string, unknown>}\n value={parsed}\n onChange={handleFormChange}\n />\n ) : (\n <>\n <Textarea\n placeholder={'{\\n \"key\": \"value\"\\n}'}\n value={value}\n onChange={(e) => onChange(e.target.value)}\n className={cn(\n 'font-mono text-[11px] min-h-[90px] resize-y',\n !isJsonValid && 'border-destructive focus-visible:ring-destructive/30',\n )}\n rows={4}\n />\n {!isJsonValid && <p className=\"text-[10px] text-destructive\">Invalid JSON</p>}\n </>\n )}\n </div>\n );\n}\n\nfunction ModeButton({\n active, onClick, children,\n}: {\n active: boolean;\n onClick: () => void;\n children: React.ReactNode;\n}) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className={cn(\n 'px-2 py-0.5 font-medium transition-colors',\n active\n ? 'bg-primary/10 text-foreground'\n : 'text-muted-foreground hover:text-foreground',\n )}\n >\n {children}\n </button>\n );\n}\n","'use client';\n\nimport { Info, ShieldCheck } from 'lucide-react';\nimport { useMemo } from 'react';\n\ninterface PreviewViewProps {\n html: string;\n}\n\n/** Heuristic: does ``html`` look like a JS-only single-page app shell?\n *\n * SPAs (Vite, CRA, Next-app dev index) ship a near-empty ``<body>``\n * with a mount div + a ``<script type=\"module\">`` that hydrates the\n * page at runtime. Previewing those in a ``sandbox=\"\"`` iframe is\n * pointless because scripts can't run — the reader sees a blank\n * page and assumes preview is broken.\n *\n * We detect this by extracting body content, stripping scripts, and\n * checking what's left. If it's basically just a mount div, we show\n * an explanatory empty-state instead of an empty iframe. */\nfunction looksLikeSpaShell(html: string): boolean {\n const bodyMatch = html.match(/<body[^>]*>([\\s\\S]*?)<\\/body>/i);\n const bodyContent = (bodyMatch?.[1] ?? html)\n // Strip all script tags with their contents — runtime-only code\n // doesn't count as visible markup for this check.\n .replace(/<script[\\s\\S]*?<\\/script>/gi, '')\n // Strip comments.\n .replace(/<!--[\\s\\S]*?-->/g, '')\n .trim();\n\n if (bodyContent.length === 0) return true;\n\n // A single empty container (``<div id=\"root\"></div>`` and friends)\n // is the classic SPA mount point. Anything else — including static\n // server-rendered pages with real content — won't match.\n const singleEmptyContainer = /^<(div|main|section)[^>]*>\\s*<\\/\\1>$/i;\n if (singleEmptyContainer.test(bodyContent)) return true;\n\n return false;\n}\n\n/** Render an HTML response inside a sandboxed iframe so the reader can\n * see what the server's error page or template actually looks like.\n *\n * Security model — ``sandbox`` is intentionally **empty**:\n * - no ``allow-scripts`` → JavaScript in the response cannot run\n * - no ``allow-same-origin`` → the page can't read parent cookies\n * - no ``allow-forms`` / ``allow-popups`` → can't phish the user\n *\n * We feed the HTML via ``srcDoc`` (not ``src``) so we never issue a\n * network request to render it — the string is already local. */\nexport function PreviewView({ html }: PreviewViewProps) {\n const isSpaShell = useMemo(() => looksLikeSpaShell(html), [html]);\n\n if (!html) {\n return (\n <div className=\"py-10 text-center text-xs text-muted-foreground\">\n Empty response body\n </div>\n );\n }\n\n if (isSpaShell) {\n return (\n <div className=\"flex flex-col items-center justify-center py-16 px-6 text-center gap-3 min-h-[400px]\">\n <div className=\"inline-flex items-center justify-center h-10 w-10 rounded-full bg-muted\">\n <Info className=\"h-5 w-5 text-muted-foreground\" />\n </div>\n <div className=\"max-w-sm space-y-1.5\">\n <p className=\"text-sm font-medium text-foreground\">\n Looks like a single-page app shell\n </p>\n <p className=\"text-xs text-muted-foreground leading-relaxed\">\n This page renders its content with JavaScript at runtime.\n Scripts are disabled in the sandbox, so Preview would show\n a blank page. Switch to <strong>Pretty</strong> or{' '}\n <strong>Raw</strong> to inspect the HTML source.\n </p>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"flex flex-col h-full min-h-[400px]\">\n <div className=\"shrink-0 flex items-center gap-1.5 px-3 py-1.5 bg-muted/30 border-b text-[10px] text-muted-foreground/70\">\n <ShieldCheck className=\"h-3 w-3\" />\n Sandboxed preview — scripts, forms and popups are disabled\n </div>\n {/*\n * Checker-pattern background so \"black on black\" responses\n * still show a clear iframe bounding box, and so readers\n * can tell the iframe has loaded even if the page itself\n * is empty / fully transparent.\n */}\n <div\n className=\"flex-1 min-h-[360px] p-2\"\n style={{\n backgroundColor: '#fff',\n backgroundImage:\n 'linear-gradient(45deg, #f3f4f6 25%, transparent 25%), linear-gradient(-45deg, #f3f4f6 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #f3f4f6 75%), linear-gradient(-45deg, transparent 75%, #f3f4f6 75%)',\n backgroundSize: '16px 16px',\n backgroundPosition: '0 0, 0 8px, 8px -8px, -8px 0px',\n }}\n >\n <iframe\n title=\"Response preview\"\n srcDoc={html}\n sandbox=\"\"\n className=\"w-full h-full min-h-[360px] bg-white border-0 rounded shadow-sm\"\n />\n </div>\n </div>\n );\n}\n","'use client';\n\nimport JsonTree from '../../../../JsonTree';\nimport PrettyCode from '../../../../PrettyCode';\nimport type { DetectedContent } from './types';\n\n// JsonTree config — same shape as the interactive docs example view\n// but with ``showActionButtons: false`` because the copy button in the\n// StatusBar already covers that flow.\nconst JSON_TREE_CONFIG = {\n maxAutoExpandDepth: 2,\n maxAutoExpandArrayItems: 10,\n maxAutoExpandObjectKeys: 5,\n maxStringLength: 200,\n collectionLimit: 50,\n showCollectionInfo: true,\n showExpandControls: true,\n showActionButtons: false,\n preserveKeyOrder: true,\n className: 'border-0 rounded-none',\n} as const;\n\ninterface PrettyViewProps {\n /** Parsed JSON tree when the body was JSON. */\n treeData: unknown;\n /** Pre-stringified body — used by the code-highlight branch for\n * non-JSON payloads. */\n rawText: string;\n detected: DetectedContent;\n}\n\n/** \"Pretty\" view — rich-rendering branch. JSON renders as ``JsonTree``;\n * anything else goes through ``PrettyCode`` in ``plain`` variant so it\n * flows naturally inside the panel's ``ScrollArea`` — no internal\n * scroll, no floating toolbar fighting the surrounding layout. */\nexport function PrettyView({ treeData, rawText, detected }: PrettyViewProps) {\n if (detected.kind === 'json' && treeData != null) {\n return <JsonTree title=\"Response Body\" data={treeData} config={JSON_TREE_CONFIG} />;\n }\n if (!rawText) {\n return (\n <div className=\"py-10 text-center text-xs text-muted-foreground\">\n Empty response body\n </div>\n );\n }\n return (\n <PrettyCode\n data={rawText}\n language={detected.prism}\n variant=\"plain\"\n isCompact\n />\n );\n}\n","'use client';\n\ninterface RawViewProps {\n rawText: string;\n}\n\n/** Verbatim response body. No parsing, no highlighting — readers\n * occasionally need to inspect trailing whitespace, escape\n * sequences, or a payload that accidentally claims one content type\n * and ships another, and the Pretty view hides some of that. */\nexport function RawView({ rawText }: RawViewProps) {\n if (!rawText) {\n return (\n <div className=\"py-10 text-center text-xs text-muted-foreground\">\n Empty response body\n </div>\n );\n }\n return (\n <pre className=\"p-4 text-[11px] font-mono text-foreground/70 whitespace-pre-wrap break-all leading-relaxed\">\n {rawText}\n </pre>\n );\n}\n","'use client';\n\nimport { CopyButton } from '@djangocfg/ui-core/components';\n\nimport type { ApiResponse } from '../../../types';\nimport { StatusBadge } from '../ui';\n\ninterface StatusBarProps {\n response: ApiResponse;\n rawText: string;\n /** Content-Type label shown inline next to size/duration. ``null``\n * when the server didn't send one — we hide the slot instead of\n * showing an empty dash. */\n contentType: string | null;\n}\n\n/** Top strip of the response panel: status badge, statusText, size,\n * duration, content-type, copy button. Compact — one line, tabular\n * numerals so 1.4 KB and 107ms don't shift as values update. */\nexport function StatusBar({ response, rawText, contentType }: StatusBarProps) {\n const sizeKb = rawText ? `${(rawText.length / 1024).toFixed(1)} KB` : '';\n const duration = response.duration != null ? `${response.duration}ms` : '';\n const hasStatus = response.status != null;\n const hasCopy = Boolean(rawText);\n\n return (\n <div className=\"shrink-0 border-b px-4 py-2 flex items-center justify-between gap-3 bg-muted/20\">\n <div className=\"flex items-center gap-2 min-w-0\">\n {hasStatus && <StatusBadge status={response.status!} />}\n {response.statusText && (\n <span className=\"text-xs text-muted-foreground truncate\">\n {response.statusText}\n </span>\n )}\n {sizeKb && (\n <span className=\"text-[10px] text-muted-foreground/50 tabular-nums shrink-0\">\n {sizeKb}\n </span>\n )}\n {duration && (\n <span className=\"text-[10px] text-muted-foreground/50 tabular-nums shrink-0\">\n {duration}\n </span>\n )}\n {contentType && (\n <span className=\"text-[10px] text-muted-foreground/50 font-mono truncate\">\n {contentType}\n </span>\n )}\n </div>\n {hasCopy && (\n <CopyButton\n value={rawText}\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-6 px-2 text-[10px] text-muted-foreground shrink-0\"\n >\n Copy\n </CopyButton>\n )}\n </div>\n );\n}\n","import type { ContentKind, DetectedContent } from './types';\n\n/** Strip Content-Type parameters (``; charset=utf-8`` etc.) and lower-case. */\nfunction normaliseContentType(raw: string | null): string | null {\n if (!raw) return null;\n const semi = raw.indexOf(';');\n return (semi === -1 ? raw : raw.slice(0, semi)).trim().toLowerCase();\n}\n\n/** Pull Content-Type out of the headers bag. We accept both plain\n * objects (``{ \"content-type\": \"...\" }``) and ``Headers``-like shapes\n * with a ``.get`` method. The context type is ``any`` so we can't be\n * stricter without plumbing a proper type through the response code\n * path. */\nfunction readContentType(headers: unknown): string | null {\n if (!headers) return null;\n // Headers instance — use ``.get`` (case-insensitive).\n if (typeof (headers as Headers).get === 'function') {\n return (headers as Headers).get('content-type');\n }\n // Plain object — look up with case-insensitive key match so both\n // ``Content-Type`` and ``content-type`` work.\n if (typeof headers === 'object') {\n for (const [k, v] of Object.entries(headers as Record<string, unknown>)) {\n if (k.toLowerCase() === 'content-type') {\n return typeof v === 'string' ? v : null;\n }\n }\n }\n return null;\n}\n\n/** Map a normalised MIME type to our short ``ContentKind``. Unknown\n * types fall back to ``text`` so PrettyCode still shows something\n * sensible (plain text is a valid Prism language). */\nfunction kindFromContentType(mime: string | null): ContentKind {\n if (!mime) return 'text';\n if (mime === 'application/json' || mime.endsWith('+json')) return 'json';\n if (mime === 'text/html' || mime === 'application/xhtml+xml') return 'html';\n if (\n mime === 'application/xml' ||\n mime === 'text/xml' ||\n mime.endsWith('+xml')\n ) return 'xml';\n if (mime === 'text/css') return 'css';\n if (\n mime === 'application/javascript' ||\n mime === 'text/javascript' ||\n mime === 'application/x-javascript'\n ) return 'javascript';\n return 'text';\n}\n\n/** Heuristic fallback when ``Content-Type`` is missing or opaque.\n * Returns ``null`` when nothing firm can be inferred; the caller\n * then defaults to ``text``. */\nfunction kindFromBody(body: string): ContentKind | null {\n const trimmed = body.trimStart();\n if (!trimmed) return null;\n if (trimmed.startsWith('<!DOCTYPE') || /^<html[\\s>]/i.test(trimmed)) return 'html';\n if (trimmed.startsWith('<?xml')) return 'xml';\n if (trimmed.startsWith('{') || trimmed.startsWith('[')) {\n // Cheap validity check — full parse happens in ResponsePanel.\n try { JSON.parse(trimmed); return 'json'; } catch { /* fall through */ }\n }\n return null;\n}\n\nconst PRISM_BY_KIND: Record<ContentKind, DetectedContent['prism']> = {\n json: 'json',\n // ``markup`` is Prism's HTML/XML grammar — there isn't a separate\n // ``html`` language. XML piggy-backs on the same tokeniser.\n html: 'markup',\n xml: 'markup',\n css: 'css',\n javascript: 'javascript',\n text: 'markup',\n};\n\n/** Detect content kind from headers, falling back to body sniffing\n * when the header is missing. Pure function — safe to call inside\n * ``useMemo`` deps on the raw body and headers. */\nexport function detectContent(headers: unknown, rawBody: string): DetectedContent {\n const contentType = normaliseContentType(readContentType(headers));\n const headerKind = kindFromContentType(contentType);\n\n // If headers say it's text/plain but the body looks like HTML or\n // JSON, trust the body — a lot of framework 500 pages claim\n // text/html but some setups default to text/plain for errors.\n const kind = headerKind === 'text' ? (kindFromBody(rawBody) ?? 'text') : headerKind;\n\n return {\n kind,\n prism: PRISM_BY_KIND[kind],\n contentType,\n };\n}\n","import { useMemo } from 'react';\n\nimport { detectContent } from './detectContent';\nimport type { DetectedContent } from './types';\n\ninterface UseResponseViewResult {\n /** Parsed JSON value when the body is JSON, otherwise ``null``.\n * JsonTree needs a live object to render properly, so we parse\n * once up-front and cache. */\n treeData: unknown;\n /** Stringified body, always present when the server returned\n * anything. Used by Raw and Pretty-for-text tabs. */\n rawText: string;\n /** Content-type + prism language inference. */\n detected: DetectedContent;\n}\n\n/** Shape the raw response payload into the pieces each view tab\n * needs. Exposed as a hook so the component stays thin and the\n * normalisation is easy to test in isolation. */\nexport function useResponseView(\n data: unknown,\n headers: unknown,\n): UseResponseViewResult {\n return useMemo(() => {\n if (data == null) {\n return {\n treeData: null,\n rawText: '',\n detected: detectContent(headers, ''),\n };\n }\n\n // String body — might be JSON-in-a-string or a plain text dump.\n if (typeof data === 'string') {\n try {\n return {\n treeData: JSON.parse(data),\n rawText: data,\n detected: detectContent(headers, data),\n };\n } catch {\n return {\n treeData: null,\n rawText: data,\n detected: detectContent(headers, data),\n };\n }\n }\n\n // Object body — axios already parsed it. Stringify for Raw/\n // Preview tabs and treat it as JSON regardless of headers.\n const stringified = (() => {\n try { return JSON.stringify(data, null, 2); } catch { return String(data); }\n })();\n return {\n treeData: data,\n rawText: stringified,\n detected: detectContent(headers, stringified),\n };\n }, [data, headers]);\n}\n","'use client';\n\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport type { ViewMode } from './types';\n\ninterface ViewTabsProps {\n active: ViewMode;\n onChange: (mode: ViewMode) => void;\n /** When false the Preview tab is hidden — only HTML responses get\n * a useful preview, everything else renders the same as Pretty. */\n showPreview: boolean;\n}\n\nconst LABELS: Record<ViewMode, string> = {\n pretty: 'Pretty',\n raw: 'Raw',\n preview: 'Preview',\n};\n\n/** Tab strip for switching between Pretty / Raw / Preview. Matches the\n * visual weight of the ``LanguageTabs`` in CodeSamples so the page\n * reads as one coherent toolbar system. */\nexport function ViewTabs({ active, onChange, showPreview }: ViewTabsProps) {\n const tabs: ViewMode[] = showPreview ? ['pretty', 'raw', 'preview'] : ['pretty', 'raw'];\n return (\n <div className=\"shrink-0 border-b px-3 py-1.5 flex items-center gap-1\">\n {tabs.map((t) => (\n <button\n key={t}\n type=\"button\"\n onClick={() => onChange(t)}\n className={cn(\n 'h-6 px-2.5 rounded text-[11px] font-medium transition-colors',\n active === t\n ? 'bg-muted text-foreground'\n : 'text-muted-foreground/70 hover:text-foreground hover:bg-muted/50',\n )}\n >\n {LABELS[t]}\n </button>\n ))}\n </div>\n );\n}\n","'use client';\n\nimport { Loader2, Send, Terminal, WifiOff } from 'lucide-react';\nimport { useEffect, useState } from 'react';\n\nimport { usePlaygroundContext } from '../../../context/PlaygroundContext';\nimport { EmptyState, ScrollArea } from '../ui';\nimport { PreviewView } from './PreviewView';\nimport { PrettyView } from './PrettyView';\nimport { RawView } from './RawView';\nimport { StatusBar } from './StatusBar';\nimport type { ViewMode } from './types';\nimport { useResponseView } from './useResponseView';\nimport { ViewTabs } from './ViewTabs';\n\n/** Response panel used by both the sticky ``SlideInPlayground`` and the\n * modal ``TryItSheet``. Responsibilities:\n * - Empty / loading / network-error gates\n * - Three view modes (Pretty / Raw / Preview) with a tab bar\n * - Auto-pick the best default view per response type (JSON → Pretty,\n * HTML → Preview, everything else → Pretty as the widest-purpose)\n *\n * View mode is local component state rather than context state — it\n * should reset when the selected endpoint changes and not leak between\n * endpoints. */\nexport function ResponsePanel() {\n const { state } = usePlaygroundContext();\n const { response, loading, selectedEndpoint } = state;\n\n const { treeData, rawText, detected } = useResponseView(response?.data, response?.headers);\n const showPreview = detected.kind === 'html';\n\n // Default view heuristic: show HTML pages preview-first so the\n // reader sees the actual rendered server page immediately.\n // Everything else lands on Pretty.\n const [mode, setMode] = useState<ViewMode>(showPreview ? 'preview' : 'pretty');\n\n // Reset the mode when the endpoint or response changes so a\n // previously-selected tab from a different shape doesn't stick\n // around (e.g. stuck on Preview when switching from HTML→JSON).\n useEffect(() => {\n setMode(showPreview ? 'preview' : 'pretty');\n }, [selectedEndpoint, response, showPreview]);\n\n if (loading) {\n return (\n <div className=\"flex items-center justify-center h-full gap-2\">\n <Loader2 className=\"h-4 w-4 animate-spin text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground\">Sending…</span>\n </div>\n );\n }\n\n if (!selectedEndpoint) return <EmptyState icon={Terminal} text=\"Response will appear here\" />;\n if (!response) return <EmptyState icon={Send} text='Press \"Send Request\" to see the response' />;\n\n const hasError = Boolean(response.error);\n const hasStatus = response.status != null;\n\n // Pure network error (no HTTP response at all — CORS, offline, timeout)\n if (hasError && !hasStatus) {\n return (\n <EmptyState\n icon={WifiOff}\n text={response.error!}\n className=\"text-destructive [&_svg]:text-destructive\"\n />\n );\n }\n\n return (\n <>\n <StatusBar response={response} rawText={rawText} contentType={detected.contentType} />\n\n {/* HTTP-level error body (4xx/5xx — has status but also error flag) */}\n {hasError && (\n <div className=\"shrink-0 mx-4 mt-3 rounded border border-destructive/20 bg-destructive/5 px-3 py-2\">\n <p className=\"text-xs text-destructive\">{response.error}</p>\n </div>\n )}\n\n <ViewTabs active={mode} onChange={setMode} showPreview={showPreview} />\n\n <ScrollArea>\n {mode === 'pretty' && (\n <PrettyView treeData={treeData} rawText={rawText} detected={detected} />\n )}\n {mode === 'raw' && <RawView rawText={rawText} />}\n {mode === 'preview' && <PreviewView html={rawText} />}\n </ScrollArea>\n </>\n );\n}\n","'use client';\n\nimport { AlertCircle, Loader2, Send } from 'lucide-react';\nimport React, { useMemo } from 'react';\n\nimport { Button } from '@djangocfg/ui-core/components';\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport { usePlaygroundContext } from '../../context/PlaygroundContext';\nimport { isValidJson } from '../../utils';\nimport { UrlBuilder } from '../../utils/url';\n\ninterface SendButtonProps {\n className?: string;\n}\n\n/**\n * Standalone Send button that reads from and acts on the playground\n * context. Disabled + explainer-banner when required inputs are missing.\n *\n * Validation rules (in order — first failure wins the banner text):\n * 1. Required path/query parameters must be non-empty.\n * 2. Path template must be fully substituted (no leftover ``{name}``).\n * 3. Request body, when present, must be valid JSON.\n *\n * We validate on the client so the user isn't punished with a 404 from\n * the server for a trivially detectable mistake (e.g. empty ``{petId}``).\n */\nexport function SendButton({ className }: SendButtonProps) {\n const { state, sendRequest } = usePlaygroundContext();\n\n const ep = state.selectedEndpoint;\n\n // Single source of truth for URL-level validation lives in UrlBuilder.\n // Recomputing every render is cheap (pure string work).\n const builder = useMemo(\n () => (ep ? new UrlBuilder(ep, state.parameters) : null),\n [ep, state.parameters],\n );\n const missingRequired = builder?.missingRequired() ?? [];\n const unsubstituted = builder?.unfilledPlaceholders() ?? [];\n\n const isJsonValid = state.requestBody ? isValidJson(state.requestBody) : true;\n\n const blockers: string[] = [];\n if (missingRequired.length > 0) {\n blockers.push(\n `Fill required parameter${missingRequired.length > 1 ? 's' : ''}: ${missingRequired.join(', ')}`,\n );\n } else if (unsubstituted.length > 0) {\n blockers.push(`URL still has unfilled placeholder${unsubstituted.length > 1 ? 's' : ''}: ${unsubstituted.map((n) => `{${n}}`).join(', ')}`);\n }\n if (!isJsonValid) blockers.push('Request body is not valid JSON');\n\n const disabled =\n state.loading ||\n !state.requestUrl ||\n blockers.length > 0;\n\n const tooltip = blockers.length > 0 ? blockers.join('\\n') : undefined;\n\n return (\n <div className={cn('space-y-2', className)}>\n {blockers.length > 0 && (\n <div className=\"flex items-start gap-2 rounded-md border border-amber-500/25 bg-amber-500/[0.06] px-3 py-2 text-[11px] text-amber-600 dark:text-amber-400\">\n <AlertCircle className=\"h-3.5 w-3.5 shrink-0 mt-px\" />\n <span className=\"leading-snug\">{blockers[0]}</span>\n </div>\n )}\n <Button\n onClick={sendRequest}\n disabled={disabled}\n size=\"sm\"\n title={tooltip}\n className=\"w-full gap-2 h-9\"\n >\n {state.loading ? (\n <>\n <Loader2 className=\"h-3.5 w-3.5 animate-spin\" />\n Sending…\n </>\n ) : (\n <>\n <Send className=\"h-3.5 w-3.5\" />\n Send Request\n </>\n )}\n </Button>\n </div>\n );\n}\n","'use client';\n\nimport React from 'react';\n\nimport { SidePanel } from '@djangocfg/ui-core/components';\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport { usePlaygroundContext } from '../../context/PlaygroundContext';\nimport { RequestPanel } from '../shared/RequestPanel';\nimport { ResponsePanel } from '../shared/ResponsePanel';\nimport { SendButton } from '../shared/SendButton';\nimport { MethodBadge, Panel, relativePath } from '../shared/ui';\n\ninterface SlideInPlaygroundProps {\n open: boolean;\n onClose: () => void;\n}\n\n// Width when only Request is visible vs. when Response is also rendered.\n// ``clamp(min, preferred, max)`` lets the panel scale with the viewport\n// instead of sitting at a fixed size that looks tiny on ultra-wide or\n// cramped on laptops.\n//\n// Narrow (Request only) — form content, no need to ever exceed ~480px.\n// 1280 viewport → 384 | 1440 → 432 | 1920 → 480 (cap) | 2560 → 480 (cap)\n//\n// Wide (Request + Response) — response can be huge JSON/HTML; give it room.\n// 1280 → 768 | 1440 → 864 | 1920 → 1152 | 2560 → 1280 (cap) | 3840 → 1280 (cap)\n//\n// Transition between the two values is animated by SidePanel.Content\n// (both ``transform`` and ``width`` listed there). clamp() interpolates\n// smoothly during that transition, no extra plumbing needed.\nconst WIDTH_NARROW = 'clamp(380px, 30vw, 480px)';\nconst WIDTH_WIDE = 'clamp(720px, 60vw, 1280px)';\n\n/**\n * Right-side slide-in playground. Two-column layout appears once the\n * user has a response in hand — before that, only the Request form is\n * shown and the panel stays narrow so docs have room to breathe.\n *\n * State transitions:\n * - no endpoint ⇒ panel not rendered\n * - endpoint, no resp ⇒ narrow (Request only)\n * - endpoint + loading ⇒ wide (Request + Response spinner)\n * - endpoint + resp ⇒ wide (Request + Response)\n *\n * Selecting a different endpoint clears ``response`` in the reducer,\n * so the panel smoothly collapses back to narrow.\n */\nexport function SlideInPlayground({ open, onClose }: SlideInPlaygroundProps) {\n const { state } = usePlaygroundContext();\n const ep = state.selectedEndpoint;\n const showResponse = state.response !== null || state.loading;\n const width = showResponse ? WIDTH_WIDE : WIDTH_NARROW;\n\n return (\n <SidePanel open={open} onOpenChange={(v) => !v && onClose()} side=\"right\">\n <SidePanel.Content width={width} className=\"max-w-[95vw]\">\n <SidePanel.Header>\n <SidePanel.Title>Playground</SidePanel.Title>\n {ep && (\n <div className=\"flex items-center gap-2 min-w-0 flex-1\">\n <MethodBadge method={ep.method} />\n <code className=\"font-mono text-[11px] text-muted-foreground truncate\">\n {relativePath(ep.path)}\n </code>\n </div>\n )}\n <SidePanel.Close className=\"ml-auto\" />\n </SidePanel.Header>\n\n {/* Body: 1 or 2 columns depending on whether we have a\n response to show. ``divide-x`` gives a 1px seam\n between the panes so they read as distinct surfaces.\n Send button lives inside the Request column so it\n reads as an action on the form it belongs to — not\n as a page-level footer that ambiguously sat under\n the response column too. */}\n <SidePanel.Body\n className={cn(\n 'overflow-hidden grid divide-x transition-[grid-template-columns] duration-250',\n showResponse\n ? 'grid-cols-[minmax(0,1fr)_minmax(0,1fr)]'\n : 'grid-cols-1',\n )}\n >\n <Panel>\n <RequestPanel />\n {ep && (\n <div className=\"shrink-0 border-t px-4 py-3 bg-background\">\n <SendButton />\n </div>\n )}\n </Panel>\n {showResponse && (\n <Panel>\n <ResponsePanel />\n </Panel>\n )}\n </SidePanel.Body>\n </SidePanel.Content>\n </SidePanel>\n );\n}\n","'use client';\n\nimport React from 'react';\n\nimport {\n ResponsiveSheet,\n ResponsiveSheetContent,\n ResponsiveSheetHeader,\n ResponsiveSheetTitle,\n} from '@djangocfg/ui-core/components';\n\nimport { usePlaygroundContext } from '../../context/PlaygroundContext';\nimport { RequestPanel } from '../shared/RequestPanel';\nimport { ResponsePanel } from '../shared/ResponsePanel';\nimport { SendButton } from '../shared/SendButton';\n\ninterface TryItSheetProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n}\n\n/**\n * Mobile/tablet fallback: the slide-in playground doesn't fit, so we\n * open Request + Response inside a ResponsiveSheet (bottom drawer on\n * mobile, side sheet on desktop). Response stays hidden until a\n * request has been sent — matching the desktop ``SlideInPlayground``\n * behaviour.\n */\nexport function TryItSheet({ open, onOpenChange }: TryItSheetProps) {\n const { state } = usePlaygroundContext();\n const showResponse = state.response !== null || state.loading;\n\n return (\n <ResponsiveSheet open={open} onOpenChange={onOpenChange}>\n <ResponsiveSheetContent className=\"sm:max-w-xl flex flex-col h-full p-0\">\n <ResponsiveSheetHeader className=\"px-4 py-3 border-b shrink-0\">\n <ResponsiveSheetTitle className=\"text-sm\">Playground</ResponsiveSheetTitle>\n </ResponsiveSheetHeader>\n {/* Send button sits inside the Request section so it\n reads as an action on the form, not an ambiguous\n page-level footer when Response is also visible. */}\n <div className=\"flex-1 min-h-0 flex flex-col divide-y\">\n <div className=\"flex-1 min-h-0 flex flex-col\">\n <RequestPanel />\n {state.selectedEndpoint && (\n <div className=\"shrink-0 border-t px-4 py-3 bg-background\">\n <SendButton />\n </div>\n )}\n </div>\n {showResponse && (\n <div className=\"flex-1 min-h-0 flex flex-col\">\n <ResponsePanel />\n </div>\n )}\n </div>\n </ResponsiveSheetContent>\n </ResponsiveSheet>\n );\n}\n","'use client';\n\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { keyBy } from 'lodash-es';\n\nimport { Skeleton, TooltipProvider } from '@djangocfg/ui-core/components';\nimport { useMediaQuery } from '@djangocfg/ui-core/hooks';\n\nimport useOpenApiSchema from '../../hooks/useOpenApiSchema';\nimport { useDocsUrlSync, type ParsedHash } from '../../hooks/useDocsUrlSync';\nimport { usePlaygroundContext } from '../../context/PlaygroundContext';\nimport type { ApiEndpoint } from '../../types';\nimport { EndpointDraftSync } from '../shared/EndpointDraftSync';\nimport { slugifySchemaId } from './anchor';\nimport { DocsSidebar } from './Sidebar';\nimport { DocsView, type DocsViewHandle } from './DocsView';\nimport { SlideInPlayground } from './SlideInPlayground';\nimport { TryItSheet } from './TryItSheet';\n\n// ─── Root ─────────────────────────────────────────────────────────────────────\n\nexport const DocsLayout: React.FC = () => {\n const { state, config, setSelectedEndpoint } = usePlaygroundContext();\n // The docs layout has a sidebar + docs column that already eat ~260px\n // before the slide-in opens. Below 1024px the slide-in (min 720 wide)\n // leaves docs with <250px — unreadable — so we fall back to the\n // mobile-style ``TryItSheet`` on those viewports.\n const isDesktop = useMediaQuery('(min-width: 1024px)');\n const isMobile = !isDesktop;\n\n const grouping = config.schemaGrouping ?? 'selector';\n const preloadAll = grouping === 'sections';\n const urlSyncEnabled =\n config.urlSync === undefined\n ? true\n : typeof config.urlSync === 'boolean'\n ? config.urlSync\n : Boolean(config.urlSync.enabled);\n\n const {\n endpoints,\n schemaInfo,\n rawSchema,\n resolvedBaseUrl,\n loading,\n error,\n schemas,\n currentSchema,\n setCurrentSchema,\n schemasData,\n } = useOpenApiSchema({\n schemas: config.schemas,\n defaultSchemaId: config.defaultSchemaId,\n baseUrl: config.baseUrl,\n preloadAll,\n });\n\n const [activeAnchor, setActiveAnchor] = useState<string | null>(null);\n const [activeSchemaId, setActiveSchemaId] = useState<string | null>(null);\n const [sheetOpen, setSheetOpen] = useState(false);\n const docsRef = useRef<DocsViewHandle | null>(null);\n\n // Desktop slide-in is driven directly by ``selectedEndpoint``. Keeping a\n // separate open-state would mean two sources of truth for the same\n // semantic — \"which endpoint is loaded into the playground\".\n const slideOpen = !isMobile && state.selectedEndpoint !== null;\n\n // Per-schema endpoint map for the sections sidebar. ``keyBy`` makes the\n // lookup O(1) at render time instead of scanning schemasData in each\n // CategoryBlock — a win for 10+ schemas.\n const endpointsBySchema = useMemo<Record<string, ApiEndpoint[]>>(() => {\n if (grouping !== 'sections') return {};\n const byId = keyBy(schemasData, (e) => e.source.id);\n const out: Record<string, ApiEndpoint[]> = {};\n for (const src of schemas) out[src.id] = byId[src.id]?.endpoints ?? [];\n return out;\n }, [grouping, schemasData, schemas]);\n\n const handleTry = useCallback(\n (ep: ApiEndpoint) => {\n setSelectedEndpoint(ep);\n if (isMobile) setSheetOpen(true);\n },\n [isMobile, setSelectedEndpoint],\n );\n\n const handleCloseSlide = useCallback(() => {\n setSelectedEndpoint(null);\n }, [setSelectedEndpoint]);\n\n const handleNavigate = useCallback(\n (anchor: string, schemaId?: string | null) => {\n // In selector mode a schema switch may be required before the\n // anchor exists in the DOM — defer the scroll until the next\n // paint so ``useOpenApiSchema`` has a chance to swap endpoints.\n if (schemaId && schemaId !== currentSchema?.id && grouping === 'selector') {\n setCurrentSchema(schemaId);\n requestAnimationFrame(() => {\n docsRef.current?.scrollToAnchor(anchor);\n });\n return;\n }\n docsRef.current?.scrollToAnchor(anchor);\n },\n [currentSchema?.id, grouping, setCurrentSchema],\n );\n\n const handleActiveChange = useCallback((anchor: string | null, schemaId: string | null) => {\n setActiveAnchor(anchor);\n setActiveSchemaId(schemaId);\n }, []);\n\n // URL sync: read hash on mount / popstate → apply; write hash when\n // scrollspy updates. Only the *effective* active schema goes into the\n // hash — in ``selector`` mode it's the combobox value, in ``sections``\n // mode it's whichever schema the scrollspy is currently inside.\n const effectiveSchemaId = grouping === 'sections' ? activeSchemaId : currentSchema?.id ?? null;\n\n const handleHashTarget = useCallback(\n (target: ParsedHash) => {\n if (!target.schemaId && !target.anchor) return;\n\n // Schema-id segment may be either the raw id or a slug — match\n // both so copy-pasted URLs survive id changes that don't affect\n // the slug. First match wins.\n const matched = target.schemaId\n ? schemas.find((s) => s.id === target.schemaId || slugifySchemaId(s.id) === target.schemaId)\n : null;\n\n const needsSchemaSwitch =\n matched && grouping === 'selector' && matched.id !== currentSchema?.id;\n\n if (needsSchemaSwitch) {\n setCurrentSchema(matched.id);\n }\n\n if (target.anchor) {\n const anchor = target.anchor;\n // Wait one frame when a switch happened so the new DOM exists.\n if (needsSchemaSwitch) {\n requestAnimationFrame(() => {\n docsRef.current?.scrollToAnchor(anchor);\n });\n } else {\n docsRef.current?.scrollToAnchor(anchor);\n }\n }\n },\n [schemas, grouping, currentSchema?.id, setCurrentSchema],\n );\n\n useDocsUrlSync({\n enabled: urlSyncEnabled,\n currentSchemaId: effectiveSchemaId,\n activeAnchor,\n onHashTarget: handleHashTarget,\n });\n\n // ─── Loading / error branches ─────────────────────────────────────────\n\n if (loading) {\n return (\n <div className=\"grid grid-cols-[260px_1fr] items-start\">\n <div\n className=\"sticky top-[var(--navbar-height,64px)] border-r p-3 space-y-1.5 overflow-y-auto\"\n style={{ height: 'calc(100dvh - var(--navbar-height, 64px))' }}\n >\n {Array.from({ length: 12 }).map((_, i) => (\n <Skeleton key={i} className=\"h-8 w-full rounded\" />\n ))}\n </div>\n <div className=\"p-8 space-y-4\">\n <Skeleton className=\"h-8 w-1/2\" />\n <Skeleton className=\"h-4 w-full\" />\n <Skeleton className=\"h-4 w-3/4\" />\n <div className=\"mt-8 space-y-6\">\n {Array.from({ length: 3 }).map((_, i) => (\n <div key={i} className=\"space-y-3\">\n <Skeleton className=\"h-6 w-1/3\" />\n <Skeleton className=\"h-20 w-full\" />\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n }\n\n if (error) {\n return (\n <div\n className=\"flex items-center justify-center p-8\"\n style={{ height: 'calc(100dvh - var(--navbar-height, 64px))' }}\n >\n <p className=\"text-sm text-destructive\">Failed to load schema: {error}</p>\n </div>\n );\n }\n\n // ─── Mobile: sidebar + docs only, playground opens in sheet ───────────\n\n if (isMobile) {\n return (\n <div className=\"flex flex-col\">\n <EndpointDraftSync schemaId={currentSchema?.id ?? null} />\n {grouping === 'sections' ? (\n <DocsView\n ref={docsRef}\n grouping=\"sections\"\n schemasData={schemasData}\n selectedVersion={state.selectedVersion}\n loadedEndpoint={state.selectedEndpoint}\n onTryEndpoint={handleTry}\n onActiveChange={handleActiveChange}\n />\n ) : (\n <DocsView\n ref={docsRef}\n info={schemaInfo}\n rawSchema={rawSchema}\n resolvedBaseUrl={resolvedBaseUrl}\n endpoints={endpoints}\n selectedVersion={state.selectedVersion}\n loadedEndpoint={state.selectedEndpoint}\n onTryEndpoint={handleTry}\n onActiveChange={handleActiveChange}\n />\n )}\n <TryItSheet open={sheetOpen} onOpenChange={setSheetOpen} />\n </div>\n );\n }\n\n // ─── Desktop ──────────────────────────────────────────────────────────\n\n return (\n <TooltipProvider delayDuration={350}>\n <div className=\"grid grid-cols-[260px_minmax(0,1fr)] items-start\">\n <EndpointDraftSync schemaId={currentSchema?.id ?? null} />\n <div\n className=\"sticky top-[var(--navbar-height,64px)]\"\n style={{ height: 'calc(100dvh - var(--navbar-height, 64px))' }}\n >\n <DocsSidebar\n info={schemaInfo}\n endpoints={endpoints}\n schemas={schemas}\n currentSchemaId={currentSchema?.id ?? null}\n onSchemaChange={setCurrentSchema}\n activeEndpointId={activeAnchor}\n selectedVersion={state.selectedVersion}\n onNavigate={handleNavigate}\n grouping={grouping}\n endpointsBySchema={endpointsBySchema}\n rawSchema={rawSchema}\n resolvedBaseUrl={resolvedBaseUrl}\n />\n </div>\n {grouping === 'sections' ? (\n <DocsView\n ref={docsRef}\n grouping=\"sections\"\n schemasData={schemasData}\n selectedVersion={state.selectedVersion}\n loadedEndpoint={state.selectedEndpoint}\n onTryEndpoint={handleTry}\n onActiveChange={handleActiveChange}\n />\n ) : (\n <DocsView\n ref={docsRef}\n info={schemaInfo}\n rawSchema={rawSchema}\n resolvedBaseUrl={resolvedBaseUrl}\n endpoints={endpoints}\n selectedVersion={state.selectedVersion}\n loadedEndpoint={state.selectedEndpoint}\n onTryEndpoint={handleTry}\n onActiveChange={handleActiveChange}\n />\n )}\n {/* SidePanel renders into <body> via portal, so it floats\n above the whole layout (sidebar + navbar included). */}\n <SlideInPlayground open={slideOpen} onClose={handleCloseSlide} />\n </div>\n </TooltipProvider>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/tools/OpenapiViewer/hooks/useOpenApiSchema.ts","../src/tools/OpenapiViewer/hooks/useDocsUrlSync.ts","../src/tools/OpenapiViewer/hooks/useEndpointDraft.ts","../src/tools/OpenapiViewer/components/shared/EndpointDraftSync.tsx","../src/tools/OpenapiViewer/components/DocsLayout/anchor.ts","../src/tools/OpenapiViewer/components/shared/ui.tsx","../src/tools/OpenapiViewer/components/DocsLayout/SchemaCopyMenu.tsx","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/BrandHeader.tsx","../src/tools/OpenapiViewer/components/DocsLayout/sidebarLabel.ts","../src/tools/OpenapiViewer/components/DocsLayout/grouping.ts","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/buildVM.ts","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/EndpointRow.tsx","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/CategoryBlock.tsx","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/SchemaSection.tsx","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/SidebarBody.tsx","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/types.ts","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/MethodChips.tsx","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/SearchInput.tsx","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/Toolbar.tsx","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/useDebouncedValue.ts","../src/tools/OpenapiViewer/components/DocsLayout/Sidebar/index.tsx","../src/tools/OpenapiViewer/utils/scrollParent.ts","../src/tools/OpenapiViewer/components/DocsLayout/ApiIntroSection.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/context.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/store/index.ts","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/store/selectors.ts","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/CodeSamples/LanguageTabs.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/CodeSamples/useCodeSnippet.ts","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/CodeSamples/index.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Header/MetaActions.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Header/PathDisplay.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Header/index.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Parameters/ParamRow.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Parameters/ParamGroup.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Parameters/index.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/SchemaFields/buildTree.ts","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/SchemaFields/FieldRow.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/SchemaFields/index.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/RequestBody/index.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Responses/ResponseBody.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Responses/StatusTag.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Responses/ResponseRow.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Responses/index.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Section/defaults.ts","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/types.ts","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/hooks/useSectionHash.ts","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Section/SectionHeader.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Section/index.tsx","../src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/index.tsx","../src/tools/OpenapiViewer/components/DocsLayout/DocsView.tsx","../src/tools/OpenapiViewer/components/shared/BodyFormEditor.tsx","../src/tools/OpenapiViewer/components/shared/EndpointResetButton.tsx","../src/tools/OpenapiViewer/components/shared/RequestPanel.tsx","../src/tools/OpenapiViewer/components/shared/ResponsePanel/PreviewView.tsx","../src/tools/OpenapiViewer/components/shared/ResponsePanel/PrettyView.tsx","../src/tools/OpenapiViewer/components/shared/ResponsePanel/RawView.tsx","../src/tools/OpenapiViewer/components/shared/ResponsePanel/StatusBar.tsx","../src/tools/OpenapiViewer/components/shared/ResponsePanel/detectContent.ts","../src/tools/OpenapiViewer/components/shared/ResponsePanel/useResponseView.ts","../src/tools/OpenapiViewer/components/shared/ResponsePanel/ViewTabs.tsx","../src/tools/OpenapiViewer/components/shared/ResponsePanel/index.tsx","../src/tools/OpenapiViewer/components/shared/SendButton.tsx","../src/tools/OpenapiViewer/components/DocsLayout/SlideInPlayground.tsx","../src/tools/OpenapiViewer/components/DocsLayout/TryItSheet.tsx","../src/tools/OpenapiViewer/components/DocsLayout/index.tsx"],"names":["__name","sampleSchemaJson","joinUrl","useState","useMemo","dereferenceSchema","resolveBaseUrl","useEffect","consola","useCallback","useRef","usePlaygroundContext","jsx","cn","jsxs","React","ChevronRight","toMarkdown","toCompactJson","toRawJson","formatBytes","toast","DropdownMenu","DropdownMenuTrigger","Button","Sparkles","ChevronDown","DropdownMenuContent","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuItem","Check","relativePath","groupBy","orderBy","partition","sortBy","deduplicateEndpoints","EndpointRow","Tooltip","TooltipTrigger","TooltipContent","CategoryBlock","Search","Input","X","Combobox","MarkdownMessage","createContext","useContext","create","persist","createJSONStorage","CODE_SAMPLE_TARGETS","buildHarRequest","resolveAbsolute","renderSnippet","PrettyCode_default","SafeTooltipProvider","Link2","FileCode2","ChevronsDownUp","ChevronsUpDown","endpointToMarkdown","Play","CopyButton","JsonTree_default","DocsView","SchemaSectionView","MAX_DEPTH","Switch","Textarea","Minus","Plus","RotateCcw","isValidJson","findApiKeyById","parseRequestHeaders","Send","Fragment","Key","Terminal","Info","ShieldCheck","Loader2","WifiOff","UrlBuilder","AlertCircle","SidePanel","ResponsiveSheet","ResponsiveSheetContent","ResponsiveSheetHeader","ResponsiveSheetTitle","useMediaQuery","keyBy","Skeleton","TooltipProvider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAaA,IAAM,eAAe,CAAC,KAAA,EAAO,MAAA,EAAQ,KAAA,EAAO,SAAS,QAAQ,CAAA;AAY7D,IAAM,gBAAA,mBAAmBA,wBAAA,CAAA,CACvB,MAAA,EACA,OAAA,EACA,UACA,QAAA,KACkB;AAClB,EAAA,MAAM,YAA2B,EAAC;AAElC,EAAA,IAAI,CAAC,MAAA,CAAO,KAAA,EAAO,OAAO,EAAC;AAE3B,EAAA,KAAA,MAAW,CAAC,MAAM,OAAO,CAAA,IAAK,OAAO,OAAA,CAAQ,MAAA,CAAO,KAAK,CAAA,EAAG;AAC1D,IAAA,KAAA,MAAW,UAAU,YAAA,EAAc;AACjC,MAAA,MAAM,EAAA,GAAM,QAAgB,MAAM,CAAA;AAClC,MAAA,IAAI,CAAC,EAA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;AAAA,YACvB,UAAA,EAAY,cAAA;AAAA,YACZ,QAAA;AAAA,YACA,iBAAA;AAAA,YACA,SAAA;AAAA,YACA;AAAA;AAAA;AACJ;AAAA,KACJ;AAAA,IACC,QAAA,KAAa,6BACVA,cAAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACG,GAAA,EAAK,OAAA;AAAA,QACL,QAAA,EAAS,UAAA;AAAA,QACT,WAAA;AAAA,QACA,iBAAiB,KAAA,CAAM,eAAA;AAAA,QACvB,gBAAgB,KAAA,CAAM,gBAAA;AAAA,QACtB,aAAA,EAAe,SAAA;AAAA,QACf,cAAA,EAAgB;AAAA;AAAA,wBAGpBA,cAAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACG,GAAA,EAAK,OAAA;AAAA,QACL,IAAA,EAAM,UAAA;AAAA,QACN,SAAA;AAAA,QACA,eAAA;AAAA,QACA,SAAA;AAAA,QACA,iBAAiB,KAAA,CAAM,eAAA;AAAA,QACvB,gBAAgB,KAAA,CAAM,gBAAA;AAAA,QACtB,aAAA,EAAe,SAAA;AAAA,QACf,cAAA,EAAgB;AAAA;AAAA,KACpB;AAAA,oBAIJA,cAAAA,CAAC,iBAAA,EAAA,EAAkB,IAAA,EAAM,SAAA,EAAW,SAAS,gBAAA,EAAkB;AAAA,GAAA,EACnE,CAAA,EACJ,CAAA;AAER,CAAA,EA1QoC,YAAA","file":"DocsLayout-KUPDWJ3G.cjs","sourcesContent":["'use client';\n\nimport consola from 'consola';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { ApiEndpoint, LoadedSchemaEntry, OpenApiInfo, OpenApiSchema, SchemaSource, UseOpenApiSchemaReturn } from '../types';\nimport { sampleSchemaJson } from '../utils/sampler';\nimport { dereferenceSchema } from '../utils/schemaExport';\nimport { joinUrl, resolveBaseUrl } from '../utils/url';\n\ntype JsonSchemaNode = Record<string, unknown>;\n\n// HTTP methods to extract from OpenAPI schema\nconst HTTP_METHODS = ['get', 'post', 'put', 'patch', 'delete'] as const;\n\n// Extract endpoints from OpenAPI schema (all methods). ``baseUrl`` is\n// resolved by the caller via ``resolveBaseUrl`` — we just paste it onto\n// the front of each path here. ``schemaId`` is tagged onto every\n// endpoint so downstream consumers (sections-mode sidebar, anchors, URL\n// sync) can correlate endpoints back to their source schema.\n//\n// ``specRoot`` is the raw, un-dereferenced schema — passed to\n// ``openapi-sampler`` so it can resolve any ``$ref`` nodes our own\n// ``dereferenceSchema`` left behind (depth-limited, external, or\n// circular). Without it the sampler throws on deep ref chains.\nconst extractEndpoints = (\n schema: OpenApiSchema,\n baseUrl: string,\n schemaId?: string,\n specRoot?: OpenApiSchema,\n): ApiEndpoint[] => {\n const endpoints: ApiEndpoint[] = [];\n\n if (!schema.paths) return [];\n\n for (const [path, methods] of Object.entries(schema.paths)) {\n for (const method of HTTP_METHODS) {\n const op = (methods as any)[method];\n if (!op) continue;\n\n const methodUpper = method.toUpperCase();\n const summary = (op.summary || '').trim();\n const description = op.description || summary || `${methodUpper} ${path}`;\n const category = op.tags?.[0] || 'Other';\n\n const parameters: Array<{\n name: string;\n type: string;\n required: boolean;\n description?: string;\n }> = [];\n\n // Collect parameters (path-level + operation-level)\n const allParams = [...((methods as any).parameters || []), ...(op.parameters || [])];\n for (const param of allParams) {\n parameters.push({\n name: param.name,\n type: param.schema?.type || 'string',\n required: param.required || false,\n description: param.description,\n });\n }\n\n // Collect responses. We also extract the ``application/json``\n // schema (preferring it, falling back to whatever media type is\n // present) and generate a sampled example — the docs layout\n // renders it as a collapsible \"Example response\" block under the\n // status-code table. ``writeOnly`` fields are skipped so secrets\n // declared ``writeOnly: true`` don't leak into response samples.\n const responses: NonNullable<ApiEndpoint['responses']> = [];\n\n if (op.responses) {\n for (const [code, response] of Object.entries(op.responses)) {\n const respContent = (response as any).content as Record<string, any> | undefined;\n const contentKeys = respContent ? Object.keys(respContent) : [];\n const chosenContentType = respContent?.['application/json']\n ? 'application/json'\n : contentKeys[0];\n const chosen = chosenContentType ? respContent?.[chosenContentType] : undefined;\n const respSchema = chosen?.schema as JsonSchemaNode | undefined;\n\n responses.push({\n code,\n description: (response as any).description || `Response ${code}`,\n contentType: chosenContentType,\n schema: respSchema,\n example: respSchema\n ? sampleSchemaJson(respSchema, { skipWriteOnly: true }, specRoot)\n : undefined,\n });\n }\n }\n\n // Extract request body info — keep the dereferenced schema so\n // downstream UI can render a fields table and generate a starter\n // example instead of showing an opaque ``object`` / ``array`` tag.\n // ``readOnly`` fields are skipped: the body is what the client\n // *sends*, so server-owned fields (id, created_at, …) must not\n // pre-fill the editor.\n let requestBody: ApiEndpoint['requestBody'];\n if (op.requestBody) {\n const content = op.requestBody.content;\n const mediaType = content?.['application/json'] || content?.[Object.keys(content || {})[0]];\n const rawSchema = mediaType?.schema as JsonSchemaNode | undefined;\n requestBody = {\n type: (rawSchema?.type as string | undefined) || 'object',\n description: op.requestBody.description,\n schema: rawSchema,\n example: rawSchema\n ? sampleSchemaJson(rawSchema, { skipReadOnly: true }, specRoot)\n : undefined,\n };\n }\n\n const endpoint: ApiEndpoint = {\n name: path.split('/').pop() || path,\n method: methodUpper,\n path: baseUrl ? joinUrl(baseUrl, path) : path,\n summary,\n description,\n category,\n parameters: parameters.length > 0 ? parameters : undefined,\n requestBody,\n responses: responses.length > 0 ? responses : undefined,\n schemaId,\n };\n\n endpoints.push(endpoint);\n }\n }\n\n return endpoints;\n};\n\n// Get unique categories from endpoints\nconst getCategories = (endpoints: ApiEndpoint[]): string[] => {\n const categories = new Set<string>();\n endpoints.forEach((endpoint) => categories.add(endpoint.category));\n return Array.from(categories).sort();\n};\n\n// Fetch schema from URL\nconst fetchSchema = async (url: string): Promise<OpenApiSchema> => {\n const response = await fetch(url, {\n headers: {\n 'Accept': 'application/json',\n },\n });\n if (!response.ok) {\n throw new Error(`Failed to fetch schema: ${response.statusText}`);\n }\n return response.json();\n};\n\ninterface UseOpenApiSchemaProps {\n schemas: SchemaSource[];\n defaultSchemaId?: string;\n /** Global base URL override from ``PlaygroundConfig.baseUrl``.\n * Per-schema ``SchemaSource.baseUrl`` takes precedence over this. */\n baseUrl?: string;\n /** When ``true`` the hook fetches every schema in ``schemas`` (not just\n * the active one) and exposes them via ``schemasData``. Used by the\n * ``sections`` grouping mode — the docs column concatenates endpoints\n * from every schema, so they all need to be on the client. Default\n * is ``false`` to preserve the original lazy behaviour. */\n preloadAll?: boolean;\n}\n\ninterface SchemaLoadState {\n loading: boolean;\n error: string | null;\n}\n\nexport default function useOpenApiSchema({\n schemas,\n defaultSchemaId,\n baseUrl: configBaseUrl,\n preloadAll = false,\n}: UseOpenApiSchemaProps): UseOpenApiSchemaReturn {\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<string | null>(null);\n const [currentSchemaId, setCurrentSchemaId] = useState<string>(\n defaultSchemaId || schemas[0]?.id\n );\n const [loadedSchemas, setLoadedSchemas] = useState<Map<string, OpenApiSchema>>(\n new Map()\n );\n // Per-schema loading/error state for ``preloadAll`` — each schema may\n // succeed or fail independently, and the UI wants to render partial\n // results while slow/broken ones are still resolving.\n const [loadStates, setLoadStates] = useState<Map<string, SchemaLoadState>>(new Map());\n\n const currentSchema = useMemo(\n () => schemas.find((s) => s.id === currentSchemaId) || null,\n [schemas, currentSchemaId]\n );\n\n const currentOpenApiSchema = useMemo(\n () => (currentSchemaId ? loadedSchemas.get(currentSchemaId) : null),\n [loadedSchemas, currentSchemaId]\n );\n\n // Dereference once per schema load so endpoint extraction sees fully\n // resolved ``$ref`` graphs. The raw schema is still exposed via\n // ``rawSchema`` for Copy-for-AI (juniors may want to hand the raw\n // document to an LLM and have it resolve refs itself).\n const dereferencedSchema = useMemo(\n () => (currentOpenApiSchema ? dereferenceSchema(currentOpenApiSchema) : null),\n [currentOpenApiSchema],\n );\n\n // Resolve base URL with priority chain. Centralised in ``resolveBaseUrl``\n // so the same logic is reused by the schema-export utilities.\n const resolvedBaseUrl = useMemo(\n () =>\n resolveBaseUrl({\n schemaSource: currentSchema?.baseUrl,\n config: configBaseUrl,\n fromServers: currentOpenApiSchema?.servers?.[0]?.url,\n }),\n [currentSchema?.baseUrl, configBaseUrl, currentOpenApiSchema],\n );\n\n const endpoints = useMemo(\n () =>\n dereferencedSchema\n ? extractEndpoints(dereferencedSchema, resolvedBaseUrl, currentSchemaId, currentOpenApiSchema ?? undefined)\n : [],\n [dereferencedSchema, resolvedBaseUrl, currentSchemaId, currentOpenApiSchema]\n );\n\n const categories = useMemo(() => getCategories(endpoints), [endpoints]);\n\n const schemaInfo = useMemo<OpenApiInfo | null>(() => {\n if (!currentOpenApiSchema?.info) return null;\n const { title, version, description } = currentOpenApiSchema.info;\n return {\n title,\n version,\n description,\n servers: currentOpenApiSchema.servers,\n };\n }, [currentOpenApiSchema]);\n\n // Load schema when current schema changes (single-schema mode)\n useEffect(() => {\n if (preloadAll) return;\n if (!currentSchema) return;\n\n // Skip if already loaded\n if (loadedSchemas.has(currentSchema.id)) {\n setLoading(false);\n return;\n }\n\n setLoading(true);\n setError(null);\n\n fetchSchema(currentSchema.url)\n .then((schema) => {\n setLoadedSchemas((prev) => new Map(prev).set(currentSchema.id, schema));\n consola.success(`Schema loaded: ${currentSchema.name}`);\n setLoading(false);\n })\n .catch((err) => {\n consola.error(`Error loading schema from ${currentSchema.url}:`, err);\n setError(err instanceof Error ? err.message : 'Failed to load schema');\n setLoading(false);\n });\n }, [currentSchema, loadedSchemas, preloadAll]);\n\n // Preload every schema (sections-grouping mode). Each schema is fetched\n // independently — a slow or broken source doesn't block the rest.\n useEffect(() => {\n if (!preloadAll) return;\n if (schemas.length === 0) {\n setLoading(false);\n return;\n }\n\n let cancelled = false;\n const pending = schemas.filter((s) => !loadedSchemas.has(s.id));\n if (pending.length === 0) {\n setLoading(false);\n return;\n }\n\n setLoading(true);\n setLoadStates((prev) => {\n const next = new Map(prev);\n for (const s of pending) next.set(s.id, { loading: true, error: null });\n return next;\n });\n\n Promise.allSettled(\n pending.map((s) =>\n fetchSchema(s.url).then((schema) => ({ id: s.id, name: s.name, schema })),\n ),\n ).then((results) => {\n if (cancelled) return;\n\n setLoadedSchemas((prev) => {\n const next = new Map(prev);\n for (const r of results) {\n if (r.status === 'fulfilled') {\n next.set(r.value.id, r.value.schema);\n consola.success(`Schema loaded: ${r.value.name}`);\n }\n }\n return next;\n });\n\n setLoadStates((prev) => {\n const next = new Map(prev);\n results.forEach((r, i) => {\n const src = pending[i]!;\n if (r.status === 'fulfilled') {\n next.set(src.id, { loading: false, error: null });\n } else {\n const msg = r.reason instanceof Error ? r.reason.message : 'Failed to load schema';\n consola.error(`Error loading schema from ${src.url}:`, r.reason);\n next.set(src.id, { loading: false, error: msg });\n }\n });\n return next;\n });\n\n setLoading(false);\n });\n\n return () => {\n cancelled = true;\n };\n }, [preloadAll, schemas, loadedSchemas]);\n\n const schemasData = useMemo<LoadedSchemaEntry[]>(() => {\n if (!preloadAll) return [];\n return schemas.map((src) => {\n const raw = loadedSchemas.get(src.id) ?? null;\n const deref = raw ? dereferenceSchema(raw) : null;\n const resolved = resolveBaseUrl({\n schemaSource: src.baseUrl,\n config: configBaseUrl,\n fromServers: raw?.servers?.[0]?.url,\n });\n const info: OpenApiInfo | null = raw?.info\n ? {\n title: raw.info.title,\n version: raw.info.version,\n description: raw.info.description,\n servers: raw.servers,\n }\n : null;\n const eps = deref ? extractEndpoints(deref, resolved, src.id, raw ?? undefined) : [];\n const state = loadStates.get(src.id) ?? { loading: !raw, error: null };\n return {\n source: src,\n info,\n rawSchema: raw,\n endpoints: eps,\n resolvedBaseUrl: resolved || undefined,\n loading: state.loading,\n error: state.error,\n };\n });\n }, [preloadAll, schemas, loadedSchemas, loadStates, configBaseUrl]);\n\n const setCurrentSchema = useCallback((schemaId: string) => {\n setCurrentSchemaId(schemaId);\n }, []);\n\n const refresh = useCallback(() => {\n if (!currentSchema) return;\n\n setLoading(true);\n setError(null);\n\n // Remove from cache to force reload\n setLoadedSchemas((prev) => {\n const next = new Map(prev);\n next.delete(currentSchema.id);\n return next;\n });\n\n fetchSchema(currentSchema.url)\n .then((schema) => {\n setLoadedSchemas((prev) => new Map(prev).set(currentSchema.id, schema));\n consola.success(`Schema refreshed: ${currentSchema.name}`);\n setLoading(false);\n })\n .catch((err) => {\n consola.error(`Error refreshing schema from ${currentSchema.url}:`, err);\n setError(err instanceof Error ? err.message : 'Failed to refresh schema');\n setLoading(false);\n });\n }, [currentSchema]);\n\n return {\n loading,\n error,\n endpoints,\n categories,\n schemas,\n currentSchema,\n schemaInfo,\n rawSchema: currentOpenApiSchema ?? null,\n // Consumers expect ``undefined`` when no base URL was resolved (for\n // conditional ``{ baseUrl?: … }`` plumbing). Turn the empty-string\n // convention from the resolver into undefined at the API boundary.\n resolvedBaseUrl: resolvedBaseUrl || undefined,\n setCurrentSchema,\n refresh,\n schemasData,\n };\n}\n","'use client';\n\nimport { useCallback, useEffect, useRef } from 'react';\n\n/** Hash format: ``#<schemaId>/<anchor>``.\n * - ``#catalog/ep-get-users`` — specific endpoint in ``catalog`` schema\n * - ``#catalog`` — open ``catalog`` schema at its top\n * - empty — no initial target, leave viewer at its default\n *\n * We intentionally keep this opinionated and stringly-typed: the host app\n * already controls which schemas exist, so there is no room for ambiguity\n * beyond the two segments. */\nexport interface ParsedHash {\n schemaId: string | null;\n anchor: string | null;\n}\n\nexport function parseDocsHash(hash: string): ParsedHash {\n const raw = hash.startsWith('#') ? hash.slice(1) : hash;\n if (!raw) return { schemaId: null, anchor: null };\n const [schemaId = null, ...rest] = raw.split('/');\n const anchor = rest.length > 0 ? rest.join('/') : null;\n return {\n schemaId: schemaId || null,\n anchor: anchor || null,\n };\n}\n\nexport function buildDocsHash(schemaId: string | null, anchor: string | null): string {\n if (!schemaId && !anchor) return '';\n if (schemaId && anchor) return `#${schemaId}/${anchor}`;\n if (schemaId) return `#${schemaId}`;\n return anchor ? `#${anchor}` : '';\n}\n\ninterface UseDocsUrlSyncProps {\n enabled: boolean;\n currentSchemaId: string | null;\n activeAnchor: string | null;\n /** Called on mount / ``popstate`` / ``hashchange`` with the hash state.\n * The consumer is responsible for dispatching into its own handlers\n * (switching schema, scrolling to endpoint) in the right order. */\n onHashTarget: (target: ParsedHash) => void;\n}\n\n/** Two-way sync between browser hash and docs viewer state.\n *\n * - Writes use ``history.replaceState`` so scrollspy-driven updates don't\n * pollute the back/forward stack. User-initiated navigation (click on\n * sidebar row, schema switch) still lands in history because the click\n * itself already did ``pushState`` — or will, via plain anchor hrefs.\n * - Reads happen on mount (initial target) and on ``popstate`` /\n * ``hashchange`` (Back/Forward / external anchor clicks).\n * - When ``enabled`` is false, the hook is a no-op — the viewer stays\n * hash-free so you can embed it inside a larger page. */\nexport function useDocsUrlSync({\n enabled,\n currentSchemaId,\n activeAnchor,\n onHashTarget,\n}: UseDocsUrlSyncProps) {\n // Ignore the very first write — otherwise on mount we'd clobber the\n // incoming hash with the viewer's empty defaults before ``onHashTarget``\n // has a chance to apply it.\n const primedRef = useRef(false);\n const onHashTargetRef = useRef(onHashTarget);\n useEffect(() => {\n onHashTargetRef.current = onHashTarget;\n }, [onHashTarget]);\n\n // Read: mount + hashchange/popstate\n useEffect(() => {\n if (!enabled || typeof window === 'undefined') return;\n\n const apply = () => {\n onHashTargetRef.current(parseDocsHash(window.location.hash));\n };\n apply();\n primedRef.current = true;\n\n window.addEventListener('hashchange', apply);\n window.addEventListener('popstate', apply);\n return () => {\n window.removeEventListener('hashchange', apply);\n window.removeEventListener('popstate', apply);\n };\n }, [enabled]);\n\n // Write: whenever the viewer's state changes\n useEffect(() => {\n if (!enabled || typeof window === 'undefined') return;\n if (!primedRef.current) return;\n\n const next = buildDocsHash(currentSchemaId, activeAnchor);\n const current = window.location.hash;\n if (next === current) return;\n\n // replaceState keeps Back/Forward meaningful — a single scroll-through\n // the page shouldn't create 50 history entries.\n const url = next\n ? `${window.location.pathname}${window.location.search}${next}`\n : `${window.location.pathname}${window.location.search}`;\n window.history.replaceState(window.history.state, '', url);\n }, [enabled, currentSchemaId, activeAnchor]);\n\n const pushTarget = useCallback(\n (schemaId: string | null, anchor: string | null) => {\n if (!enabled || typeof window === 'undefined') return;\n const next = buildDocsHash(schemaId, anchor);\n const url = next\n ? `${window.location.pathname}${window.location.search}${next}`\n : `${window.location.pathname}${window.location.search}`;\n window.history.pushState(window.history.state, '', url);\n },\n [enabled],\n );\n\n return { pushTarget };\n}\n","'use client';\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nimport type { ApiEndpoint } from '../types';\n\n/**\n * Per-endpoint draft kept in localStorage so user input survives across\n * reloads and across switching back-and-forth between endpoints.\n *\n * Scoped by ``schemaId`` + ``method`` + ``path`` — two endpoints on the\n * same path with different methods don't share drafts. Two different\n * APIs don't collide either.\n *\n * Storage shape:\n * { parameters: { [name]: string }, requestBody: string }\n *\n * Implementation note: we deliberately DO NOT build on top of\n * ``useLocalStorage`` here. That hook's ``setValue`` callback reference\n * changes whenever its internal state changes, and when EndpointDraftSync\n * mirrors context → draft, the chain\n * state change ⇒ persist call ⇒ hook state change ⇒ new callback ⇒\n * effect rerun ⇒ persist call …\n * blew up into a maximum-update-depth loop. Writing straight to\n * ``localStorage`` with a stable ref-based writer breaks the cycle.\n */\nexport interface EndpointDraft {\n parameters: Record<string, string>;\n requestBody: string;\n}\n\nconst EMPTY_DRAFT: EndpointDraft = { parameters: {}, requestBody: '' };\n\nfunction storageKey(schemaId: string | null, ep: ApiEndpoint | null): string | null {\n if (!schemaId || !ep) return null;\n return `openapi-playground:draft:${schemaId}:${ep.method}:${ep.path}`;\n}\n\nfunction readDraft(key: string | null): EndpointDraft {\n if (!key || typeof window === 'undefined') return EMPTY_DRAFT;\n try {\n const raw = window.localStorage.getItem(key);\n if (!raw) return EMPTY_DRAFT;\n const parsed = JSON.parse(raw) as Partial<EndpointDraft>;\n return {\n parameters: parsed?.parameters ?? {},\n requestBody: typeof parsed?.requestBody === 'string' ? parsed.requestBody : '',\n };\n } catch {\n return EMPTY_DRAFT;\n }\n}\n\nfunction writeDraft(key: string | null, value: EndpointDraft): void {\n if (!key || typeof window === 'undefined') return;\n try {\n // Skip writes for empty drafts — reduces storage noise and keeps\n // \"never edited\" endpoints out of storage entirely.\n if (Object.keys(value.parameters).length === 0 && !value.requestBody) {\n window.localStorage.removeItem(key);\n return;\n }\n window.localStorage.setItem(key, JSON.stringify(value));\n } catch {\n // Quota / private mode — silently drop; UI state still works.\n }\n}\n\nexport interface UseEndpointDraftResult {\n /** Draft snapshot loaded on mount / endpoint change. Does not update\n * as the user types — the caller owns the \"live\" state (context). */\n draft: EndpointDraft;\n /** Persist the current parameters. Safe to call on every change;\n * writes skip when the endpoint has no key yet. */\n setParameters: (params: Record<string, string>) => void;\n setRequestBody: (body: string) => void;\n /** Wipe the persisted draft for the current endpoint. */\n reset: () => void;\n}\n\nexport function useEndpointDraft(\n schemaId: string | null,\n endpoint: ApiEndpoint | null,\n): UseEndpointDraftResult {\n const key = storageKey(schemaId, endpoint);\n\n // ``draft`` is reloaded from storage only when the key changes —\n // not when we write. Writes don't need to come back to us because\n // the caller keeps the live state and re-reads on key change.\n const [draft, setDraftSnapshot] = useState<EndpointDraft>(() => readDraft(key));\n\n // Track the last loaded key so we reload exactly once per endpoint.\n const loadedKeyRef = useRef<string | null>(key);\n useEffect(() => {\n if (loadedKeyRef.current === key) return;\n loadedKeyRef.current = key;\n setDraftSnapshot(readDraft(key));\n }, [key]);\n\n // Keep a ref of the current key so the writers below stay stable\n // across renders — React callback identity was the root cause of\n // the infinite render loop we had before.\n const keyRef = useRef(key);\n useEffect(() => {\n keyRef.current = key;\n }, [key]);\n\n // Same for the latest full draft value — both writers need to merge\n // their field into the last known shape before writing.\n const latestRef = useRef<EndpointDraft>(draft);\n useEffect(() => {\n latestRef.current = draft;\n }, [draft]);\n\n const setParameters = useCallback((params: Record<string, string>) => {\n const next: EndpointDraft = {\n parameters: params,\n requestBody: latestRef.current.requestBody,\n };\n latestRef.current = next;\n writeDraft(keyRef.current, next);\n }, []);\n\n const setRequestBody = useCallback((body: string) => {\n const next: EndpointDraft = {\n parameters: latestRef.current.parameters,\n requestBody: body,\n };\n latestRef.current = next;\n writeDraft(keyRef.current, next);\n }, []);\n\n const reset = useCallback(() => {\n latestRef.current = EMPTY_DRAFT;\n if (keyRef.current && typeof window !== 'undefined') {\n try { window.localStorage.removeItem(keyRef.current); } catch { /* noop */ }\n }\n setDraftSnapshot(EMPTY_DRAFT);\n }, []);\n\n return { draft, setParameters, setRequestBody, reset };\n}\n","'use client';\n\nimport React, { useEffect, useRef } from 'react';\n\nimport { usePlaygroundContext } from '../../context/PlaygroundContext';\nimport { useEndpointDraft } from '../../hooks/useEndpointDraft';\n\ninterface EndpointDraftSyncProps {\n /** Active schema id (so drafts don't bleed between different APIs).\n * When null — drafts are disabled (hook returns empty draft, writes\n * are no-ops). Pass the current schema's ``id`` from useOpenApiSchema. */\n schemaId: string | null;\n}\n\n/**\n * Headless component: keeps ``RequestPanel`` state mirrored with a\n * per-endpoint draft in localStorage.\n *\n * Flow:\n * 1. On endpoint change ⇒ read draft ⇒ push into context state.\n * 2. On context state change (user edits params/body) ⇒ write draft.\n *\n * Step 1 is gated by a ref so \"just-loaded\" drafts don't immediately\n * trigger step 2. Step 2 additionally compares against a serialised\n * snapshot of the last persisted value so a re-render without a real\n * value change doesn't touch storage.\n *\n * Had an infinite-render-loop bug here earlier: the persist callbacks\n * were driven by ``useLocalStorage`` whose setter identity changed on\n * every internal state update, so depending on them from an effect\n * created a cycle. Fixed by making ``useEndpointDraft``'s writers\n * stable (ref-based), and by gating writes with value comparison below.\n */\nexport function EndpointDraftSync({ schemaId }: EndpointDraftSyncProps) {\n const { state, setParameters, setRequestBody, setActiveSchemaId } = usePlaygroundContext();\n const ep = state.selectedEndpoint;\n\n // Mirror schemaId into context so other components (e.g. the Reset\n // button in RequestPanel) can read it without receiving props from\n // a parent they don't own.\n useEffect(() => {\n setActiveSchemaId(schemaId);\n }, [schemaId, setActiveSchemaId]);\n\n const { draft, setParameters: persistParams, setRequestBody: persistBody } =\n useEndpointDraft(schemaId, ep);\n\n const lastLoadedKeyRef = useRef<string | null>(null);\n const lastPersistedParamsRef = useRef<string>('');\n const lastPersistedBodyRef = useRef<string>('');\n const currentKey = ep ? `${ep.method}|${ep.path}` : null;\n\n // Step 1 — hydrate context from draft on endpoint switch.\n //\n // IMPORTANT: only apply fields that actually exist in the saved draft.\n // SELECT_ENDPOINT in the reducer pre-fills ``requestBody`` with an\n // auto-generated schema example, and ``parameters`` with ``{}``.\n // If we blindly overwrite those with an empty draft we wipe the\n // example before the user ever sees it. Tracked via a bug: opening\n // POST /pet showed ``{\"key\":\"value\"}`` instead of the Pet example.\n useEffect(() => {\n if (!ep || !currentKey) {\n lastLoadedKeyRef.current = null;\n return;\n }\n if (lastLoadedKeyRef.current === currentKey) return;\n lastLoadedKeyRef.current = currentKey;\n\n const hasStoredParams =\n draft.parameters && Object.keys(draft.parameters).length > 0;\n const hasStoredBody = typeof draft.requestBody === 'string' && draft.requestBody !== '';\n\n if (hasStoredParams) {\n setParameters(draft.parameters);\n lastPersistedParamsRef.current = JSON.stringify(draft.parameters);\n } else {\n // Keep whatever the reducer put there; mirror it into the\n // \"last persisted\" ref so step-2 treats it as a baseline.\n lastPersistedParamsRef.current = JSON.stringify(state.parameters);\n }\n\n if (hasStoredBody) {\n setRequestBody(draft.requestBody);\n lastPersistedBodyRef.current = draft.requestBody;\n } else {\n lastPersistedBodyRef.current = state.requestBody;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [currentKey]);\n\n // Step 2 — persist user edits.\n useEffect(() => {\n if (!ep || lastLoadedKeyRef.current !== currentKey) return;\n const serialised = JSON.stringify(state.parameters);\n if (serialised === lastPersistedParamsRef.current) return;\n lastPersistedParamsRef.current = serialised;\n persistParams(state.parameters);\n }, [state.parameters, ep, currentKey, persistParams]);\n\n useEffect(() => {\n if (!ep || lastLoadedKeyRef.current !== currentKey) return;\n if (state.requestBody === lastPersistedBodyRef.current) return;\n lastPersistedBodyRef.current = state.requestBody;\n persistBody(state.requestBody);\n }, [state.requestBody, ep, currentKey, persistBody]);\n\n return null;\n}\n","import type { ApiEndpoint } from '../../types';\n\n/** DOM-safe anchor for a single endpoint.\n *\n * Two forms:\n * - Scoped (``schemaId`` provided) — ``ep-<schema>-<method>-<slug>``.\n * Used in ``sections`` mode where endpoints from different schemas\n * coexist on one page and would otherwise collide.\n * - Flat — ``ep-<method>-<slug>``. Used in ``selector`` mode where\n * only one schema is mounted at a time. */\nexport function endpointAnchor(\n ep: Pick<ApiEndpoint, 'method' | 'path'>,\n schemaId?: string | null,\n): string {\n const slug = ep.path\n .replace(/^https?:\\/\\/[^/]+/, '')\n .replace(/[{}]/g, '')\n .replace(/[^a-zA-Z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .toLowerCase();\n const schemaSlug = schemaId ? `${slugifySchemaId(schemaId)}-` : '';\n return `ep-${schemaSlug}${ep.method.toLowerCase()}-${slug}`;\n}\n\n/** Canonical slug for a schema id — safe for anchors and hash fragments. */\nexport function slugifySchemaId(id: string): string {\n return id.replace(/[^a-zA-Z0-9_-]+/g, '-').replace(/^-+|-+$/g, '');\n}\n","'use client';\n\n/**\n * Shared primitive UI components used by the playground panels\n * (Request, Response) in both the slide-in and mobile-sheet surfaces.\n * Keep this file free of any business logic or context reads.\n */\n\nimport { ChevronRight } from 'lucide-react';\nimport React from 'react';\n\nimport { cn } from '@djangocfg/ui-core/lib';\n\n// ─── Style helpers ────────────────────────────────────────────────────────────\n\nconst METHOD_STYLES: Record<string, string> = {\n GET: 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/25',\n POST: 'bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/25',\n PUT: 'bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/25',\n PATCH: 'bg-orange-500/10 text-orange-600 dark:text-orange-400 border-orange-500/25',\n DELETE: 'bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/25',\n} as const;\n\nconst METHOD_FALLBACK = 'bg-muted text-muted-foreground border-border';\n\nexport function getMethodStyle(method: string): string {\n return METHOD_STYLES[method.toUpperCase()] ?? METHOD_FALLBACK;\n}\n\nexport function getStatusStyle(status: number): string {\n if (status >= 500) return 'bg-red-500/10 text-red-500 dark:text-red-400 border-red-500/25';\n if (status >= 400) return 'bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/25';\n if (status >= 300) return 'bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/25';\n return 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/25';\n}\n\n// ``relativePath`` lives in utils/url.ts now — re-exported here so every\n// component that used to import it from ``./ui`` keeps working.\nexport { relativePath } from '../../utils/url';\n\n// ─── Atoms ────────────────────────────────────────────────────────────────────\n\nexport function MethodBadge({ method }: { method: string }) {\n return (\n <span className={cn(\n 'inline-flex shrink-0 items-center rounded border px-1.5 py-px',\n 'font-mono text-[10px] font-bold uppercase tracking-wider leading-none',\n getMethodStyle(method),\n )}>\n {method}\n </span>\n );\n}\n\nexport function StatusBadge({ status }: { status: number }) {\n return (\n <span className={cn(\n 'inline-flex items-center rounded border px-1.5 py-px',\n 'font-mono text-[11px] font-bold leading-none',\n getStatusStyle(status),\n )}>\n {status}\n </span>\n );\n}\n\nexport function SectionLabel({ children }: { children: React.ReactNode }) {\n return (\n <p className=\"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60 select-none\">\n {children}\n </p>\n );\n}\n\nexport function Panel({ children, className }: { children: React.ReactNode; className?: string }) {\n return (\n <div className={cn('flex flex-col min-h-0 overflow-hidden', className)}>\n {children}\n </div>\n );\n}\n\nexport function ScrollArea({ children, className }: { children: React.ReactNode; className?: string }) {\n return (\n <div className={cn('flex-1 overflow-y-auto min-h-0', className)}>\n {children}\n </div>\n );\n}\n\nexport function PanelHeader({ title }: { title: string }) {\n return (\n <div className=\"shrink-0 border-b px-4 h-10 flex items-center\">\n <span className=\"text-[11px] font-semibold uppercase tracking-widest text-muted-foreground/50\">\n {title}\n </span>\n </div>\n );\n}\n\nexport function EmptyState({\n icon: Icon,\n text,\n className,\n}: {\n icon: React.ElementType;\n text: string;\n className?: string;\n}) {\n return (\n <div\n className={cn(\n 'flex flex-col items-center justify-center h-full gap-3 px-6 text-center',\n className,\n )}\n >\n <Icon className=\"h-7 w-7 text-muted-foreground/25\" />\n <p className=\"text-xs text-muted-foreground\">{text}</p>\n </div>\n );\n}\n\nexport function CollapsibleSection({\n label,\n action,\n children,\n defaultOpen = false,\n}: {\n label: React.ReactNode;\n action?: React.ReactNode;\n children: React.ReactNode;\n defaultOpen?: boolean;\n}) {\n const [open, setOpen] = React.useState(defaultOpen);\n return (\n <div className=\"space-y-0\">\n <div className=\"flex items-center justify-between\">\n <button\n type=\"button\"\n onClick={() => setOpen((v) => !v)}\n className=\"flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60 hover:text-muted-foreground transition-colors py-1\"\n >\n <ChevronRight className={cn('h-3 w-3 transition-transform', open && 'rotate-90')} />\n {label}\n </button>\n {action && <div className=\"shrink-0\">{action}</div>}\n </div>\n {open && <div>{children}</div>}\n </div>\n );\n}\n","'use client';\n\nimport { Check, ChevronDown, Sparkles } from 'lucide-react';\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport {\n Button,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@djangocfg/ui-core/components';\nimport { toast } from '@djangocfg/ui-core/hooks';\n\nimport type { ApiEndpoint, OpenApiSchema } from '../../types';\nimport {\n formatBytes,\n toCompactJson,\n toMarkdown,\n toRawJson,\n} from '../../utils/schemaExport';\n\ntype Flavour = 'markdown' | 'compact' | 'raw';\n\nconst FLAVOUR_LABELS: Record<Flavour, { title: string; hint: string }> = {\n markdown: {\n title: 'Markdown for LLM',\n hint: 'Endpoints + params as prose. Smallest.',\n },\n compact: {\n title: 'Compact JSON',\n hint: 'Dereferenced, no examples, minified.',\n },\n raw: {\n title: 'Raw JSON',\n hint: 'Full OpenAPI document with $refs.',\n },\n};\n\ninterface SchemaCopyMenuProps {\n schema: OpenApiSchema | null;\n endpoints: ApiEndpoint[];\n /** Resolved base URL that gets embedded into the copy so the AI\n * receives working URLs, not the ones originally in ``schema.servers``. */\n baseUrl?: string;\n /** Trigger appearance.\n * - ``button`` (default) — labelled pill with icon + chevron.\n * - ``icon`` — square ghost button, used in tight spots like the\n * sidebar header where there is no room for \"Copy for AI\". */\n variant?: 'button' | 'icon';\n}\n\n/**\n * Per-schema copy dropdown. Shows three flavours tuned for different LLM\n * use-cases. We compute each flavour lazily (only on click) because\n * dereferencing + stringifying a large schema can be non-trivial — sizes\n * are displayed after the first successful copy, via a tiny cache.\n */\nexport function SchemaCopyMenu({ schema, endpoints, baseUrl, variant = 'button' }: SchemaCopyMenuProps) {\n const [sizeCache, setSizeCache] = useState<Partial<Record<Flavour, string>>>({});\n const [justCopied, setJustCopied] = useState<Flavour | null>(null);\n const [open, setOpen] = useState(false);\n\n const isReady = schema !== null && endpoints.length > 0;\n\n const build = useCallback(\n (flavour: Flavour): string => {\n if (!schema) return '';\n if (flavour === 'markdown') return toMarkdown(schema, endpoints, baseUrl);\n if (flavour === 'compact') return toCompactJson(schema, baseUrl);\n return toRawJson(schema, baseUrl);\n },\n [schema, endpoints, baseUrl],\n );\n\n const handleCopy = useCallback(\n async (flavour: Flavour) => {\n if (!isReady) return;\n const text = build(flavour);\n const label = FLAVOUR_LABELS[flavour].title;\n try {\n await navigator.clipboard.writeText(text);\n const size = formatBytes(text);\n setSizeCache((prev) => ({ ...prev, [flavour]: size }));\n setJustCopied(flavour);\n setTimeout(() => setJustCopied(null), 1500);\n setOpen(false);\n toast.success(`Copied ${label}`, { description: size });\n } catch (err) {\n const message = err instanceof Error ? err.message : 'Clipboard permission denied';\n toast.error('Copy failed', { description: message });\n }\n },\n [build, isReady],\n );\n\n const flavours = useMemo<Flavour[]>(() => ['markdown', 'compact', 'raw'], []);\n\n return (\n <DropdownMenu open={open} onOpenChange={setOpen}>\n <DropdownMenuTrigger asChild>\n {variant === 'icon' ? (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-7 w-7 shrink-0\"\n disabled={!isReady}\n title=\"Copy schema for AI\"\n aria-label=\"Copy schema for AI\"\n >\n <Sparkles className=\"h-3.5 w-3.5\" />\n </Button>\n ) : (\n <Button variant=\"outline\" size=\"sm\" className=\"h-8 gap-1.5 text-xs\" disabled={!isReady}>\n <Sparkles className=\"h-3 w-3\" />\n Copy for AI\n <ChevronDown className=\"h-3 w-3 opacity-60\" />\n </Button>\n )}\n </DropdownMenuTrigger>\n <DropdownMenuContent\n side=\"right\"\n align=\"start\"\n sideOffset={6}\n collisionPadding={8}\n className=\"w-60 max-w-[calc(100vw-16px)]\"\n >\n <DropdownMenuLabel className=\"text-[10px] uppercase tracking-wider text-muted-foreground/70\">\n Copy schema\n </DropdownMenuLabel>\n <DropdownMenuSeparator />\n {flavours.map((f) => {\n const label = FLAVOUR_LABELS[f];\n const size = sizeCache[f];\n const isDone = justCopied === f;\n return (\n <DropdownMenuItem\n key={f}\n onClick={(e) => {\n e.preventDefault();\n void handleCopy(f);\n }}\n className=\"flex flex-col items-start gap-0.5 py-2 cursor-pointer\"\n >\n <div className=\"flex w-full items-center gap-2\">\n <span className=\"text-xs font-medium flex-1\">{label.title}</span>\n {isDone ? (\n <span className=\"inline-flex items-center gap-1 text-[10px] text-emerald-500\">\n <Check className=\"h-3 w-3\" /> Copied\n </span>\n ) : size ? (\n <span className=\"text-[10px] font-mono text-muted-foreground/70 tabular-nums\">\n {size}\n </span>\n ) : null}\n </div>\n <span className=\"text-[10px] text-muted-foreground/70 leading-snug line-clamp-1\">\n {label.hint}\n </span>\n </DropdownMenuItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n","'use client';\n\nimport type { ApiEndpoint, OpenApiInfo, OpenApiSchema } from '../../../types';\nimport { SchemaCopyMenu } from '../SchemaCopyMenu';\n\ninterface BrandHeaderProps {\n info: OpenApiInfo | null;\n /** Used only by ``SchemaCopyMenu`` — displayed label comes from ``info``. */\n endpoints: ApiEndpoint[];\n rawSchema?: OpenApiSchema | null;\n resolvedBaseUrl?: string;\n}\n\n/** Topmost row of the sidebar: API title on the left, tiny version\n * tag below it, and the Copy-for-AI menu on the right. The version\n * used to sit inline with the title and fought it for space on narrow\n * panels — stacking them vertically keeps the title at a readable\n * size and the version as quiet metadata. */\nexport function BrandHeader({ info, endpoints, rawSchema, resolvedBaseUrl }: BrandHeaderProps) {\n const apiTitle = info?.title ?? 'API Reference';\n const copyReady = rawSchema !== null && rawSchema !== undefined && endpoints.length > 0;\n\n return (\n <div className=\"shrink-0 border-b px-3 py-2.5 flex items-start gap-2\">\n <div className=\"flex-1 min-w-0\">\n <div\n className=\"text-[13px] font-semibold text-foreground leading-tight truncate\"\n title={apiTitle}\n >\n {apiTitle}\n </div>\n {info?.version && (\n <div className=\"font-mono text-[10px] text-muted-foreground/60 leading-tight mt-0.5\">\n v{info.version}\n </div>\n )}\n </div>\n {copyReady && (\n <SchemaCopyMenu\n schema={rawSchema ?? null}\n endpoints={endpoints}\n baseUrl={resolvedBaseUrl}\n variant=\"icon\"\n />\n )}\n </div>\n );\n}\n","import type { ApiEndpoint } from '../../types';\n\n/**\n * Given a list of full endpoint paths, return the longest ``/``-aligned\n * prefix they all share. Used to strip the redundant group prefix\n * (``/api/v3/pet``) from sidebar labels so the meaningful tail is visible.\n *\n * Works on full URLs too — if every path begins with the same origin,\n * the origin is part of the common prefix and gets stripped.\n */\nexport function longestCommonPrefix(paths: string[]): string {\n if (paths.length === 0) return '';\n if (paths.length === 1) return '';\n\n const segments = paths.map((p) => p.split('/'));\n const minLen = Math.min(...segments.map((s) => s.length));\n\n const shared: string[] = [];\n for (let i = 0; i < minLen; i++) {\n const first = segments[0]![i];\n if (segments.every((s) => s[i] === first)) {\n shared.push(first!);\n } else {\n break;\n }\n }\n // Don't strip everything — we always want at least a leading \"/\" or\n // the method on the visible side. If the group has one endpoint,\n // the caller guards with paths.length check already.\n const joined = shared.join('/');\n // Trim trailing slash so the tail is clean (``/foo`` not ``foo``).\n return joined;\n}\n\n/**\n * Compute the label to show in the sidebar for a given endpoint.\n *\n * Priority:\n * 1. ``ep.summary`` — human-readable, from OpenAPI ``operation.summary``.\n * 2. The tail of ``ep.path`` after stripping the group's common prefix.\n * 3. Full ``ep.path`` if the group has a single endpoint (no prefix to strip).\n */\nexport function sidebarLabel(ep: ApiEndpoint, groupCommonPrefix: string): string {\n if (ep.summary) return ep.summary;\n\n if (groupCommonPrefix && ep.path.startsWith(groupCommonPrefix)) {\n const tail = ep.path.slice(groupCommonPrefix.length) || '/';\n return tail;\n }\n return relativePath(ep.path);\n}\n\nfunction relativePath(full: string): string {\n try { return new URL(full).pathname; } catch { return full; }\n}\n\n/** Tooltip text: always the definitive ``METHOD relative/path``. */\nexport function sidebarTooltip(ep: ApiEndpoint): string {\n return `${ep.method} ${relativePath(ep.path)}`;\n}\n","/**\n * Shared grouping / sort for the docs layout.\n *\n * Sidebar and the docs longread MUST use the same order — otherwise\n * scrollspy highlights jump around as the user scrolls (the sidebar's\n * ordered list doesn't match the visual order of sections in the docs).\n * This module is the single source of truth for that ordering.\n */\n\nimport { groupBy, orderBy, partition, sortBy } from 'lodash-es';\n\nimport type { ApiEndpoint, SchemaSource } from '../../types';\nimport { longestCommonPrefix } from './sidebarLabel';\n\nexport type EndpointGroup = {\n category: string;\n endpoints: ApiEndpoint[];\n /** Longest ``/``-aligned prefix shared by every endpoint in this\n * group. Used by the sidebar to strip the redundant group prefix\n * from fallback labels. */\n commonPrefix: string;\n};\n\n/** A schema's worth of categorised endpoints. The outer level of the\n * ``sections`` sidebar iterates over these. */\nexport type SchemaSection = {\n source: SchemaSource;\n groups: EndpointGroup[];\n};\n\nconst METHOD_ORDER: Record<string, number> = {\n GET: 0,\n POST: 1,\n PUT: 2,\n PATCH: 3,\n DELETE: 4,\n};\n\nconst methodRank = (ep: ApiEndpoint) => METHOD_ORDER[ep.method] ?? 99;\n\n/**\n * Stable, deterministic ordering so two different renders with the\n * same endpoint list always produce the same visual sequence.\n *\n * Groups: alphabetical by tag/category, with ``Other`` pinned to the\n * bottom (spec-less endpoints should not steal the top slot).\n *\n * Within a group: endpoints sorted by path first (so related resources\n * cluster), then by HTTP method (read → write → delete).\n */\nexport function groupEndpoints(list: ApiEndpoint[]): EndpointGroup[] {\n const byCategory = groupBy(list, 'category');\n const all: EndpointGroup[] = Object.entries(byCategory).map(([category, endpoints]) => ({\n category,\n endpoints: orderBy(endpoints, ['path', methodRank], ['asc', 'asc']),\n commonPrefix: longestCommonPrefix(endpoints.map((e) => e.path)),\n }));\n // \"Other\" sinks to the bottom regardless of alphabet.\n const [other, named] = partition(all, (g) => g.category === 'Other');\n return [...sortBy(named, (g) => g.category.toLowerCase()), ...other];\n}\n\n/** Flatten grouped endpoints back into a linear list that preserves\n * group order + within-group order. This is the canonical order for\n * both the sidebar and the docs longread. */\nexport function flattenGrouped(groups: EndpointGroup[]): ApiEndpoint[] {\n return groups.flatMap((g) => g.endpoints);\n}\n\n/** Build per-schema sections in the same order as the original\n * ``schemas`` array. Schemas with zero endpoints are kept so users see\n * an empty-state placeholder instead of \"the section silently vanished\". */\nexport function buildSchemaSections(\n sources: SchemaSource[],\n endpointsBySchema: Record<string, ApiEndpoint[]>,\n): SchemaSection[] {\n return sources.map((source) => ({\n source,\n groups: groupEndpoints(endpointsBySchema[source.id] ?? []),\n }));\n}\n\n/** Flatten schema-sections into a linear endpoint list. Used by scrollspy\n * and by the docs longread to render endpoints in the exact same order\n * as the sidebar. */\nexport function flattenSchemaSections(sections: SchemaSection[]): ApiEndpoint[] {\n return sections.flatMap((s) => flattenGrouped(s.groups));\n}\n","import type { ApiEndpoint, OpenApiSchema, SchemaSource } from '../../../types';\nimport { deduplicateEndpoints } from '../../../utils/versionManager';\nimport { endpointAnchor } from '../anchor';\nimport { buildSchemaSections, groupEndpoints, type EndpointGroup } from '../grouping';\nimport { sidebarLabel, sidebarTooltip } from '../sidebarLabel';\nimport type {\n CategoryVM,\n EndpointRowVM,\n MethodFilter,\n SchemaSectionVM,\n SidebarBodyVM,\n} from './types';\n\n// ``OpenApiSchema`` is imported to satisfy the build VM signatures even\n// though we never read it here — re-exported so consumers can reuse\n// the same type surface without another import.\nexport type { OpenApiSchema };\n\nexport function filterEndpoints(\n list: ApiEndpoint[],\n query: string,\n method: MethodFilter,\n): ApiEndpoint[] {\n let out = list;\n if (method !== 'ALL') {\n out = out.filter((e) => e.method === method);\n }\n if (query) {\n const q = query.toLowerCase();\n out = out.filter(\n (e) =>\n e.summary.toLowerCase().includes(q) ||\n e.name.toLowerCase().includes(q) ||\n e.description.toLowerCase().includes(q) ||\n e.path.toLowerCase().includes(q),\n );\n }\n return out;\n}\n\nfunction buildCategory(\n group: EndpointGroup,\n activeEndpointId: string | null,\n schemaId: string | null,\n keyPrefix: string,\n): CategoryVM {\n const rows: EndpointRowVM[] = group.endpoints.map((ep) => {\n const anchor = endpointAnchor(ep, schemaId ?? ep.schemaId ?? null);\n return {\n key: `${ep.method}-${ep.path}`,\n anchor,\n schemaId: schemaId ?? ep.schemaId ?? null,\n label: sidebarLabel(ep, group.commonPrefix),\n tooltip: sidebarTooltip(ep),\n method: ep.method,\n useMono: !ep.summary,\n isActive: activeEndpointId === anchor,\n };\n });\n return {\n key: `${keyPrefix}${group.category}`,\n category: group.category,\n rows,\n };\n}\n\nfunction emptyTextFor(query: string, method: MethodFilter, defaultText: string): string {\n if (query && method !== 'ALL') return `No ${method} endpoints match \"${query}\"`;\n if (query) return `No endpoints match \"${query}\"`;\n if (method !== 'ALL') return `No ${method} endpoints`;\n return defaultText;\n}\n\nexport function buildFlatVM(\n endpoints: ApiEndpoint[],\n selectedVersion: string,\n query: string,\n method: MethodFilter,\n activeEndpointId: string | null,\n): SidebarBodyVM {\n const filtered = filterEndpoints(\n deduplicateEndpoints(endpoints, selectedVersion),\n query,\n method,\n );\n const groups = groupEndpoints(filtered);\n return {\n kind: 'flat',\n categories: groups.map((g) => buildCategory(g, activeEndpointId, null, '')),\n emptyText: emptyTextFor(query, method, 'No endpoints in this schema'),\n };\n}\n\nexport function buildSectionsVM(\n schemas: SchemaSource[],\n endpointsBySchema: Record<string, ApiEndpoint[]>,\n selectedVersion: string,\n query: string,\n method: MethodFilter,\n activeEndpointId: string | null,\n): SidebarBodyVM {\n const filteredMap: Record<string, ApiEndpoint[]> = {};\n for (const src of schemas) {\n const raw = endpointsBySchema[src.id] ?? [];\n filteredMap[src.id] = filterEndpoints(\n deduplicateEndpoints(raw, selectedVersion),\n query,\n method,\n );\n }\n const rawSections = buildSchemaSections(schemas, filteredMap);\n const sections: SchemaSectionVM[] = rawSections\n .filter((s) => s.groups.length > 0)\n .map((s) => ({\n sourceId: s.source.id,\n sourceName: s.source.name,\n categories: s.groups.map((g) =>\n buildCategory(g, activeEndpointId, s.source.id, `${s.source.id}-`),\n ),\n }));\n return {\n kind: 'sections',\n sections,\n emptyText: emptyTextFor(query, method, 'No endpoints in any schema'),\n };\n}\n","'use client';\n\nimport React, { useEffect, useRef } from 'react';\n\nimport { Tooltip, TooltipContent, TooltipTrigger } from '@djangocfg/ui-core/components';\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport { MethodBadge } from '../../shared/ui';\nimport type { EndpointRowVM, NavigateFn } from './types';\n\ninterface EndpointRowProps {\n row: EndpointRowVM;\n onNavigate: NavigateFn;\n}\n\n/** One endpoint in the sidebar list. Layout decisions worth calling out:\n * - Fixed 52px badge column via CSS grid so ``GET`` / ``POST`` /\n * ``PATCH`` all take the same horizontal slot and labels align\n * vertically on the left edge. Without this the list looks ragged\n * because ``POST`` is wider than ``GET`` and each label starts at\n * a different x offset.\n * - ``items-baseline`` so the method badge sits on the same visual\n * line as the label text, not in its vertical centre.\n * - ``py-1`` (not the old ``py-1.5``) for higher list density.\n * - Trailing full-stops are trimmed from the label. OpenAPI\n * summaries often end in ``.`` which looks like noise in a list.\n * - Active state is a single left-edge accent bar + soft tint — no\n * big filled background so the method badge still carries the\n * colour semantics of the row. */\nexport const EndpointRow = React.memo(function EndpointRow({\n row,\n onNavigate,\n}: EndpointRowProps) {\n // Strip a trailing full-stop — OpenAPI ``summary`` routinely ends\n // in ``.`` which looks like punctuation noise when stacked in a list.\n const displayLabel = row.label.replace(/\\.$/, '');\n\n // Keep the active row visible inside the sidebar's scroll container.\n // ``block: 'nearest'`` is a no-op when the row is already in view,\n // so this only fires when the user scrolled the docs far enough to\n // push the highlighted endpoint above/below the sidebar viewport.\n const buttonRef = useRef<HTMLButtonElement | null>(null);\n useEffect(() => {\n if (!row.isActive || !buttonRef.current) return;\n buttonRef.current.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }, [row.isActive]);\n\n return (\n <Tooltip delayDuration={350}>\n <TooltipTrigger asChild>\n <button\n ref={buttonRef}\n onClick={() => onNavigate(row.anchor, row.schemaId)}\n aria-current={row.isActive ? 'location' : undefined}\n className={cn(\n 'relative w-full text-left grid grid-cols-[52px_minmax(0,1fr)] items-baseline gap-2 pl-3 pr-3 py-1 transition-colors',\n row.isActive\n ? 'bg-primary/10 text-foreground'\n : 'hover:bg-muted/40 text-foreground/75 hover:text-foreground',\n )}\n >\n {row.isActive && (\n <span className=\"absolute left-0 top-1 bottom-1 w-0.5 rounded-r bg-primary\" />\n )}\n <span className=\"justify-self-start\">\n <MethodBadge method={row.method} />\n </span>\n <span\n className={cn(\n 'line-clamp-2 leading-snug min-w-0',\n row.useMono ? 'font-mono text-[11px] break-all' : 'text-[12px]',\n row.isActive && 'text-foreground font-medium',\n )}\n >\n {displayLabel}\n </span>\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"right\" align=\"center\" className=\"font-mono text-[11px]\">\n {row.tooltip}\n </TooltipContent>\n </Tooltip>\n );\n});\n","'use client';\n\nimport React from 'react';\n\nimport { EndpointRow } from './EndpointRow';\nimport type { CategoryVM, NavigateFn } from './types';\n\ninterface CategoryBlockProps {\n category: CategoryVM;\n onNavigate: NavigateFn;\n}\n\n/** A labelled group of endpoint rows. The category header is\n * deliberately tiny (text-[10px] tracking-wider) — it's a divider, not\n * a call to attention. Users who are reading the list want to see the\n * endpoint names, not the category prose. */\nexport const CategoryBlock = React.memo(function CategoryBlock({\n category,\n onNavigate,\n}: CategoryBlockProps) {\n return (\n <div className=\"mb-2.5 last:mb-1\">\n <div className=\"px-3 pt-3 pb-1 text-[10px] font-semibold uppercase tracking-[0.14em] text-muted-foreground/50 select-none\">\n {category.category}\n </div>\n <div>\n {category.rows.map((row) => (\n <EndpointRow key={row.key} row={row} onNavigate={onNavigate} />\n ))}\n </div>\n </div>\n );\n});\n","'use client';\n\nimport { CategoryBlock } from './CategoryBlock';\nimport type { NavigateFn, SchemaSectionVM } from './types';\n\ninterface SchemaSectionProps {\n section: SchemaSectionVM;\n onNavigate: NavigateFn;\n}\n\n/** One schema block inside ``sections`` grouping mode. Renders a\n * sticky header with the schema name so users can tell which API\n * they're looking at while scrolling, then the categories below. */\nexport function SchemaSection({ section, onNavigate }: SchemaSectionProps) {\n return (\n <div className=\"mb-4 last:mb-2\">\n <div className=\"px-3 py-1.5 sticky top-0 z-[1] bg-background/95 backdrop-blur-[2px] border-b border-border/40\">\n <span className=\"text-[11px] font-bold uppercase tracking-[0.12em] text-foreground/80\">\n {section.sourceName}\n </span>\n </div>\n {section.categories.map((cat) => (\n <CategoryBlock key={cat.key} category={cat} onNavigate={onNavigate} />\n ))}\n </div>\n );\n}\n","'use client';\n\nimport { CategoryBlock } from './CategoryBlock';\nimport { SchemaSection } from './SchemaSection';\nimport type { NavigateFn, SidebarBodyVM } from './types';\n\ninterface SidebarBodyProps {\n body: SidebarBodyVM;\n onNavigate: NavigateFn;\n}\n\n/** Scrollable body of the sidebar. Picks the rendering strategy based\n * on ``body.kind`` — flat category list for single-schema mode,\n * nested schema sections for multi-schema mode — and falls back to\n * a centred empty-state message when the filter pipeline yields no\n * rows. */\nexport function SidebarBody({ body, onNavigate }: SidebarBodyProps) {\n if (body.kind === 'flat') {\n if (body.categories.length === 0) {\n return (\n <div className=\"py-10 px-4 text-center text-xs text-muted-foreground\">\n {body.emptyText}\n </div>\n );\n }\n return (\n <nav className=\"pt-1.5 pb-[10vh]\">\n {body.categories.map((cat) => (\n <CategoryBlock key={cat.key} category={cat} onNavigate={onNavigate} />\n ))}\n </nav>\n );\n }\n\n if (body.sections.length === 0) {\n return (\n <div className=\"py-10 px-4 text-center text-xs text-muted-foreground\">\n {body.emptyText}\n </div>\n );\n }\n\n return (\n <nav className=\"py-1.5\">\n {body.sections.map((section) => (\n <SchemaSection key={section.sourceId} section={section} onNavigate={onNavigate} />\n ))}\n </nav>\n );\n}\n","import type { ApiEndpoint } from '../../../types';\n\n/** HTTP method filter. ``ALL`` is a sentinel for no filter — using a\n * string union (rather than ``string | null``) keeps the filter chips\n * and reducer logic type-safe without null juggling. */\nexport const METHOD_FILTERS = ['ALL', 'GET', 'POST', 'PUT', 'PATCH', 'DELETE'] as const;\nexport type MethodFilter = (typeof METHOD_FILTERS)[number];\n\nexport interface EndpointRowVM {\n key: string;\n anchor: string;\n schemaId: string | null;\n label: string;\n tooltip: string;\n method: string;\n /** Summary-less endpoints get a monospace font for the path-tail\n * label so the tech string is readable against a sea of prose. */\n useMono: boolean;\n isActive: boolean;\n}\n\nexport interface CategoryVM {\n key: string;\n category: string;\n rows: EndpointRowVM[];\n}\n\nexport interface SchemaSectionVM {\n sourceId: string;\n sourceName: string;\n categories: CategoryVM[];\n}\n\nexport type SidebarBodyVM =\n | { kind: 'flat'; categories: CategoryVM[]; emptyText: string }\n | { kind: 'sections'; sections: SchemaSectionVM[]; emptyText: string };\n\nexport type NavigateFn = (anchor: string, schemaId?: string | null) => void;\n\n// Re-exported here so downstream files don't all re-import from the\n// outer ``types`` module for every component prop.\nexport type { ApiEndpoint };\n","'use client';\n\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport { METHOD_FILTERS, type MethodFilter } from './types';\n\ninterface MethodChipsProps {\n value: MethodFilter;\n onChange: (v: MethodFilter) => void;\n}\n\n/** Horizontal filter strip. Scrolls horizontally on narrow widths\n * rather than wrapping to a second line — the toolbar stays a fixed\n * height so the endpoint list below gets every pixel it can.\n *\n * Active chips use a solid fill (not the outlined-with-tint style\n * from the old design) so \"this filter is on\" reads at a glance\n * without the eye having to resolve subtle border colour shifts. */\nexport function MethodChips({ value, onChange }: MethodChipsProps) {\n return (\n <div className=\"flex items-center gap-1 overflow-x-auto -mx-1 px-1 pb-px\">\n {METHOD_FILTERS.map((m) => {\n const active = value === m;\n return (\n <button\n key={m}\n type=\"button\"\n onClick={() => onChange(m)}\n aria-pressed={active}\n className={cn(\n 'shrink-0 px-2 h-6 rounded font-mono text-[10px] font-semibold tracking-wide uppercase transition-colors',\n active\n ? 'bg-foreground text-background'\n : 'text-muted-foreground/70 hover:text-foreground hover:bg-muted',\n )}\n >\n {m}\n </button>\n );\n })}\n </div>\n );\n}\n","'use client';\n\nimport { Search, X } from 'lucide-react';\nimport React from 'react';\n\nimport { Input } from '@djangocfg/ui-core/components';\nimport { cn } from '@djangocfg/ui-core/lib';\n\ninterface SearchInputProps {\n value: string;\n onChange: (v: string) => void;\n placeholder?: string;\n}\n\n/** Search field with a leading icon and a trailing clear button. The\n * clear button only appears when there's something to clear so the\n * idle state reads as a single clean input rather than \"icon + input\n * + mystery button\". */\nexport function SearchInput({ value, onChange, placeholder }: SearchInputProps) {\n return (\n <div className=\"relative\">\n <Search className=\"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground/50 pointer-events-none\" />\n <Input\n placeholder={placeholder ?? 'Search endpoints…'}\n value={value}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => onChange(e.target.value)}\n className=\"pl-8 pr-7 h-8 text-xs\"\n />\n {value && (\n <button\n type=\"button\"\n onClick={() => onChange('')}\n aria-label=\"Clear search\"\n className={cn(\n 'absolute right-1.5 top-1/2 -translate-y-1/2 h-5 w-5 rounded',\n 'inline-flex items-center justify-center',\n 'text-muted-foreground/50 hover:text-foreground hover:bg-muted transition-colors',\n )}\n >\n <X className=\"h-3 w-3\" />\n </button>\n )}\n </div>\n );\n}\n","'use client';\n\nimport React from 'react';\n\nimport { Combobox } from '@djangocfg/ui-core/components';\n\nimport type { SchemaSource } from '../../../types';\nimport { MethodChips } from './MethodChips';\nimport { SearchInput } from './SearchInput';\nimport type { MethodFilter } from './types';\n\ninterface ToolbarProps {\n schemas: SchemaSource[];\n currentSchemaId: string | null;\n onSchemaChange: (id: string) => void;\n showSchemaSelector: boolean;\n\n search: string;\n onSearchChange: (v: string) => void;\n\n methodFilter: MethodFilter;\n onMethodFilterChange: (v: MethodFilter) => void;\n}\n\n/** Filter / control panel of the sidebar. Groups the schema selector,\n * search box, and HTTP method chips into a single visually cohesive\n * block so they read as \"one toolbar\" rather than three separate\n * affordances stacked on top of each other.\n *\n * Each row is optional in the sense that we only render the schema\n * selector when there are multiple schemas to choose between. */\nexport function Toolbar({\n schemas,\n currentSchemaId,\n onSchemaChange,\n showSchemaSelector,\n search,\n onSearchChange,\n methodFilter,\n onMethodFilterChange,\n}: ToolbarProps) {\n const schemaOptions = React.useMemo(\n () => schemas.map((s) => ({ value: s.id, label: s.name })),\n [schemas],\n );\n\n return (\n <div className=\"shrink-0 border-b px-3 py-2.5 space-y-2\">\n {showSchemaSelector && (\n <Combobox\n options={schemaOptions}\n value={currentSchemaId ?? ''}\n onValueChange={(id) => id && onSchemaChange(id)}\n placeholder=\"Select API\"\n searchPlaceholder=\"Search APIs…\"\n emptyText=\"No APIs found\"\n className=\"w-full h-8 text-xs\"\n />\n )}\n <SearchInput value={search} onChange={onSearchChange} />\n <MethodChips value={methodFilter} onChange={onMethodFilterChange} />\n </div>\n );\n}\n","import { useEffect, useState } from 'react';\n\n/** Debounce a fast-changing value. Used for the sidebar search box so\n * each keystroke doesn't re-run the filter pipeline (endpoint list\n * can be hundreds of items long in some specs). 120ms is short\n * enough to feel instant while still batching rapid typing. */\nexport function useDebouncedValue<T>(value: T, delayMs = 120): T {\n const [debounced, setDebounced] = useState(value);\n useEffect(() => {\n const id = setTimeout(() => setDebounced(value), delayMs);\n return () => clearTimeout(id);\n }, [value, delayMs]);\n return debounced;\n}\n","'use client';\n\nimport React, { useMemo, useState } from 'react';\n\nimport type { ApiEndpoint, OpenApiInfo, OpenApiSchema, SchemaSource } from '../../../types';\nimport { ScrollArea } from '../../shared/ui';\nimport { BrandHeader } from './BrandHeader';\nimport { buildFlatVM, buildSectionsVM } from './buildVM';\nimport { SidebarBody } from './SidebarBody';\nimport { Toolbar } from './Toolbar';\nimport type { MethodFilter, SidebarBodyVM } from './types';\nimport { useDebouncedValue } from './useDebouncedValue';\n\nexport interface DocsSidebarProps {\n info: OpenApiInfo | null;\n /** Active-schema endpoints — used by ``selector`` mode. */\n endpoints: ApiEndpoint[];\n /** All configured schemas (used by both modes). */\n schemas: SchemaSource[];\n currentSchemaId: string | null;\n onSchemaChange: (id: string) => void;\n activeEndpointId: string | null;\n selectedVersion: string;\n onNavigate: (anchor: string, schemaId?: string | null) => void;\n /** Presentation mode. Default: ``selector`` (back-compat). */\n grouping?: 'selector' | 'sections';\n /** Required for ``sections`` mode — endpoints grouped by their source\n * schema id. The sidebar renders them as two-level sections. */\n endpointsBySchema?: Record<string, ApiEndpoint[]>;\n /** Raw active schema + resolved base URL — used by the Copy-for-AI\n * dropdown in the brand row. ``null`` disables the button. */\n rawSchema?: OpenApiSchema | null;\n resolvedBaseUrl?: string;\n}\n\n/** Docs sidebar orchestrator. Thin — each child folder owns its own\n * rendering; this file wires props, debounces search, and decides\n * which view-model builder to call. */\nexport function DocsSidebar({\n info,\n endpoints,\n schemas,\n currentSchemaId,\n onSchemaChange,\n activeEndpointId,\n selectedVersion,\n onNavigate,\n grouping = 'selector',\n endpointsBySchema,\n rawSchema,\n resolvedBaseUrl,\n}: DocsSidebarProps) {\n const [search, setSearch] = useState('');\n const [methodFilter, setMethodFilter] = useState<MethodFilter>('ALL');\n const debouncedSearch = useDebouncedValue(search);\n\n const body = useMemo<SidebarBodyVM>(() => {\n if (grouping === 'sections') {\n return buildSectionsVM(\n schemas,\n endpointsBySchema ?? {},\n selectedVersion,\n debouncedSearch,\n methodFilter,\n activeEndpointId,\n );\n }\n return buildFlatVM(\n endpoints,\n selectedVersion,\n debouncedSearch,\n methodFilter,\n activeEndpointId,\n );\n }, [\n grouping,\n schemas,\n endpointsBySchema,\n endpoints,\n selectedVersion,\n debouncedSearch,\n methodFilter,\n activeEndpointId,\n ]);\n\n const hasMultipleSchemas = schemas.length > 1;\n const showSchemaSelector = grouping === 'selector' && hasMultipleSchemas;\n\n return (\n <aside className=\"flex flex-col h-full min-h-0 border-r bg-muted/10\">\n <BrandHeader\n info={info}\n endpoints={endpoints}\n rawSchema={rawSchema}\n resolvedBaseUrl={resolvedBaseUrl}\n />\n <Toolbar\n schemas={schemas}\n currentSchemaId={currentSchemaId}\n onSchemaChange={onSchemaChange}\n showSchemaSelector={showSchemaSelector}\n search={search}\n onSearchChange={setSearch}\n methodFilter={methodFilter}\n onMethodFilterChange={setMethodFilter}\n />\n <ScrollArea>\n <SidebarBody body={body} onNavigate={onNavigate} />\n </ScrollArea>\n </aside>\n );\n}\n","/**\n * Find the nearest ancestor that actually scrolls vertically, or\n * ``window`` when none exists. Handles the common embed scenarios:\n *\n * - Standalone page: nothing in the chain scrolls → caller scrolls\n * ``window`` and listens to ``window.scroll``.\n * - Dev playground / modal shell: an intermediate ``overflow-auto``\n * container scrolls → caller scrolls that element and listens to\n * *its* ``scroll`` events (which do NOT bubble to window).\n *\n * A \"scrollable\" ancestor is one whose computed ``overflow-y`` is\n * ``auto`` or ``scroll`` AND whose content actually overflows. We bail\n * before ``document.body`` — ``documentElement`` is represented by\n * ``window`` in the caller's hot path, so returning the body itself\n * would double-count the scroll surface.\n */\nexport type ScrollTarget = HTMLElement | Window;\n\nexport function getScrollParent(el: HTMLElement | null): ScrollTarget {\n if (typeof window === 'undefined') return (null as unknown) as Window;\n if (!el) return window;\n\n let cur: HTMLElement | null = el.parentElement;\n while (cur && cur !== document.body && cur !== document.documentElement) {\n const style = getComputedStyle(cur);\n const overflowY = style.overflowY;\n const canScroll =\n (overflowY === 'auto' || overflowY === 'scroll' || overflowY === 'overlay') &&\n cur.scrollHeight > cur.clientHeight;\n if (canScroll) return cur;\n cur = cur.parentElement;\n }\n return window;\n}\n\n/** Top-relative scroll position of the target. */\nexport function getScrollTop(target: ScrollTarget): number {\n return target === window ? window.scrollY : (target as HTMLElement).scrollTop;\n}\n\n/** Visible viewport height of the target. */\nexport function getViewportHeight(target: ScrollTarget): number {\n return target === window ? window.innerHeight : (target as HTMLElement).clientHeight;\n}\n\n/** Y coordinate of the target's top edge, in viewport space. Used to\n * translate ``getBoundingClientRect().top`` into target-relative\n * coordinates. For ``window`` this is always ``0``. */\nexport function getTargetTop(target: ScrollTarget): number {\n return target === window ? 0 : (target as HTMLElement).getBoundingClientRect().top;\n}\n\n/** Scroll the target so that the given absolute Y lands at its top.\n *\n * For ``window`` we ask the browser to animate smoothly — every engine\n * honours that path. Nested ``overflow-auto`` elements are a different\n * story: some layouts (e.g. dev-playground shells with flex parents)\n * silently drop the animation, leaving the user stuck. Direct\n * ``scrollTop`` writes always work, so we use them there — loss of\n * animation beats broken navigation. Consumers who want animated\n * scrolling inside a custom shell can wrap this function themselves. */\nexport function scrollTargetTo(target: ScrollTarget, top: number) {\n if (target === window) {\n window.scrollTo({ top, behavior: 'smooth' });\n return;\n }\n (target as HTMLElement).scrollTop = top;\n}\n","'use client';\n\nimport React from 'react';\n\nimport { MarkdownMessage } from '../../../../components/markdown';\nimport type { ApiEndpoint, OpenApiInfo, OpenApiSchema } from '../../types';\nimport { SchemaCopyMenu } from './SchemaCopyMenu';\n\ninterface ApiIntroSectionProps {\n info: OpenApiInfo;\n schema: OpenApiSchema | null;\n endpoints: ApiEndpoint[];\n resolvedBaseUrl?: string;\n}\n\ninterface BaseUrlRow {\n url: string;\n description?: string;\n}\n\nexport function ApiIntroSection({ info, schema, endpoints, resolvedBaseUrl }: ApiIntroSectionProps) {\n // Prefer the *resolved* base URL whenever we have one — that's the\n // URL actual requests target, not the raw ``servers[0].url`` from\n // the spec (which can be a bare path like ``/api/v3``). Fall back\n // to the spec's ``servers`` list so specs that document multiple\n // servers keep showing all of them.\n const baseUrlRows: BaseUrlRow[] = resolvedBaseUrl\n ? [{ url: resolvedBaseUrl, description: info.servers?.[0]?.description }]\n : (info.servers ?? []).map((s) => ({ url: s.url, description: s.description }));\n\n return (\n <section className=\"pb-10 mb-10 border-b\">\n <div className=\"flex items-start justify-between gap-4 flex-wrap\">\n <div className=\"flex items-center gap-3 flex-wrap min-w-0\">\n <h1 className=\"text-3xl font-semibold tracking-tight text-foreground leading-tight\">\n {info.title}\n </h1>\n <span className=\"inline-flex items-center rounded-full bg-muted px-2 py-0.5 font-mono text-[11px] text-muted-foreground\">\n v{info.version}\n </span>\n </div>\n <SchemaCopyMenu\n schema={schema}\n endpoints={endpoints}\n baseUrl={resolvedBaseUrl}\n />\n </div>\n\n {info.description && (\n <div className=\"mt-4 text-muted-foreground\">\n <MarkdownMessage content={info.description} />\n </div>\n )}\n\n {baseUrlRows.length > 0 && (\n <div className=\"mt-6 space-y-2\">\n <h4 className=\"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60\">\n Base URL\n </h4>\n <div className=\"space-y-1.5\">\n {baseUrlRows.map((row, i) => (\n <div key={`${row.url}-${i}`} className=\"flex items-baseline gap-2 flex-wrap\">\n <code className=\"font-mono text-xs px-2 py-1 rounded bg-muted border\">\n {row.url}\n </code>\n {row.description && (\n <span className=\"text-xs text-muted-foreground\">\n {row.description}\n </span>\n )}\n </div>\n ))}\n </div>\n </div>\n )}\n </section>\n );\n}\n","'use client';\n\nimport React, { createContext, useContext, useMemo } from 'react';\n\n/** Identity context for a single EndpointDoc subtree.\n *\n * This is NOT a state container — state lives in the zustand store at\n * ``./store``. The context only carries per-endpoint *identity* values\n * so children (Section, CodeSamples, future ExpandAll button) don't\n * have to re-derive them or receive them as repeated props.\n *\n * Why identity-only:\n * - One zustand singleton handles state for *all* endpoints on the\n * page, keyed by ``endpointId``. Wrapping zustand itself in a\n * Provider would defeat that composite-key design.\n * - Identity (anchor, HTTP method) is invariant inside an endpoint\n * card; deriving it per-child is wasted work and makes the props\n * table look noisier than the logic actually is. */\ninterface EndpointDocContextValue {\n /** DOM-safe anchor id for this endpoint — used as the store key\n * prefix (``openSections[`${endpointId}:${sectionId}`]``) and as\n * the URL hash target for shareable links. */\n endpointId: string;\n /** HTTP method (``GET`` / ``POST`` / …). Drives per-method default\n * open state for Section. Kept in context so ``defaultSectionOpen``\n * doesn't need to be threaded as a prop through every subtree. */\n method: string;\n}\n\nconst EndpointDocContext = createContext<EndpointDocContextValue | null>(null);\n\ninterface EndpointDocProviderProps extends EndpointDocContextValue {\n children: React.ReactNode;\n}\n\nexport function EndpointDocProvider({ endpointId, method, children }: EndpointDocProviderProps) {\n // Memoise the value so every re-render of the parent orchestrator\n // doesn't invalidate children reading the context — the common\n // hover/focus state on the header row re-renders EndpointDoc often.\n const value = useMemo(() => ({ endpointId, method }), [endpointId, method]);\n return <EndpointDocContext.Provider value={value}>{children}</EndpointDocContext.Provider>;\n}\n\nexport function useEndpointDocContext(): EndpointDocContextValue {\n const ctx = useContext(EndpointDocContext);\n if (!ctx) {\n // Treated as a programming error, not a runtime one — if this\n // fires, something rendered EndpointDoc internals outside the\n // provider, which means the store keys will collide or be\n // missing entirely. Loud failure beats silent corruption.\n throw new Error(\n '[OpenapiViewer] useEndpointDocContext must be used inside <EndpointDocProvider>.',\n );\n }\n return ctx;\n}\n","'use client';\n\nimport { create } from 'zustand';\nimport { persist, createJSONStorage } from 'zustand/middleware';\n\nimport type { CodeSampleTargetId } from '../../../../utils/codeSamples';\nimport type { SectionId } from '../types';\n\n/** Composite key so the same section id (``responses``) can have\n * distinct state per endpoint on the page. We don't use Map because\n * zustand+persist serialises state to JSON and Map survival there\n * requires extra replacer/reviver boilerplate for no real gain. */\nexport const sectionKey = (endpointId: string, sectionId: SectionId): string =>\n `${endpointId}:${sectionId}`;\n\nexport interface EndpointDocState {\n /** ``${endpointId}:${sectionId}`` → open? — ``undefined`` means\n * \"use the component's ``defaultOpen``\"; the store only stores\n * user-driven overrides so defaults can change later without\n * stale persisted state overriding them. */\n openSections: Record<string, boolean>;\n /** Active code-sample tab per endpoint. Keyed on endpoint id only;\n * users tend to pick one language and stick with it across the\n * whole page, so sharing between endpoints is acceptable UX. */\n activeCodeTab: Record<string, CodeSampleTargetId>;\n}\n\nexport interface EndpointDocActions {\n toggleSection: (endpointId: string, sectionId: SectionId) => void;\n setSectionOpen: (endpointId: string, sectionId: SectionId, open: boolean) => void;\n setCodeTab: (endpointId: string, tab: CodeSampleTargetId) => void;\n /** Bulk ops — \"expand all\" / \"collapse all\" on a single endpoint.\n * The component calls these from an action button in the header. */\n expandAll: (endpointId: string, sectionIds: readonly SectionId[]) => void;\n collapseAll: (endpointId: string, sectionIds: readonly SectionId[]) => void;\n}\n\nexport type EndpointDocStore = EndpointDocState & EndpointDocActions;\n\nconst initialState: EndpointDocState = {\n openSections: {},\n activeCodeTab: {},\n};\n\n/** Zustand store with sessionStorage persistence. Using sessionStorage\n * (not localStorage) so closing the tab clears state — the viewer is\n * often embedded in a dashboard and persisting forever would surprise\n * users who switched schemas. */\nexport const useEndpointDocStore = create<EndpointDocStore>()(\n persist(\n (set) => ({\n ...initialState,\n\n toggleSection: (endpointId, sectionId) =>\n set((state) => {\n const key = sectionKey(endpointId, sectionId);\n const current = state.openSections[key];\n return {\n openSections: {\n ...state.openSections,\n // If there's no explicit override yet, the user's\n // first click means \"flip from the default\". We\n // assume the default was ``true`` for the most\n // common case (bodies/responses) and ``false``\n // otherwise; the Section component tracks this\n // via its ``defaultOpen`` prop and never calls\n // toggle on sections whose defaults match the\n // next state.\n [key]: current === undefined ? false : !current,\n },\n };\n }),\n\n setSectionOpen: (endpointId, sectionId, open) =>\n set((state) => ({\n openSections: {\n ...state.openSections,\n [sectionKey(endpointId, sectionId)]: open,\n },\n })),\n\n setCodeTab: (endpointId, tab) =>\n set((state) => ({\n activeCodeTab: {\n ...state.activeCodeTab,\n [endpointId]: tab,\n },\n })),\n\n expandAll: (endpointId, sectionIds) =>\n set((state) => {\n const next = { ...state.openSections };\n for (const sid of sectionIds) {\n next[sectionKey(endpointId, sid)] = true;\n }\n return { openSections: next };\n }),\n\n collapseAll: (endpointId, sectionIds) =>\n set((state) => {\n const next = { ...state.openSections };\n for (const sid of sectionIds) {\n next[sectionKey(endpointId, sid)] = false;\n }\n return { openSections: next };\n }),\n }),\n {\n name: 'openapi-viewer:endpoint-doc',\n storage: createJSONStorage(() => {\n // Guard for SSR / non-browser environments — zustand's\n // persist middleware calls storage.getItem synchronously\n // during hydration, and ``sessionStorage`` is undefined\n // there. Returning a noop keeps SSR snapshots stable.\n if (typeof window === 'undefined') {\n return {\n getItem: () => null,\n setItem: () => {},\n removeItem: () => {},\n };\n }\n return window.sessionStorage;\n }),\n // Only persist user overrides, not the functions. Zustand\n // serialises everything by default and logs a warning on\n // non-serialisable values; partialize keeps the payload lean.\n partialize: (state) => ({\n openSections: state.openSections,\n activeCodeTab: state.activeCodeTab,\n }),\n },\n ),\n);\n","'use client';\n\nimport type { CodeSampleTargetId } from '../../../../utils/codeSamples';\nimport type { SectionId } from '../types';\nimport { sectionKey, useEndpointDocStore } from './index';\n\n/** Read whether a section is open, falling back to ``defaultOpen`` when\n * the user hasn't explicitly toggled it. Returning a raw boolean makes\n * the caller's conditional rendering trivial. */\nexport function useIsSectionOpen(\n endpointId: string,\n sectionId: SectionId,\n defaultOpen: boolean,\n): boolean {\n return useEndpointDocStore((s) => {\n const explicit = s.openSections[sectionKey(endpointId, sectionId)];\n return explicit === undefined ? defaultOpen : explicit;\n });\n}\n\n/** Read the active code-sample tab for this endpoint, falling back to\n * a shared default (``curl``). Falls back at read time rather than at\n * write time so changing the default later doesn't require store\n * migration. */\nexport function useActiveCodeTab(\n endpointId: string,\n fallback: CodeSampleTargetId = 'curl',\n): CodeSampleTargetId {\n return useEndpointDocStore((s) => s.activeCodeTab[endpointId] ?? fallback);\n}\n\nexport function useEndpointDocActions() {\n return useEndpointDocStore((s) => ({\n toggleSection: s.toggleSection,\n setSectionOpen: s.setSectionOpen,\n setCodeTab: s.setCodeTab,\n expandAll: s.expandAll,\n collapseAll: s.collapseAll,\n }));\n}\n","'use client';\n\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport { CODE_SAMPLE_TARGETS, type CodeSampleTargetId } from '../../../../utils/codeSamples';\n\ninterface LanguageTabsProps {\n activeId: CodeSampleTargetId;\n onChange: (id: CodeSampleTargetId) => void;\n}\n\n/** Horizontal tab strip for switching between cURL/JS/Python/… The\n * strip scrolls horizontally on narrow viewports rather than wrapping\n * to a second line so the adjacent code block keeps its vertical\n * rhythm. */\nexport function LanguageTabs({ activeId, onChange }: LanguageTabsProps) {\n return (\n <div className=\"flex items-center gap-1 overflow-x-auto -mx-1 px-1\">\n {CODE_SAMPLE_TARGETS.map((t) => (\n <button\n key={t.id}\n type=\"button\"\n onClick={() => onChange(t.id)}\n className={cn(\n 'shrink-0 h-7 px-2.5 rounded text-xs font-medium transition-colors',\n activeId === t.id\n ? 'bg-muted text-foreground'\n : 'text-muted-foreground/70 hover:text-foreground hover:bg-muted/50',\n )}\n >\n {t.label}\n </button>\n ))}\n </div>\n );\n}\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport type { ApiEndpoint } from '../../../../types';\nimport {\n CODE_SAMPLE_TARGETS,\n renderSnippet,\n type CodeSampleTargetId,\n} from '../../../../utils/codeSamples';\nimport { buildHarRequest } from '../../../../utils/operationToHar';\nimport { resolveAbsolute } from '../../../../utils/url';\n\ninterface UseCodeSnippetInput {\n endpoint: ApiEndpoint;\n body?: string;\n parameters?: Record<string, string>;\n headers?: Record<string, string>;\n baseUrl?: string;\n activeId: CodeSampleTargetId;\n}\n\ninterface UseCodeSnippetResult {\n /** Fully-rendered snippet string. Always present — falls back to an\n * \"unavailable\" message if the generator returns null, so the\n * consumer can always mount ``PrettyCode``. */\n snippet: string;\n /** Prism language id matching ``activeId`` — passed to PrettyCode so\n * it picks the right highlighter. */\n prism: string;\n}\n\n/** Encapsulates HAR build + snippet render + memoisation for the Code\n * Samples block. Kept as a hook (rather than inline ``useMemo`` blocks\n * in the component) so unit tests can exercise the snippet pipeline\n * independently of React rendering. */\nexport function useCodeSnippet({\n endpoint,\n body,\n parameters,\n headers,\n baseUrl,\n activeId,\n}: UseCodeSnippetInput): UseCodeSnippetResult {\n const effectiveBody = body ?? endpoint.requestBody?.example;\n\n // Build the HAR once per input change — every tab rebuilds its\n // snippet from this shared request shape.\n //\n // ``endpoint.path`` already carries the schema's ``servers[0].url``\n // (joined upstream in ``useOpenApiSchema``). Usually that's a path\n // like ``/api/v3/pet`` — good enough for same-origin fetch, wrong\n // for curl/python/go which need a runnable absolute URL. We hand\n // off to ``resolveAbsolute`` so the snippet is copy-pasteable from\n // a terminal without the user having to edit the host in manually.\n //\n // Priority: explicit ``baseUrl`` prop > resolved origin > bare path.\n const har = useMemo(() => {\n const h = buildHarRequest({\n endpoint,\n body: effectiveBody,\n parameters,\n headers,\n baseUrl,\n });\n return baseUrl ? h : { ...h, url: resolveAbsolute(h.url) };\n }, [endpoint, effectiveBody, parameters, headers, baseUrl]);\n\n return useMemo(() => {\n const target = CODE_SAMPLE_TARGETS.find((t) => t.id === activeId)!;\n const code = renderSnippet(har, activeId);\n return {\n snippet: code ?? `// Snippet for ${target.label} is unavailable for this request.`,\n prism: target.prism,\n };\n }, [har, activeId]);\n}\n","'use client';\n\nimport PrettyCode from '../../../../../PrettyCode';\nimport type { ApiEndpoint } from '../../../../types';\nimport { useEndpointDocContext } from '../context';\nimport { useEndpointDocStore } from '../store';\nimport { useActiveCodeTab } from '../store/selectors';\nimport { LanguageTabs } from './LanguageTabs';\nimport { useCodeSnippet } from './useCodeSnippet';\n\ninterface CodeSamplesProps {\n endpoint: ApiEndpoint;\n /** Optional body to include in generated snippets. When omitted we\n * use ``endpoint.requestBody?.example`` if present, so the snippet\n * shows a realistic payload out of the box. */\n body?: string;\n /** Parameter values to substitute into the URL. Missing path params\n * fall back to ``{name}`` placeholders so the snippet still\n * illustrates the shape. */\n parameters?: Record<string, string>;\n /** Extra headers to include in snippets (e.g. a picked API key). */\n headers?: Record<string, string>;\n /** Base URL override — falls back to ``endpoint.path`` which\n * already has the resolved base URL prepended by the extractor. */\n baseUrl?: string;\n}\n\n/** Code samples block: language tab bar + highlighted snippet. The\n * outer Section wrapper (collapsible) lives one level up; this\n * component is always \"open\" from its own perspective. */\nexport function CodeSamples({ endpoint, body, parameters, headers, baseUrl }: CodeSamplesProps) {\n const { endpointId } = useEndpointDocContext();\n const activeId = useActiveCodeTab(endpointId);\n const setCodeTab = useEndpointDocStore((s) => s.setCodeTab);\n\n const { snippet, prism } = useCodeSnippet({\n endpoint,\n body,\n parameters,\n headers,\n baseUrl,\n activeId,\n });\n\n return (\n <div className=\"space-y-2.5\">\n <LanguageTabs activeId={activeId} onChange={(id) => setCodeTab(endpointId, id)} />\n <PrettyCode\n data={snippet}\n language={prism as never}\n isCompact\n maxLines={20}\n />\n </div>\n );\n}\n","'use client';\n\nimport {\n Check,\n ChevronsDownUp,\n ChevronsUpDown,\n FileCode2,\n Link2,\n} from 'lucide-react';\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n SafeTooltipProvider,\n} from '@djangocfg/ui-core/components';\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport { useEndpointDocContext } from '../context';\nimport { sectionKey, useEndpointDocStore } from '../store';\nimport type { SectionId } from '../types';\n\ninterface MetaActionsProps {\n anchor: string;\n endpointMarkdown: string;\n /** Sections present on this endpoint — expand/collapse acts only\n * on visible rows, never on catalogue items the card doesn't render. */\n presentSections: readonly SectionId[];\n}\n\ninterface IconButtonProps {\n label: string;\n onClick: () => void;\n children: React.ReactNode;\n active?: boolean;\n}\n\n/** Tight 24×24 icon button used across the meta row. Keeps the hit\n * target compact so the row reads as a secondary metadata strip, not\n * a toolbar that competes with the path for attention. */\nfunction IconButton({ label, onClick, children, active }: IconButtonProps) {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={onClick}\n aria-label={label}\n className={cn(\n 'shrink-0 h-6 w-6 inline-flex items-center justify-center rounded',\n 'text-muted-foreground/60 hover:text-foreground hover:bg-muted transition-colors',\n active && 'text-emerald-500 hover:text-emerald-500',\n )}\n >\n {children}\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"bottom\" className=\"text-[11px]\">\n {label}\n </TooltipContent>\n </Tooltip>\n );\n}\n\n/** Inline meta-row actions: copy link · copy markdown · expand/collapse\n * all. Actions are always visible (corporate tool pattern) but sized\n * down so the path on the next line stays the visual focal point. */\nexport function MetaActions({ anchor, endpointMarkdown, presentSections }: MetaActionsProps) {\n const { endpointId } = useEndpointDocContext();\n const expandAll = useEndpointDocStore((s) => s.expandAll);\n const collapseAll = useEndpointDocStore((s) => s.collapseAll);\n const openSections = useEndpointDocStore((s) => s.openSections);\n\n const [justCopied, setJustCopied] = useState<'link' | 'md' | null>(null);\n const flash = useCallback((which: 'link' | 'md') => {\n setJustCopied(which);\n setTimeout(() => setJustCopied(null), 1200);\n }, []);\n\n const mostlyOpen = useMemo(() => {\n if (presentSections.length === 0) return false;\n let openCount = 0;\n for (const sid of presentSections) {\n if (openSections[sectionKey(endpointId, sid)]) openCount += 1;\n }\n return openCount > presentSections.length / 2;\n }, [openSections, presentSections, endpointId]);\n\n const copyLink = useCallback(() => {\n if (typeof window === 'undefined') return;\n const url = `${window.location.origin}${window.location.pathname}#${anchor}`;\n void navigator.clipboard?.writeText(url).then(() => flash('link'));\n }, [anchor, flash]);\n\n const copyMarkdown = useCallback(() => {\n if (typeof window === 'undefined') return;\n void navigator.clipboard?.writeText(endpointMarkdown).then(() => flash('md'));\n }, [endpointMarkdown, flash]);\n\n const toggleAll = useCallback(() => {\n if (mostlyOpen) collapseAll(endpointId, presentSections);\n else expandAll(endpointId, presentSections);\n }, [mostlyOpen, collapseAll, expandAll, endpointId, presentSections]);\n\n return (\n <SafeTooltipProvider delayDuration={200}>\n <div className=\"flex items-center gap-0.5\">\n <IconButton\n label={justCopied === 'link' ? 'Copied!' : 'Copy link to endpoint'}\n onClick={copyLink}\n active={justCopied === 'link'}\n >\n {justCopied === 'link' ? (\n <Check className=\"h-3.5 w-3.5\" />\n ) : (\n <Link2 className=\"h-3.5 w-3.5\" />\n )}\n </IconButton>\n <IconButton\n label={justCopied === 'md' ? 'Copied!' : 'Copy as Markdown (for AI)'}\n onClick={copyMarkdown}\n active={justCopied === 'md'}\n >\n {justCopied === 'md' ? (\n <Check className=\"h-3.5 w-3.5\" />\n ) : (\n <FileCode2 className=\"h-3.5 w-3.5\" />\n )}\n </IconButton>\n {presentSections.length >= 2 && (\n <IconButton\n label={mostlyOpen ? 'Collapse all sections' : 'Expand all sections'}\n onClick={toggleAll}\n >\n {mostlyOpen ? (\n <ChevronsDownUp className=\"h-3.5 w-3.5\" />\n ) : (\n <ChevronsUpDown className=\"h-3.5 w-3.5\" />\n )}\n </IconButton>\n )}\n </div>\n </SafeTooltipProvider>\n );\n}\n","'use client';\n\nimport { relativePath } from '../../../shared/ui';\n\ninterface PathDisplayProps {\n path: string;\n}\n\n/** The endpoint path as the visual focal point of the card. Renders in\n * large monospace so readers scanning the page land on it first — the\n * path is what distinguishes one endpoint from another, so it should\n * be the biggest visible element short of the section title hierarchy.\n *\n * ``relativePath`` strips the resolved base URL so the docs always\n * show the API-local path, not an absolute URL cluttered with host\n * noise. */\nexport function PathDisplay({ path }: PathDisplayProps) {\n return (\n <code\n className=\"block font-mono text-lg md:text-xl font-semibold text-foreground leading-tight\"\n style={{ overflowWrap: 'anywhere', wordBreak: 'break-word' }}\n >\n {relativePath(path)}\n </code>\n );\n}\n","'use client';\n\nimport { Play } from 'lucide-react';\nimport React, { useMemo } from 'react';\n\nimport { Button } from '@djangocfg/ui-core/components';\n\nimport { MarkdownMessage } from '../../../../../../components/markdown';\nimport type { ApiEndpoint } from '../../../../types';\nimport { endpointToMarkdown } from '../../../../utils/schemaExport';\nimport type { SectionId } from '../types';\nimport { MetaActions } from './MetaActions';\nimport { MethodBadge } from './MethodBadge';\nimport { PathDisplay } from './PathDisplay';\n\ninterface EndpointHeaderProps {\n endpoint: ApiEndpoint;\n anchor: string;\n isLoadedInPlayground: boolean;\n onTryIt: () => void;\n /** Sections actually rendered on this endpoint — drives the\n * expand/collapse-all icon in the meta row. */\n presentSections: readonly SectionId[];\n}\n\n/** Card header, three stacked rows:\n * 1. Meta — small utility strip: method badge · inline actions · Try-it.\n * 2. Path — large monospace, the visual focus of the card.\n * 3. Description — prose, aligned to the left edge under path.\n *\n * Splitting metadata from the path lets the path itself become the\n * focal point — readers scan paths when scrolling, not badges. The\n * meta row stays compact so it reads as \"info about this endpoint\"\n * rather than \"toolbar that competes for attention\". */\nexport function EndpointHeader({\n endpoint,\n anchor,\n isLoadedInPlayground,\n onTryIt,\n presentSections,\n}: EndpointHeaderProps) {\n // Memoise the markdown dump — only recomputes when the endpoint\n // reference changes, not on unrelated re-renders of the subtree.\n const endpointMd = useMemo(() => endpointToMarkdown(endpoint), [endpoint]);\n\n return (\n <header className=\"space-y-3\">\n {/* Row 1 — meta strip. Badge + inline icon actions on the\n left, primary CTA on the right. Kept tight (24px tall)\n so it doesn't visually compete with the path row below. */}\n <div className=\"flex items-center gap-3 flex-wrap\">\n <div className=\"flex items-center gap-2 min-w-0\">\n <MethodBadge method={endpoint.method} />\n <MetaActions\n anchor={anchor}\n endpointMarkdown={endpointMd}\n presentSections={presentSections}\n />\n </div>\n <Button\n size=\"sm\"\n variant={isLoadedInPlayground ? 'secondary' : 'default'}\n onClick={onTryIt}\n className=\"ml-auto h-7 text-xs gap-1.5 px-2.5\"\n >\n <Play className=\"h-3 w-3\" />\n {isLoadedInPlayground ? 'Loaded' : 'Try it'}\n </Button>\n </div>\n\n {/* Row 2 — path as the visual focal point. Larger and more\n prominent than it was when competing with the badge\n and action icons inline. */}\n <div className=\"min-w-0\">\n <PathDisplay path={endpoint.path} />\n </div>\n\n {/* Row 3 — description, aligned to the left edge under the\n path. Text-sm so it reads as subtitle, not body copy. */}\n {endpoint.description && (\n <div className=\"text-muted-foreground text-sm\">\n <MarkdownMessage content={endpoint.description} />\n </div>\n )}\n </header>\n );\n}\n","'use client';\n\nimport type { ApiEndpoint } from '../../../../types';\n\ntype Param = NonNullable<ApiEndpoint['parameters']>[number];\n\ninterface ParamRowProps {\n param: Param;\n}\n\n/** Single parameter row. Name + required marker + type + (optional)\n * description. Wrapped in ``<div>`` rather than a table row so the\n * list degrades to a stack on narrow widths without losing semantics. */\nexport function ParamRow({ param }: ParamRowProps) {\n return (\n <div className=\"px-3 py-2.5 bg-background space-y-1\">\n <div className=\"flex items-baseline gap-2 flex-wrap\">\n <code className=\"font-mono text-xs font-medium text-foreground\">{param.name}</code>\n {param.required && (\n <span\n title=\"Required\"\n className=\"text-[9px] text-destructive font-bold leading-none\"\n >\n *\n </span>\n )}\n <code className=\"font-mono text-[11px] text-muted-foreground/70\">{param.type}</code>\n </div>\n {param.description && (\n <p className=\"text-xs text-muted-foreground leading-relaxed break-words\">\n {param.description}\n </p>\n )}\n </div>\n );\n}\n","'use client';\n\nimport type { ApiEndpoint } from '../../../../types';\nimport { ParamRow } from './ParamRow';\n\ninterface ParamGroupProps {\n /** Small uppercase label shown above the group (``Path``, ``Query``). */\n label: string;\n params: NonNullable<ApiEndpoint['parameters']>;\n}\n\n/** Labelled block of parameter rows. We split path vs query so the user\n * can tell which values go in the URL template vs the query string at\n * a glance — both are ``parameters`` in OpenAPI terms but they land in\n * different places in the generated request. */\nexport function ParamGroup({ label, params }: ParamGroupProps) {\n if (params.length === 0) return null;\n return (\n <div className=\"space-y-1.5\">\n <div className=\"text-[10px] font-semibold uppercase tracking-[0.1em] text-muted-foreground/60 px-1\">\n {label}\n </div>\n <div className=\"divide-y border rounded-md overflow-hidden\">\n {params.map((p) => (\n <ParamRow key={`${label}-${p.name}`} param={p} />\n ))}\n </div>\n </div>\n );\n}\n","'use client';\n\nimport type { ApiEndpoint } from '../../../../types';\nimport { ParamGroup } from './ParamGroup';\n\ninterface ParametersProps {\n pathParams: NonNullable<ApiEndpoint['parameters']>;\n queryParams: NonNullable<ApiEndpoint['parameters']>;\n}\n\n/** Combined path + query parameters block. Each group renders only\n * when non-empty; when both are empty the parent should not render\n * the Section at all (we check up-stream so the Section badge shows a\n * real count). */\nexport function Parameters({ pathParams, queryParams }: ParametersProps) {\n return (\n <div className=\"space-y-4\">\n <ParamGroup label=\"Path\" params={pathParams} />\n <ParamGroup label=\"Query\" params={queryParams} />\n </div>\n );\n}\n","/**\n * JSON Schema → ``FieldNode`` tree.\n *\n * Handles the OpenAPI 3.x subset we actually see: objects with\n * ``properties`` + ``required``, arrays with ``items``, enums,\n * primitives with ``format``. ``allOf`` / ``oneOf`` / ``anyOf`` are\n * flattened best-effort — we pick the first branch so the UI shows\n * *a* shape rather than an empty row. Upstream dereferencing\n * (``dereferenceSchema``) is expected to have resolved ``$ref`` before\n * this runs.\n */\n\nimport type { FieldKind, FieldNode } from './types';\n\ntype JsonSchemaNode = Record<string, unknown> & {\n type?: string;\n properties?: Record<string, JsonSchemaNode>;\n required?: string[];\n items?: JsonSchemaNode;\n enum?: unknown[];\n description?: string;\n format?: string;\n allOf?: JsonSchemaNode[];\n oneOf?: JsonSchemaNode[];\n anyOf?: JsonSchemaNode[];\n};\n\n/** Hard cap on recursion so self-referential schemas can't blow the\n * call stack. Anything this deep is unreadable in a docs view anyway. */\nconst MAX_DEPTH = 5;\n\n/** Merge ``allOf`` branches into a single pseudo-object. Shallow merge\n * is enough for the display — deep merge would require semantic JSON\n * Schema reasoning that we don't need for a read-only viewer. */\nfunction mergeAllOf(branches: JsonSchemaNode[]): JsonSchemaNode {\n const properties: Record<string, JsonSchemaNode> = {};\n const required: string[] = [];\n for (const b of branches) {\n if (b.properties) Object.assign(properties, b.properties);\n if (Array.isArray(b.required)) required.push(...b.required);\n }\n return { type: 'object', properties, required };\n}\n\nfunction describeType(node: JsonSchemaNode): { label: string; kind: FieldKind } {\n if (node.type === 'array') {\n const itemLabel = node.items ? describeType(node.items).label : 'any';\n return { label: `array<${itemLabel}>`, kind: 'array' };\n }\n if (node.type === 'object' || node.properties) {\n return { label: 'object', kind: 'object' };\n }\n const base = node.type || 'any';\n if (Array.isArray(node.enum) && node.enum.length > 0) {\n return { label: `${base} enum`, kind: 'primitive' };\n }\n if (node.format) {\n return { label: `${base} (${node.format})`, kind: 'primitive' };\n }\n return { label: base, kind: 'primitive' };\n}\n\nfunction resolveCombinators(node: JsonSchemaNode): JsonSchemaNode {\n // ``allOf`` → merge shallowly. Other combinators → pick the first\n // branch (see module docstring rationale).\n if (Array.isArray(node.allOf) && node.allOf.length > 0) {\n return { ...mergeAllOf(node.allOf), description: node.description };\n }\n if (Array.isArray(node.oneOf) && node.oneOf.length > 0) {\n return { ...node.oneOf[0]!, description: node.description ?? node.oneOf[0]!.description };\n }\n if (Array.isArray(node.anyOf) && node.anyOf.length > 0) {\n return { ...node.anyOf[0]!, description: node.description ?? node.anyOf[0]!.description };\n }\n return node;\n}\n\nfunction buildNode(\n name: string,\n schema: JsonSchemaNode,\n isRequired: boolean,\n depth: number,\n): FieldNode {\n const resolved = resolveCombinators(schema);\n const { label, kind } = describeType(resolved);\n const node: FieldNode = {\n name,\n type: label,\n kind,\n required: isRequired,\n description: resolved.description,\n };\n\n if (Array.isArray(resolved.enum) && resolved.enum.length > 0) {\n node.enumValues = resolved.enum.map((v) => String(v));\n }\n\n if (depth >= MAX_DEPTH) return node;\n\n if (kind === 'object' && resolved.properties) {\n const required = new Set(resolved.required ?? []);\n node.children = Object.entries(resolved.properties).map(([key, child]) =>\n buildNode(key, child, required.has(key), depth + 1),\n );\n } else if (kind === 'array' && resolved.items) {\n // Synthesise a single ``[]`` child. If items are objects, the\n // child's own children will appear — so the tree reads as\n // ``tags → [] → { id, name }``.\n node.children = [buildNode('[]', resolved.items, false, depth + 1)];\n }\n\n return node;\n}\n\n/** Top-level entry. The root schema is usually an object or array; we\n * return its children directly so the tree starts one level deep\n * (skipping the redundant \"root\" node). */\nexport function buildSchemaTree(schema: JsonSchemaNode | undefined): FieldNode[] {\n if (!schema) return [];\n const root = buildNode('', schema, false, 0);\n if (root.children && root.children.length > 0) return root.children;\n // Primitive body (rare) — return the root itself as a one-row tree.\n if (root.kind === 'primitive' || (!root.children && root.name === '')) {\n return [{ ...root, name: root.name || '(body)' }];\n }\n return [];\n}\n","'use client';\n\nimport { ChevronRight } from 'lucide-react';\nimport React, { useState } from 'react';\n\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport type { FieldNode } from './types';\n\ninterface FieldRowProps {\n field: FieldNode;\n /** 0-based nesting level. Used to compute left padding so the tree\n * visually expresses hierarchy without relying on a separate tree\n * component (no deps, one file). */\n depth: number;\n /** Parent container nodes render with an extra vertical tick so the\n * tree reads as a rooted graph instead of flat indented rows. */\n showTreeLine?: boolean;\n}\n\n/** Recursive tree row. Object/array nodes are collapsible and default\n * to expanded at shallow depths — readers almost always want to see\n * the first level of nesting, and explicitly collapsing uninteresting\n * subtrees is cheaper than expanding every interesting one. */\nexport function FieldRow({ field, depth, showTreeLine = true }: FieldRowProps) {\n const isExpandable = (field.kind === 'object' || field.kind === 'array') &&\n Array.isArray(field.children) && field.children.length > 0;\n\n // Expand levels 0-1 by default; beyond that the tree can explode\n // visually for deeply-nested objects (think Pet.category.tag.…).\n const [open, setOpen] = useState(depth < 2);\n\n // Inline padding via style so arbitrary depths render without a\n // pile of Tailwind classes. 14px per level matches the chevron gap\n // at smaller text sizes.\n const padLeft = showTreeLine ? depth * 14 : 0;\n\n return (\n <div className=\"bg-background\">\n <div\n className={cn(\n 'grid grid-cols-[16px_minmax(0,1fr)] items-baseline gap-2 px-3 py-2',\n isExpandable && 'cursor-pointer hover:bg-muted/30',\n )}\n style={{ paddingLeft: 12 + padLeft }}\n onClick={() => isExpandable && setOpen((v) => !v)}\n role={isExpandable ? 'button' : undefined}\n aria-expanded={isExpandable ? open : undefined}\n >\n <ChevronRight\n className={cn(\n 'h-3.5 w-3.5 text-muted-foreground/50 shrink-0 transition-transform',\n !isExpandable && 'opacity-0',\n open && 'rotate-90',\n )}\n />\n <div className=\"min-w-0 space-y-1\">\n <div className=\"flex items-baseline gap-2 flex-wrap\">\n <code className=\"font-mono text-xs font-medium text-foreground\">\n {field.name}\n </code>\n {field.required && (\n <span\n title=\"Required\"\n className=\"text-[9px] text-destructive font-bold leading-none\"\n >\n *\n </span>\n )}\n <code className=\"font-mono text-[11px] text-muted-foreground/70\">\n {field.type}\n </code>\n </div>\n {field.description && (\n <p className=\"text-xs text-muted-foreground leading-relaxed break-words\">\n {field.description}\n </p>\n )}\n {field.enumValues && field.enumValues.length > 0 && (\n <div className=\"flex flex-wrap gap-1 pt-0.5\">\n {field.enumValues.map((v) => (\n <code\n key={v}\n className=\"inline-flex items-center rounded border border-border/60 bg-muted/40 px-1.5 py-px font-mono text-[10px] text-muted-foreground\"\n >\n {v}\n </code>\n ))}\n </div>\n )}\n </div>\n </div>\n {isExpandable && open && (\n <div>\n {field.children!.map((child, i) => (\n <FieldRow\n key={`${child.name}-${i}`}\n field={child}\n depth={depth + 1}\n />\n ))}\n </div>\n )}\n </div>\n );\n}\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { buildSchemaTree } from './buildTree';\nimport { FieldRow } from './FieldRow';\n\ninterface SchemaFieldsProps {\n schema: Record<string, unknown>;\n}\n\n/** Tree-view of a JSON schema's fields. Replaces the old flat list\n * where nested objects appeared as ``category.id`` / ``category.name``\n * as siblings — here they nest visually under ``category``.\n *\n * The component is purely presentational; all shape logic lives in\n * ``buildSchemaTree``. That split lets us swap the renderer later\n * (e.g. virtualised rows for huge schemas) without touching the\n * traversal. */\nexport function SchemaFields({ schema }: SchemaFieldsProps) {\n const tree = useMemo(() => buildSchemaTree(schema as never), [schema]);\n if (tree.length === 0) return null;\n\n return (\n <div className=\"divide-y border rounded-md overflow-hidden\">\n {tree.map((node, i) => (\n <FieldRow key={`${node.name}-${i}`} field={node} depth={0} />\n ))}\n </div>\n );\n}\n","'use client';\n\nimport type { ApiEndpoint } from '../../../../types';\nimport { SchemaFields } from '../SchemaFields';\n\ninterface RequestBodyProps {\n body: NonNullable<ApiEndpoint['requestBody']>;\n}\n\n/** Request body preview. Shows a short type summary line (``object``,\n * ``array<object>``, …) alongside the body description, then the\n * tree-view of fields. The example payload is rendered below in its\n * own section (code samples) because the user often wants to copy it\n * independently from inspecting the shape. */\nexport function RequestBody({ body }: RequestBodyProps) {\n const typeLabel = body.schema\n ? body.type === 'array'\n ? `array<${(body.schema as { items?: { type?: string } }).items?.type ?? 'object'}>`\n : body.type\n : body.type;\n\n return (\n <div className=\"space-y-3\">\n <div className=\"flex items-baseline gap-2 flex-wrap\">\n <code className=\"font-mono text-[11px] text-muted-foreground/80\">{typeLabel}</code>\n {body.description && (\n <span className=\"text-xs text-muted-foreground\">{body.description}</span>\n )}\n </div>\n {body.schema && <SchemaFields schema={body.schema} />}\n </div>\n );\n}\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { CopyButton } from '@djangocfg/ui-core/components';\n\nimport JsonTree from '../../../../../JsonTree';\n\n// Compact, read-only JsonTree config. Docs longread is space-constrained\n// so we ship less chrome than the interactive ``ResponsePanel`` — copy\n// button lives outside the tree (on the row header) and collection-info\n// stays on so long arrays don't silently truncate.\nconst EXAMPLE_JSON_TREE_CONFIG = {\n maxAutoExpandDepth: 2,\n maxAutoExpandArrayItems: 5,\n maxAutoExpandObjectKeys: 8,\n maxStringLength: 160,\n collectionLimit: 25,\n showCollectionInfo: true,\n showExpandControls: false,\n showActionButtons: false,\n preserveKeyOrder: true,\n className: 'border-0 rounded-none',\n} as const;\n\ninterface ResponseBodyProps {\n example: string;\n contentType?: string;\n}\n\n/** Render the example response body: content-type strip + copy button\n * header, then the JSON tree (falling back to a ``<pre>`` if the\n * example isn't valid JSON — sampler occasionally emits non-JSON for\n * exotic content types). */\nexport function ResponseBody({ example, contentType }: ResponseBodyProps) {\n // Parse once and cache. ``example`` is pre-stringified by the\n // sampler; JsonTree wants a live object to render nodes with proper\n // folding, so we flip it back here.\n const parsed = useMemo(() => {\n try {\n return JSON.parse(example);\n } catch {\n return null;\n }\n }, [example]);\n\n return (\n <div className=\"border-t bg-muted/20\">\n <div className=\"flex items-center justify-between px-3 py-1.5 border-b border-border/50\">\n <code className=\"font-mono text-[10px] uppercase tracking-wider text-muted-foreground/70\">\n {contentType ?? 'application/json'}\n </code>\n <CopyButton\n value={example}\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-6 px-2 text-[10px] text-muted-foreground\"\n >\n Copy\n </CopyButton>\n </div>\n {parsed != null ? (\n <JsonTree\n title=\"\"\n data={parsed}\n mode=\"compact\"\n config={EXAMPLE_JSON_TREE_CONFIG}\n />\n ) : (\n <pre className=\"p-3 text-[11px] font-mono text-foreground/70 whitespace-pre-wrap break-all leading-relaxed\">\n {example}\n </pre>\n )}\n </div>\n );\n}\n","'use client';\n\nimport { cn } from '@djangocfg/ui-core/lib';\n\ninterface StatusTagProps {\n code: string;\n}\n\n/** HTTP status pill. Colours map to the usual conventions: 2xx green,\n * 3xx blue, 4xx amber, 5xx red, non-numeric (``default``) neutral.\n * Codes that don't parse as integers render in the neutral style so we\n * never flash a wrong-severity colour at the user. */\nexport function StatusTag({ code }: StatusTagProps) {\n const numeric = Number.parseInt(code, 10);\n const cls = !Number.isFinite(numeric)\n ? 'bg-muted text-muted-foreground border-border'\n : numeric >= 500\n ? 'bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/25'\n : numeric >= 400\n ? 'bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/25'\n : numeric >= 300\n ? 'bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/25'\n : 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/25';\n return (\n <span className={cn(\n 'inline-flex items-center justify-center rounded border px-2 py-0.5 font-mono text-[11px] font-bold leading-none shrink-0 tabular-nums',\n cls,\n )}>\n {code}\n </span>\n );\n}\n","'use client';\n\nimport { ChevronRight } from 'lucide-react';\nimport { useState } from 'react';\n\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport type { ApiEndpoint } from '../../../../types';\nimport { ResponseBody } from './ResponseBody';\nimport { StatusTag } from './StatusTag';\n\ninterface ResponseRowProps {\n response: NonNullable<ApiEndpoint['responses']>[number];\n}\n\n/** One status-code row in the Responses section.\n *\n * Layout:\n * - Chevron column only renders when there's an example to expand.\n * Otherwise the row is inert (no button wrapper, no hover state)\n * and the space stays tight instead of reserving an empty gutter\n * under a disabled chevron.\n * - Status tag column is ``48px`` wide — enough for ``default`` and\n * 3-digit codes in the font size we use. Keeps descriptions\n * aligned on their left edge across all rows regardless of code.\n *\n * Expansion defaults:\n * - 2xx with example → open (happy-path is what readers want first).\n * - Everything else → closed, one click to inspect. */\nexport function ResponseRow({ response }: ResponseRowProps) {\n const hasExample = Boolean(response.example);\n const numeric = Number.parseInt(response.code, 10);\n const isSuccess = Number.isFinite(numeric) && numeric >= 200 && numeric < 300;\n const [open, setOpen] = useState(hasExample && isSuccess);\n\n // Inert row (no example available) — render as a plain div so the\n // layout stays identical but without button affordances.\n if (!hasExample) {\n return (\n <div className=\"flex items-center gap-3 px-3 py-2 bg-background\">\n <div className=\"w-12 shrink-0 flex justify-start\">\n <StatusTag code={response.code} />\n </div>\n <span className=\"text-sm text-muted-foreground leading-relaxed break-words min-w-0\">\n {response.description}\n </span>\n </div>\n );\n }\n\n return (\n <div className=\"bg-background\">\n <button\n type=\"button\"\n onClick={() => setOpen((v) => !v)}\n className=\"w-full flex items-center gap-3 px-3 py-2 text-left hover:bg-muted/40 cursor-pointer transition-colors\"\n aria-expanded={open}\n >\n <ChevronRight\n className={cn(\n 'h-3.5 w-3.5 text-muted-foreground/60 transition-transform shrink-0',\n open && 'rotate-90',\n )}\n />\n <div className=\"w-12 shrink-0 flex justify-start\">\n <StatusTag code={response.code} />\n </div>\n <span className=\"text-sm text-muted-foreground leading-relaxed break-words min-w-0 flex-1\">\n {response.description}\n </span>\n </button>\n {open && (\n <ResponseBody\n example={response.example!}\n contentType={response.contentType}\n />\n )}\n </div>\n );\n}\n","'use client';\n\nimport type { ApiEndpoint } from '../../../../types';\nimport { ResponseRow } from './ResponseRow';\n\ninterface ResponsesProps {\n responses: NonNullable<ApiEndpoint['responses']>;\n}\n\n/** Flat list of response rows. Outer collapsible wrapper lives in the\n * ``Section`` component higher up; this component only knows how to\n * arrange the individual rows. */\nexport function Responses({ responses }: ResponsesProps) {\n return (\n <div className=\"divide-y border rounded-md overflow-hidden\">\n {responses.map((r) => (\n <ResponseRow key={r.code} response={r} />\n ))}\n </div>\n );\n}\n","import type { SectionId } from '../types';\n\n/** Per-HTTP-method defaults for which sections start open. The goal is\n * \"the most useful section is already visible\" without burying the\n * less-important ones entirely.\n *\n * Rationale by method:\n * - GET/DELETE: parameters + 2xx response — the request itself has\n * no body, so that's what the reader needs to see first.\n * - POST/PUT/PATCH: request body + 2xx response — the shape to send\n * is the main question; parameters and code samples are\n * secondary, available one click away.\n * - Other (HEAD/OPTIONS/…): be conservative, open nothing extra\n * beyond responses. */\nconst DEFAULTS_BY_METHOD: Record<string, Partial<Record<SectionId, boolean>>> = {\n GET: { parameters: true, responses: true },\n DELETE: { parameters: true, responses: true },\n POST: { requestBody: true, responses: true },\n PUT: { requestBody: true, responses: true },\n PATCH: { requestBody: true, responses: true },\n};\n\n/** Resolve the default open state for a given (method, section). Falls\n * back to ``false`` for unknown combinations. */\nexport function defaultSectionOpen(method: string, sectionId: SectionId): boolean {\n return DEFAULTS_BY_METHOD[method.toUpperCase()]?.[sectionId] ?? false;\n}\n","/**\n * Local types for the EndpointDoc folder. Wider OpenAPI types live in\n * ``../../../types``; this module only declares what's specific to the\n * docs-view rendering (section identifiers, tab ids, etc.).\n */\n\n/** Sections a single endpoint card can contain. Section identity is\n * stable because zustand stores open/close state keyed by it, and the\n * URL hash router references sections by the same id. */\nexport type SectionId = 'parameters' | 'requestBody' | 'responses' | 'codeSamples';\n\nexport const ALL_SECTION_IDS: readonly SectionId[] = [\n 'parameters',\n 'requestBody',\n 'responses',\n 'codeSamples',\n] as const;\n","'use client';\n\nimport { useEffect } from 'react';\n\nimport { useEndpointDocStore } from '../store';\nimport { ALL_SECTION_IDS, type SectionId } from '../types';\n\n/** Parse ``#section=<endpointId>.<sectionId>`` out of a hash string.\n * Returns ``null`` for any other shape (including the plain\n * ``#<endpointId>`` form used elsewhere for scrolling to an endpoint). */\nexport function parseSectionHash(hash: string): { endpointId: string; sectionId: SectionId } | null {\n const raw = hash.startsWith('#') ? hash.slice(1) : hash;\n if (!raw.startsWith('section=')) return null;\n const value = raw.slice('section='.length);\n const dot = value.lastIndexOf('.');\n if (dot <= 0 || dot === value.length - 1) return null;\n const endpointId = value.slice(0, dot);\n const sectionIdCandidate = value.slice(dot + 1);\n if (!(ALL_SECTION_IDS as readonly string[]).includes(sectionIdCandidate)) return null;\n return { endpointId, sectionId: sectionIdCandidate as SectionId };\n}\n\n/** Build the shareable hash that opens a specific section. */\nexport function buildSectionHash(endpointId: string, sectionId: SectionId): string {\n return `section=${endpointId}.${sectionId}`;\n}\n\n/** On mount + on hashchange, read ``#section=...``, open that section\n * in the store, and scroll its endpoint into view. Runs once per\n * hash change, not per endpoint render — the effect lives above the\n * per-endpoint level in the tree.\n *\n * Behaviour:\n * 1. Parse hash. If it isn't our ``section=`` form, bail — the\n * browser's own anchor-scrolling handles ``#ep-…`` URLs already.\n * 2. Open the referenced section in the zustand store so its body\n * is visible the moment the user lands.\n * 3. Scroll the endpoint's ``<section id={endpointId}>`` into view\n * on the next frame (after the section body has mounted). */\nexport function useSectionHashRouter(): void {\n const setSectionOpen = useEndpointDocStore((s) => s.setSectionOpen);\n\n useEffect(() => {\n if (typeof window === 'undefined') return;\n\n function apply() {\n const parsed = parseSectionHash(window.location.hash);\n if (!parsed) return;\n setSectionOpen(parsed.endpointId, parsed.sectionId, true);\n // Defer scroll to let the section body render first —\n // scrolling a collapsed row lands on the wrong offset\n // because the body takes vertical space once expanded.\n requestAnimationFrame(() => {\n const el = document.getElementById(parsed.endpointId);\n el?.scrollIntoView({ behavior: 'smooth', block: 'start' });\n });\n }\n\n apply();\n window.addEventListener('hashchange', apply);\n return () => window.removeEventListener('hashchange', apply);\n }, [setSectionOpen]);\n}\n","'use client';\n\nimport { Check, ChevronDown, Link2 } from 'lucide-react';\nimport { useState } from 'react';\n\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport { useEndpointDocContext } from '../context';\nimport { buildSectionHash } from '../hooks/useSectionHash';\nimport type { SectionId } from '../types';\n\ninterface SectionHeaderProps {\n /** Section identifier — needed to build the shareable hash link. */\n sectionId: SectionId;\n title: string;\n badge?: number;\n open: boolean;\n onToggle: () => void;\n}\n\n/** Clickable header for a collapsible section. The whole row toggles,\n * plus a hover-revealed anchor button copies a ``#section=...`` URL so\n * users can share a link that lands with this exact section already\n * expanded (handled by ``useSectionHashRouter``). */\nexport function SectionHeader({ sectionId, title, badge, open, onToggle }: SectionHeaderProps) {\n const { endpointId } = useEndpointDocContext();\n const [copied, setCopied] = useState(false);\n\n const copyHash = (e: React.MouseEvent) => {\n // Prevent the row toggle — the anchor button must not collapse\n // the section while the user is copying the link.\n e.stopPropagation();\n if (typeof window === 'undefined') return;\n const hash = buildSectionHash(endpointId, sectionId);\n const url = `${window.location.origin}${window.location.pathname}#${hash}`;\n void navigator.clipboard?.writeText(url).then(() => {\n setCopied(true);\n setTimeout(() => setCopied(false), 1200);\n });\n };\n\n return (\n <div\n className={cn(\n 'group/section w-full flex items-center gap-2 py-1.5 -ml-1 px-1 rounded cursor-pointer',\n 'hover:bg-muted/30 transition-colors',\n )}\n onClick={onToggle}\n role=\"button\"\n aria-expanded={open}\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onToggle();\n }\n }}\n >\n <ChevronDown\n className={cn(\n 'h-3.5 w-3.5 text-muted-foreground/50 transition-transform shrink-0',\n !open && '-rotate-90',\n )}\n />\n <h4 className=\"text-[10px] font-semibold uppercase tracking-[0.12em] text-muted-foreground/80\">\n {title}\n </h4>\n {typeof badge === 'number' && badge > 0 && (\n <span className=\"font-mono text-[10px] text-muted-foreground/50 tabular-nums\">\n {badge}\n </span>\n )}\n <button\n type=\"button\"\n onClick={copyHash}\n title=\"Copy link to this section\"\n className={cn(\n 'ml-auto shrink-0 p-1 rounded text-muted-foreground/40 hover:text-foreground hover:bg-muted transition-all',\n 'opacity-0 group-hover/section:opacity-100 focus-visible:opacity-100',\n copied && 'opacity-100 text-emerald-500',\n )}\n >\n {copied ? <Check className=\"h-3 w-3\" /> : <Link2 className=\"h-3 w-3\" />}\n </button>\n </div>\n );\n}\n","'use client';\n\nimport React from 'react';\n\nimport { useEndpointDocContext } from '../context';\nimport { useEndpointDocStore } from '../store';\nimport { useIsSectionOpen } from '../store/selectors';\nimport type { SectionId } from '../types';\nimport { defaultSectionOpen } from './defaults';\nimport { SectionHeader } from './SectionHeader';\n\ninterface SectionProps {\n /** Identifies the section inside the endpoint's card — used as a\n * key in zustand + URL hash routing. Must match one of ``SectionId``. */\n id: SectionId;\n title: string;\n /** Optional count badge shown next to the title. */\n badge?: number;\n children: React.ReactNode;\n}\n\n/** Collapsible section wrapper. Pulls endpoint identity from\n * ``EndpointDocProvider`` so the component API stays at \"id + title\"\n * — the rest is implicit from context. Children render lazily when\n * open; a docs page may mount dozens of endpoints × four sections and\n * mounting everything eagerly would churn on the first scroll pass. */\nexport function Section({ id, title, badge, children }: SectionProps) {\n const { endpointId, method } = useEndpointDocContext();\n const defaultOpen = defaultSectionOpen(method, id);\n const open = useIsSectionOpen(endpointId, id, defaultOpen);\n const toggleSection = useEndpointDocStore((s) => s.toggleSection);\n\n return (\n <div className=\"space-y-2.5\">\n <SectionHeader\n sectionId={id}\n title={title}\n badge={badge}\n open={open}\n onToggle={() => toggleSection(endpointId, id)}\n />\n {open && <div>{children}</div>}\n </div>\n );\n}\n","'use client';\n\nimport React from 'react';\n\nimport type { ApiEndpoint } from '../../../types';\nimport { endpointAnchor } from '../anchor';\nimport { CodeSamples } from './CodeSamples';\nimport { EndpointDocProvider } from './context';\nimport { EndpointHeader } from './Header';\nimport { Parameters } from './Parameters';\nimport { RequestBody } from './RequestBody';\nimport { Responses } from './Responses';\nimport { Section } from './Section';\nimport type { SectionId } from './types';\n\ninterface EndpointDocProps {\n endpoint: ApiEndpoint;\n /** Is this endpoint currently loaded in the sticky playground? */\n isLoadedInPlayground: boolean;\n onTryIt: () => void;\n /** Scoping prefix for the anchor, so endpoints from different schemas\n * don't collide on a single page. Falls back to ``endpoint.schemaId``. */\n schemaId?: string | null;\n}\n\n/** Card that documents one API endpoint: header + a stack of collapsible\n * sections (parameters, request body, responses, code samples). The\n * component itself is a thin orchestrator — each child folder owns its\n * own rendering concerns and reads the endpoint identity from context. */\nexport function EndpointDoc({ endpoint, isLoadedInPlayground, onTryIt, schemaId }: EndpointDocProps) {\n const scopedSchemaId = schemaId ?? endpoint.schemaId ?? null;\n const anchor = endpointAnchor(endpoint, scopedSchemaId);\n const pathParams = endpoint.parameters?.filter((p) => endpoint.path.includes(`{${p.name}}`)) ?? [];\n const queryParams = endpoint.parameters?.filter((p) => !endpoint.path.includes(`{${p.name}}`)) ?? [];\n\n const hasParameters = pathParams.length > 0 || queryParams.length > 0;\n const hasResponses = (endpoint.responses?.length ?? 0) > 0;\n\n // Collect section ids that actually render so the header's\n // expand/collapse-all toggle only touches visible sections.\n // ``codeSamples`` is always present — it synthesises a snippet\n // even for parameter-less endpoints.\n const presentSections: SectionId[] = [];\n if (hasParameters) presentSections.push('parameters');\n if (endpoint.requestBody) presentSections.push('requestBody');\n presentSections.push('codeSamples');\n if (hasResponses) presentSections.push('responses');\n\n return (\n <EndpointDocProvider endpointId={anchor} method={endpoint.method}>\n <section\n id={anchor}\n data-endpoint-anchor={anchor}\n data-schema-id={scopedSchemaId ?? ''}\n className=\"scroll-mt-24 py-10 first:pt-0\"\n >\n <EndpointHeader\n endpoint={endpoint}\n anchor={anchor}\n isLoadedInPlayground={isLoadedInPlayground}\n onTryIt={onTryIt}\n presentSections={presentSections}\n />\n\n <div className=\"mt-8 space-y-5\">\n {hasParameters && (\n <Section\n id=\"parameters\"\n title=\"Parameters\"\n badge={pathParams.length + queryParams.length}\n >\n <Parameters pathParams={pathParams} queryParams={queryParams} />\n </Section>\n )}\n {endpoint.requestBody && (\n <Section id=\"requestBody\" title=\"Request body\">\n <RequestBody body={endpoint.requestBody} />\n </Section>\n )}\n <Section id=\"codeSamples\" title=\"Code samples\">\n <CodeSamples endpoint={endpoint} />\n </Section>\n {hasResponses && (\n <Section\n id=\"responses\"\n title=\"Responses\"\n badge={endpoint.responses!.length}\n >\n <Responses responses={endpoint.responses!} />\n </Section>\n )}\n </div>\n </section>\n </EndpointDocProvider>\n );\n}\n","'use client';\n\nimport React, { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport type { ApiEndpoint, LoadedSchemaEntry, OpenApiInfo, OpenApiSchema } from '../../types';\nimport {\n getScrollParent,\n getScrollTop,\n getTargetTop,\n getViewportHeight,\n scrollTargetTo,\n type ScrollTarget,\n} from '../../utils/scrollParent';\nimport { deduplicateEndpoints } from '../../utils/versionManager';\nimport { ApiIntroSection } from './ApiIntroSection';\nimport { EndpointDoc } from './EndpointDoc';\nimport { useSectionHashRouter } from './EndpointDoc/hooks/useSectionHash';\nimport { SchemaCopyMenu } from './SchemaCopyMenu';\n\nexport interface DocsViewHandle {\n scrollToAnchor: (anchor: string) => void;\n}\n\n// ─── Props ───────────────────────────────────────────────────────────────────\n\ninterface SelectorProps {\n grouping?: 'selector';\n info: OpenApiInfo | null;\n rawSchema: OpenApiSchema | null;\n resolvedBaseUrl?: string;\n endpoints: ApiEndpoint[];\n selectedVersion: string;\n loadedEndpoint: ApiEndpoint | null;\n onTryEndpoint: (ep: ApiEndpoint) => void;\n onActiveChange: (anchor: string | null, schemaId: string | null) => void;\n}\n\ninterface SectionsProps {\n grouping: 'sections';\n /** Per-schema data (info + endpoints). Rendered in order. */\n schemasData: LoadedSchemaEntry[];\n selectedVersion: string;\n loadedEndpoint: ApiEndpoint | null;\n onTryEndpoint: (ep: ApiEndpoint) => void;\n onActiveChange: (anchor: string | null, schemaId: string | null) => void;\n}\n\ntype DocsViewProps = SelectorProps | SectionsProps;\n\n// ─── View-model types ────────────────────────────────────────────────────────\n\ninterface EndpointRow {\n key: string;\n endpoint: ApiEndpoint;\n isLoaded: boolean;\n schemaId: string | null;\n}\n\ntype SectionState =\n | { kind: 'ready'; rows: EndpointRow[] }\n | { kind: 'loading' }\n | { kind: 'error'; message: string }\n | { kind: 'empty' };\n\ninterface SchemaSectionVM {\n schemaId: string;\n title: string;\n version: string | null;\n description: string | null;\n state: SectionState;\n /** Copy-for-AI payload. ``null`` when the section is still loading\n * or failed — the dropdown stays disabled. */\n rawSchema: OpenApiSchema | null;\n baseUrl: string | undefined;\n allEndpoints: ApiEndpoint[];\n}\n\n// ─── Helpers ─────────────────────────────────────────────────────────────────\n\n/** Pixel offset from the top of the scroll container where the viewer\n * should \"park\" sections. Reads ``--navbar-height`` for back-compat\n * with pages that already set it; defaults to ``0`` for embedded /\n * no-navbar setups (the common case when hosted in a shell). */\nconst readNavbarOffset = () => {\n if (typeof document === 'undefined') return 0;\n const raw = getComputedStyle(document.documentElement).getPropertyValue('--navbar-height');\n const parsed = parseInt(raw || '', 10);\n return Number.isFinite(parsed) ? parsed : 0;\n};\n\nconst isSameEndpoint = (a: ApiEndpoint | null, b: ApiEndpoint) =>\n a !== null && a.method === b.method && a.path === b.path;\n\nfunction buildEndpointRow(\n ep: ApiEndpoint,\n loadedEndpoint: ApiEndpoint | null,\n schemaId: string | null,\n): EndpointRow {\n const keySchema = schemaId ? `${schemaId}-` : '';\n return {\n key: `${keySchema}${ep.method}-${ep.path}`,\n endpoint: ep,\n isLoaded: isSameEndpoint(loadedEndpoint, ep),\n schemaId,\n };\n}\n\nfunction buildSchemaSectionVM(\n entry: LoadedSchemaEntry,\n selectedVersion: string,\n loadedEndpoint: ApiEndpoint | null,\n): SchemaSectionVM {\n const title = entry.info?.title ?? entry.source.name;\n const version = entry.info?.version ?? null;\n const description = entry.info?.description ?? null;\n\n let state: SectionState;\n if (entry.loading) {\n state = { kind: 'loading' };\n } else if (entry.error) {\n state = { kind: 'error', message: entry.error };\n } else {\n const visible = deduplicateEndpoints(entry.endpoints, selectedVersion);\n state = visible.length === 0\n ? { kind: 'empty' }\n : {\n kind: 'ready',\n rows: visible.map((ep) => buildEndpointRow(ep, loadedEndpoint, entry.source.id)),\n };\n }\n\n return {\n schemaId: entry.source.id,\n title,\n version,\n description,\n state,\n rawSchema: entry.rawSchema,\n baseUrl: entry.resolvedBaseUrl,\n allEndpoints: entry.endpoints,\n };\n}\n\n// ─── Component ───────────────────────────────────────────────────────────────\n\nexport const DocsView = React.forwardRef<DocsViewHandle, DocsViewProps>(function DocsView(\n props,\n ref,\n) {\n const scrollRef = useRef<HTMLDivElement | null>(null);\n const scrollTargetRef = useRef<ScrollTarget | null>(null);\n const { onActiveChange } = props;\n\n // ``#section=<endpointId>.<sectionId>`` shareable deep-links —\n // opens the referenced section in the store and scrolls it in.\n // Idempotent, attaches a single hashchange listener.\n useSectionHashRouter();\n\n // Resolve the real scroll container once the ref is attached. In\n // standalone pages that's ``window``; inside an ``overflow-auto``\n // shell (dev playground, modal) it's the wrapping DIV.\n const ensureScrollTarget = useCallback((): ScrollTarget | null => {\n if (scrollTargetRef.current) return scrollTargetRef.current;\n if (!scrollRef.current) return null;\n scrollTargetRef.current = getScrollParent(scrollRef.current);\n return scrollTargetRef.current;\n }, []);\n\n // Scroll a given section into view. Works against whichever ancestor\n // actually scrolls — window for standalone, the overflow-auto parent\n // for embedded layouts — so callers don't need to know the difference.\n const scrollToAnchor = useCallback(\n (anchor: string) => {\n const root = scrollRef.current;\n if (!root) return;\n const el = root.querySelector<HTMLElement>(`[data-endpoint-anchor=\"${anchor}\"]`);\n if (!el) return;\n const target = ensureScrollTarget();\n if (!target) return;\n const navbar = readNavbarOffset();\n const top =\n el.getBoundingClientRect().top -\n getTargetTop(target) +\n getScrollTop(target) -\n navbar -\n 8;\n scrollTargetTo(target, top);\n },\n [ensureScrollTarget],\n );\n\n React.useImperativeHandle(ref, () => ({ scrollToAnchor }), [scrollToAnchor]);\n\n // Scrollspy: pick the topmost endpoint section whose top is near the\n // upper quarter of the viewport. Listens on the real scroll container\n // (see ``ensureScrollTarget``) because ``scroll`` events on a nested\n // overflow:auto element do NOT bubble up to window.\n useEffect(() => {\n const root = scrollRef.current;\n if (!root) return;\n const target = ensureScrollTarget();\n if (!target) return;\n\n let rafId = 0;\n let lastActive: string | null = null;\n\n const compute = () => {\n rafId = 0;\n const sections = root.querySelectorAll<HTMLElement>('[data-endpoint-anchor]');\n if (sections.length === 0) return;\n const navbar = readNavbarOffset();\n const viewportTop = getTargetTop(target);\n const threshold = viewportTop + navbar + getViewportHeight(target) * 0.25;\n let active: HTMLElement | null = null;\n for (const s of Array.from(sections)) {\n const top = s.getBoundingClientRect().top;\n if (top <= threshold) {\n active = s;\n } else {\n break;\n }\n }\n const anchor = active?.dataset.endpointAnchor ?? null;\n if (anchor !== lastActive) {\n lastActive = anchor;\n onActiveChange(anchor, active?.dataset.schemaId || null);\n }\n };\n\n const onScroll = () => {\n if (rafId) return;\n rafId = requestAnimationFrame(compute);\n };\n\n compute();\n target.addEventListener('scroll', onScroll, { passive: true });\n // Resize always bubbles to window — listen there regardless of target.\n window.addEventListener('resize', onScroll, { passive: true });\n return () => {\n target.removeEventListener('scroll', onScroll);\n window.removeEventListener('resize', onScroll);\n if (rafId) cancelAnimationFrame(rafId);\n };\n }, [onActiveChange, ensureScrollTarget, props]);\n\n if (props.grouping === 'sections') {\n return <SectionsBody scrollRef={scrollRef} {...props} />;\n }\n\n return <SelectorBody scrollRef={scrollRef} {...props} />;\n});\n\n// ─── Selector body (single active schema) ────────────────────────────────────\n\nfunction SelectorBody({\n scrollRef,\n info,\n rawSchema,\n resolvedBaseUrl,\n endpoints,\n selectedVersion,\n loadedEndpoint,\n onTryEndpoint,\n}: SelectorProps & { scrollRef: React.RefObject<HTMLDivElement | null> }) {\n const visibleEndpoints = useMemo(\n () => deduplicateEndpoints(endpoints, selectedVersion),\n [endpoints, selectedVersion],\n );\n\n const rows = useMemo<EndpointRow[]>(\n () => visibleEndpoints.map((ep) => buildEndpointRow(ep, loadedEndpoint, ep.schemaId ?? null)),\n [visibleEndpoints, loadedEndpoint],\n );\n\n const isEmpty = rows.length === 0;\n\n return (\n <div ref={scrollRef}>\n <div className=\"mx-auto w-full max-w-[860px] px-6 md:px-10 lg:px-14 py-12\">\n {info && (\n <ApiIntroSection\n info={info}\n schema={rawSchema}\n endpoints={visibleEndpoints}\n resolvedBaseUrl={resolvedBaseUrl}\n />\n )}\n {isEmpty ? (\n <div className=\"py-16 text-center text-sm text-muted-foreground\">\n No endpoints to display.\n </div>\n ) : (\n <div className=\"divide-y divide-border/60\">\n {rows.map((row) => (\n <EndpointDoc\n key={row.key}\n endpoint={row.endpoint}\n isLoadedInPlayground={row.isLoaded}\n onTryIt={() => onTryEndpoint(row.endpoint)}\n schemaId={row.schemaId}\n />\n ))}\n </div>\n )}\n </div>\n </div>\n );\n}\n\n// ─── Sections body (all schemas concatenated) ────────────────────────────────\n\nfunction SectionsBody({\n scrollRef,\n schemasData,\n selectedVersion,\n loadedEndpoint,\n onTryEndpoint,\n}: SectionsProps & { scrollRef: React.RefObject<HTMLDivElement | null> }) {\n const sections = useMemo<SchemaSectionVM[]>(\n () => schemasData.map((e) => buildSchemaSectionVM(e, selectedVersion, loadedEndpoint)),\n [schemasData, selectedVersion, loadedEndpoint],\n );\n\n return (\n <div ref={scrollRef}>\n <div className=\"mx-auto w-full max-w-[860px] px-6 md:px-10 lg:px-14 py-12 space-y-16\">\n {sections.map((section) => (\n <SchemaSectionView key={section.schemaId} section={section} onTryEndpoint={onTryEndpoint} />\n ))}\n </div>\n </div>\n );\n}\n\nconst SchemaSectionView = React.memo(function SchemaSectionView({\n section,\n onTryEndpoint,\n}: {\n section: SchemaSectionVM;\n onTryEndpoint: (ep: ApiEndpoint) => void;\n}) {\n const canCopy = section.rawSchema !== null && section.allEndpoints.length > 0;\n return (\n <section data-schema-anchor={section.schemaId} className=\"scroll-mt-20\">\n <header className=\"mb-8 pb-4 border-b\">\n <div className=\"flex items-start justify-between gap-4\">\n <div className=\"flex items-baseline gap-3 min-w-0\">\n <h2 className=\"text-2xl font-semibold tracking-tight\">{section.title}</h2>\n {section.version && (\n <span className=\"font-mono text-xs text-muted-foreground/70\">\n v{section.version}\n </span>\n )}\n </div>\n {canCopy && (\n <SchemaCopyMenu\n schema={section.rawSchema}\n endpoints={section.allEndpoints}\n baseUrl={section.baseUrl}\n />\n )}\n </div>\n {section.description && (\n <p className=\"mt-2 text-sm text-muted-foreground whitespace-pre-wrap\">\n {section.description}\n </p>\n )}\n </header>\n <SchemaSectionStateView section={section} onTryEndpoint={onTryEndpoint} />\n </section>\n );\n});\n\nfunction SchemaSectionStateView({\n section,\n onTryEndpoint,\n}: {\n section: SchemaSectionVM;\n onTryEndpoint: (ep: ApiEndpoint) => void;\n}) {\n switch (section.state.kind) {\n case 'loading':\n return (\n <div className=\"py-8 text-center text-sm text-muted-foreground\">\n Loading {section.title}…\n </div>\n );\n case 'error':\n return (\n <div className=\"py-8 text-center text-sm text-destructive\">\n Failed to load {section.title}: {section.state.message}\n </div>\n );\n case 'empty':\n return (\n <div className=\"py-8 text-center text-sm text-muted-foreground\">\n No endpoints in this schema.\n </div>\n );\n case 'ready':\n return (\n <div className=\"divide-y divide-border/60\">\n {section.state.rows.map((row) => (\n <EndpointDoc\n key={row.key}\n endpoint={row.endpoint}\n isLoadedInPlayground={row.isLoaded}\n onTryIt={() => onTryEndpoint(row.endpoint)}\n schemaId={row.schemaId}\n />\n ))}\n </div>\n );\n }\n}\n","'use client';\n\n/**\n * Form-based request body editor driven by JSON Schema.\n *\n * Replaces the ``{\"key\":\"value\"}`` textarea prompt with a real form:\n * one input per property, typed widgets for primitives, nested objects\n * indented, arrays with add/remove. The component is controlled — the\n * parent owns the body value (as any JSON) and persists to localStorage.\n *\n * Intentionally not a full JSON-Schema-Form: we don't cover oneOf/anyOf,\n * pattern validation, min/max — the playground just needs a usable\n * interactive shape. Users who hit a corner case can flip the ``JSON``\n * toggle in RequestPanel and edit raw.\n */\n\nimport { Minus, Plus } from 'lucide-react';\nimport React, { useCallback } from 'react';\n\nimport { Combobox, Input, Switch, Textarea } from '@djangocfg/ui-core/components';\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport { SectionLabel } from './ui';\n\ntype JsonSchemaNode = Record<string, unknown> & {\n type?: string;\n properties?: Record<string, JsonSchemaNode>;\n required?: string[];\n items?: JsonSchemaNode;\n enum?: unknown[];\n description?: string;\n format?: string;\n};\n\nconst MAX_DEPTH = 6;\n\n// ─── Value helpers ────────────────────────────────────────────────────────────\n\nfunction defaultForSchema(schema: JsonSchemaNode | undefined): unknown {\n if (!schema) return null;\n if (Array.isArray(schema.enum) && schema.enum.length > 0) return schema.enum[0];\n switch (schema.type) {\n case 'object': {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(schema.properties ?? {})) {\n out[k] = defaultForSchema(v);\n }\n return out;\n }\n case 'array':\n return [];\n case 'integer':\n case 'number':\n return 0;\n case 'boolean':\n return false;\n case 'string':\n return '';\n default:\n if (schema.properties) {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(schema.properties)) {\n out[k] = defaultForSchema(v);\n }\n return out;\n }\n return '';\n }\n}\n\n// ─── Root ─────────────────────────────────────────────────────────────────────\n\nexport interface BodyFormEditorProps {\n schema: JsonSchemaNode;\n value: unknown;\n onChange: (next: unknown) => void;\n}\n\nexport function BodyFormEditor({ schema, value, onChange }: BodyFormEditorProps) {\n return (\n <SchemaField\n schema={schema}\n value={value}\n onChange={onChange}\n depth={0}\n required={false}\n />\n );\n}\n\n// ─── Recursive renderer ───────────────────────────────────────────────────────\n\ninterface SchemaFieldProps {\n schema: JsonSchemaNode;\n value: unknown;\n onChange: (next: unknown) => void;\n depth: number;\n required: boolean;\n label?: string;\n}\n\nfunction SchemaField({ schema, value, onChange, depth, required, label }: SchemaFieldProps) {\n // Depth cutoff: collapse further nesting into a raw JSON textarea —\n // deeper forms get impossible to navigate and lose value for the UX\n // we're trying to offer (quick exploration).\n if (depth > MAX_DEPTH) {\n return <RawJsonField label={label} value={value} onChange={onChange} />;\n }\n\n if (Array.isArray(schema.enum) && schema.enum.length > 0) {\n return <EnumField schema={schema} value={value} onChange={onChange} label={label} required={required} />;\n }\n\n switch (schema.type) {\n case 'object':\n return <ObjectField schema={schema} value={value} onChange={onChange} depth={depth} label={label} />;\n case 'array':\n return <ArrayField schema={schema} value={value} onChange={onChange} depth={depth} label={label} required={required} />;\n case 'boolean':\n return <BooleanField value={value} onChange={onChange} label={label} schema={schema} required={required} />;\n case 'integer':\n case 'number':\n return <NumberField value={value} onChange={onChange} label={label} schema={schema} required={required} />;\n case 'string':\n default:\n // Untyped / string-ish — plain text input. Covers the\n // \"body is a free-form string\" case too (e.g. text/plain).\n if (!schema.type && schema.properties) {\n return <ObjectField schema={schema} value={value} onChange={onChange} depth={depth} label={label} />;\n }\n return <StringField value={value} onChange={onChange} label={label} schema={schema} required={required} />;\n }\n}\n\n// ─── Primitive widgets ────────────────────────────────────────────────────────\n\nfunction FieldHeader({\n label,\n type,\n required,\n description,\n}: {\n label?: string;\n type: string;\n required: boolean;\n description?: string;\n}) {\n if (!label) return null;\n return (\n <div className=\"space-y-0.5\">\n <div className=\"flex items-baseline gap-1.5\">\n <span className=\"font-mono text-[11px] text-foreground/80\">{label}</span>\n {required && <span className=\"text-[9px] text-destructive font-bold leading-none\">*</span>}\n <span className=\"font-mono text-[10px] text-muted-foreground/50\">{type}</span>\n </div>\n {description && (\n <p className=\"text-[10px] text-muted-foreground/70 leading-snug\">{description}</p>\n )}\n </div>\n );\n}\n\nfunction StringField({\n value, onChange, label, schema, required,\n}: {\n value: unknown;\n onChange: (next: string) => void;\n label?: string;\n schema: JsonSchemaNode;\n required: boolean;\n}) {\n const stringValue = typeof value === 'string' ? value : value == null ? '' : String(value);\n const placeholder = schema.format ? `${schema.type ?? 'string'} (${schema.format})` : schema.description || schema.type || 'string';\n return (\n <div className=\"space-y-1\">\n <FieldHeader label={label} type={schema.format ? `string (${schema.format})` : 'string'} required={required} description={schema.description} />\n <Input\n value={stringValue}\n onChange={(e) => onChange(e.target.value)}\n placeholder={placeholder}\n className=\"h-8 text-xs font-mono\"\n />\n </div>\n );\n}\n\nfunction NumberField({\n value, onChange, label, schema, required,\n}: {\n value: unknown;\n onChange: (next: number | null) => void;\n label?: string;\n schema: JsonSchemaNode;\n required: boolean;\n}) {\n const raw = value == null ? '' : String(value);\n const type = schema.type === 'integer' ? 'integer' : 'number';\n return (\n <div className=\"space-y-1\">\n <FieldHeader label={label} type={schema.format ? `${type} (${schema.format})` : type} required={required} description={schema.description} />\n <Input\n type=\"number\"\n value={raw}\n onChange={(e) => {\n const v = e.target.value;\n if (v === '') return onChange(null);\n const n = schema.type === 'integer' ? parseInt(v, 10) : parseFloat(v);\n onChange(Number.isNaN(n) ? null : n);\n }}\n placeholder={type}\n className=\"h-8 text-xs font-mono\"\n />\n </div>\n );\n}\n\nfunction BooleanField({\n value, onChange, label, schema, required,\n}: {\n value: unknown;\n onChange: (next: boolean) => void;\n label?: string;\n schema: JsonSchemaNode;\n required: boolean;\n}) {\n const bool = value === true;\n return (\n <div className=\"flex items-start justify-between gap-3\">\n <FieldHeader label={label} type=\"boolean\" required={required} description={schema.description} />\n <Switch checked={bool} onCheckedChange={onChange} className=\"mt-0.5 shrink-0\" />\n </div>\n );\n}\n\nfunction EnumField({\n schema, value, onChange, label, required,\n}: {\n schema: JsonSchemaNode;\n value: unknown;\n onChange: (next: unknown) => void;\n label?: string;\n required: boolean;\n}) {\n const options = (schema.enum ?? []).map((v) => ({\n value: String(v),\n label: String(v),\n }));\n const strValue = value == null ? '' : String(value);\n return (\n <div className=\"space-y-1\">\n <FieldHeader label={label} type={`${schema.type ?? 'enum'} enum`} required={required} description={schema.description} />\n <Combobox\n options={options}\n value={strValue}\n onValueChange={(v) => {\n // Preserve original type if schema declares integer/number.\n if (schema.type === 'integer') onChange(parseInt(v, 10));\n else if (schema.type === 'number') onChange(parseFloat(v));\n else onChange(v);\n }}\n placeholder=\"Select…\"\n searchPlaceholder=\"Search…\"\n className=\"h-8 text-xs\"\n />\n </div>\n );\n}\n\nfunction RawJsonField({\n label, value, onChange,\n}: {\n label?: string;\n value: unknown;\n onChange: (next: unknown) => void;\n}) {\n const [text, setText] = React.useState(() => JSON.stringify(value ?? null, null, 2));\n // Resync when value changes from outside (e.g. endpoint switch).\n React.useEffect(() => {\n setText(JSON.stringify(value ?? null, null, 2));\n }, [value]);\n return (\n <div className=\"space-y-1\">\n {label && <SectionLabel>{label} (raw)</SectionLabel>}\n <Textarea\n value={text}\n onChange={(e) => {\n setText(e.target.value);\n try { onChange(JSON.parse(e.target.value)); } catch { /* keep last valid */ }\n }}\n className=\"font-mono text-[11px] min-h-[80px]\"\n rows={4}\n />\n </div>\n );\n}\n\n// ─── Composite widgets ────────────────────────────────────────────────────────\n\nfunction ObjectField({\n schema, value, onChange, depth, label,\n}: {\n schema: JsonSchemaNode;\n value: unknown;\n onChange: (next: Record<string, unknown>) => void;\n depth: number;\n label?: string;\n}) {\n const obj = (value && typeof value === 'object' && !Array.isArray(value))\n ? (value as Record<string, unknown>)\n : {};\n const required = new Set(schema.required ?? []);\n const entries = Object.entries(schema.properties ?? {});\n\n const setKey = useCallback(\n (key: string) => (next: unknown) => {\n onChange({ ...obj, [key]: next });\n },\n [obj, onChange],\n );\n\n if (entries.length === 0) {\n return <RawJsonField label={label} value={obj} onChange={onChange as (v: unknown) => void} />;\n }\n\n // Root-level object (depth === 0) renders flat; nested gets an\n // indented, bordered group so the hierarchy is visible.\n const wrapperClass = depth === 0\n ? 'space-y-3'\n : 'space-y-2 border-l-2 border-border/60 pl-3 ml-px';\n\n return (\n <div className=\"space-y-1.5\">\n {label && depth > 0 && (\n <div className=\"flex items-baseline gap-1.5\">\n <span className=\"font-mono text-[11px] text-foreground/80\">{label}</span>\n <span className=\"font-mono text-[10px] text-muted-foreground/50\">object</span>\n </div>\n )}\n <div className={cn(wrapperClass)}>\n {entries.map(([key, subSchema]) => (\n <SchemaField\n key={key}\n schema={subSchema}\n value={obj[key]}\n onChange={setKey(key)}\n depth={depth + 1}\n required={required.has(key)}\n label={key}\n />\n ))}\n </div>\n </div>\n );\n}\n\nfunction ArrayField({\n schema, value, onChange, depth, label, required,\n}: {\n schema: JsonSchemaNode;\n value: unknown;\n onChange: (next: unknown[]) => void;\n depth: number;\n label?: string;\n required: boolean;\n}) {\n const arr = Array.isArray(value) ? value : [];\n const items = schema.items ?? { type: 'string' };\n\n const addItem = () => onChange([...arr, defaultForSchema(items)]);\n const removeAt = (i: number) => onChange(arr.filter((_, idx) => idx !== i));\n const setAt = (i: number) => (next: unknown) =>\n onChange(arr.map((v, idx) => (idx === i ? next : v)));\n\n return (\n <div className=\"space-y-1.5\">\n {label && (\n <div className=\"flex items-baseline gap-1.5\">\n <span className=\"font-mono text-[11px] text-foreground/80\">{label}</span>\n {required && <span className=\"text-[9px] text-destructive font-bold leading-none\">*</span>}\n <span className=\"font-mono text-[10px] text-muted-foreground/50\">\n {`array<${items.type ?? 'any'}>`}\n </span>\n </div>\n )}\n <div className=\"space-y-2 border-l-2 border-border/60 pl-3 ml-px\">\n {arr.length === 0 && (\n <p className=\"text-[10px] text-muted-foreground/50 italic\">Empty array</p>\n )}\n {arr.map((v, i) => (\n <div key={i} className=\"flex items-start gap-2\">\n <div className=\"flex-1 min-w-0\">\n <SchemaField\n schema={items}\n value={v}\n onChange={setAt(i)}\n depth={depth + 1}\n required={false}\n label={`${label ?? ''}[${i}]`}\n />\n </div>\n <button\n type=\"button\"\n onClick={() => removeAt(i)}\n title=\"Remove item\"\n className=\"shrink-0 h-7 w-7 inline-flex items-center justify-center rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors\"\n >\n <Minus className=\"h-3.5 w-3.5\" />\n </button>\n </div>\n ))}\n <button\n type=\"button\"\n onClick={addItem}\n className=\"inline-flex items-center gap-1.5 text-[10px] text-muted-foreground hover:text-foreground transition-colors py-1\"\n >\n <Plus className=\"h-3 w-3\" />\n Add item\n </button>\n </div>\n </div>\n );\n}\n","'use client';\n\nimport { RotateCcw } from 'lucide-react';\nimport React, { useCallback } from 'react';\n\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport { usePlaygroundContext } from '../../context/PlaygroundContext';\nimport { useEndpointDraft } from '../../hooks/useEndpointDraft';\n\n/**\n * \"Reset\" ghost button for the current endpoint's draft.\n *\n * Wipes both the in-memory context state (parameters + body) and the\n * persisted localStorage entry. We call reset() *after* clearing the\n * context so the EndpointDraftSync effect that mirrors state → storage\n * doesn't immediately re-create a now-empty draft with an empty object\n * (benign, but uglier in storage).\n */\nexport function EndpointResetButton() {\n const { state, setParameters, setRequestBody } = usePlaygroundContext();\n const ep = state.selectedEndpoint;\n const { reset } = useEndpointDraft(state.activeSchemaId, ep);\n\n const hasDraft =\n Object.keys(state.parameters).length > 0 || state.requestBody.length > 0;\n\n const onClick = useCallback(() => {\n setParameters({});\n setRequestBody('');\n reset();\n }, [setParameters, setRequestBody, reset]);\n\n if (!ep || !hasDraft) return null;\n\n return (\n <button\n type=\"button\"\n onClick={onClick}\n title=\"Reset parameters & body (keeps auth)\"\n className={cn(\n 'inline-flex items-center gap-1 text-[10px] text-muted-foreground',\n 'hover:text-foreground transition-colors',\n )}\n >\n <RotateCcw className=\"h-2.5 w-2.5\" />\n Reset\n </button>\n );\n}\n","'use client';\n\nimport { Key, Send, Sparkles, Terminal } from 'lucide-react';\nimport React, { useCallback, useMemo } from 'react';\n\nimport {\n Combobox,\n type ComboboxOption,\n Input,\n Textarea,\n} from '@djangocfg/ui-core/components';\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport PrettyCode from '../../../PrettyCode';\nimport { usePlaygroundContext } from '../../context/PlaygroundContext';\nimport { findApiKeyById, isValidJson, parseRequestHeaders } from '../../utils';\nimport { resolveAbsolute } from '../../utils/url';\nimport { BodyFormEditor } from './BodyFormEditor';\nimport { EndpointResetButton } from './EndpointResetButton';\nimport {\n CollapsibleSection,\n EmptyState,\n ScrollArea,\n SectionLabel,\n relativePath,\n} from './ui';\n\n// ─── Param fields ─────────────────────────────────────────────────────────────\n\ntype Param = { name: string; type: string; required: boolean; description?: string };\n\nfunction ParamFields({ label, params }: { label: string; params: Param[] }) {\n const { state, setParameters } = usePlaygroundContext();\n\n function handleChange(name: string, value: string) {\n setParameters({ ...state.parameters, [name]: value });\n }\n\n return (\n <div className=\"space-y-2\">\n <SectionLabel>{label}</SectionLabel>\n <div className=\"space-y-2\">\n {params.map((p) => {\n const value = state.parameters[p.name] ?? '';\n const placeholder = p.description || p.name;\n return (\n <div key={p.name} className=\"space-y-1\">\n <div className=\"flex items-center gap-1.5\">\n <span className=\"font-mono text-[11px] text-foreground/80\">{p.name}</span>\n {p.required && (\n <span className=\"text-[9px] text-destructive font-bold leading-none\">*</span>\n )}\n <span className=\"font-mono text-[10px] text-muted-foreground/50\">{p.type}</span>\n </div>\n <Input\n value={value}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) =>\n handleChange(p.name, e.target.value)\n }\n placeholder={placeholder}\n className=\"h-8 text-xs font-mono\"\n />\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\n// ─── RequestPanel ─────────────────────────────────────────────────────────────\n\nexport function RequestPanel() {\n const {\n state,\n apiKeys,\n apiKeysLoading,\n setRequestBody,\n setRequestHeaders,\n setSelectedApiKey,\n setManualApiToken,\n sendRequest,\n } = usePlaygroundContext();\n\n // Pre-compute every per-key view-model so the JSX stays a flat\n // render — no boolean math in the markup.\n const apiKeyOptions: ComboboxOption[] = useMemo(\n () =>\n apiKeys.map((k) => ({\n value: k.id,\n label: k.name || 'Unnamed key',\n // Surface the first 8 chars of the secret so the user\n // can tell two similarly-named keys apart at a glance.\n description: k.secret\n ? `${k.secret.slice(0, 8)}…`\n : undefined,\n })),\n [apiKeys],\n );\n const hasApiKeys = apiKeyOptions.length > 0;\n\n const ep = state.selectedEndpoint;\n\n // ── Data (hooks must not be conditional) ─────────────────────────────────\n const isJsonValid = state.requestBody ? isValidJson(state.requestBody) : true;\n\n const curlCommand = useMemo(() => {\n if (!state.requestUrl) return '';\n // Resolve to an absolute URL so the snippet is runnable from a\n // shell. The live ``fetch`` inside the playground resolves the\n // relative form itself via the browser; copy-pasting to curl\n // doesn't get that treatment.\n const absoluteUrl = resolveAbsolute(state.requestUrl);\n const apiKey = state.selectedApiKey ? findApiKeyById(apiKeys, state.selectedApiKey) : null;\n const hdrs = parseRequestHeaders(state.requestHeaders);\n if (apiKey) hdrs['X-API-Key'] = apiKey.secret || apiKey.id;\n let cmd = `curl -X ${state.requestMethod} \"${absoluteUrl}\"`;\n Object.entries(hdrs).forEach(([k, v]) => { cmd += ` \\\\\\n -H \"${k}: ${v}\"`; });\n if (state.requestBody && state.requestMethod !== 'GET' && isJsonValid) {\n cmd += ` \\\\\\n -d '${state.requestBody}'`;\n }\n return cmd;\n }, [state, apiKeys, isJsonValid]);\n\n const pathParams = useMemo(\n () => ep?.parameters?.filter((p) => ep.path.includes(`{${p.name}}`)) ?? [],\n [ep],\n );\n const queryParams = useMemo(\n () => ep?.parameters?.filter((p) => !ep.path.includes(`{${p.name}}`)) ?? [],\n [ep],\n );\n\n // ── Derived ───────────────────────────────────────────────────────────────\n const isSendDisabled = state.loading || !state.requestUrl || !isJsonValid;\n // Show the absolute URL in the meta row so the user sees exactly\n // what will go over the wire — same rewrite we do for cURL.\n const displayUrl = resolveAbsolute(state.requestUrl || ep?.path || '');\n const hasBody = ep?.method !== 'GET';\n const bodyType = ep?.requestBody?.type ?? '';\n const hasPathParams = pathParams.length > 0;\n const hasQueryParams = queryParams.length > 0;\n const hasCurl = Boolean(curlCommand);\n const epPath = ep ? relativePath(ep.path) : '';\n // Show the URL meta row only when it differs from the endpoint's\n // template shape — i.e. the user has substituted path params or the\n // URL host is worth showing explicitly.\n const urlChanged = displayUrl !== '' && displayUrl !== epPath;\n\n // ── Early return ──────────────────────────────────────────────────────────\n if (!ep) {\n return <EmptyState icon={Send} text=\"Select an endpoint to build a request\" />;\n }\n\n // ── Render ────────────────────────────────────────────────────────────────\n return (\n <>\n {/* Inline meta row — shows the effective URL when it differs\n from the endpoint's path template (e.g. after substituting\n path parameters), plus the Reset action. We dropped the\n full endpoint header because the containing surface (SidePanel\n in docs layout, column header in classic layout) already\n shows the method + path, and duplicating the Send button\n next to a full-width Send at the bottom read as confusing. */}\n {(urlChanged || ep) && (\n <div className=\"shrink-0 border-b px-4 py-2 bg-muted/10 flex items-center gap-2 min-h-[28px]\">\n {urlChanged ? (\n <span className=\"font-mono text-[10px] text-muted-foreground/60 break-all leading-snug truncate min-w-0 flex-1\">\n {displayUrl}\n </span>\n ) : (\n <span className=\"flex-1\" />\n )}\n <EndpointResetButton />\n </div>\n )}\n\n {/* Scrollable fields */}\n <ScrollArea className=\"px-4 py-3 space-y-3\">\n\n {hasPathParams && <ParamFields label=\"Path Parameters\" params={pathParams} />}\n {hasQueryParams && <ParamFields label=\"Query Parameters\" params={queryParams} />}\n\n {/* Body */}\n {hasBody && (\n <BodySection\n schema={ep.requestBody?.schema}\n bodyType={bodyType}\n bodyDescription={ep.requestBody?.description}\n value={state.requestBody}\n onChange={setRequestBody}\n isJsonValid={isJsonValid}\n />\n )}\n\n {/* Auth & Headers — collapsed by default */}\n <CollapsibleSection\n label={\n <span className=\"inline-flex items-center gap-1\">\n <Key className=\"h-2.5 w-2.5\" />\n Auth & Headers\n </span>\n }\n >\n <div className=\"space-y-3 pt-2\">\n <div className=\"space-y-1.5\">\n <SectionLabel>API Key</SectionLabel>\n <Combobox\n options={apiKeyOptions}\n value={state.selectedApiKey ?? ''}\n onValueChange={(v) => setSelectedApiKey(v || null)}\n placeholder={\n apiKeysLoading\n ? 'Loading keys…'\n : hasApiKeys\n ? 'Select an API key'\n : 'No API keys yet'\n }\n searchPlaceholder=\"Search keys…\"\n emptyText=\"No matching key\"\n disabled={apiKeysLoading || !hasApiKeys}\n className=\"h-8\"\n />\n <p className=\"text-[10px] text-muted-foreground\">\n Picks are sent via the{' '}\n <span className=\"font-mono\">X-API-Key</span> header.\n </p>\n </div>\n <div className=\"space-y-1.5\">\n <SectionLabel>Bearer Token</SectionLabel>\n <Input\n type=\"password\"\n placeholder=\"Leave empty to use JWT from localStorage\"\n value={state.manualApiToken}\n onChange={(e) => setManualApiToken(e.target.value)}\n className=\"font-mono text-xs h-8\"\n />\n </div>\n <div className=\"space-y-1.5\">\n <SectionLabel>Headers</SectionLabel>\n <Textarea\n value={state.requestHeaders}\n onChange={(e) => setRequestHeaders(e.target.value)}\n className=\"font-mono text-[11px] min-h-[60px] resize-y\"\n rows={3}\n />\n </div>\n </div>\n </CollapsibleSection>\n\n {/* cURL — collapsed by default. PrettyCode has its own\n hover-toolbar with Copy, so no duplicate action here. */}\n {hasCurl && (\n <CollapsibleSection\n label={\n <span className=\"inline-flex items-center gap-1\">\n <Terminal className=\"h-2.5 w-2.5\" />\n cURL\n </span>\n }\n >\n <div className=\"mt-2\">\n <PrettyCode\n data={curlCommand}\n language=\"bash\"\n isCompact\n maxLines={50}\n />\n </div>\n </CollapsibleSection>\n )}\n\n {/* Bottom breathing room — the Send footer lives outside\n this component (in SlideInPlayground / TryItSheet),\n so we just leave a little space so the last section\n doesn't crash against the container edge. */}\n <div className=\"h-4\" />\n </ScrollArea>\n </>\n );\n}\n\n// ─── Body section ─────────────────────────────────────────────────────────────\n\ninterface BodySectionProps {\n schema: Record<string, unknown> | undefined;\n bodyType: string;\n bodyDescription?: string;\n /** JSON-serialised body kept in context. Form edits are re-serialised\n * before being written back so one source of truth survives across\n * the two view modes. */\n value: string;\n onChange: (raw: string) => void;\n isJsonValid: boolean;\n}\n\ntype BodyViewMode = 'form' | 'json';\n\nfunction BodySection({ schema, bodyType, bodyDescription, value, onChange, isJsonValid }: BodySectionProps) {\n // Default to form view when we have a schema to drive it. Fall back\n // to raw JSON for schemaless endpoints (or binary bodies, etc.).\n const hasSchema = !!schema;\n const [mode, setMode] = React.useState<BodyViewMode>(hasSchema ? 'form' : 'json');\n\n // Parse the context's JSON string once per value change so the form\n // sees a structured object. Invalid JSON is tolerated — the form\n // simply shows empty fields until the user fixes it.\n const parsed = React.useMemo(() => {\n if (!value) return null;\n try { return JSON.parse(value); } catch { return null; }\n }, [value]);\n\n const handleFormChange = useCallback(\n (next: unknown) => {\n onChange(JSON.stringify(next, null, 2));\n },\n [onChange],\n );\n\n return (\n <div className=\"space-y-2\">\n <div className=\"flex items-center justify-between gap-2 flex-wrap\">\n <div className=\"flex items-baseline gap-2 min-w-0\">\n <SectionLabel>Body</SectionLabel>\n {bodyType && (\n <span className=\"text-[10px] text-muted-foreground/40 font-mono\">{bodyType}</span>\n )}\n {bodyDescription && (\n <span className=\"text-[10px] text-muted-foreground/60 truncate\">{bodyDescription}</span>\n )}\n </div>\n {hasSchema && (\n <div className=\"inline-flex rounded-md border overflow-hidden text-[10px]\">\n <ModeButton active={mode === 'form'} onClick={() => setMode('form')}>Form</ModeButton>\n <ModeButton active={mode === 'json'} onClick={() => setMode('json')}>JSON</ModeButton>\n </div>\n )}\n {mode === 'json' && isJsonValid && value && (\n <button\n type=\"button\"\n onClick={() => {\n try { onChange(JSON.stringify(JSON.parse(value), null, 2)); } catch { /* noop */ }\n }}\n className=\"inline-flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors\"\n >\n <Sparkles className=\"h-2.5 w-2.5\" />\n Format\n </button>\n )}\n </div>\n\n {mode === 'form' && hasSchema ? (\n <BodyFormEditor\n schema={schema as Record<string, unknown>}\n value={parsed}\n onChange={handleFormChange}\n />\n ) : (\n <>\n <Textarea\n placeholder={'{\\n \"key\": \"value\"\\n}'}\n value={value}\n onChange={(e) => onChange(e.target.value)}\n className={cn(\n 'font-mono text-[11px] min-h-[90px] resize-y',\n !isJsonValid && 'border-destructive focus-visible:ring-destructive/30',\n )}\n rows={4}\n />\n {!isJsonValid && <p className=\"text-[10px] text-destructive\">Invalid JSON</p>}\n </>\n )}\n </div>\n );\n}\n\nfunction ModeButton({\n active, onClick, children,\n}: {\n active: boolean;\n onClick: () => void;\n children: React.ReactNode;\n}) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className={cn(\n 'px-2 py-0.5 font-medium transition-colors',\n active\n ? 'bg-primary/10 text-foreground'\n : 'text-muted-foreground hover:text-foreground',\n )}\n >\n {children}\n </button>\n );\n}\n","'use client';\n\nimport { Info, ShieldCheck } from 'lucide-react';\nimport { useMemo } from 'react';\n\ninterface PreviewViewProps {\n html: string;\n}\n\n/** Heuristic: does ``html`` look like a JS-only single-page app shell?\n *\n * SPAs (Vite, CRA, Next-app dev index) ship a near-empty ``<body>``\n * with a mount div + a ``<script type=\"module\">`` that hydrates the\n * page at runtime. Previewing those in a ``sandbox=\"\"`` iframe is\n * pointless because scripts can't run — the reader sees a blank\n * page and assumes preview is broken.\n *\n * We detect this by extracting body content, stripping scripts, and\n * checking what's left. If it's basically just a mount div, we show\n * an explanatory empty-state instead of an empty iframe. */\nfunction looksLikeSpaShell(html: string): boolean {\n const bodyMatch = html.match(/<body[^>]*>([\\s\\S]*?)<\\/body>/i);\n const bodyContent = (bodyMatch?.[1] ?? html)\n // Strip all script tags with their contents — runtime-only code\n // doesn't count as visible markup for this check.\n .replace(/<script[\\s\\S]*?<\\/script>/gi, '')\n // Strip comments.\n .replace(/<!--[\\s\\S]*?-->/g, '')\n .trim();\n\n if (bodyContent.length === 0) return true;\n\n // A single empty container (``<div id=\"root\"></div>`` and friends)\n // is the classic SPA mount point. Anything else — including static\n // server-rendered pages with real content — won't match.\n const singleEmptyContainer = /^<(div|main|section)[^>]*>\\s*<\\/\\1>$/i;\n if (singleEmptyContainer.test(bodyContent)) return true;\n\n return false;\n}\n\n/** Render an HTML response inside a sandboxed iframe so the reader can\n * see what the server's error page or template actually looks like.\n *\n * Security model — ``sandbox`` is intentionally **empty**:\n * - no ``allow-scripts`` → JavaScript in the response cannot run\n * - no ``allow-same-origin`` → the page can't read parent cookies\n * - no ``allow-forms`` / ``allow-popups`` → can't phish the user\n *\n * We feed the HTML via ``srcDoc`` (not ``src``) so we never issue a\n * network request to render it — the string is already local. */\nexport function PreviewView({ html }: PreviewViewProps) {\n const isSpaShell = useMemo(() => looksLikeSpaShell(html), [html]);\n\n if (!html) {\n return (\n <div className=\"py-10 text-center text-xs text-muted-foreground\">\n Empty response body\n </div>\n );\n }\n\n if (isSpaShell) {\n return (\n <div className=\"flex flex-col items-center justify-center py-16 px-6 text-center gap-3 min-h-[400px]\">\n <div className=\"inline-flex items-center justify-center h-10 w-10 rounded-full bg-muted\">\n <Info className=\"h-5 w-5 text-muted-foreground\" />\n </div>\n <div className=\"max-w-sm space-y-1.5\">\n <p className=\"text-sm font-medium text-foreground\">\n Looks like a single-page app shell\n </p>\n <p className=\"text-xs text-muted-foreground leading-relaxed\">\n This page renders its content with JavaScript at runtime.\n Scripts are disabled in the sandbox, so Preview would show\n a blank page. Switch to <strong>Pretty</strong> or{' '}\n <strong>Raw</strong> to inspect the HTML source.\n </p>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"flex flex-col h-full min-h-[400px]\">\n <div className=\"shrink-0 flex items-center gap-1.5 px-3 py-1.5 bg-muted/30 border-b text-[10px] text-muted-foreground/70\">\n <ShieldCheck className=\"h-3 w-3\" />\n Sandboxed preview — scripts, forms and popups are disabled\n </div>\n {/*\n * Checker-pattern background so \"black on black\" responses\n * still show a clear iframe bounding box, and so readers\n * can tell the iframe has loaded even if the page itself\n * is empty / fully transparent.\n */}\n <div\n className=\"flex-1 min-h-[360px] p-2\"\n style={{\n backgroundColor: '#fff',\n backgroundImage:\n 'linear-gradient(45deg, #f3f4f6 25%, transparent 25%), linear-gradient(-45deg, #f3f4f6 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #f3f4f6 75%), linear-gradient(-45deg, transparent 75%, #f3f4f6 75%)',\n backgroundSize: '16px 16px',\n backgroundPosition: '0 0, 0 8px, 8px -8px, -8px 0px',\n }}\n >\n <iframe\n title=\"Response preview\"\n srcDoc={html}\n sandbox=\"\"\n className=\"w-full h-full min-h-[360px] bg-white border-0 rounded shadow-sm\"\n />\n </div>\n </div>\n );\n}\n","'use client';\n\nimport JsonTree from '../../../../JsonTree';\nimport PrettyCode from '../../../../PrettyCode';\nimport type { DetectedContent } from './types';\n\n// JsonTree config — same shape as the interactive docs example view\n// but with ``showActionButtons: false`` because the copy button in the\n// StatusBar already covers that flow.\nconst JSON_TREE_CONFIG = {\n maxAutoExpandDepth: 2,\n maxAutoExpandArrayItems: 10,\n maxAutoExpandObjectKeys: 5,\n maxStringLength: 200,\n collectionLimit: 50,\n showCollectionInfo: true,\n showExpandControls: true,\n showActionButtons: false,\n preserveKeyOrder: true,\n className: 'border-0 rounded-none',\n} as const;\n\ninterface PrettyViewProps {\n /** Parsed JSON tree when the body was JSON. */\n treeData: unknown;\n /** Pre-stringified body — used by the code-highlight branch for\n * non-JSON payloads. */\n rawText: string;\n detected: DetectedContent;\n}\n\n/** \"Pretty\" view — rich-rendering branch. JSON renders as ``JsonTree``;\n * anything else goes through ``PrettyCode`` in ``plain`` variant so it\n * flows naturally inside the panel's ``ScrollArea`` — no internal\n * scroll, no floating toolbar fighting the surrounding layout. */\nexport function PrettyView({ treeData, rawText, detected }: PrettyViewProps) {\n if (detected.kind === 'json' && treeData != null) {\n return <JsonTree title=\"Response Body\" data={treeData} config={JSON_TREE_CONFIG} />;\n }\n if (!rawText) {\n return (\n <div className=\"py-10 text-center text-xs text-muted-foreground\">\n Empty response body\n </div>\n );\n }\n return (\n <PrettyCode\n data={rawText}\n language={detected.prism}\n variant=\"plain\"\n isCompact\n />\n );\n}\n","'use client';\n\ninterface RawViewProps {\n rawText: string;\n}\n\n/** Verbatim response body. No parsing, no highlighting — readers\n * occasionally need to inspect trailing whitespace, escape\n * sequences, or a payload that accidentally claims one content type\n * and ships another, and the Pretty view hides some of that. */\nexport function RawView({ rawText }: RawViewProps) {\n if (!rawText) {\n return (\n <div className=\"py-10 text-center text-xs text-muted-foreground\">\n Empty response body\n </div>\n );\n }\n return (\n <pre className=\"p-4 text-[11px] font-mono text-foreground/70 whitespace-pre-wrap break-all leading-relaxed\">\n {rawText}\n </pre>\n );\n}\n","'use client';\n\nimport { CopyButton } from '@djangocfg/ui-core/components';\n\nimport type { ApiResponse } from '../../../types';\nimport { StatusBadge } from '../ui';\n\ninterface StatusBarProps {\n response: ApiResponse;\n rawText: string;\n /** Content-Type label shown inline next to size/duration. ``null``\n * when the server didn't send one — we hide the slot instead of\n * showing an empty dash. */\n contentType: string | null;\n}\n\n/** Top strip of the response panel: status badge, statusText, size,\n * duration, content-type, copy button. Compact — one line, tabular\n * numerals so 1.4 KB and 107ms don't shift as values update. */\nexport function StatusBar({ response, rawText, contentType }: StatusBarProps) {\n const sizeKb = rawText ? `${(rawText.length / 1024).toFixed(1)} KB` : '';\n const duration = response.duration != null ? `${response.duration}ms` : '';\n const hasStatus = response.status != null;\n const hasCopy = Boolean(rawText);\n\n return (\n <div className=\"shrink-0 border-b px-4 py-2 flex items-center justify-between gap-3 bg-muted/20\">\n <div className=\"flex items-center gap-2 min-w-0\">\n {hasStatus && <StatusBadge status={response.status!} />}\n {response.statusText && (\n <span className=\"text-xs text-muted-foreground truncate\">\n {response.statusText}\n </span>\n )}\n {sizeKb && (\n <span className=\"text-[10px] text-muted-foreground/50 tabular-nums shrink-0\">\n {sizeKb}\n </span>\n )}\n {duration && (\n <span className=\"text-[10px] text-muted-foreground/50 tabular-nums shrink-0\">\n {duration}\n </span>\n )}\n {contentType && (\n <span className=\"text-[10px] text-muted-foreground/50 font-mono truncate\">\n {contentType}\n </span>\n )}\n </div>\n {hasCopy && (\n <CopyButton\n value={rawText}\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-6 px-2 text-[10px] text-muted-foreground shrink-0\"\n >\n Copy\n </CopyButton>\n )}\n </div>\n );\n}\n","import type { ContentKind, DetectedContent } from './types';\n\n/** Strip Content-Type parameters (``; charset=utf-8`` etc.) and lower-case. */\nfunction normaliseContentType(raw: string | null): string | null {\n if (!raw) return null;\n const semi = raw.indexOf(';');\n return (semi === -1 ? raw : raw.slice(0, semi)).trim().toLowerCase();\n}\n\n/** Pull Content-Type out of the headers bag. We accept both plain\n * objects (``{ \"content-type\": \"...\" }``) and ``Headers``-like shapes\n * with a ``.get`` method. The context type is ``any`` so we can't be\n * stricter without plumbing a proper type through the response code\n * path. */\nfunction readContentType(headers: unknown): string | null {\n if (!headers) return null;\n // Headers instance — use ``.get`` (case-insensitive).\n if (typeof (headers as Headers).get === 'function') {\n return (headers as Headers).get('content-type');\n }\n // Plain object — look up with case-insensitive key match so both\n // ``Content-Type`` and ``content-type`` work.\n if (typeof headers === 'object') {\n for (const [k, v] of Object.entries(headers as Record<string, unknown>)) {\n if (k.toLowerCase() === 'content-type') {\n return typeof v === 'string' ? v : null;\n }\n }\n }\n return null;\n}\n\n/** Map a normalised MIME type to our short ``ContentKind``. Unknown\n * types fall back to ``text`` so PrettyCode still shows something\n * sensible (plain text is a valid Prism language). */\nfunction kindFromContentType(mime: string | null): ContentKind {\n if (!mime) return 'text';\n if (mime === 'application/json' || mime.endsWith('+json')) return 'json';\n if (mime === 'text/html' || mime === 'application/xhtml+xml') return 'html';\n if (\n mime === 'application/xml' ||\n mime === 'text/xml' ||\n mime.endsWith('+xml')\n ) return 'xml';\n if (mime === 'text/css') return 'css';\n if (\n mime === 'application/javascript' ||\n mime === 'text/javascript' ||\n mime === 'application/x-javascript'\n ) return 'javascript';\n return 'text';\n}\n\n/** Heuristic fallback when ``Content-Type`` is missing or opaque.\n * Returns ``null`` when nothing firm can be inferred; the caller\n * then defaults to ``text``. */\nfunction kindFromBody(body: string): ContentKind | null {\n const trimmed = body.trimStart();\n if (!trimmed) return null;\n if (trimmed.startsWith('<!DOCTYPE') || /^<html[\\s>]/i.test(trimmed)) return 'html';\n if (trimmed.startsWith('<?xml')) return 'xml';\n if (trimmed.startsWith('{') || trimmed.startsWith('[')) {\n // Cheap validity check — full parse happens in ResponsePanel.\n try { JSON.parse(trimmed); return 'json'; } catch { /* fall through */ }\n }\n return null;\n}\n\nconst PRISM_BY_KIND: Record<ContentKind, DetectedContent['prism']> = {\n json: 'json',\n // ``markup`` is Prism's HTML/XML grammar — there isn't a separate\n // ``html`` language. XML piggy-backs on the same tokeniser.\n html: 'markup',\n xml: 'markup',\n css: 'css',\n javascript: 'javascript',\n text: 'markup',\n};\n\n/** Detect content kind from headers, falling back to body sniffing\n * when the header is missing. Pure function — safe to call inside\n * ``useMemo`` deps on the raw body and headers. */\nexport function detectContent(headers: unknown, rawBody: string): DetectedContent {\n const contentType = normaliseContentType(readContentType(headers));\n const headerKind = kindFromContentType(contentType);\n\n // If headers say it's text/plain but the body looks like HTML or\n // JSON, trust the body — a lot of framework 500 pages claim\n // text/html but some setups default to text/plain for errors.\n const kind = headerKind === 'text' ? (kindFromBody(rawBody) ?? 'text') : headerKind;\n\n return {\n kind,\n prism: PRISM_BY_KIND[kind],\n contentType,\n };\n}\n","import { useMemo } from 'react';\n\nimport { detectContent } from './detectContent';\nimport type { DetectedContent } from './types';\n\ninterface UseResponseViewResult {\n /** Parsed JSON value when the body is JSON, otherwise ``null``.\n * JsonTree needs a live object to render properly, so we parse\n * once up-front and cache. */\n treeData: unknown;\n /** Stringified body, always present when the server returned\n * anything. Used by Raw and Pretty-for-text tabs. */\n rawText: string;\n /** Content-type + prism language inference. */\n detected: DetectedContent;\n}\n\n/** Shape the raw response payload into the pieces each view tab\n * needs. Exposed as a hook so the component stays thin and the\n * normalisation is easy to test in isolation. */\nexport function useResponseView(\n data: unknown,\n headers: unknown,\n): UseResponseViewResult {\n return useMemo(() => {\n if (data == null) {\n return {\n treeData: null,\n rawText: '',\n detected: detectContent(headers, ''),\n };\n }\n\n // String body — might be JSON-in-a-string or a plain text dump.\n if (typeof data === 'string') {\n try {\n return {\n treeData: JSON.parse(data),\n rawText: data,\n detected: detectContent(headers, data),\n };\n } catch {\n return {\n treeData: null,\n rawText: data,\n detected: detectContent(headers, data),\n };\n }\n }\n\n // Object body — axios already parsed it. Stringify for Raw/\n // Preview tabs and treat it as JSON regardless of headers.\n const stringified = (() => {\n try { return JSON.stringify(data, null, 2); } catch { return String(data); }\n })();\n return {\n treeData: data,\n rawText: stringified,\n detected: detectContent(headers, stringified),\n };\n }, [data, headers]);\n}\n","'use client';\n\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport type { ViewMode } from './types';\n\ninterface ViewTabsProps {\n active: ViewMode;\n onChange: (mode: ViewMode) => void;\n /** When false the Preview tab is hidden — only HTML responses get\n * a useful preview, everything else renders the same as Pretty. */\n showPreview: boolean;\n}\n\nconst LABELS: Record<ViewMode, string> = {\n pretty: 'Pretty',\n raw: 'Raw',\n preview: 'Preview',\n};\n\n/** Tab strip for switching between Pretty / Raw / Preview. Matches the\n * visual weight of the ``LanguageTabs`` in CodeSamples so the page\n * reads as one coherent toolbar system. */\nexport function ViewTabs({ active, onChange, showPreview }: ViewTabsProps) {\n const tabs: ViewMode[] = showPreview ? ['pretty', 'raw', 'preview'] : ['pretty', 'raw'];\n return (\n <div className=\"shrink-0 border-b px-3 py-1.5 flex items-center gap-1\">\n {tabs.map((t) => (\n <button\n key={t}\n type=\"button\"\n onClick={() => onChange(t)}\n className={cn(\n 'h-6 px-2.5 rounded text-[11px] font-medium transition-colors',\n active === t\n ? 'bg-muted text-foreground'\n : 'text-muted-foreground/70 hover:text-foreground hover:bg-muted/50',\n )}\n >\n {LABELS[t]}\n </button>\n ))}\n </div>\n );\n}\n","'use client';\n\nimport { Loader2, Send, Terminal, WifiOff } from 'lucide-react';\nimport { useEffect, useState } from 'react';\n\nimport { usePlaygroundContext } from '../../../context/PlaygroundContext';\nimport { EmptyState, ScrollArea } from '../ui';\nimport { PreviewView } from './PreviewView';\nimport { PrettyView } from './PrettyView';\nimport { RawView } from './RawView';\nimport { StatusBar } from './StatusBar';\nimport type { ViewMode } from './types';\nimport { useResponseView } from './useResponseView';\nimport { ViewTabs } from './ViewTabs';\n\n/** Response panel used by both the sticky ``SlideInPlayground`` and the\n * modal ``TryItSheet``. Responsibilities:\n * - Empty / loading / network-error gates\n * - Three view modes (Pretty / Raw / Preview) with a tab bar\n * - Auto-pick the best default view per response type (JSON → Pretty,\n * HTML → Preview, everything else → Pretty as the widest-purpose)\n *\n * View mode is local component state rather than context state — it\n * should reset when the selected endpoint changes and not leak between\n * endpoints. */\nexport function ResponsePanel() {\n const { state } = usePlaygroundContext();\n const { response, loading, selectedEndpoint } = state;\n\n const { treeData, rawText, detected } = useResponseView(response?.data, response?.headers);\n const showPreview = detected.kind === 'html';\n\n // Default view heuristic: show HTML pages preview-first so the\n // reader sees the actual rendered server page immediately.\n // Everything else lands on Pretty.\n const [mode, setMode] = useState<ViewMode>(showPreview ? 'preview' : 'pretty');\n\n // Reset the mode when the endpoint or response changes so a\n // previously-selected tab from a different shape doesn't stick\n // around (e.g. stuck on Preview when switching from HTML→JSON).\n useEffect(() => {\n setMode(showPreview ? 'preview' : 'pretty');\n }, [selectedEndpoint, response, showPreview]);\n\n if (loading) {\n return (\n <div className=\"flex items-center justify-center h-full gap-2\">\n <Loader2 className=\"h-4 w-4 animate-spin text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground\">Sending…</span>\n </div>\n );\n }\n\n if (!selectedEndpoint) return <EmptyState icon={Terminal} text=\"Response will appear here\" />;\n if (!response) return <EmptyState icon={Send} text='Press \"Send Request\" to see the response' />;\n\n const hasError = Boolean(response.error);\n const hasStatus = response.status != null;\n\n // Pure network error (no HTTP response at all — CORS, offline, timeout)\n if (hasError && !hasStatus) {\n return (\n <EmptyState\n icon={WifiOff}\n text={response.error!}\n className=\"text-destructive [&_svg]:text-destructive\"\n />\n );\n }\n\n return (\n <>\n <StatusBar response={response} rawText={rawText} contentType={detected.contentType} />\n\n {/* HTTP-level error body (4xx/5xx — has status but also error flag) */}\n {hasError && (\n <div className=\"shrink-0 mx-4 mt-3 rounded border border-destructive/20 bg-destructive/5 px-3 py-2\">\n <p className=\"text-xs text-destructive\">{response.error}</p>\n </div>\n )}\n\n <ViewTabs active={mode} onChange={setMode} showPreview={showPreview} />\n\n <ScrollArea>\n {mode === 'pretty' && (\n <PrettyView treeData={treeData} rawText={rawText} detected={detected} />\n )}\n {mode === 'raw' && <RawView rawText={rawText} />}\n {mode === 'preview' && <PreviewView html={rawText} />}\n </ScrollArea>\n </>\n );\n}\n","'use client';\n\nimport { AlertCircle, Loader2, Send } from 'lucide-react';\nimport React, { useMemo } from 'react';\n\nimport { Button } from '@djangocfg/ui-core/components';\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport { usePlaygroundContext } from '../../context/PlaygroundContext';\nimport { isValidJson } from '../../utils';\nimport { UrlBuilder } from '../../utils/url';\n\ninterface SendButtonProps {\n className?: string;\n}\n\n/**\n * Standalone Send button that reads from and acts on the playground\n * context. Disabled + explainer-banner when required inputs are missing.\n *\n * Validation rules (in order — first failure wins the banner text):\n * 1. Required path/query parameters must be non-empty.\n * 2. Path template must be fully substituted (no leftover ``{name}``).\n * 3. Request body, when present, must be valid JSON.\n *\n * We validate on the client so the user isn't punished with a 404 from\n * the server for a trivially detectable mistake (e.g. empty ``{petId}``).\n */\nexport function SendButton({ className }: SendButtonProps) {\n const { state, sendRequest } = usePlaygroundContext();\n\n const ep = state.selectedEndpoint;\n\n // Single source of truth for URL-level validation lives in UrlBuilder.\n // Recomputing every render is cheap (pure string work).\n const builder = useMemo(\n () => (ep ? new UrlBuilder(ep, state.parameters) : null),\n [ep, state.parameters],\n );\n const missingRequired = builder?.missingRequired() ?? [];\n const unsubstituted = builder?.unfilledPlaceholders() ?? [];\n\n const isJsonValid = state.requestBody ? isValidJson(state.requestBody) : true;\n\n const blockers: string[] = [];\n if (missingRequired.length > 0) {\n blockers.push(\n `Fill required parameter${missingRequired.length > 1 ? 's' : ''}: ${missingRequired.join(', ')}`,\n );\n } else if (unsubstituted.length > 0) {\n blockers.push(`URL still has unfilled placeholder${unsubstituted.length > 1 ? 's' : ''}: ${unsubstituted.map((n) => `{${n}}`).join(', ')}`);\n }\n if (!isJsonValid) blockers.push('Request body is not valid JSON');\n\n const disabled =\n state.loading ||\n !state.requestUrl ||\n blockers.length > 0;\n\n const tooltip = blockers.length > 0 ? blockers.join('\\n') : undefined;\n\n return (\n <div className={cn('space-y-2', className)}>\n {blockers.length > 0 && (\n <div className=\"flex items-start gap-2 rounded-md border border-amber-500/25 bg-amber-500/[0.06] px-3 py-2 text-[11px] text-amber-600 dark:text-amber-400\">\n <AlertCircle className=\"h-3.5 w-3.5 shrink-0 mt-px\" />\n <span className=\"leading-snug\">{blockers[0]}</span>\n </div>\n )}\n <Button\n onClick={sendRequest}\n disabled={disabled}\n size=\"sm\"\n title={tooltip}\n className=\"w-full gap-2 h-9\"\n >\n {state.loading ? (\n <>\n <Loader2 className=\"h-3.5 w-3.5 animate-spin\" />\n Sending…\n </>\n ) : (\n <>\n <Send className=\"h-3.5 w-3.5\" />\n Send Request\n </>\n )}\n </Button>\n </div>\n );\n}\n","'use client';\n\nimport React from 'react';\n\nimport { SidePanel } from '@djangocfg/ui-core/components';\nimport { cn } from '@djangocfg/ui-core/lib';\n\nimport { usePlaygroundContext } from '../../context/PlaygroundContext';\nimport { RequestPanel } from '../shared/RequestPanel';\nimport { ResponsePanel } from '../shared/ResponsePanel';\nimport { SendButton } from '../shared/SendButton';\nimport { MethodBadge, Panel, relativePath } from '../shared/ui';\n\ninterface SlideInPlaygroundProps {\n open: boolean;\n onClose: () => void;\n}\n\n// Width when only Request is visible vs. when Response is also rendered.\n// ``clamp(min, preferred, max)`` lets the panel scale with the viewport\n// instead of sitting at a fixed size that looks tiny on ultra-wide or\n// cramped on laptops.\n//\n// Narrow (Request only) — form content, no need to ever exceed ~480px.\n// 1280 viewport → 384 | 1440 → 432 | 1920 → 480 (cap) | 2560 → 480 (cap)\n//\n// Wide (Request + Response) — response can be huge JSON/HTML; give it room.\n// 1280 → 768 | 1440 → 864 | 1920 → 1152 | 2560 → 1280 (cap) | 3840 → 1280 (cap)\n//\n// Transition between the two values is animated by SidePanel.Content\n// (both ``transform`` and ``width`` listed there). clamp() interpolates\n// smoothly during that transition, no extra plumbing needed.\nconst WIDTH_NARROW = 'clamp(380px, 30vw, 480px)';\nconst WIDTH_WIDE = 'clamp(720px, 60vw, 1280px)';\n\n/**\n * Right-side slide-in playground. Two-column layout appears once the\n * user has a response in hand — before that, only the Request form is\n * shown and the panel stays narrow so docs have room to breathe.\n *\n * State transitions:\n * - no endpoint ⇒ panel not rendered\n * - endpoint, no resp ⇒ narrow (Request only)\n * - endpoint + loading ⇒ wide (Request + Response spinner)\n * - endpoint + resp ⇒ wide (Request + Response)\n *\n * Selecting a different endpoint clears ``response`` in the reducer,\n * so the panel smoothly collapses back to narrow.\n */\nexport function SlideInPlayground({ open, onClose }: SlideInPlaygroundProps) {\n const { state } = usePlaygroundContext();\n const ep = state.selectedEndpoint;\n const showResponse = state.response !== null || state.loading;\n const width = showResponse ? WIDTH_WIDE : WIDTH_NARROW;\n\n return (\n <SidePanel open={open} onOpenChange={(v) => !v && onClose()} side=\"right\">\n <SidePanel.Content width={width} className=\"max-w-[95vw]\">\n <SidePanel.Header>\n <SidePanel.Title>Playground</SidePanel.Title>\n {ep && (\n <div className=\"flex items-center gap-2 min-w-0 flex-1\">\n <MethodBadge method={ep.method} />\n <code className=\"font-mono text-[11px] text-muted-foreground truncate\">\n {relativePath(ep.path)}\n </code>\n </div>\n )}\n <SidePanel.Close className=\"ml-auto\" />\n </SidePanel.Header>\n\n {/* Body: 1 or 2 columns depending on whether we have a\n response to show. ``divide-x`` gives a 1px seam\n between the panes so they read as distinct surfaces.\n Send button lives inside the Request column so it\n reads as an action on the form it belongs to — not\n as a page-level footer that ambiguously sat under\n the response column too. */}\n <SidePanel.Body\n className={cn(\n 'overflow-hidden grid divide-x transition-[grid-template-columns] duration-250',\n showResponse\n ? 'grid-cols-[minmax(0,1fr)_minmax(0,1fr)]'\n : 'grid-cols-1',\n )}\n >\n <Panel>\n <RequestPanel />\n {ep && (\n <div className=\"shrink-0 border-t px-4 py-3 bg-background\">\n <SendButton />\n </div>\n )}\n </Panel>\n {showResponse && (\n <Panel>\n <ResponsePanel />\n </Panel>\n )}\n </SidePanel.Body>\n </SidePanel.Content>\n </SidePanel>\n );\n}\n","'use client';\n\nimport React from 'react';\n\nimport {\n ResponsiveSheet,\n ResponsiveSheetContent,\n ResponsiveSheetHeader,\n ResponsiveSheetTitle,\n} from '@djangocfg/ui-core/components';\n\nimport { usePlaygroundContext } from '../../context/PlaygroundContext';\nimport { RequestPanel } from '../shared/RequestPanel';\nimport { ResponsePanel } from '../shared/ResponsePanel';\nimport { SendButton } from '../shared/SendButton';\n\ninterface TryItSheetProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n}\n\n/**\n * Mobile/tablet fallback: the slide-in playground doesn't fit, so we\n * open Request + Response inside a ResponsiveSheet (bottom drawer on\n * mobile, side sheet on desktop). Response stays hidden until a\n * request has been sent — matching the desktop ``SlideInPlayground``\n * behaviour.\n */\nexport function TryItSheet({ open, onOpenChange }: TryItSheetProps) {\n const { state } = usePlaygroundContext();\n const showResponse = state.response !== null || state.loading;\n\n return (\n <ResponsiveSheet open={open} onOpenChange={onOpenChange}>\n <ResponsiveSheetContent className=\"sm:max-w-xl flex flex-col h-full p-0\">\n <ResponsiveSheetHeader className=\"px-4 py-3 border-b shrink-0\">\n <ResponsiveSheetTitle className=\"text-sm\">Playground</ResponsiveSheetTitle>\n </ResponsiveSheetHeader>\n {/* Send button sits inside the Request section so it\n reads as an action on the form, not an ambiguous\n page-level footer when Response is also visible. */}\n <div className=\"flex-1 min-h-0 flex flex-col divide-y\">\n <div className=\"flex-1 min-h-0 flex flex-col\">\n <RequestPanel />\n {state.selectedEndpoint && (\n <div className=\"shrink-0 border-t px-4 py-3 bg-background\">\n <SendButton />\n </div>\n )}\n </div>\n {showResponse && (\n <div className=\"flex-1 min-h-0 flex flex-col\">\n <ResponsePanel />\n </div>\n )}\n </div>\n </ResponsiveSheetContent>\n </ResponsiveSheet>\n );\n}\n","'use client';\n\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { keyBy } from 'lodash-es';\n\nimport { Skeleton, TooltipProvider } from '@djangocfg/ui-core/components';\nimport { useMediaQuery } from '@djangocfg/ui-core/hooks';\n\nimport useOpenApiSchema from '../../hooks/useOpenApiSchema';\nimport { useDocsUrlSync, type ParsedHash } from '../../hooks/useDocsUrlSync';\nimport { usePlaygroundContext } from '../../context/PlaygroundContext';\nimport type { ApiEndpoint } from '../../types';\nimport { EndpointDraftSync } from '../shared/EndpointDraftSync';\nimport { slugifySchemaId } from './anchor';\nimport { DocsSidebar } from './Sidebar';\nimport { DocsView, type DocsViewHandle } from './DocsView';\nimport { SlideInPlayground } from './SlideInPlayground';\nimport { TryItSheet } from './TryItSheet';\n\n// ─── Root ─────────────────────────────────────────────────────────────────────\n\nexport const DocsLayout: React.FC = () => {\n const { state, config, setSelectedEndpoint } = usePlaygroundContext();\n // The docs layout has a sidebar + docs column that already eat ~260px\n // before the slide-in opens. Below 1024px the slide-in (min 720 wide)\n // leaves docs with <250px — unreadable — so we fall back to the\n // mobile-style ``TryItSheet`` on those viewports.\n const isDesktop = useMediaQuery('(min-width: 1024px)');\n const isMobile = !isDesktop;\n\n const grouping = config.schemaGrouping ?? 'selector';\n const preloadAll = grouping === 'sections';\n const urlSyncEnabled =\n config.urlSync === undefined\n ? true\n : typeof config.urlSync === 'boolean'\n ? config.urlSync\n : Boolean(config.urlSync.enabled);\n\n const {\n endpoints,\n schemaInfo,\n rawSchema,\n resolvedBaseUrl,\n loading,\n error,\n schemas,\n currentSchema,\n setCurrentSchema,\n schemasData,\n } = useOpenApiSchema({\n schemas: config.schemas,\n defaultSchemaId: config.defaultSchemaId,\n baseUrl: config.baseUrl,\n preloadAll,\n });\n\n const [activeAnchor, setActiveAnchor] = useState<string | null>(null);\n const [activeSchemaId, setActiveSchemaId] = useState<string | null>(null);\n const [sheetOpen, setSheetOpen] = useState(false);\n const docsRef = useRef<DocsViewHandle | null>(null);\n\n // Desktop slide-in is driven directly by ``selectedEndpoint``. Keeping a\n // separate open-state would mean two sources of truth for the same\n // semantic — \"which endpoint is loaded into the playground\".\n const slideOpen = !isMobile && state.selectedEndpoint !== null;\n\n // Per-schema endpoint map for the sections sidebar. ``keyBy`` makes the\n // lookup O(1) at render time instead of scanning schemasData in each\n // CategoryBlock — a win for 10+ schemas.\n const endpointsBySchema = useMemo<Record<string, ApiEndpoint[]>>(() => {\n if (grouping !== 'sections') return {};\n const byId = keyBy(schemasData, (e) => e.source.id);\n const out: Record<string, ApiEndpoint[]> = {};\n for (const src of schemas) out[src.id] = byId[src.id]?.endpoints ?? [];\n return out;\n }, [grouping, schemasData, schemas]);\n\n const handleTry = useCallback(\n (ep: ApiEndpoint) => {\n setSelectedEndpoint(ep);\n if (isMobile) setSheetOpen(true);\n },\n [isMobile, setSelectedEndpoint],\n );\n\n const handleCloseSlide = useCallback(() => {\n setSelectedEndpoint(null);\n }, [setSelectedEndpoint]);\n\n const handleNavigate = useCallback(\n (anchor: string, schemaId?: string | null) => {\n // In selector mode a schema switch may be required before the\n // anchor exists in the DOM — defer the scroll until the next\n // paint so ``useOpenApiSchema`` has a chance to swap endpoints.\n if (schemaId && schemaId !== currentSchema?.id && grouping === 'selector') {\n setCurrentSchema(schemaId);\n requestAnimationFrame(() => {\n docsRef.current?.scrollToAnchor(anchor);\n });\n return;\n }\n docsRef.current?.scrollToAnchor(anchor);\n },\n [currentSchema?.id, grouping, setCurrentSchema],\n );\n\n const handleActiveChange = useCallback((anchor: string | null, schemaId: string | null) => {\n setActiveAnchor(anchor);\n setActiveSchemaId(schemaId);\n }, []);\n\n // URL sync: read hash on mount / popstate → apply; write hash when\n // scrollspy updates. Only the *effective* active schema goes into the\n // hash — in ``selector`` mode it's the combobox value, in ``sections``\n // mode it's whichever schema the scrollspy is currently inside.\n const effectiveSchemaId = grouping === 'sections' ? activeSchemaId : currentSchema?.id ?? null;\n\n const handleHashTarget = useCallback(\n (target: ParsedHash) => {\n if (!target.schemaId && !target.anchor) return;\n\n // Schema-id segment may be either the raw id or a slug — match\n // both so copy-pasted URLs survive id changes that don't affect\n // the slug. First match wins.\n const matched = target.schemaId\n ? schemas.find((s) => s.id === target.schemaId || slugifySchemaId(s.id) === target.schemaId)\n : null;\n\n const needsSchemaSwitch =\n matched && grouping === 'selector' && matched.id !== currentSchema?.id;\n\n if (needsSchemaSwitch) {\n setCurrentSchema(matched.id);\n }\n\n if (target.anchor) {\n const anchor = target.anchor;\n // Wait one frame when a switch happened so the new DOM exists.\n if (needsSchemaSwitch) {\n requestAnimationFrame(() => {\n docsRef.current?.scrollToAnchor(anchor);\n });\n } else {\n docsRef.current?.scrollToAnchor(anchor);\n }\n }\n },\n [schemas, grouping, currentSchema?.id, setCurrentSchema],\n );\n\n useDocsUrlSync({\n enabled: urlSyncEnabled,\n currentSchemaId: effectiveSchemaId,\n activeAnchor,\n onHashTarget: handleHashTarget,\n });\n\n // ─── Loading / error branches ─────────────────────────────────────────\n\n if (loading) {\n return (\n <div className=\"grid grid-cols-[260px_1fr] items-start\">\n <div\n className=\"sticky top-[var(--navbar-height,64px)] border-r p-3 space-y-1.5 overflow-y-auto\"\n style={{ height: 'calc(100dvh - var(--navbar-height, 64px))' }}\n >\n {Array.from({ length: 12 }).map((_, i) => (\n <Skeleton key={i} className=\"h-8 w-full rounded\" />\n ))}\n </div>\n <div className=\"p-8 space-y-4\">\n <Skeleton className=\"h-8 w-1/2\" />\n <Skeleton className=\"h-4 w-full\" />\n <Skeleton className=\"h-4 w-3/4\" />\n <div className=\"mt-8 space-y-6\">\n {Array.from({ length: 3 }).map((_, i) => (\n <div key={i} className=\"space-y-3\">\n <Skeleton className=\"h-6 w-1/3\" />\n <Skeleton className=\"h-20 w-full\" />\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n }\n\n if (error) {\n return (\n <div\n className=\"flex items-center justify-center p-8\"\n style={{ height: 'calc(100dvh - var(--navbar-height, 64px))' }}\n >\n <p className=\"text-sm text-destructive\">Failed to load schema: {error}</p>\n </div>\n );\n }\n\n // ─── Mobile: sidebar + docs only, playground opens in sheet ───────────\n\n if (isMobile) {\n return (\n <div className=\"flex flex-col\">\n <EndpointDraftSync schemaId={currentSchema?.id ?? null} />\n {grouping === 'sections' ? (\n <DocsView\n ref={docsRef}\n grouping=\"sections\"\n schemasData={schemasData}\n selectedVersion={state.selectedVersion}\n loadedEndpoint={state.selectedEndpoint}\n onTryEndpoint={handleTry}\n onActiveChange={handleActiveChange}\n />\n ) : (\n <DocsView\n ref={docsRef}\n info={schemaInfo}\n rawSchema={rawSchema}\n resolvedBaseUrl={resolvedBaseUrl}\n endpoints={endpoints}\n selectedVersion={state.selectedVersion}\n loadedEndpoint={state.selectedEndpoint}\n onTryEndpoint={handleTry}\n onActiveChange={handleActiveChange}\n />\n )}\n <TryItSheet open={sheetOpen} onOpenChange={setSheetOpen} />\n </div>\n );\n }\n\n // ─── Desktop ──────────────────────────────────────────────────────────\n\n return (\n <TooltipProvider delayDuration={350}>\n <div className=\"grid grid-cols-[260px_minmax(0,1fr)] items-start\">\n <EndpointDraftSync schemaId={currentSchema?.id ?? null} />\n <div\n className=\"sticky top-[var(--navbar-height,64px)]\"\n style={{ height: 'calc(100dvh - var(--navbar-height, 64px))' }}\n >\n <DocsSidebar\n info={schemaInfo}\n endpoints={endpoints}\n schemas={schemas}\n currentSchemaId={currentSchema?.id ?? null}\n onSchemaChange={setCurrentSchema}\n activeEndpointId={activeAnchor}\n selectedVersion={state.selectedVersion}\n onNavigate={handleNavigate}\n grouping={grouping}\n endpointsBySchema={endpointsBySchema}\n rawSchema={rawSchema}\n resolvedBaseUrl={resolvedBaseUrl}\n />\n </div>\n {grouping === 'sections' ? (\n <DocsView\n ref={docsRef}\n grouping=\"sections\"\n schemasData={schemasData}\n selectedVersion={state.selectedVersion}\n loadedEndpoint={state.selectedEndpoint}\n onTryEndpoint={handleTry}\n onActiveChange={handleActiveChange}\n />\n ) : (\n <DocsView\n ref={docsRef}\n info={schemaInfo}\n rawSchema={rawSchema}\n resolvedBaseUrl={resolvedBaseUrl}\n endpoints={endpoints}\n selectedVersion={state.selectedVersion}\n loadedEndpoint={state.selectedEndpoint}\n onTryEndpoint={handleTry}\n onActiveChange={handleActiveChange}\n />\n )}\n {/* SidePanel renders into <body> via portal, so it floats\n above the whole layout (sidebar + navbar included). */}\n <SlideInPlayground open={slideOpen} onClose={handleCloseSlide} />\n </div>\n </TooltipProvider>\n );\n};\n"]}
|