export interface UpdateResult { success: boolean; filePath?: string; error?: string; /** * Set when an attribute edit was refused because the attribute is bound to a * dynamic JSX expression (e.g. `src={item.url}`). Overwriting it would collapse * the binding to a literal and corrupt every instance rendered from the same * JSX node (a row/grid of images from a `.map()`). The caller should edit the * backing data instead (typically via the AI chat fallback). */ dynamicAttribute?: string; /** * Set when a text edit was refused because the element's text is a dynamic JSX * EXPRESSION (e.g. `{plan.price}`). Overwriting the children would * collapse the binding and change every instance rendered from the same JSX * node (e.g. a price shared across a set of cards). * * ☠️ **DATA-BOUND ONLY, and the narrowness is the whole meaning of the flag.** * It has exactly one consumer, `commitInlineEdit` * (`apps/templates/webapp/src/visual-inspector/inspector.ts`), and that consumer * does not read it as "why the write failed" — it reads it as a HAND-OFF: it * keeps the owner's optimistic DOM text and asks the cockpit to land the edit * through the backing data instead (`inline-edit-commit { dataBound: true }` → * `trySingletonDataEdit` / `tryDataItemEdit`). Keeping the typed text is only * honest because that path really can write, after which HMR re-renders the * element with the new value. * * So it must NOT be set on a refusal nothing can repair. This docblock used to * say "or it wraps child elements", and the two structural refusals below said * it too — `elementChildren.length > 0` with no own text, and own text SPLIT * across more than one node. For both, the cockpit's own pre-flight * (`hasStaticText` in `AstEngine.ts`, the deliberate mirror of these refusals) * answers false and `resolveSingletonTextBinding` finds no binding, because the * text is a LITERAL sitting beside a child tag rather than an expression — so * the hand-off is a dead end and the cockpit ends at an "ask in chat" toast * having written nothing. Meanwhile the inspector had already returned WITHOUT * `restoreDirectText`, so the fabricated sentence stood in the live preview over * a file that was never written, with the child element the select-all * overwrote gone and no HMR coming to correct either. One double-click on * `

Desde $100 MXN

` — the shape this file's own split-text * refusal is written for — reached it. * * ☠️ **The third door was the refusal TEST itself, and it stayed open after * those two were closed.** It asked whether any child was a * `JSXExpressionContainer` — the SHAPE — where the question is whether the * element renders DATA. Prettier's `{" "}` line-wrap spacer is a container, so * the ordinary `

¿Ya tienes cuenta?{" "}Inicia sesión

` took this * flag on every inline edit and produced exactly the outcome above. The test is * now `analyzeTextContent`'s: a container holding a plain `Literal` is text this * writer edits ({@link ownTextNodes}), not data it hands off. * * A refusal that carries no flag takes the inspector's generic arm, which * restores the element's text node by node and re-reports the ORIGINAL: the * typed value visibly snaps back, which is the designed way a refused inline * edit is reported to the owner. */ dynamicText?: boolean; /** * Set when a className edit was refused because the attribute is bound to an * expression this writer cannot edit IN PLACE (`className={styles.card}`, * `` className={`px-4 ${gap}`} ``). Collapsing it to a string literal would * delete the binding — see {@link resolveClassNameTarget}. * * The third member of the same family as {@link dynamicAttribute} and * {@link dynamicText}, and it was the one missing: the className arm was the * only editable property with no dynamic refusal at all. */ dynamicClassName?: boolean; } export declare function updateComponentElement(componentId: string, updates: { className?: string; textContent?: string; attributes?: Record; }, rootDir: string): Promise; export declare function deleteComponent(componentId: string, rootDir: string): Promise; //# sourceMappingURL=ast-transformer.d.ts.map