laif-ds 0.1.76 → 0.1.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/prism-cpp.js +3 -0
- package/dist/_virtual/prism-cpp2.js +5 -0
- package/dist/_virtual/prism-java.js +3 -0
- package/dist/_virtual/prism-java2.js +5 -0
- package/dist/_virtual/prism-python.js +3 -0
- package/dist/_virtual/prism-python2.js +5 -0
- package/dist/_virtual/prism-rust.js +3 -0
- package/dist/_virtual/prism-rust2.js +5 -0
- package/dist/_virtual/prism-typescript.js +3 -0
- package/dist/_virtual/prism-typescript2.js +5 -0
- package/dist/_virtual/prism.js +3 -0
- package/dist/_virtual/prism2.js +5 -0
- package/dist/components/editor/context/toolbar-context.js +42 -0
- package/dist/components/editor/editor-hooks/use-modal.js +30 -0
- package/dist/components/editor/editor-hooks/use-update-toolbar.js +24 -0
- package/dist/components/editor/editor-ui/content-editable.js +26 -0
- package/dist/components/editor/plugins/actions/actions-plugin.js +7 -0
- package/dist/components/editor/plugins/actions/clear-editor-plugin.js +39 -0
- package/dist/components/editor/plugins/actions/counter-character-plugin.js +53 -0
- package/dist/components/editor/plugins/toolbar/block-format/block-format-data.js +52 -0
- package/dist/components/editor/plugins/toolbar/block-format/format-bulleted-list.js +26 -0
- package/dist/components/editor/plugins/toolbar/block-format/format-check-list.js +26 -0
- package/dist/components/editor/plugins/toolbar/block-format/format-heading.js +31 -0
- package/dist/components/editor/plugins/toolbar/block-format/format-numbered-list.js +26 -0
- package/dist/components/editor/plugins/toolbar/block-format/format-paragraph.js +23 -0
- package/dist/components/editor/plugins/toolbar/block-format/format-quote.js +24 -0
- package/dist/components/editor/plugins/toolbar/block-format-toolbar-plugin.js +56 -0
- package/dist/components/editor/plugins/toolbar/font-format-toolbar-plugin.js +50 -0
- package/dist/components/editor/plugins/toolbar/history-toolbar-plugin.js +69 -0
- package/dist/components/editor/plugins/toolbar/toolbar-plugin.js +34 -0
- package/dist/components/editor/themes/editor-theme.js +112 -0
- package/dist/components/ui/accordion.js +1 -1
- package/dist/components/ui/alert-dialog.js +3 -3
- package/dist/components/ui/alert.js +3 -3
- package/dist/components/ui/app-editor.js +150 -0
- package/dist/components/ui/app-multiple-select-dropdown.js +13 -13
- package/dist/components/ui/async-select.js +18 -18
- package/dist/components/ui/button.js +25 -24
- package/dist/components/ui/calendar.js +9 -9
- package/dist/components/ui/card.js +26 -26
- package/dist/components/ui/chat-message.js +6 -6
- package/dist/components/ui/chat.js +44 -44
- package/dist/components/ui/context-menu.js +2 -2
- package/dist/components/ui/dialog.js +46 -40
- package/dist/components/ui/drawer.js +33 -33
- package/dist/components/ui/dropdown-menu.js +20 -20
- package/dist/components/ui/file-preview.js +51 -51
- package/dist/components/ui/gantt/components/Controls/Controls.js +51 -60
- package/dist/components/ui/hover-card.js +5 -5
- package/dist/components/ui/input-selector.js +19 -19
- package/dist/components/ui/interrupt-prompt.js +6 -6
- package/dist/components/ui/markdown-renderer.js +16 -16
- package/dist/components/ui/menubar.js +26 -26
- package/dist/components/ui/message-input.js +9 -9
- package/dist/components/ui/multiple-selector.js +20 -20
- package/dist/components/ui/navigation-menu.js +5 -5
- package/dist/components/ui/popover.js +4 -4
- package/dist/components/ui/prompt-suggestions.js +11 -11
- package/dist/components/ui/resizable.js +2 -2
- package/dist/components/ui/sheet.js +16 -16
- package/dist/components/ui/sidebar.js +24 -23
- package/dist/components/ui/table-skeleton.js +36 -36
- package/dist/components/ui/table.js +25 -25
- package/dist/components/ui/toggle-group.js +15 -15
- package/dist/components/ui/weekly-calendar/appointment-card.js +24 -24
- package/dist/index.d.ts +23 -1
- package/dist/index.js +48 -44
- package/dist/laif-ds.css +1 -0
- package/dist/node_modules/@lexical/clipboard/LexicalClipboard.prod.js +159 -0
- package/dist/node_modules/@lexical/code/LexicalCode.prod.js +236 -0
- package/dist/node_modules/@lexical/dragon/LexicalDragon.prod.js +46 -0
- package/dist/node_modules/@lexical/history/LexicalHistory.prod.js +89 -0
- package/dist/node_modules/@lexical/html/LexicalHtml.prod.js +108 -0
- package/dist/node_modules/@lexical/link/LexicalLink.prod.js +187 -0
- package/dist/node_modules/@lexical/list/LexicalList.prod.js +729 -0
- package/dist/node_modules/@lexical/markdown/LexicalMarkdown.prod.js +367 -0
- package/dist/node_modules/@lexical/react/LexicalCheckListPlugin.prod.js +11 -0
- package/dist/node_modules/@lexical/react/LexicalClearEditorPlugin.prod.js +17 -0
- package/dist/node_modules/@lexical/react/LexicalComposer.prod.js +45 -0
- package/dist/node_modules/@lexical/react/LexicalComposerContext.prod.js +22 -0
- package/dist/node_modules/@lexical/react/LexicalContentEditable.prod.js +55 -0
- package/dist/node_modules/@lexical/react/LexicalErrorBoundary.prod.js +49 -0
- package/dist/node_modules/@lexical/react/LexicalHistoryPlugin.prod.js +15 -0
- package/dist/node_modules/@lexical/react/LexicalListPlugin.prod.js +17 -0
- package/dist/node_modules/@lexical/react/LexicalOnChangePlugin.prod.js +16 -0
- package/dist/node_modules/@lexical/react/LexicalRichTextPlugin.prod.js +56 -0
- package/dist/node_modules/@lexical/react/useLexicalEditable.prod.js +21 -0
- package/dist/node_modules/@lexical/rich-text/LexicalRichText.prod.js +376 -0
- package/dist/node_modules/@lexical/selection/LexicalSelection.prod.js +107 -0
- package/dist/node_modules/@lexical/table/LexicalTable.prod.js +661 -0
- package/dist/node_modules/@lexical/text/LexicalText.prod.js +37 -0
- package/dist/node_modules/@lexical/utils/LexicalUtils.prod.js +102 -0
- package/dist/node_modules/lexical/Lexical.prod.js +4901 -0
- package/dist/node_modules/prismjs/components/prism-c.js +77 -0
- package/dist/node_modules/prismjs/components/prism-clike.js +32 -0
- package/dist/node_modules/prismjs/components/prism-cpp.js +93 -0
- package/dist/node_modules/prismjs/components/prism-css.js +56 -0
- package/dist/node_modules/prismjs/components/prism-java.js +122 -0
- package/dist/node_modules/prismjs/components/prism-javascript.js +138 -0
- package/dist/node_modules/prismjs/components/prism-markdown.js +301 -0
- package/dist/node_modules/prismjs/components/prism-markup.js +174 -0
- package/dist/node_modules/prismjs/components/prism-objectivec.js +11 -0
- package/dist/node_modules/prismjs/components/prism-powershell.js +56 -0
- package/dist/node_modules/prismjs/components/prism-python.js +69 -0
- package/dist/node_modules/prismjs/components/prism-rust.js +124 -0
- package/dist/node_modules/prismjs/components/prism-sql.js +34 -0
- package/dist/node_modules/prismjs/components/prism-swift.js +114 -0
- package/dist/node_modules/prismjs/components/prism-typescript.js +53 -0
- package/dist/node_modules/prismjs/prism.js +1165 -0
- package/dist/styles.css +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +12 -1
|
@@ -0,0 +1,661 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { $findMatchingParent as M, addClassNamesToElement as b, removeClassNamesFromElement as A, $descendantsMatching as V } from "../utils/LexicalUtils.prod.js";
|
|
3
|
+
import { $createPoint as K, $isParagraphNode as ot, $isElementNode as X, $normalizeSelection__EXPERIMENTAL as rt, isCurrentlyReadOnlyMode as nt, TEXT_TYPE_TO_FORMAT as lt, ElementNode as k, isHTMLElement as T, $isInlineElementOrDecoratorNode as st, $isTextNode as L, $isLineBreakNode as H, $createParagraphNode as P, $applyNodeReplacement as W, setDOMUnmanaged as it, $getEditor as at, $getNearestNodeFromDOMNode as Y } from "../../lexical/Lexical.prod.js";
|
|
4
|
+
const E = /^(\d+(?:\.\d+)?)px$/, y = { BOTH: 3, NO_STATUS: 0, ROW: 1 };
|
|
5
|
+
class R extends k {
|
|
6
|
+
static getType() {
|
|
7
|
+
return "tablecell";
|
|
8
|
+
}
|
|
9
|
+
static clone(t) {
|
|
10
|
+
return new R(t.__headerState, t.__colSpan, t.__width, t.__key);
|
|
11
|
+
}
|
|
12
|
+
afterCloneFrom(t) {
|
|
13
|
+
super.afterCloneFrom(t), this.__rowSpan = t.__rowSpan, this.__backgroundColor = t.__backgroundColor, this.__verticalAlign = t.__verticalAlign;
|
|
14
|
+
}
|
|
15
|
+
static importDOM() {
|
|
16
|
+
return { td: (t) => ({ conversion: I, priority: 0 }), th: (t) => ({ conversion: I, priority: 0 }) };
|
|
17
|
+
}
|
|
18
|
+
static importJSON(t) {
|
|
19
|
+
return j().updateFromJSON(t);
|
|
20
|
+
}
|
|
21
|
+
updateFromJSON(t) {
|
|
22
|
+
return super.updateFromJSON(t).setHeaderStyles(t.headerState).setColSpan(t.colSpan || 1).setRowSpan(t.rowSpan || 1).setWidth(t.width || void 0).setBackgroundColor(t.backgroundColor || null).setVerticalAlign(t.verticalAlign || void 0);
|
|
23
|
+
}
|
|
24
|
+
constructor(t = y.NO_STATUS, e = 1, o, r) {
|
|
25
|
+
super(r), this.__colSpan = e, this.__rowSpan = 1, this.__headerState = t, this.__width = o, this.__backgroundColor = null, this.__verticalAlign = void 0;
|
|
26
|
+
}
|
|
27
|
+
createDOM(t) {
|
|
28
|
+
const e = document.createElement(this.getTag());
|
|
29
|
+
return this.__width && (e.style.width = `${this.__width}px`), this.__colSpan > 1 && (e.colSpan = this.__colSpan), this.__rowSpan > 1 && (e.rowSpan = this.__rowSpan), this.__backgroundColor !== null && (e.style.backgroundColor = this.__backgroundColor), z(this.__verticalAlign) && (e.style.verticalAlign = this.__verticalAlign), b(e, t.theme.tableCell, this.hasHeader() && t.theme.tableCellHeader), e;
|
|
30
|
+
}
|
|
31
|
+
exportDOM(t) {
|
|
32
|
+
const e = super.exportDOM(t);
|
|
33
|
+
if (T(e.element)) {
|
|
34
|
+
const o = e.element;
|
|
35
|
+
o.setAttribute("data-temporary-table-cell-lexical-key", this.getKey()), o.style.border = "1px solid black", this.__colSpan > 1 && (o.colSpan = this.__colSpan), this.__rowSpan > 1 && (o.rowSpan = this.__rowSpan), o.style.width = `${this.getWidth() || 75}px`, o.style.verticalAlign = this.getVerticalAlign() || "top", o.style.textAlign = "start", this.__backgroundColor === null && this.hasHeader() && (o.style.backgroundColor = "#f2f3f5");
|
|
36
|
+
}
|
|
37
|
+
return e;
|
|
38
|
+
}
|
|
39
|
+
exportJSON() {
|
|
40
|
+
return { ...super.exportJSON(), ...z(this.__verticalAlign) && { verticalAlign: this.__verticalAlign }, backgroundColor: this.getBackgroundColor(), colSpan: this.__colSpan, headerState: this.__headerState, rowSpan: this.__rowSpan, width: this.getWidth() };
|
|
41
|
+
}
|
|
42
|
+
getColSpan() {
|
|
43
|
+
return this.getLatest().__colSpan;
|
|
44
|
+
}
|
|
45
|
+
setColSpan(t) {
|
|
46
|
+
const e = this.getWritable();
|
|
47
|
+
return e.__colSpan = t, e;
|
|
48
|
+
}
|
|
49
|
+
getRowSpan() {
|
|
50
|
+
return this.getLatest().__rowSpan;
|
|
51
|
+
}
|
|
52
|
+
setRowSpan(t) {
|
|
53
|
+
const e = this.getWritable();
|
|
54
|
+
return e.__rowSpan = t, e;
|
|
55
|
+
}
|
|
56
|
+
getTag() {
|
|
57
|
+
return this.hasHeader() ? "th" : "td";
|
|
58
|
+
}
|
|
59
|
+
setHeaderStyles(t, e = y.BOTH) {
|
|
60
|
+
const o = this.getWritable();
|
|
61
|
+
return o.__headerState = t & e | o.__headerState & ~e, o;
|
|
62
|
+
}
|
|
63
|
+
getHeaderStyles() {
|
|
64
|
+
return this.getLatest().__headerState;
|
|
65
|
+
}
|
|
66
|
+
setWidth(t) {
|
|
67
|
+
const e = this.getWritable();
|
|
68
|
+
return e.__width = t, e;
|
|
69
|
+
}
|
|
70
|
+
getWidth() {
|
|
71
|
+
return this.getLatest().__width;
|
|
72
|
+
}
|
|
73
|
+
getBackgroundColor() {
|
|
74
|
+
return this.getLatest().__backgroundColor;
|
|
75
|
+
}
|
|
76
|
+
setBackgroundColor(t) {
|
|
77
|
+
const e = this.getWritable();
|
|
78
|
+
return e.__backgroundColor = t, e;
|
|
79
|
+
}
|
|
80
|
+
getVerticalAlign() {
|
|
81
|
+
return this.getLatest().__verticalAlign;
|
|
82
|
+
}
|
|
83
|
+
setVerticalAlign(t) {
|
|
84
|
+
const e = this.getWritable();
|
|
85
|
+
return e.__verticalAlign = t || void 0, e;
|
|
86
|
+
}
|
|
87
|
+
toggleHeaderStyle(t) {
|
|
88
|
+
const e = this.getWritable();
|
|
89
|
+
return (e.__headerState & t) === t ? e.__headerState -= t : e.__headerState += t, e;
|
|
90
|
+
}
|
|
91
|
+
hasHeaderState(t) {
|
|
92
|
+
return (this.getHeaderStyles() & t) === t;
|
|
93
|
+
}
|
|
94
|
+
hasHeader() {
|
|
95
|
+
return this.getLatest().__headerState !== y.NO_STATUS;
|
|
96
|
+
}
|
|
97
|
+
updateDOM(t) {
|
|
98
|
+
return t.__headerState !== this.__headerState || t.__width !== this.__width || t.__colSpan !== this.__colSpan || t.__rowSpan !== this.__rowSpan || t.__backgroundColor !== this.__backgroundColor || t.__verticalAlign !== this.__verticalAlign;
|
|
99
|
+
}
|
|
100
|
+
isShadowRoot() {
|
|
101
|
+
return !0;
|
|
102
|
+
}
|
|
103
|
+
collapseAtStart() {
|
|
104
|
+
return !0;
|
|
105
|
+
}
|
|
106
|
+
canBeEmpty() {
|
|
107
|
+
return !1;
|
|
108
|
+
}
|
|
109
|
+
canIndent() {
|
|
110
|
+
return !1;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function z(l) {
|
|
114
|
+
return l === "middle" || l === "bottom";
|
|
115
|
+
}
|
|
116
|
+
function I(l) {
|
|
117
|
+
const t = l, e = l.nodeName.toLowerCase();
|
|
118
|
+
let o;
|
|
119
|
+
E.test(t.style.width) && (o = parseFloat(t.style.width));
|
|
120
|
+
const r = j(e === "th" ? y.ROW : y.NO_STATUS, t.colSpan, o);
|
|
121
|
+
r.__rowSpan = t.rowSpan;
|
|
122
|
+
const n = t.style.backgroundColor;
|
|
123
|
+
n !== "" && (r.__backgroundColor = n);
|
|
124
|
+
const s = t.style.verticalAlign;
|
|
125
|
+
z(s) && (r.__verticalAlign = s);
|
|
126
|
+
const i = t.style, a = (i && i.textDecoration || "").split(" "), h = i.fontWeight === "700" || i.fontWeight === "bold", c = a.includes("line-through"), u = i.fontStyle === "italic", d = a.includes("underline");
|
|
127
|
+
return { after: (_) => {
|
|
128
|
+
const w = [];
|
|
129
|
+
let p = null;
|
|
130
|
+
const f = () => {
|
|
131
|
+
if (p) {
|
|
132
|
+
const g = p.getFirstChild();
|
|
133
|
+
H(g) && p.getChildrenSize() === 1 && g.remove();
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
for (const g of _) st(g) || L(g) || H(g) ? (L(g) && (h && g.toggleFormat("bold"), c && g.toggleFormat("strikethrough"), u && g.toggleFormat("italic"), d && g.toggleFormat("underline")), p ? p.append(g) : (p = P().append(g), w.push(p))) : (w.push(g), f(), p = null);
|
|
137
|
+
return f(), w.length === 0 && w.push(P()), w;
|
|
138
|
+
}, node: r };
|
|
139
|
+
}
|
|
140
|
+
function j(l = y.NO_STATUS, t = 1, e) {
|
|
141
|
+
return W(new R(l, t, e));
|
|
142
|
+
}
|
|
143
|
+
function S(l) {
|
|
144
|
+
return l instanceof R;
|
|
145
|
+
}
|
|
146
|
+
function m(l, ...t) {
|
|
147
|
+
const e = new URL("https://lexical.dev/docs/error"), o = new URLSearchParams();
|
|
148
|
+
o.append("code", l);
|
|
149
|
+
for (const r of t) o.append("v", r);
|
|
150
|
+
throw e.search = o.toString(), Error(`Minified Lexical error #${l}; visit ${e.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
151
|
+
}
|
|
152
|
+
class O extends k {
|
|
153
|
+
static getType() {
|
|
154
|
+
return "tablerow";
|
|
155
|
+
}
|
|
156
|
+
static clone(t) {
|
|
157
|
+
return new O(t.__height, t.__key);
|
|
158
|
+
}
|
|
159
|
+
static importDOM() {
|
|
160
|
+
return { tr: (t) => ({ conversion: ct, priority: 0 }) };
|
|
161
|
+
}
|
|
162
|
+
static importJSON(t) {
|
|
163
|
+
return Q().updateFromJSON(t);
|
|
164
|
+
}
|
|
165
|
+
updateFromJSON(t) {
|
|
166
|
+
return super.updateFromJSON(t).setHeight(t.height);
|
|
167
|
+
}
|
|
168
|
+
constructor(t, e) {
|
|
169
|
+
super(e), this.__height = t;
|
|
170
|
+
}
|
|
171
|
+
exportJSON() {
|
|
172
|
+
const t = this.getHeight();
|
|
173
|
+
return { ...super.exportJSON(), ...t === void 0 ? void 0 : { height: t } };
|
|
174
|
+
}
|
|
175
|
+
createDOM(t) {
|
|
176
|
+
const e = document.createElement("tr");
|
|
177
|
+
return this.__height && (e.style.height = `${this.__height}px`), b(e, t.theme.tableRow), e;
|
|
178
|
+
}
|
|
179
|
+
extractWithChild(t, e, o) {
|
|
180
|
+
return o === "html";
|
|
181
|
+
}
|
|
182
|
+
isShadowRoot() {
|
|
183
|
+
return !0;
|
|
184
|
+
}
|
|
185
|
+
setHeight(t) {
|
|
186
|
+
const e = this.getWritable();
|
|
187
|
+
return e.__height = t, e;
|
|
188
|
+
}
|
|
189
|
+
getHeight() {
|
|
190
|
+
return this.getLatest().__height;
|
|
191
|
+
}
|
|
192
|
+
updateDOM(t) {
|
|
193
|
+
return t.__height !== this.__height;
|
|
194
|
+
}
|
|
195
|
+
canBeEmpty() {
|
|
196
|
+
return !1;
|
|
197
|
+
}
|
|
198
|
+
canIndent() {
|
|
199
|
+
return !1;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
function ct(l) {
|
|
203
|
+
const t = l;
|
|
204
|
+
let e;
|
|
205
|
+
return E.test(t.style.height) && (e = parseFloat(t.style.height)), { after: (o) => V(o, S), node: Q(e) };
|
|
206
|
+
}
|
|
207
|
+
function Q(l) {
|
|
208
|
+
return W(new O(l));
|
|
209
|
+
}
|
|
210
|
+
function v(l) {
|
|
211
|
+
return l instanceof O;
|
|
212
|
+
}
|
|
213
|
+
const G = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, ut = G && "documentMode" in document ? document.documentMode : null;
|
|
214
|
+
G && "InputEvent" in window && !ut && new window.InputEvent("input");
|
|
215
|
+
function ht(l, t, e) {
|
|
216
|
+
const [o, r, n] = Z(l, t, e);
|
|
217
|
+
return r === null && m(207), n === null && m(208), [o, r, n];
|
|
218
|
+
}
|
|
219
|
+
function Z(l, t, e) {
|
|
220
|
+
const o = [];
|
|
221
|
+
let r = null, n = null;
|
|
222
|
+
function s(a) {
|
|
223
|
+
let h = o[a];
|
|
224
|
+
return h === void 0 && (o[a] = h = []), h;
|
|
225
|
+
}
|
|
226
|
+
const i = l.getChildren();
|
|
227
|
+
for (let a = 0; a < i.length; a++) {
|
|
228
|
+
const h = i[a];
|
|
229
|
+
v(h) || m(209);
|
|
230
|
+
const c = s(a);
|
|
231
|
+
for (let u = h.getFirstChild(), d = 0; u != null; u = u.getNextSibling()) {
|
|
232
|
+
for (S(u) || m(147); c[d] !== void 0; ) d++;
|
|
233
|
+
const _ = { cell: u, startColumn: d, startRow: a }, { __rowSpan: w, __colSpan: p } = u;
|
|
234
|
+
for (let f = 0; f < w && !(a + f >= i.length); f++) {
|
|
235
|
+
const g = s(a + f);
|
|
236
|
+
for (let C = 0; C < p; C++) g[d + C] = _;
|
|
237
|
+
}
|
|
238
|
+
t !== null && r === null && t.is(u) && (r = _), e !== null && n === null && e.is(u) && (n = _);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return [o, r, n];
|
|
242
|
+
}
|
|
243
|
+
function dt(l) {
|
|
244
|
+
let t;
|
|
245
|
+
if (l instanceof R) t = l;
|
|
246
|
+
else if ("__type" in l) {
|
|
247
|
+
const r = M(l, S);
|
|
248
|
+
S(r) || m(148), t = r;
|
|
249
|
+
} else {
|
|
250
|
+
const r = M(l.getNode(), S);
|
|
251
|
+
S(r) || m(148), t = r;
|
|
252
|
+
}
|
|
253
|
+
const e = t.getParent();
|
|
254
|
+
v(e) || m(149);
|
|
255
|
+
const o = e.getParent();
|
|
256
|
+
return et(o) || m(210), [t, e, o];
|
|
257
|
+
}
|
|
258
|
+
function _t(l, t, e) {
|
|
259
|
+
let o, r = Math.min(t.startColumn, e.startColumn), n = Math.min(t.startRow, e.startRow), s = Math.max(t.startColumn + t.cell.__colSpan - 1, e.startColumn + e.cell.__colSpan - 1), i = Math.max(t.startRow + t.cell.__rowSpan - 1, e.startRow + e.cell.__rowSpan - 1);
|
|
260
|
+
do {
|
|
261
|
+
o = !1;
|
|
262
|
+
for (let a = 0; a < l.length; a++) for (let h = 0; h < l[0].length; h++) {
|
|
263
|
+
const c = l[a][h];
|
|
264
|
+
if (!c) continue;
|
|
265
|
+
const u = c.startColumn + c.cell.__colSpan - 1, d = c.startRow + c.cell.__rowSpan - 1, _ = c.startColumn <= s && u >= r, w = c.startRow <= i && d >= n;
|
|
266
|
+
if (_ && w) {
|
|
267
|
+
const p = Math.min(r, c.startColumn), f = Math.max(s, u), g = Math.min(n, c.startRow), C = Math.max(i, d);
|
|
268
|
+
p === r && f === s && g === n && C === i || (r = p, s = f, n = g, i = C, o = !0);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
} while (o);
|
|
272
|
+
return { maxColumn: s, maxRow: i, minColumn: r, minRow: n };
|
|
273
|
+
}
|
|
274
|
+
function J(l) {
|
|
275
|
+
const [t, , e] = dt(l), o = e.getChildren(), r = o.length, n = o[0].getChildren().length, s = new Array(r);
|
|
276
|
+
for (let i = 0; i < r; i++) s[i] = new Array(n);
|
|
277
|
+
for (let i = 0; i < r; i++) {
|
|
278
|
+
const a = o[i].getChildren();
|
|
279
|
+
let h = 0;
|
|
280
|
+
for (let c = 0; c < a.length; c++) {
|
|
281
|
+
for (; s[i][h]; ) h++;
|
|
282
|
+
const u = a[c], d = u.__rowSpan || 1, _ = u.__colSpan || 1;
|
|
283
|
+
for (let w = 0; w < d; w++) for (let p = 0; p < _; p++) s[i + w][h + p] = u;
|
|
284
|
+
if (t === u) return { colSpan: _, columnIndex: h, rowIndex: i, rowSpan: d };
|
|
285
|
+
h += _;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
function B(l) {
|
|
291
|
+
const [[t, e, o, r], [n, s, i, a]] = ["anchor", "focus"].map((h) => {
|
|
292
|
+
const c = l[h].getNode(), u = M(c, S);
|
|
293
|
+
S(u) || m(238, h, c.getKey(), c.getType());
|
|
294
|
+
const d = u.getParent();
|
|
295
|
+
v(d) || m(239, h);
|
|
296
|
+
const _ = d.getParent();
|
|
297
|
+
return et(_) || m(240, h), [c, u, d, _];
|
|
298
|
+
});
|
|
299
|
+
return r.is(a) || m(241), { anchorCell: e, anchorNode: t, anchorRow: o, anchorTable: r, focusCell: s, focusNode: n, focusRow: i, focusTable: a };
|
|
300
|
+
}
|
|
301
|
+
class $ {
|
|
302
|
+
constructor(t, e, o) {
|
|
303
|
+
this.anchor = e, this.focus = o, e._selection = this, o._selection = this, this._cachedNodes = null, this.dirty = !1, this.tableKey = t;
|
|
304
|
+
}
|
|
305
|
+
getStartEndPoints() {
|
|
306
|
+
return [this.anchor, this.focus];
|
|
307
|
+
}
|
|
308
|
+
isValid() {
|
|
309
|
+
return this.tableKey !== "root" && this.anchor.key !== "root" && this.anchor.type === "element" && this.focus.key !== "root" && this.focus.type === "element";
|
|
310
|
+
}
|
|
311
|
+
isBackward() {
|
|
312
|
+
return this.focus.isBefore(this.anchor);
|
|
313
|
+
}
|
|
314
|
+
getCachedNodes() {
|
|
315
|
+
return this._cachedNodes;
|
|
316
|
+
}
|
|
317
|
+
setCachedNodes(t) {
|
|
318
|
+
this._cachedNodes = t;
|
|
319
|
+
}
|
|
320
|
+
is(t) {
|
|
321
|
+
return gt(t) && this.tableKey === t.tableKey && this.anchor.is(t.anchor) && this.focus.is(t.focus);
|
|
322
|
+
}
|
|
323
|
+
set(t, e, o) {
|
|
324
|
+
this.dirty = this.dirty || t !== this.tableKey || e !== this.anchor.key || o !== this.focus.key, this.tableKey = t, this.anchor.key = e, this.focus.key = o, this._cachedNodes = null;
|
|
325
|
+
}
|
|
326
|
+
clone() {
|
|
327
|
+
return new $(this.tableKey, K(this.anchor.key, this.anchor.offset, this.anchor.type), K(this.focus.key, this.focus.offset, this.focus.type));
|
|
328
|
+
}
|
|
329
|
+
isCollapsed() {
|
|
330
|
+
return !1;
|
|
331
|
+
}
|
|
332
|
+
extract() {
|
|
333
|
+
return this.getNodes();
|
|
334
|
+
}
|
|
335
|
+
insertRawText(t) {
|
|
336
|
+
}
|
|
337
|
+
insertText() {
|
|
338
|
+
}
|
|
339
|
+
hasFormat(t) {
|
|
340
|
+
let e = 0;
|
|
341
|
+
this.getNodes().filter(S).forEach((r) => {
|
|
342
|
+
const n = r.getFirstChild();
|
|
343
|
+
ot(n) && (e |= n.getTextFormat());
|
|
344
|
+
});
|
|
345
|
+
const o = lt[t];
|
|
346
|
+
return !!(e & o);
|
|
347
|
+
}
|
|
348
|
+
insertNodes(t) {
|
|
349
|
+
const e = this.focus.getNode();
|
|
350
|
+
X(e) || m(151), rt(e.select(0, e.getChildrenSize())).insertNodes(t);
|
|
351
|
+
}
|
|
352
|
+
getShape() {
|
|
353
|
+
const { anchorCell: t, focusCell: e } = B(this), o = J(t);
|
|
354
|
+
o === null && m(153);
|
|
355
|
+
const r = J(e);
|
|
356
|
+
r === null && m(155);
|
|
357
|
+
const n = Math.min(o.columnIndex, r.columnIndex), s = Math.max(o.columnIndex + o.colSpan - 1, r.columnIndex + r.colSpan - 1), i = Math.min(o.rowIndex, r.rowIndex), a = Math.max(o.rowIndex + o.rowSpan - 1, r.rowIndex + r.rowSpan - 1);
|
|
358
|
+
return { fromX: Math.min(n, s), fromY: Math.min(i, a), toX: Math.max(n, s), toY: Math.max(i, a) };
|
|
359
|
+
}
|
|
360
|
+
getNodes() {
|
|
361
|
+
if (!this.isValid()) return [];
|
|
362
|
+
const t = this._cachedNodes;
|
|
363
|
+
if (t !== null) return t;
|
|
364
|
+
const { anchorTable: e, anchorCell: o, focusCell: r } = B(this), n = r.getParents()[1];
|
|
365
|
+
if (n !== e) {
|
|
366
|
+
if (e.isParentOf(r)) {
|
|
367
|
+
const f = n.getParent();
|
|
368
|
+
f == null && m(159), this.set(this.tableKey, r.getKey(), f.getKey());
|
|
369
|
+
} else {
|
|
370
|
+
const f = e.getParent();
|
|
371
|
+
f == null && m(158), this.set(this.tableKey, f.getKey(), r.getKey());
|
|
372
|
+
}
|
|
373
|
+
return this.getNodes();
|
|
374
|
+
}
|
|
375
|
+
const [s, i, a] = ht(e, o, r), { minColumn: h, maxColumn: c, minRow: u, maxRow: d } = _t(s, i, a), _ = /* @__PURE__ */ new Map([[e.getKey(), e]]);
|
|
376
|
+
let w = null;
|
|
377
|
+
for (let f = u; f <= d; f++) for (let g = h; g <= c; g++) {
|
|
378
|
+
const { cell: C } = s[f][g], N = C.getParent();
|
|
379
|
+
v(N) || m(160), N !== w && (_.set(N.getKey(), N), w = N), _.has(C.getKey()) || pt(C, (D) => {
|
|
380
|
+
_.set(D.getKey(), D);
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
const p = Array.from(_.values());
|
|
384
|
+
return nt() || (this._cachedNodes = p), p;
|
|
385
|
+
}
|
|
386
|
+
getTextContent() {
|
|
387
|
+
const t = this.getNodes().filter((o) => S(o));
|
|
388
|
+
let e = "";
|
|
389
|
+
for (let o = 0; o < t.length; o++) {
|
|
390
|
+
const r = t[o], n = r.__parent, s = (t[o + 1] || {}).__parent;
|
|
391
|
+
e += r.getTextContent() + (s !== n ? `
|
|
392
|
+
` : " ");
|
|
393
|
+
}
|
|
394
|
+
return e;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
function gt(l) {
|
|
398
|
+
return l instanceof $;
|
|
399
|
+
}
|
|
400
|
+
function pt(l, t) {
|
|
401
|
+
const e = [[l]];
|
|
402
|
+
for (let o = e.at(-1); o !== void 0 && e.length > 0; o = e.at(-1)) {
|
|
403
|
+
const r = o.pop();
|
|
404
|
+
r === void 0 ? e.pop() : t(r) !== !1 && X(r) && e.push(r.getChildren());
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
function x(l) {
|
|
408
|
+
return T(l) && l.nodeName === "TABLE";
|
|
409
|
+
}
|
|
410
|
+
function ft(l, t) {
|
|
411
|
+
for (let e = t, o = null; e !== null; e = e.getParent()) {
|
|
412
|
+
if (l.is(e)) return o;
|
|
413
|
+
S(e) && (o = e);
|
|
414
|
+
}
|
|
415
|
+
return null;
|
|
416
|
+
}
|
|
417
|
+
function mt(l, t, e) {
|
|
418
|
+
return ft(l, Y(t, e));
|
|
419
|
+
}
|
|
420
|
+
function q(l, t, e) {
|
|
421
|
+
if (!t.theme.tableAlignment) return;
|
|
422
|
+
const o = [], r = [];
|
|
423
|
+
for (const n of ["center", "right"]) {
|
|
424
|
+
const s = t.theme.tableAlignment[n];
|
|
425
|
+
s && (n === e ? r : o).push(s);
|
|
426
|
+
}
|
|
427
|
+
A(l, ...o), b(l, ...r);
|
|
428
|
+
}
|
|
429
|
+
const wt = /* @__PURE__ */ new WeakSet();
|
|
430
|
+
function U(l = at()) {
|
|
431
|
+
return wt.has(l);
|
|
432
|
+
}
|
|
433
|
+
class F extends k {
|
|
434
|
+
static getType() {
|
|
435
|
+
return "table";
|
|
436
|
+
}
|
|
437
|
+
getColWidths() {
|
|
438
|
+
return this.getLatest().__colWidths;
|
|
439
|
+
}
|
|
440
|
+
setColWidths(t) {
|
|
441
|
+
const e = this.getWritable();
|
|
442
|
+
return e.__colWidths = t, e;
|
|
443
|
+
}
|
|
444
|
+
static clone(t) {
|
|
445
|
+
return new F(t.__key);
|
|
446
|
+
}
|
|
447
|
+
afterCloneFrom(t) {
|
|
448
|
+
super.afterCloneFrom(t), this.__colWidths = t.__colWidths, this.__rowStriping = t.__rowStriping, this.__frozenColumnCount = t.__frozenColumnCount, this.__frozenRowCount = t.__frozenRowCount;
|
|
449
|
+
}
|
|
450
|
+
static importDOM() {
|
|
451
|
+
return { table: (t) => ({ conversion: St, priority: 1 }) };
|
|
452
|
+
}
|
|
453
|
+
static importJSON(t) {
|
|
454
|
+
return tt().updateFromJSON(t);
|
|
455
|
+
}
|
|
456
|
+
updateFromJSON(t) {
|
|
457
|
+
return super.updateFromJSON(t).setRowStriping(t.rowStriping || !1).setFrozenColumns(t.frozenColumnCount || 0).setFrozenRows(t.frozenRowCount || 0).setColWidths(t.colWidths);
|
|
458
|
+
}
|
|
459
|
+
constructor(t) {
|
|
460
|
+
super(t), this.__rowStriping = !1, this.__frozenColumnCount = 0, this.__frozenRowCount = 0;
|
|
461
|
+
}
|
|
462
|
+
exportJSON() {
|
|
463
|
+
return { ...super.exportJSON(), colWidths: this.getColWidths(), frozenColumnCount: this.__frozenColumnCount ? this.__frozenColumnCount : void 0, frozenRowCount: this.__frozenRowCount ? this.__frozenRowCount : void 0, rowStriping: this.__rowStriping ? this.__rowStriping : void 0 };
|
|
464
|
+
}
|
|
465
|
+
extractWithChild(t, e, o) {
|
|
466
|
+
return o === "html";
|
|
467
|
+
}
|
|
468
|
+
getDOMSlot(t) {
|
|
469
|
+
const e = x(t) ? t : t.querySelector("table");
|
|
470
|
+
return x(e) || m(229), super.getDOMSlot(t).withElement(e).withAfter(e.querySelector("colgroup"));
|
|
471
|
+
}
|
|
472
|
+
createDOM(t, e) {
|
|
473
|
+
const o = document.createElement("table");
|
|
474
|
+
this.__style && (o.style.cssText = this.__style);
|
|
475
|
+
const r = document.createElement("colgroup");
|
|
476
|
+
if (o.appendChild(r), it(r), b(o, t.theme.table), this.updateTableElement(null, o, t), U(e)) {
|
|
477
|
+
const n = document.createElement("div"), s = t.theme.tableScrollableWrapper;
|
|
478
|
+
return s ? b(n, s) : n.style.cssText = "overflow-x: auto;", n.appendChild(o), this.updateTableWrapper(null, n, o, t), n;
|
|
479
|
+
}
|
|
480
|
+
return o;
|
|
481
|
+
}
|
|
482
|
+
updateTableWrapper(t, e, o, r) {
|
|
483
|
+
this.__frozenColumnCount !== (t ? t.__frozenColumnCount : 0) && function(n, s, i, a) {
|
|
484
|
+
a > 0 ? (b(n, i.theme.tableFrozenColumn), s.setAttribute("data-lexical-frozen-column", "true")) : (A(n, i.theme.tableFrozenColumn), s.removeAttribute("data-lexical-frozen-column"));
|
|
485
|
+
}(e, o, r, this.__frozenColumnCount), this.__frozenRowCount !== (t ? t.__frozenRowCount : 0) && function(n, s, i, a) {
|
|
486
|
+
a > 0 ? (b(n, i.theme.tableFrozenRow), s.setAttribute("data-lexical-frozen-row", "true")) : (A(n, i.theme.tableFrozenRow), s.removeAttribute("data-lexical-frozen-row"));
|
|
487
|
+
}(e, o, r, this.__frozenRowCount);
|
|
488
|
+
}
|
|
489
|
+
updateTableElement(t, e, o) {
|
|
490
|
+
this.__style !== (t ? t.__style : "") && (e.style.cssText = this.__style), this.__rowStriping !== (!!t && t.__rowStriping) && function(r, n, s) {
|
|
491
|
+
s ? (b(r, n.theme.tableRowStriping), r.setAttribute("data-lexical-row-striping", "true")) : (A(r, n.theme.tableRowStriping), r.removeAttribute("data-lexical-row-striping"));
|
|
492
|
+
}(e, o, this.__rowStriping), function(r, n, s, i) {
|
|
493
|
+
const a = r.querySelector("colgroup");
|
|
494
|
+
if (!a) return;
|
|
495
|
+
const h = [];
|
|
496
|
+
for (let c = 0; c < s; c++) {
|
|
497
|
+
const u = document.createElement("col"), d = i && i[c];
|
|
498
|
+
d && (u.style.width = `${d}px`), h.push(u);
|
|
499
|
+
}
|
|
500
|
+
a.replaceChildren(...h);
|
|
501
|
+
}(e, 0, this.getColumnCount(), this.getColWidths()), q(e, o, this.getFormatType());
|
|
502
|
+
}
|
|
503
|
+
updateDOM(t, e, o) {
|
|
504
|
+
const r = this.getDOMSlot(e).element;
|
|
505
|
+
return e === r === U() || (T(n = e) && n.nodeName === "DIV" && this.updateTableWrapper(t, e, r, o), this.updateTableElement(t, r, o), !1);
|
|
506
|
+
var n;
|
|
507
|
+
}
|
|
508
|
+
exportDOM(t) {
|
|
509
|
+
const e = super.exportDOM(t), { element: o } = e;
|
|
510
|
+
return { after: (r) => {
|
|
511
|
+
if (e.after && (r = e.after(r)), !x(r) && T(r) && (r = r.querySelector("table")), !x(r)) return null;
|
|
512
|
+
q(r, t._config, this.getFormatType());
|
|
513
|
+
const [n] = Z(this, null, null), s = /* @__PURE__ */ new Map();
|
|
514
|
+
for (const c of n) for (const u of c) {
|
|
515
|
+
const d = u.cell.getKey();
|
|
516
|
+
s.has(d) || s.set(d, { colSpan: u.cell.getColSpan(), startColumn: u.startColumn });
|
|
517
|
+
}
|
|
518
|
+
const i = /* @__PURE__ */ new Set();
|
|
519
|
+
for (const c of r.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")) {
|
|
520
|
+
const u = c.getAttribute("data-temporary-table-cell-lexical-key");
|
|
521
|
+
if (u) {
|
|
522
|
+
const d = s.get(u);
|
|
523
|
+
if (c.removeAttribute("data-temporary-table-cell-lexical-key"), d) {
|
|
524
|
+
s.delete(u);
|
|
525
|
+
for (let _ = 0; _ < d.colSpan; _++) i.add(_ + d.startColumn);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
const a = r.querySelector(":scope > colgroup");
|
|
530
|
+
if (a) {
|
|
531
|
+
const c = Array.from(r.querySelectorAll(":scope > colgroup > col")).filter((u, d) => i.has(d));
|
|
532
|
+
a.replaceChildren(...c);
|
|
533
|
+
}
|
|
534
|
+
const h = r.querySelectorAll(":scope > tr");
|
|
535
|
+
if (h.length > 0) {
|
|
536
|
+
const c = document.createElement("tbody");
|
|
537
|
+
for (const u of h) c.appendChild(u);
|
|
538
|
+
r.append(c);
|
|
539
|
+
}
|
|
540
|
+
return r;
|
|
541
|
+
}, element: !x(o) && T(o) ? o.querySelector("table") : o };
|
|
542
|
+
}
|
|
543
|
+
canBeEmpty() {
|
|
544
|
+
return !1;
|
|
545
|
+
}
|
|
546
|
+
isShadowRoot() {
|
|
547
|
+
return !0;
|
|
548
|
+
}
|
|
549
|
+
getCordsFromCellNode(t, e) {
|
|
550
|
+
const { rows: o, domRows: r } = e;
|
|
551
|
+
for (let n = 0; n < o; n++) {
|
|
552
|
+
const s = r[n];
|
|
553
|
+
if (s != null) for (let i = 0; i < s.length; i++) {
|
|
554
|
+
const a = s[i];
|
|
555
|
+
if (a == null) continue;
|
|
556
|
+
const { elem: h } = a, c = mt(this, h);
|
|
557
|
+
if (c !== null && t.is(c)) return { x: i, y: n };
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
throw new Error("Cell not found in table.");
|
|
561
|
+
}
|
|
562
|
+
getDOMCellFromCords(t, e, o) {
|
|
563
|
+
const { domRows: r } = o, n = r[e];
|
|
564
|
+
if (n == null) return null;
|
|
565
|
+
const s = n[t < n.length ? t : n.length - 1];
|
|
566
|
+
return s ?? null;
|
|
567
|
+
}
|
|
568
|
+
getDOMCellFromCordsOrThrow(t, e, o) {
|
|
569
|
+
const r = this.getDOMCellFromCords(t, e, o);
|
|
570
|
+
if (!r) throw new Error("Cell not found at cords.");
|
|
571
|
+
return r;
|
|
572
|
+
}
|
|
573
|
+
getCellNodeFromCords(t, e, o) {
|
|
574
|
+
const r = this.getDOMCellFromCords(t, e, o);
|
|
575
|
+
if (r == null) return null;
|
|
576
|
+
const n = Y(r.elem);
|
|
577
|
+
return S(n) ? n : null;
|
|
578
|
+
}
|
|
579
|
+
getCellNodeFromCordsOrThrow(t, e, o) {
|
|
580
|
+
const r = this.getCellNodeFromCords(t, e, o);
|
|
581
|
+
if (!r) throw new Error("Node at cords not TableCellNode.");
|
|
582
|
+
return r;
|
|
583
|
+
}
|
|
584
|
+
getRowStriping() {
|
|
585
|
+
return !!this.getLatest().__rowStriping;
|
|
586
|
+
}
|
|
587
|
+
setRowStriping(t) {
|
|
588
|
+
const e = this.getWritable();
|
|
589
|
+
return e.__rowStriping = t, e;
|
|
590
|
+
}
|
|
591
|
+
setFrozenColumns(t) {
|
|
592
|
+
const e = this.getWritable();
|
|
593
|
+
return e.__frozenColumnCount = t, e;
|
|
594
|
+
}
|
|
595
|
+
getFrozenColumns() {
|
|
596
|
+
return this.getLatest().__frozenColumnCount;
|
|
597
|
+
}
|
|
598
|
+
setFrozenRows(t) {
|
|
599
|
+
const e = this.getWritable();
|
|
600
|
+
return e.__frozenRowCount = t, e;
|
|
601
|
+
}
|
|
602
|
+
getFrozenRows() {
|
|
603
|
+
return this.getLatest().__frozenRowCount;
|
|
604
|
+
}
|
|
605
|
+
canSelectBefore() {
|
|
606
|
+
return !0;
|
|
607
|
+
}
|
|
608
|
+
canIndent() {
|
|
609
|
+
return !1;
|
|
610
|
+
}
|
|
611
|
+
getColumnCount() {
|
|
612
|
+
const t = this.getFirstChild();
|
|
613
|
+
if (!t) return 0;
|
|
614
|
+
let e = 0;
|
|
615
|
+
return t.getChildren().forEach((o) => {
|
|
616
|
+
S(o) && (e += o.getColSpan());
|
|
617
|
+
}), e;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
function St(l) {
|
|
621
|
+
const t = tt();
|
|
622
|
+
l.hasAttribute("data-lexical-row-striping") && t.setRowStriping(!0), l.hasAttribute("data-lexical-frozen-column") && t.setFrozenColumns(1), l.hasAttribute("data-lexical-frozen-row") && t.setFrozenRows(1);
|
|
623
|
+
const e = l.querySelector(":scope > colgroup");
|
|
624
|
+
if (e) {
|
|
625
|
+
let o = [];
|
|
626
|
+
for (const r of e.querySelectorAll(":scope > col")) {
|
|
627
|
+
let n = r.style.width || "";
|
|
628
|
+
if (!E.test(n) && (n = r.getAttribute("width") || "", !/^\d+$/.test(n))) {
|
|
629
|
+
o = void 0;
|
|
630
|
+
break;
|
|
631
|
+
}
|
|
632
|
+
o.push(parseFloat(n));
|
|
633
|
+
}
|
|
634
|
+
o && t.setColWidths(o);
|
|
635
|
+
}
|
|
636
|
+
return { after: (o) => V(o, v), node: t };
|
|
637
|
+
}
|
|
638
|
+
function tt() {
|
|
639
|
+
return W(new F());
|
|
640
|
+
}
|
|
641
|
+
function et(l) {
|
|
642
|
+
return l instanceof F;
|
|
643
|
+
}
|
|
644
|
+
export {
|
|
645
|
+
ht as $computeTableMap,
|
|
646
|
+
Z as $computeTableMapSkipCellCheck,
|
|
647
|
+
j as $createTableCellNode,
|
|
648
|
+
tt as $createTableNode,
|
|
649
|
+
Q as $createTableRowNode,
|
|
650
|
+
dt as $getNodeTriplet,
|
|
651
|
+
J as $getTableCellNodeRect,
|
|
652
|
+
U as $isScrollableTablesActive,
|
|
653
|
+
S as $isTableCellNode,
|
|
654
|
+
et as $isTableNode,
|
|
655
|
+
v as $isTableRowNode,
|
|
656
|
+
gt as $isTableSelection,
|
|
657
|
+
y as TableCellHeaderStates,
|
|
658
|
+
R as TableCellNode,
|
|
659
|
+
F as TableNode,
|
|
660
|
+
O as TableRowNode
|
|
661
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { $getRoot as a, $isDecoratorNode as u, $isElementNode as c, $isParagraphNode as d, $isTextNode as h } from "../../lexical/Lexical.prod.js";
|
|
3
|
+
function $() {
|
|
4
|
+
return a().getTextContent();
|
|
5
|
+
}
|
|
6
|
+
function g(t, r = !0) {
|
|
7
|
+
if (t) return !1;
|
|
8
|
+
let e = $();
|
|
9
|
+
return r && (e = e.trim()), e === "";
|
|
10
|
+
}
|
|
11
|
+
function C(t) {
|
|
12
|
+
if (!g(t, !1)) return !1;
|
|
13
|
+
const r = a().getChildren(), e = r.length;
|
|
14
|
+
if (e > 1) return !1;
|
|
15
|
+
for (let o = 0; o < e; o++) {
|
|
16
|
+
const n = r[o];
|
|
17
|
+
if (u(n)) return !1;
|
|
18
|
+
if (c(n)) {
|
|
19
|
+
if (!d(n) || n.__indent !== 0) return !1;
|
|
20
|
+
const s = n.getChildren(), f = s.length;
|
|
21
|
+
for (let i = 0; i < f; i++) {
|
|
22
|
+
const l = s[o];
|
|
23
|
+
if (!h(l)) return !1;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return !0;
|
|
28
|
+
}
|
|
29
|
+
function p(t) {
|
|
30
|
+
return () => C(t);
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
C as $canShowPlaceholder,
|
|
34
|
+
p as $canShowPlaceholderCurry,
|
|
35
|
+
g as $isRootTextContentEmpty,
|
|
36
|
+
$ as $rootTextContent
|
|
37
|
+
};
|