Render pipeline

Sample documentation (demo only)
This is an incomplete, outdated docs snapshot shipped with the playground — screenshots were removed on purpose.
For the full, current manuals go to voodflow.com/docs.

Public and canvas HTML for pages and chrome. Binding/condition/component expansion happens here — not in Blade.

Voodflow\Voodbuilder\Support\Editor\EditorRenderer

  • File: Support/Editor/EditorRenderer.php
  • Kind: final class
  • Responsibility: Turn a published SitePage.builder_payload into public HTML / CSS / JS.
  • Entry from model: SitePage::renderedContent() → render(); renderedStyles() → css(); renderedScripts() → js(); pageCssStylesheetUrl() → cssStylesheetUrl().

html(SitePage $page): string

Reads builder_payload['html']. Empty → ''.

Pipeline:

  1. If page uses chrome shell → ChromeLayoutManagedContent::stripSiteChromeFromPageHtml
  2. stripChromeEditorBleedFromPageHtml
  3. EditorHtmlSanitizer::stripEditorOnlyElements
  4. Nested normalize: sanitize → ThemeToken migrate → LibraryLayout → HeroBackground → CodeBlock → StepTabs → EditorFormNormalizer::normalizeForPage → Placeholder
  5. EditorBackgroundPublishNormalizer::preferCssBackgrounds (uses CSS from PageCssArtifactStore::resolveCss)

Does not expand bindings/conditions — that is render().

css(SitePage $page): ?string

  1. ComponentRuntimeBridge::globalClassCss() + componentCssForHtml(...)
  2. If CSS artifact exists on disk → wallpaper overlay remap for public (Grapes wrapper id absent) + sanitize; combine with global/component
  3. Else resolve published page CSS from payload → ThemePalette::stripEmbeddedPaletteOverrides → PageSurfaceCssPublish::remapForPublic → EditorCssSanitizer
  4. Return combined string or null

cssStylesheetUrl(SitePage $page): ?string

Public URL for large stylesheet artifact (PageCssArtifactStore::publicUrl), or null.

js(SitePage $page): ?string

  1. AuthorScriptPolicy::keepOrDiscard — only entitlement consulted on the public render path (pages.custom-js)
  2. EditorJsSanitizer::sanitize
  3. Empty → null

HTML content is intentionally not licence-gated on render (product rule: published sites stay up if licence lapses; author scripts do not).

render(SitePage $page): string

Full body HTML for {!! !!}:

  1. html($page)
  2. EditorElementConditionRenderer::render
  3. ComponentRuntimeBridge::renderComponentHtml
  4. EditorBindingRenderer::render
  5. EditorDynamicBlockRenderer::render
  6. GlobalTextTags::replaceInHtml
  7. EditorHtmlSecuritySanitizer::sanitize (last gate)

Last gate why: seeders, template imports, revision restore, and direct DB writes reach this method without EditorGate::normalizePayload. Author JS uses js(), so body <script> is never legitimate here.


Voodflow\Voodbuilder\Support\Editor\EditorChromeHtmlPipeline

  • File: Support/Editor/EditorChromeHtmlPipeline.php
  • Kind: final class
  • Responsibility: Same idea as page render for chrome-layout HTML (no SitePage).

render(string $html, bool $canvasPreview = false): string

  1. stripEditorOnlyElements
  2. sanitize → ThemeToken → CodeBlock → StepTabs → Placeholder
  3. Conditions with $page = null
  4. ComponentRuntimeBridge::renderComponentHtml($html, null)
  5. Bindings: renderForEditor if $canvasPreview, else render
  6. EditorDynamicBlockRenderer
  7. GlobalTextTags
  8. EditorHtmlSecuritySanitizer last gate (chrome is {!! !!} on every page)

Used by ChromeLayoutRenderer before splitting on data-voodbuilder-content-slot.


Voodflow\Voodbuilder\Support\Editor\EditorCanvas

  • File: Support/Editor/EditorCanvas.php
  • Kind: final class
  • Responsibility: Stylesheet URLs and frame chrome for the GrapesJS iframe (edit mode), not public HTML.
Signature Behaviour
styleUrls(): array Canvas stylesheet URLs (Vite + package canvas CSS)
publishedStyleUrls(): array Stylesheets required when a Visual page is published
resolveViteAsset(string $entry): ?string (protected) Resolve built Vite URL for an entry
toRootRelativeAssetUrl(string $url): ?string Same-origin root-relative URL so canvas CSS follows browser host/port when APP_URL differs
pageBackgroundColor(string $subTheme): string Canvas page background for sub-theme
frameStyle(string $subTheme, bool $popupMode = false): string Inline frame chrome CSS
readPackageCanvasCss(string $filename): string (protected) Read package canvas CSS file
readPopupShellCanvasCss(): string (protected) Popup shell CSS from sibling vpopups package when present
readTabsCanvasCss(): string (protected) Tabs canvas CSS
hasBuiltAsset(string $entry): bool (protected) Whether Vite manifest contains entry

Voodflow\Voodbuilder\Support\Editor\ChromeLayoutContentSlotBlock

  • File: Support/Editor/ChromeLayoutContentSlotBlock.php
  • Kind: final class
  • Responsibility: Editor block definition for the chrome content slot marker (data-voodbuilder-content-slot).
Signature Behaviour
definition(): EditorBlockDefinition Block id/label/category/HTML for the sidebar
Demo resets in 00:29:44