{"version":3,"sources":["../../src/components/includeContexts.ts"],"sourcesContent":["import { createContext } from 'react';\n\nimport { EvaluationContext } from '../sandboxTypes';\n\n// The contexts `<Include>` publishes and reads, in their own module so that `Include` and\n// `SafeInclude` can each import them without importing each other. `Include` branches to\n// `SafeInclude` and `SafeInclude` publishes `RenderExportedComponentContext`, which would be\n// a cycle if either owned the contexts — and `check:circular` is a CI gate, because a\n// circular SDK import once made the bundler infinite-loop.\n//\n// Both are re-exported from `./Include`, which is the public entry point; nothing outside\n// needs to know this module exists.\n\n/** The value exposed on {@link RenderExportedComponentContext}: the evaluation\n *  context of the module `Include` resolved. */\nexport type RenderFileContextType = {\n  evaluationContext: EvaluationContext;\n};\n\n/** Context carrying the included module's {@link EvaluationContext} to its subtree. */\nexport const RenderExportedComponentContext = createContext<RenderFileContextType | null>(null);\n\n/** Which renderer `Include` uses: `compiled` evaluates the module (the default, unchanged\n *  behaviour); `interpreted` renders the file's Markdown/MDX **as data** through the safe\n *  renderer, so no author JavaScript executes. */\nexport type IncludeMode = 'compiled' | 'interpreted';\n\n/** Declare the renderer for every `Include` in a subtree. An **interpreter** app\n *  (TRUST_MODES_SPEC §5) sets this once at its root instead of remembering to pass `mode` at\n *  each call site — the failure mode being silent (one forgotten `<Include>` executes author\n *  code while the app believes it renders nothing but data). Defaults to `compiled`, so every\n *  existing consumer is unaffected. */\nexport const IncludeModeContext = createContext<IncludeMode>('compiled');\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA8B;AAoBvB,MAAM,qCAAiC,4BAA4C,IAAI;AAYvF,MAAM,yBAAqB,4BAA2B,UAAU;","names":[]}