Add configurable graph SPA corpus filters

This commit is contained in:
Meta Vens 2026-05-24 05:27:02 +01:00
commit 1bd1856fb2
2 changed files with 78 additions and 4 deletions

View file

@ -4,6 +4,13 @@ export type GameCultGraphSpaShellOptions = {
stylesheetHref: string
moduleSrc: string
rootClassName?: string
config?: {
title?: string
architectureDescription?: string
allowedSlugPrefixes?: string[]
blockedSlugPrefixes?: string[]
blockedPathSegments?: string[]
}
}
export default ((options?: Partial<GameCultGraphSpaShellOptions>) => {
@ -18,6 +25,13 @@ export default ((options?: Partial<GameCultGraphSpaShellOptions>) => {
<>
<link rel="stylesheet" href={shellOptions.stylesheetHref} />
<div class={shellOptions.rootClassName}></div>
{shellOptions.config ? (
<script
dangerouslySetInnerHTML={{
__html: `window.gameCultGraphSpaConfig = ${JSON.stringify(shellOptions.config)};`,
}}
/>
) : null}
<script type="module" src={shellOptions.moduleSrc}></script>
</>
)