Conn2Flow
Docs navigation

Reference / Libraries

editor-texto.php library

The rich text editor (Quill) in the admin panel and the CSS that makes published content look the way the author saw it while writing.

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 tokens

editor_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 with url()/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

7 of 7

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

array{css: list<string>, javascript: list<string>}

editor_texto_paridade_css

view source · line 153 ↗
editor_texto_paridade_css(string $contrato): string

CSS que dá à área de edição a aparência da página publicada.

Parameters

$contratostring
Conteúdo do browser-contract.css do projeto (pode ser vazio).

Returns

string
Bloco <style> escopado, ou string vazia quando não há o que injetar.

editor_texto_assets_publicacao

view source · line 333 ↗
editor_texto_assets_publicacao(string $urlRaiz = '', string $versao = ''): array

Tags do CSS de conteúdo entregue ao visitante.

Parameters

$urlRaizstring
Raiz pública do projeto.
$versaostring
Versão do asset, para cache-bust.

Returns

array
Lista de tags <link>.

The Future is Hybrid: Human + AI.

Conn2Flow is the tool. If you need the Architect to design your company's strategy using this technology...

Hire Specialized Consulting