UNPKG

laif-ds

Version:

Design System di Laif con componenti React basati su principi di Atomic Design

38 lines (37 loc) 903 B
"use client"; import { $getRoot as a, $isDecoratorNode as u, $isElementNode as c, $isParagraphNode as d, $isTextNode as h } from "../../lexical/Lexical.prod.js"; function $() { return a().getTextContent(); } function g(t, r = !0) { if (t) return !1; let e = $(); return r && (e = e.trim()), e === ""; } function C(t) { if (!g(t, !1)) return !1; const r = a().getChildren(), e = r.length; if (e > 1) return !1; for (let o = 0; o < e; o++) { const n = r[o]; if (u(n)) return !1; if (c(n)) { if (!d(n) || n.__indent !== 0) return !1; const s = n.getChildren(), f = s.length; for (let i = 0; i < f; i++) { const l = s[o]; if (!h(l)) return !1; } } } return !0; } function p(t) { return () => C(t); } export { C as $canShowPlaceholder, p as $canShowPlaceholderCurry, g as $isRootTextContentEmpty, $ as $rootTextContent };