import { ProjectPluginStructure, UIDLElement } from '@teleporthq/teleport-types'; /** * Codegen-side decomposition of the Collapsible Text primitive. * * The GUI's `collapsibleTextNodeToUIDL` mapper is *supposed* to bake the * clamp + overflow markers into the exported UIDL, but a project can be exported * without that decomposition (the primitive then arrives as the raw * `collapsible-text` element carrying only its content paragraph and the two * toggle labels). Doing the decomposition here as well means the generated app * clamps + gates the "Show more" toggle no matter how the UIDL was produced — * and stays idempotent when the UIDL *is* already decomposed. * * `state → style` is not expressible in the generated code, so instead of * toggling a line-clamp the body is emitted as TWO mutually-exclusive views of * the same content: a *collapsed* view carrying a static `-webkit-line-clamp` * (rendered when `expanded === false`) and an *expanded* view without it. Only * one mounts at runtime. The collapsed view is tagged `data-tq-collapsible-clamp` * and the Show more label `data-tq-collapsible-more` so the shipped * `TqCollapsibleTextOverflow` helper can measure real overflow and hide the * toggle when the text already fits. */ export declare const COLLAPSIBLE_TEXT_ELEMENT_TYPE = "collapsible-text"; export declare const DEFAULT_COLLAPSIBLE_TRUNCATE_LINES = 3; /** * Decomposes a single `collapsible-text` element IN PLACE. No-op when the element * is already decomposed (root marker present) or isn't the expected * content + Show more + See less shape. */ export declare const decomposeCollapsibleTextElement: (element: UIDLElement) => void; /** * Walks every page + component in the project UIDL and decomposes each * `collapsible-text` element. Returns true if the primitive was used anywhere. */ export declare const decomposeCollapsibleTextInProject: (uidl: ProjectPluginStructure['uidl']) => boolean; //# sourceMappingURL=decompose.d.ts.map