Path in the Gestor bibliotecas/editor-texto.php
Everything about Quill, the rich text editor of the admin panel forms, lives here: the version, the editor tags, the published content CSS and the visual parity between the two. Not to be confused with the HTML editor (html-editor.php).
In the panel: opening the editor
gestor_incluir_biblioteca('editor-texto');
editor_texto_incluir(); // ['paridade' => false] to skip the project tokenseditor_texto_incluir() adds to the page:
-
Quill's CSS and JavaScript, through the external assets registry (disk first, CDN as a fallback);
-
interface/quill-content.css, the same content CSS the site receives; -
interface/editor-texto.js, which creates the editors over the<textarea>s and keeps the form field in sync; -
the parity: if the project has
contents/tailwindcss/browser-contract.css, its CSS variables (--…) are copied into.ql-editor, so the author writes with the site's font and colors. Values withurl()/data:or longer than 160 characters are left out.
The version comes from $_GESTOR['editor-texto-versao'] or from the external assets registry (quill 2.0.3). quill-content.css was generated for that version: changing one without the other makes the editor and the site render differently.
On the site: published content
Quill stores formatting as classes (ql-align-right, ql-indent-2), not inline styles. Without quill-content.css, the published page loses alignments and indents.
The router takes care of it on its own (gestor_pagina_quill()): after assembling the page and the widgets, editor_texto_conteudo_detectar($html) looks for Quill classes (class by class, not by substring) and, if it finds any, includes the CSS from editor_texto_assets_publicacao(). Pages without editor content load nothing.
Detail
Internal helpers (used by the functions above; rarely called directly): editor_texto_assets_externos_carregar(), editor_texto_versao_cdn(), editor_texto_assets_editor(), editor_texto_paridade_css().
Functions
Generated from gestor/bibliotecas/editor-texto.php · 7 functions
editor_texto_assets_externos_carregar
view source · line 38 ↗editor_texto_assets_externos_carregar()Garante que o registro de assets externos esteja carregado.
editor_texto_versao_cdn
view source · line 59 ↗editor_texto_versao_cdn(): stringVersão do Quill servida pelo CDN.
Returns
editor_texto_assets_editor
view source · line 93 ↗editor_texto_assets_editor(string $urlRaiz = '', string $versaoAsset = '', $vendorFisico = '', $vendorPublico = ''): array{css: list<string>, javascript: list<string>}Tags de CSS e JavaScript do editor de texto.
Parameters
$urlRaizstring- Raiz pública do projeto (
$_GESTOR['url-raiz']). $versaoAssetstring- Versão dos assets do core, para cache-bust.
$vendorFisico$vendorPublico
Returns
editor_texto_paridade_css
view source · line 153 ↗editor_texto_paridade_css(string $contrato): stringCSS que dá à área de edição a aparência da página publicada.
Parameters
$contratostring- Conteúdo do
browser-contract.cssdo projeto (pode ser vazio).
Returns
<style> escopado, ou string vazia quando não há o que injetar.editor_texto_incluir
view source · line 213 ↗editor_texto_incluir(array $params = false): voidInclui no pipeline da página tudo que o editor de texto precisa.
Parameters
$paramsarray
Returns
editor_texto_conteudo_detectar
view source · line 271 ↗editor_texto_conteudo_detectar(string $html): boolDetecta conteúdo formatado pelo editor de texto no HTML final.
Parameters
$htmlstring- HTML final da página, já com widgets incluídos.
Returns
editor_texto_assets_publicacao
view source · line 333 ↗editor_texto_assets_publicacao(string $urlRaiz = '', string $versao = ''): arrayTags do CSS de conteúdo entregue ao visitante.
Parameters
$urlRaizstring- Raiz pública do projeto.
$versaostring- Versão do asset, para cache-bust.
Returns
<link>.