eddyter 1.4.18 → 1.4.19

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.
Files changed (60) hide show
  1. package/dist/AIChatPlugin-BUWq8ixX.js +1042 -0
  2. package/dist/{CombinedAutocompletGrammarPlugin-BXOz6IRb.js → CombinedAutocompletGrammarPlugin-Dq25w8tq.js} +388 -337
  3. package/dist/{CommentBubblePlugin-kiMehQkL.js → CommentBubblePlugin-B77d3Qq6.js} +4 -4
  4. package/dist/CommentPlugin-BJQyKmrN.js +212 -0
  5. package/dist/{NotePanelPlugin-FirMseLu.js → NotePanelPlugin-BqOdcg07.js} +3 -3
  6. package/dist/{TextEnhancePlugin-oXbL_F1i.js → TextEnhancePlugin-BnmdRgUu.js} +2 -2
  7. package/dist/assets/style.css +1 -1
  8. package/dist/components/AnimatedPlaceholderText.d.ts +2 -0
  9. package/dist/components/DividerPicker/DividerPicker.d.ts +17 -0
  10. package/dist/components/EditorialDivider/EditorialDividerView.d.ts +23 -0
  11. package/dist/components/EmojiPickerWidget/EmojiPickerWidget.d.ts +1 -1
  12. package/dist/components/LockedFeature/LockedFeature.d.ts +4 -0
  13. package/dist/components/Toolbar/styles.d.ts +19 -1
  14. package/dist/components/UnifiedColorPicker/UnifiedColorPicker.d.ts +1 -0
  15. package/dist/components/ui/button.d.ts +1 -1
  16. package/dist/components/ui/separator.d.ts +4 -1
  17. package/dist/constants.d.ts +12 -1
  18. package/dist/editorConfig.d.ts +7 -0
  19. package/dist/{generateDocxThumbnail-RE7yNAXP.js → generateDocxThumbnail-DBMxjZ83.js} +1 -1
  20. package/dist/{generatePdfThumbnail-CnldK2yE.js → generatePdfThumbnail-Cv2-ZCzh.js} +4 -4
  21. package/dist/{generateXlsxThumbnail-BpBB4ePK.js → generateXlsxThumbnail-UHmNc7Fa.js} +1 -1
  22. package/dist/hooks/useEditorToolbar.d.ts +1 -1
  23. package/dist/{index-CL0adQ5R.js → index-BaWQzoL2.js} +11 -11
  24. package/dist/{index-CXyZgoBl.js → index-Bex3G_eE.js} +18704 -15777
  25. package/dist/index-C_mjLQUF.js +796 -0
  26. package/dist/{index-C8ZUqYRj.js → index-ChSepytp.js} +26 -26
  27. package/dist/index-Cl_A9eof.js +1508 -0
  28. package/dist/{index-B4W_mfNI.js → index-DcHU8PlQ.js} +120 -123
  29. package/dist/{index-CKRp6axU.js → index-q_TW8dU1.js} +19 -19
  30. package/dist/index.js +7 -7
  31. package/dist/nodes/AsterismNode.d.ts +22 -0
  32. package/dist/nodes/ButtonNode.d.ts +37 -0
  33. package/dist/nodes/ColumnNode.d.ts +44 -0
  34. package/dist/nodes/ColumnsNode.d.ts +45 -0
  35. package/dist/nodes/EditorialFieldNode.d.ts +32 -0
  36. package/dist/nodes/FaqNode.d.ts +28 -0
  37. package/dist/nodes/ImagePlaceholderNode.d.ts +15 -0
  38. package/dist/nodes/LabeledRuleNode.d.ts +33 -0
  39. package/dist/nodes/OrnamentDividerNode.d.ts +22 -0
  40. package/dist/nodes/PullQuoteRulesNode.d.ts +32 -0
  41. package/dist/nodes/SectionNumberHeadingNode.d.ts +42 -0
  42. package/dist/plugins/BlockLayoutPlugin.d.ts +29 -0
  43. package/dist/plugins/ColumnAddButtonPlugin.d.ts +12 -0
  44. package/dist/plugins/CommentPlugin.commands.d.ts +1 -0
  45. package/dist/plugins/CustomHorizontalRulePlugin/CustomHorizontalRuleNode.d.ts +12 -2
  46. package/dist/plugins/CustomHorizontalRulePlugin/HorizontalRuleCustomizationDialog.d.ts +2 -1
  47. package/dist/plugins/CustomHorizontalRulePlugin/styles.d.ts +38 -0
  48. package/dist/plugins/EditorialFloatingToolbarPlugin.d.ts +8 -0
  49. package/dist/plugins/EditorialTypographyPlugin.d.ts +18 -0
  50. package/dist/plugins/PatternsPlugin.d.ts +12 -0
  51. package/dist/{sparkles-CTAYmQOE.js → sparkles-C-XoMho5.js} +1 -1
  52. package/dist/types.d.ts +11 -0
  53. package/dist/ui/Icons.d.ts +34 -9
  54. package/dist/{useVoiceToText-U0yKgS5Q.js → useVoiceToText-BzaLSbRi.js} +17 -17
  55. package/package.json +1 -1
  56. package/dist/AIChatPlugin-DsUPycjT.js +0 -872
  57. package/dist/CommentPlugin-DIuM-Jao.js +0 -154
  58. package/dist/index-DZAvLKar.js +0 -1431
  59. package/dist/index-F2-F96Nx.js +0 -720
  60. package/dist/square-CupR-YWR.js +0 -7
@@ -1,14 +1,14 @@
1
1
  import { jsx as r, jsxs as p } from "react/jsx-runtime";
2
- import { useLexicalComposerContext as B } from "@lexical/react/LexicalComposerContext";
2
+ import { useLexicalComposerContext as j } from "@lexical/react/LexicalComposerContext";
3
3
  import { $getNodeByKey as g } from "lexical";
4
- import { useState as E, useEffect as N } from "react";
5
- import { au as k, av as y, ak as I, aw as h, ax as T, ay as W } from "./index-CXyZgoBl.js";
4
+ import { useState as B, useEffect as N } from "react";
5
+ import { aF as k, aG as y, av as E, aH as h, aI as T, aJ as W } from "./index-Bex3G_eE.js";
6
6
  function $(e, t) {
7
7
  const d = e.split(".").pop()?.toLowerCase();
8
8
  return d === "pdf" || t.startsWith("data:application/pdf") ? "pdf" : d === "docx" || t.startsWith("data:application/vnd.openxmlformats") && e.toLowerCase().endsWith(".docx") ? "docx" : d === "xlsx" || d === "xls" || t.startsWith("data:application/vnd.openxmlformats-officedocument.spreadsheetml") || t.startsWith("data:application/vnd.ms-excel") ? "xlsx" : null;
9
9
  }
10
10
  function z(e, t) {
11
- const [d, n] = E(null);
11
+ const [d, n] = B(null);
12
12
  return N(() => {
13
13
  const c = e && t ? $(t, e) : null;
14
14
  if (!e || !t || !c) {
@@ -16,15 +16,15 @@ function z(e, t) {
16
16
  return;
17
17
  }
18
18
  let l = !1;
19
- return c === "pdf" ? import("./generatePdfThumbnail-CnldK2yE.js").then(({ generatePdfThumbnail: o }) => o(e)).then((o) => {
19
+ return c === "pdf" ? import("./generatePdfThumbnail-Cv2-ZCzh.js").then(({ generatePdfThumbnail: o }) => o(e)).then((o) => {
20
20
  l || n(o);
21
21
  }).catch(() => {
22
22
  l || n(null);
23
- }) : c === "docx" ? import("./generateDocxThumbnail-RE7yNAXP.js").then(({ generateDocxThumbnail: o }) => o(e)).then((o) => {
23
+ }) : c === "docx" ? import("./generateDocxThumbnail-DBMxjZ83.js").then(({ generateDocxThumbnail: o }) => o(e)).then((o) => {
24
24
  l || n(o);
25
25
  }).catch(() => {
26
26
  l || n(null);
27
- }) : c === "xlsx" && import("./generateXlsxThumbnail-BpBB4ePK.js").then(({ generateXlsxThumbnail: o }) => o(e)).then((o) => {
27
+ }) : c === "xlsx" && import("./generateXlsxThumbnail-UHmNc7Fa.js").then(({ generateXlsxThumbnail: o }) => o(e)).then((o) => {
28
28
  l || n(o);
29
29
  }).catch(() => {
30
30
  l || n(null);
@@ -36,10 +36,10 @@ function z(e, t) {
36
36
  const R = (e) => e ? e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : e < 1024 * 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(1)} MB` : `${(e / (1024 * 1024 * 1024)).toFixed(1)} GB` : "", D = (e) => {
37
37
  const t = e.split(".");
38
38
  return t.length > 1 ? t[t.length - 1].toLowerCase() : "";
39
- }, C = (e) => {
39
+ }, F = (e) => {
40
40
  const t = D(e);
41
41
  return t === "pdf" || t === "docx" || t === "xlsx" || t === "xls";
42
- }, F = (e) => {
42
+ }, C = (e) => {
43
43
  const t = D(e);
44
44
  return ["pdf", "doc", "docx", "txt", "odt"].includes(t) ? /* @__PURE__ */ r(h, { className: "cteditor-w-8 cteditor-h-8 cteditor-text-blue-600" }) : ["xls", "xlsx", "csv"].includes(t) ? /* @__PURE__ */ r(h, { className: "cteditor-w-8 cteditor-h-8 cteditor-text-green-600" }) : ["ppt", "pptx"].includes(t) ? /* @__PURE__ */ r(h, { className: "cteditor-w-8 cteditor-h-8 cteditor-text-red-600" }) : ["zip", "rar", "7z", "tar", "gz"].includes(t) ? /* @__PURE__ */ r(T, { className: "cteditor-w-8 cteditor-h-8 cteditor-text-orange-500" }) : /* @__PURE__ */ r(W, { className: "cteditor-w-8 cteditor-h-8 cteditor-text-gray-500" });
45
45
  }, H = ({
@@ -49,7 +49,7 @@ const R = (e) => e ? e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFix
49
49
  displayType: n = "card",
50
50
  nodeKey: c
51
51
  }) => {
52
- const l = n === "inline" ? "inline" : "card", [o] = B(), u = z(C(t) ? e : void 0, t);
52
+ const l = n === "inline" ? "inline" : "card", [o] = j(), u = z(F(t) ? e : void 0, t);
53
53
  if (N(() => {
54
54
  u && o.update(() => {
55
55
  const a = g(c);
@@ -61,12 +61,12 @@ const R = (e) => e ? e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFix
61
61
  a.preventDefault(), a.stopPropagation();
62
62
  try {
63
63
  if (e.startsWith("data:")) {
64
- const i = e.split(","), f = i[0].match(/:(.*?);/), L = f ? f[1] : "application/octet-stream", w = atob(i[1]);
65
- let x = w.length;
66
- const b = new Uint8Array(x);
64
+ const i = e.split(","), f = i[0].match(/:(.*?);/), L = f ? f[1] : "application/octet-stream", b = atob(i[1]);
65
+ let x = b.length;
66
+ const w = new Uint8Array(x);
67
67
  for (; x--; )
68
- b[x] = w.charCodeAt(x);
69
- const j = new Blob([b], { type: L }), v = URL.createObjectURL(j), s = document.createElement("a");
68
+ w[x] = b.charCodeAt(x);
69
+ const I = new Blob([w], { type: L }), v = URL.createObjectURL(I), s = document.createElement("a");
70
70
  s.href = v, s.download = t, s.style.display = "none", document.body.appendChild(s), s.click(), document.body.removeChild(s), setTimeout(() => URL.revokeObjectURL(v), 100);
71
71
  } else {
72
72
  const i = document.createElement("a");
@@ -80,7 +80,7 @@ const R = (e) => e ? e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFix
80
80
  const i = g(c);
81
81
  k(i) && i.remove();
82
82
  });
83
- }, U = C(t) && u;
83
+ }, U = F(t) && u;
84
84
  return l === "inline" ? /* @__PURE__ */ p(
85
85
  "div",
86
86
  {
@@ -89,7 +89,7 @@ const R = (e) => e ? e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFix
89
89
  tabIndex: 0,
90
90
  "data-lexical-node-key": c,
91
91
  children: [
92
- /* @__PURE__ */ r("span", { className: "cteditor-flex-shrink-0 *:cteditor-size-5", children: F(t) }),
92
+ /* @__PURE__ */ r("span", { className: "cteditor-flex-shrink-0 *:cteditor-size-5", children: C(t) }),
93
93
  /* @__PURE__ */ r("span", { className: "cteditor-flex-1 cteditor-min-w-0 cteditor-text-sm cteditor-font-medium cteditor-text-black cteditor-truncate", children: t }),
94
94
  /* @__PURE__ */ r(
95
95
  "button",
@@ -119,7 +119,7 @@ const R = (e) => e ? e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFix
119
119
  alt: "",
120
120
  className: "cteditor-w-full cteditor-h-full cteditor-object-cover"
121
121
  }
122
- ) : /* @__PURE__ */ r("div", { className: "*:cteditor-size-8", children: F(t) }) }),
122
+ ) : /* @__PURE__ */ r("div", { className: "*:cteditor-size-8", children: C(t) }) }),
123
123
  /* @__PURE__ */ p("div", { className: "cteditor-flex cteditor-items-center cteditor-gap-2 cteditor-w-full", children: [
124
124
  /* @__PURE__ */ p("div", { className: "cteditor-flex-1 cteditor-min-w-0", children: [
125
125
  /* @__PURE__ */ r("div", { className: "cteditor-font-medium cteditor-text-xs cteditor-text-black cteditor-truncate", children: t }),
@@ -145,7 +145,7 @@ const R = (e) => e ? e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFix
145
145
  className: "cteditor-p-1 cteditor-rounded-md cteditor-text-black/80 hover:cteditor-bg-black/10 cteditor-transition-colors",
146
146
  "aria-label": "Delete file",
147
147
  title: "Delete file",
148
- children: /* @__PURE__ */ r(I, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-current" })
148
+ children: /* @__PURE__ */ r(E, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-current" })
149
149
  }
150
150
  )
151
151
  ] })
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { aM as i, aN as r, aO as t, aP as s, aQ as o, aR as d, aS as u, aT as v, u as f, Q as n, aU as l, aV as w } from "./index-CXyZgoBl.js";
1
+ import { aX as i, aY as r, aZ as t, a_ as s, a$ as o, b0 as d, b1 as b, b2 as u, u as v, a5 as f, b3 as n, b4 as l } from "./index-Bex3G_eE.js";
2
2
  export {
3
3
  i as ConfigurableEditor,
4
4
  r as ConfigurableEditorWithAuth,
@@ -6,10 +6,10 @@ export {
6
6
  s as EditorProvider,
7
7
  o as HtmlViewProvider,
8
8
  d as LinkPreviewHover,
9
- u as defaultEditorConfig,
10
- v as isReactNativeWebView,
11
- f as useEditor,
12
- n as useHtmlView,
13
- l as useReactNativeBridge,
14
- w as verifyApiKey
9
+ b as defaultEditorConfig,
10
+ u as isReactNativeWebView,
11
+ v as useEditor,
12
+ f as useHtmlView,
13
+ n as useReactNativeBridge,
14
+ l as verifyApiKey
15
15
  };
@@ -0,0 +1,22 @@
1
+ import { DecoratorNode, DOMConversionMap, DOMExportOutput, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from '../../node_modules/lexical';
2
+ export type AsterismVariant = "asterism" | "triple-star" | "section";
3
+ export type SerializedAsterismNode = Spread<{
4
+ variant: AsterismVariant;
5
+ }, SerializedLexicalNode>;
6
+ export declare class AsterismNode extends DecoratorNode<JSX.Element> {
7
+ __variant: AsterismVariant;
8
+ static getType(): string;
9
+ static clone(node: AsterismNode): AsterismNode;
10
+ constructor(variant?: AsterismVariant, key?: NodeKey);
11
+ static importJSON(serializedNode: SerializedAsterismNode): AsterismNode;
12
+ exportJSON(): SerializedAsterismNode;
13
+ static importDOM(): DOMConversionMap | null;
14
+ exportDOM(): DOMExportOutput;
15
+ createDOM(): HTMLElement;
16
+ updateDOM(): false;
17
+ getVariant(): AsterismVariant;
18
+ setVariant(variant: AsterismVariant): void;
19
+ decorate(): JSX.Element;
20
+ }
21
+ export declare function $createAsterismNode(variant?: AsterismVariant): AsterismNode;
22
+ export declare function $isAsterismNode(node: LexicalNode | null | undefined): node is AsterismNode;
@@ -0,0 +1,37 @@
1
+ import { DecoratorNode, DOMConversionMap, DOMExportOutput, EditorConfig, LexicalEditor, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from '../../node_modules/lexical';
2
+ export type ButtonVariant = "filled" | "outline";
3
+ export type ButtonAlign = "left" | "center" | "right";
4
+ export declare function sanitizeButtonHref(href: string): string;
5
+ export type SerializedButtonNode = Spread<{
6
+ label: string;
7
+ href: string;
8
+ variant: ButtonVariant;
9
+ align: ButtonAlign;
10
+ }, SerializedLexicalNode>;
11
+ export declare class ButtonNode extends DecoratorNode<JSX.Element> {
12
+ __label: string;
13
+ __href: string;
14
+ __variant: ButtonVariant;
15
+ __align: ButtonAlign;
16
+ static getType(): string;
17
+ static clone(node: ButtonNode): ButtonNode;
18
+ constructor(label?: string, href?: string, variant?: ButtonVariant, align?: ButtonAlign, key?: NodeKey);
19
+ createDOM(_config: EditorConfig): HTMLElement;
20
+ updateDOM(): boolean;
21
+ static importDOM(): DOMConversionMap | null;
22
+ exportDOM(): DOMExportOutput;
23
+ exportJSON(): SerializedButtonNode;
24
+ static importJSON(serializedNode: SerializedButtonNode): ButtonNode;
25
+ getLabel(): string;
26
+ setLabel(label: string): void;
27
+ getHref(): string;
28
+ setHref(href: string): void;
29
+ getVariant(): ButtonVariant;
30
+ setVariant(variant: ButtonVariant): void;
31
+ getAlign(): ButtonAlign;
32
+ setAlign(align: ButtonAlign): void;
33
+ isInline(): false;
34
+ decorate(_editor: LexicalEditor): JSX.Element;
35
+ }
36
+ export declare function $createButtonNode(label?: string, href?: string, variant?: ButtonVariant, align?: ButtonAlign): ButtonNode;
37
+ export declare function $isButtonNode(node: LexicalNode | null | undefined): node is ButtonNode;
@@ -0,0 +1,44 @@
1
+ import { DOMConversionMap, DOMExportOutput, EditorConfig, ElementNode, LexicalNode, NodeKey, SerializedElementNode, Spread } from '../../node_modules/lexical';
2
+ export declare function clampColumnSpan(value: number | null | undefined): number;
3
+ export type SerializedColumnNode = Spread<{
4
+ span: number;
5
+ }, SerializedElementNode>;
6
+ /**
7
+ * A single column inside a {@link ColumnsNode}. Holds any block-level content
8
+ * (paragraphs, headings, lists, images, …) but — by the nesting rules in the
9
+ * block spec — never another ColumnsNode (max nesting depth = 1).
10
+ *
11
+ * `__span` is how many grid tracks the column occupies. A normal column spans 1;
12
+ * "merging" two columns produces one wider column that spans 2 (or 3), so a row
13
+ * can be e.g. a narrow column beside a double-width one.
14
+ */
15
+ export declare class ColumnNode extends ElementNode {
16
+ __span: number;
17
+ static getType(): string;
18
+ static clone(node: ColumnNode): ColumnNode;
19
+ constructor(span?: number, key?: NodeKey);
20
+ createDOM(_config: EditorConfig): HTMLElement;
21
+ updateDOM(prevNode: ColumnNode, dom: HTMLElement): boolean;
22
+ static importDOM(): DOMConversionMap | null;
23
+ exportDOM(): DOMExportOutput;
24
+ exportJSON(): SerializedColumnNode;
25
+ static importJSON(serializedNode: SerializedColumnNode): ColumnNode;
26
+ getSpan(): number;
27
+ setSpan(span: number): void;
28
+ isShadowRoot(): boolean;
29
+ /** A column is always a self-contained block container, never inline. */
30
+ isInline(): false;
31
+ /** Keep empty columns alive so the placeholder + caret target persist. */
32
+ canBeEmpty(): true;
33
+ /** Text typed at the column boundary must land in a child block, not here. */
34
+ canInsertTextBefore(): false;
35
+ canInsertTextAfter(): false;
36
+ }
37
+ /**
38
+ * @param withParagraph when true (default) seeds an empty paragraph so the
39
+ * column has a caret target and survives Lexical normalization. Pass
40
+ * false during import, where children arrive deserialized.
41
+ * @param span how many grid tracks the column occupies (1 = normal).
42
+ */
43
+ export declare function $createColumnNode(withParagraph?: boolean, span?: number): ColumnNode;
44
+ export declare function $isColumnNode(node: LexicalNode | null | undefined): node is ColumnNode;
@@ -0,0 +1,45 @@
1
+ import { DOMConversionMap, DOMExportOutput, EditorConfig, ElementNode, LexicalNode, NodeKey, SerializedElementNode, Spread } from '../../node_modules/lexical';
2
+ export type ColumnCount = 1 | 2 | 3;
3
+ declare const MIN_COLUMNS = 1;
4
+ declare const MAX_COLUMNS = 3;
5
+ /**
6
+ * The count is the total number of grid *tracks* (the layout width in units),
7
+ * not the number of child columns — a merged/wide column spans more than one
8
+ * track, so `count` = the sum of every column's span (1–3).
9
+ */
10
+ export declare function clampColumnCount(value: number | null | undefined): ColumnCount;
11
+ export type SerializedColumnsNode = Spread<{
12
+ count: ColumnCount;
13
+ }, SerializedElementNode>;
14
+ /**
15
+ * A row of 2–3 {@link ColumnNode}s — the page-builder "columns" layout. Renders
16
+ * as a CSS grid that collapses to a single stack when the editor *container*
17
+ * (not the viewport) is narrow, via the `@container` query in blocks.css and the
18
+ * exported stylesheet. Nesting columns inside columns is disallowed (depth = 1).
19
+ */
20
+ export declare class ColumnsNode extends ElementNode {
21
+ __count: ColumnCount;
22
+ static getType(): string;
23
+ static clone(node: ColumnsNode): ColumnsNode;
24
+ constructor(count?: ColumnCount, key?: NodeKey);
25
+ createDOM(_config: EditorConfig): HTMLElement;
26
+ updateDOM(prevNode: ColumnsNode, dom: HTMLElement): boolean;
27
+ static importDOM(): DOMConversionMap | null;
28
+ exportDOM(): DOMExportOutput;
29
+ exportJSON(): SerializedColumnsNode;
30
+ static importJSON(serializedNode: SerializedColumnsNode): ColumnsNode;
31
+ getCount(): ColumnCount;
32
+ setCount(count: ColumnCount): void;
33
+ isInline(): false;
34
+ /** Always a self-contained layout block; never holds raw text directly. */
35
+ canBeEmpty(): false;
36
+ canInsertTextBefore(): false;
37
+ canInsertTextAfter(): false;
38
+ }
39
+ /**
40
+ * @param withColumns when true (default) seeds `count` empty columns. Pass false
41
+ * during import, where the ColumnNodes arrive deserialized as children.
42
+ */
43
+ export declare function $createColumnsNode(count?: ColumnCount, withColumns?: boolean): ColumnsNode;
44
+ export declare function $isColumnsNode(node: LexicalNode | null | undefined): node is ColumnsNode;
45
+ export { MAX_COLUMNS, MIN_COLUMNS };
@@ -0,0 +1,32 @@
1
+ import { DOMConversionMap, EditorConfig, ElementNode, LexicalNode, NodeKey, RangeSelection, SerializedElementNode, Spread } from '../../node_modules/lexical';
2
+ export type EditorialFieldRole = "label" | "number" | "heading" | "quote" | "attribution";
3
+ export type SerializedEditorialFieldNode = Spread<{
4
+ role: EditorialFieldRole;
5
+ placeholder: string;
6
+ }, SerializedElementNode>;
7
+ export declare class EditorialFieldNode extends ElementNode {
8
+ __role: EditorialFieldRole;
9
+ __placeholder: string;
10
+ static getType(): string;
11
+ static clone(node: EditorialFieldNode): EditorialFieldNode;
12
+ constructor(role: EditorialFieldRole, placeholder?: string, key?: NodeKey);
13
+ createDOM(_config: EditorConfig): HTMLElement;
14
+ updateDOM(prevNode: EditorialFieldNode, dom: HTMLElement): boolean;
15
+ static importDOM(): DOMConversionMap | null;
16
+ exportDOM(): {
17
+ element: HTMLElement;
18
+ };
19
+ exportJSON(): SerializedEditorialFieldNode;
20
+ static importJSON(serializedNode: SerializedEditorialFieldNode): EditorialFieldNode;
21
+ getRole(): EditorialFieldRole;
22
+ isInline(): false;
23
+ /** Keep empty fields alive so the placeholder + caret target persist. */
24
+ canBeEmpty(): true;
25
+ /** New text typed at the boundary stays inside this field. */
26
+ canInsertTextBefore(): boolean;
27
+ canInsertTextAfter(): boolean;
28
+ /** Pressing Enter is handled by the plugin, not by splitting the field. */
29
+ insertNewAfter(_selection: RangeSelection, _restoreSelection?: boolean): null;
30
+ }
31
+ export declare function $createEditorialFieldNode(role: EditorialFieldRole, placeholder?: string): EditorialFieldNode;
32
+ export declare function $isEditorialFieldNode(node: LexicalNode | null | undefined): node is EditorialFieldNode;
@@ -0,0 +1,28 @@
1
+ import { DecoratorNode, DOMConversionMap, DOMExportOutput, EditorConfig, LexicalEditor, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from '../../node_modules/lexical';
2
+ export interface FaqItem {
3
+ q: string;
4
+ a: string;
5
+ }
6
+ export type SerializedFaqNode = Spread<{
7
+ items: FaqItem[];
8
+ }, SerializedLexicalNode>;
9
+ export declare class FaqNode extends DecoratorNode<JSX.Element> {
10
+ __items: FaqItem[];
11
+ static getType(): string;
12
+ static clone(node: FaqNode): FaqNode;
13
+ constructor(items?: FaqItem[], key?: NodeKey);
14
+ createDOM(_config: EditorConfig): HTMLElement;
15
+ updateDOM(): boolean;
16
+ static importDOM(): DOMConversionMap | null;
17
+ exportDOM(): DOMExportOutput;
18
+ exportJSON(): SerializedFaqNode;
19
+ static importJSON(serializedNode: SerializedFaqNode): FaqNode;
20
+ getItems(): FaqItem[];
21
+ setItemField(index: number, field: "q" | "a", value: string): void;
22
+ addItem(): void;
23
+ removeItem(index: number): void;
24
+ isInline(): false;
25
+ decorate(_editor: LexicalEditor): JSX.Element;
26
+ }
27
+ export declare function $createFaqNode(items?: FaqItem[]): FaqNode;
28
+ export declare function $isFaqNode(node: LexicalNode | null | undefined): node is FaqNode;
@@ -0,0 +1,15 @@
1
+ import { DecoratorNode, DOMConversionMap, DOMExportOutput, EditorConfig, LexicalEditor, LexicalNode, SerializedLexicalNode } from '../../node_modules/lexical';
2
+ export declare class ImagePlaceholderNode extends DecoratorNode<JSX.Element> {
3
+ static getType(): string;
4
+ static clone(node: ImagePlaceholderNode): ImagePlaceholderNode;
5
+ static importJSON(): ImagePlaceholderNode;
6
+ exportJSON(): SerializedLexicalNode;
7
+ createDOM(_config: EditorConfig): HTMLElement;
8
+ updateDOM(): boolean;
9
+ static importDOM(): DOMConversionMap | null;
10
+ exportDOM(): DOMExportOutput;
11
+ isInline(): false;
12
+ decorate(_editor: LexicalEditor): JSX.Element;
13
+ }
14
+ export declare function $createImagePlaceholderNode(): ImagePlaceholderNode;
15
+ export declare function $isImagePlaceholderNode(node: LexicalNode | null | undefined): node is ImagePlaceholderNode;
@@ -0,0 +1,33 @@
1
+ import { DOMConversionMap, DOMExportOutput, EditorConfig, ElementNode, LexicalNode, NodeKey, SerializedElementNode, Spread } from '../../node_modules/lexical';
2
+ import { EditorialFieldNode } from './EditorialFieldNode';
3
+ export type LabeledRuleStyle = "thin" | "thick" | "dashed" | "dotted";
4
+ export type SerializedLabeledRuleNode = Spread<{
5
+ ruleStyle: LabeledRuleStyle;
6
+ }, SerializedElementNode>;
7
+ export declare class LabeledRuleNode extends ElementNode {
8
+ __ruleStyle: LabeledRuleStyle;
9
+ static getType(): string;
10
+ static clone(node: LabeledRuleNode): LabeledRuleNode;
11
+ constructor(ruleStyle?: LabeledRuleStyle, key?: NodeKey);
12
+ createDOM(_config: EditorConfig): HTMLElement;
13
+ updateDOM(prevNode: LabeledRuleNode, dom: HTMLElement): boolean;
14
+ static importDOM(): DOMConversionMap | null;
15
+ exportDOM(): DOMExportOutput;
16
+ exportJSON(): SerializedLabeledRuleNode;
17
+ static importJSON(serializedNode: SerializedLabeledRuleNode): LabeledRuleNode;
18
+ getRuleStyle(): LabeledRuleStyle;
19
+ setRuleStyle(ruleStyle: LabeledRuleStyle): void;
20
+ isInline(): false;
21
+ /** Always rendered as a self-contained block. */
22
+ canBeEmpty(): false;
23
+ canInsertTextBefore(): false;
24
+ canInsertTextAfter(): false;
25
+ }
26
+ /**
27
+ * @param withField when true (default) seeds the editable label field. Pass
28
+ * false during import, where the field arrives as a deserialized child.
29
+ */
30
+ export declare function $createLabeledRuleNode(ruleStyle?: LabeledRuleStyle, withField?: boolean): LabeledRuleNode;
31
+ export declare function $isLabeledRuleNode(node: LexicalNode | null | undefined): node is LabeledRuleNode;
32
+ /** Returns the editable label field, if present. */
33
+ export declare function $getLabeledRuleField(node: LabeledRuleNode): EditorialFieldNode | null;
@@ -0,0 +1,22 @@
1
+ import { DecoratorNode, DOMConversionMap, DOMExportOutput, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from '../../node_modules/lexical';
2
+ export type OrnamentVariant = "star" | "flower" | "diamond" | "dot" | "section";
3
+ export type SerializedOrnamentDividerNode = Spread<{
4
+ variant: OrnamentVariant;
5
+ }, SerializedLexicalNode>;
6
+ export declare class OrnamentDividerNode extends DecoratorNode<JSX.Element> {
7
+ __variant: OrnamentVariant;
8
+ static getType(): string;
9
+ static clone(node: OrnamentDividerNode): OrnamentDividerNode;
10
+ constructor(variant?: OrnamentVariant, key?: NodeKey);
11
+ static importJSON(serializedNode: SerializedOrnamentDividerNode): OrnamentDividerNode;
12
+ exportJSON(): SerializedOrnamentDividerNode;
13
+ static importDOM(): DOMConversionMap | null;
14
+ exportDOM(): DOMExportOutput;
15
+ createDOM(): HTMLElement;
16
+ updateDOM(): false;
17
+ getVariant(): OrnamentVariant;
18
+ setVariant(variant: OrnamentVariant): void;
19
+ decorate(): JSX.Element;
20
+ }
21
+ export declare function $createOrnamentDividerNode(variant?: OrnamentVariant): OrnamentDividerNode;
22
+ export declare function $isOrnamentDividerNode(node: LexicalNode | null | undefined): node is OrnamentDividerNode;
@@ -0,0 +1,32 @@
1
+ import { DOMConversionMap, DOMExportOutput, EditorConfig, ElementNode, LexicalNode, NodeKey, SerializedElementNode, Spread } from '../../node_modules/lexical';
2
+ import { EditorialFieldNode } from './EditorialFieldNode';
3
+ export type PullQuoteRules = "full" | "short" | "none";
4
+ export type SerializedPullQuoteRulesNode = Spread<{
5
+ rules: PullQuoteRules;
6
+ }, SerializedElementNode>;
7
+ export declare class PullQuoteRulesNode extends ElementNode {
8
+ __rules: PullQuoteRules;
9
+ static getType(): string;
10
+ static clone(node: PullQuoteRulesNode): PullQuoteRulesNode;
11
+ constructor(rules?: PullQuoteRules, key?: NodeKey);
12
+ createDOM(_config: EditorConfig): HTMLElement;
13
+ updateDOM(prevNode: PullQuoteRulesNode, dom: HTMLElement): boolean;
14
+ static importDOM(): DOMConversionMap | null;
15
+ exportDOM(): DOMExportOutput;
16
+ exportJSON(): SerializedPullQuoteRulesNode;
17
+ static importJSON(serializedNode: SerializedPullQuoteRulesNode): PullQuoteRulesNode;
18
+ getRules(): PullQuoteRules;
19
+ setRules(rules: PullQuoteRules): void;
20
+ isInline(): false;
21
+ canBeEmpty(): false;
22
+ canInsertTextBefore(): false;
23
+ canInsertTextAfter(): false;
24
+ }
25
+ /**
26
+ * @param withFields when true (default) seeds the quote + attribution fields.
27
+ * Pass false during import, where fields arrive as deserialized children.
28
+ */
29
+ export declare function $createPullQuoteRulesNode(rules?: PullQuoteRules, withFields?: boolean): PullQuoteRulesNode;
30
+ export declare function $isPullQuoteRulesNode(node: LexicalNode | null | undefined): node is PullQuoteRulesNode;
31
+ /** [quoteField, attributionField] when present. */
32
+ export declare function $getPullQuoteFields(node: PullQuoteRulesNode): EditorialFieldNode[];
@@ -0,0 +1,42 @@
1
+ import { DOMConversionMap, DOMExportOutput, EditorConfig, ElementNode, LexicalNode, NodeKey, SerializedElementNode, Spread } from '../../node_modules/lexical';
2
+ import { EditorialFieldNode } from './EditorialFieldNode';
3
+ /** Horizontal placement of the number + heading group. */
4
+ export type SectionHeadingAlign = "left" | "center" | "right";
5
+ export type SerializedSectionNumberHeadingNode = Spread<{
6
+ align: SectionHeadingAlign;
7
+ /** v2 hook (spec §11.2) — manual numbering only in v1, default false. */
8
+ autoNumber: boolean;
9
+ }, SerializedElementNode>;
10
+ export declare class SectionNumberHeadingNode extends ElementNode {
11
+ __align: SectionHeadingAlign;
12
+ __autoNumber: boolean;
13
+ static getType(): string;
14
+ static clone(node: SectionNumberHeadingNode): SectionNumberHeadingNode;
15
+ constructor(align?: SectionHeadingAlign, autoNumber?: boolean, key?: NodeKey);
16
+ /** CSS class list, including the `--autonumber` modifier when enabled. */
17
+ private buildClassName;
18
+ createDOM(_config: EditorConfig): HTMLElement;
19
+ updateDOM(prevNode: SectionNumberHeadingNode, dom: HTMLElement): boolean;
20
+ /** 1-based position among auto-numbered section headings before this one. */
21
+ private computeAutoNumber;
22
+ static importDOM(): DOMConversionMap | null;
23
+ exportDOM(): DOMExportOutput;
24
+ exportJSON(): SerializedSectionNumberHeadingNode;
25
+ static importJSON(serializedNode: SerializedSectionNumberHeadingNode): SectionNumberHeadingNode;
26
+ getAlign(): SectionHeadingAlign;
27
+ setAlign(align: SectionHeadingAlign): void;
28
+ getAutoNumber(): boolean;
29
+ setAutoNumber(autoNumber: boolean): void;
30
+ isInline(): false;
31
+ canBeEmpty(): false;
32
+ canInsertTextBefore(): false;
33
+ canInsertTextAfter(): false;
34
+ }
35
+ /**
36
+ * @param withFields when true (default) seeds the number + heading fields. Pass
37
+ * false during import, where fields arrive as deserialized children.
38
+ */
39
+ export declare function $createSectionNumberHeadingNode(align?: SectionHeadingAlign, autoNumber?: boolean, withFields?: boolean): SectionNumberHeadingNode;
40
+ export declare function $isSectionNumberHeadingNode(node: LexicalNode | null | undefined): node is SectionNumberHeadingNode;
41
+ /** [numberField, headingField] when present. */
42
+ export declare function $getSectionFields(node: SectionNumberHeadingNode): EditorialFieldNode[];
@@ -0,0 +1,29 @@
1
+ import { LexicalCommand } from '../../node_modules/lexical';
2
+ import { ColumnCount, ColumnsNode } from '../nodes/ColumnsNode';
3
+ export declare const INSERT_COLUMNS_COMMAND: LexicalCommand<ColumnCount | undefined>;
4
+ export declare const INSERT_BUTTON_BLOCK_COMMAND: LexicalCommand<void>;
5
+ export declare const INSERT_FAQ_COMMAND: LexicalCommand<void>;
6
+ /** Appends an empty column, capped at MAX_COLUMNS tracks. Returns true if changed. */
7
+ export declare function $addColumn(columns: ColumnsNode): boolean;
8
+ /**
9
+ * Removes the last column (floored at one column). The column and its content
10
+ * are deleted together — removing a column removes what's in it, matching the
11
+ * prototype and user expectation.
12
+ */
13
+ export declare function $removeColumn(columns: ColumnsNode): boolean;
14
+ /**
15
+ * Merges the adjacent columns at `index` and `index + 1` into one wider column:
16
+ * the right column's content moves into the left one, whose span grows to cover
17
+ * both. Lets a 3-track row become e.g. a narrow column beside a double-width one.
18
+ * `index` is 0-based (0 merges columns 1 & 2, 1 merges columns 2 & 3).
19
+ */
20
+ export declare function $mergeColumnsAt(columns: ColumnsNode, index: number): boolean;
21
+ /** Convenience: merges the last two columns (used when there's only one pair). */
22
+ export declare function $mergeColumns(columns: ColumnsNode): boolean;
23
+ /**
24
+ * Splits the last wide (span > 1) column back into a narrower column plus a new
25
+ * empty single-track column — the inverse of {@link $mergeColumns}.
26
+ */
27
+ export declare function $splitColumn(columns: ColumnsNode): boolean;
28
+ declare const BlockLayoutPlugin: React.FC;
29
+ export default BlockLayoutPlugin;
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * Renders a small "+ block" button inside each column, matching the prototype's
4
+ * per-column affordance. Clicking it appends a paragraph to that column and
5
+ * opens the slash menu, so a block can be inserted directly into a single
6
+ * column (otherwise the caret + "/" is the only path). Positions are overlaid
7
+ * via a portal — the column DOM stays Lexical-managed and untouched.
8
+ */
9
+ declare const ColumnAddButtonPlugin: React.FC<{
10
+ anchorElem?: HTMLElement;
11
+ }>;
12
+ export default ColumnAddButtonPlugin;
@@ -3,3 +3,4 @@ export declare const INSERT_COMMENT_COMMAND: LexicalCommand<{
3
3
  text: string;
4
4
  }>;
5
5
  export declare const OPEN_COMMENT_MODAL_COMMAND: LexicalCommand<unknown>;
6
+ export declare const OPEN_COMMENT_SIDEBAR_COMMAND: LexicalCommand<unknown>;
@@ -1,10 +1,14 @@
1
1
  import { HorizontalRuleNode as BaseHorizontalRuleNode } from '../../../node_modules/@lexical/react/LexicalHorizontalRuleNode';
2
2
  import { DOMConversionMap, DOMExportOutput, LexicalCommand, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from '../../../node_modules/lexical';
3
3
  export type LineStyle = "solid" | "dashed" | "dotted" | "double";
4
+ /** Width variants for the plain rule (spec §04.2). "full" = 100%, others = % of column. */
5
+ export type WidthVariant = "full" | "60" | "40" | "20";
6
+ export declare const VALID_WIDTH_VARIANTS: WidthVariant[];
4
7
  export interface CustomHorizontalRulePayload {
5
8
  color?: string;
6
9
  strokeWidth?: number;
7
10
  lineStyle?: LineStyle;
11
+ width?: WidthVariant;
8
12
  }
9
13
  export interface OpenHorizontalRuleDialogPayload {
10
14
  editingNodeKey?: NodeKey;
@@ -13,6 +17,7 @@ export type SerializedCustomHorizontalRuleNode = Spread<{
13
17
  color?: string;
14
18
  strokeWidth?: number;
15
19
  lineStyle?: LineStyle;
20
+ width?: WidthVariant;
16
21
  }, SerializedLexicalNode>;
17
22
  export declare const INSERT_CUSTOM_HORIZONTAL_RULE_COMMAND: LexicalCommand<CustomHorizontalRulePayload>;
18
23
  /** Opens the horizontal rule customization dialog (e.g. from slash menu). */
@@ -21,9 +26,12 @@ export declare class CustomHorizontalRuleNode extends BaseHorizontalRuleNode {
21
26
  __color?: string;
22
27
  __strokeWidth?: number;
23
28
  __lineStyle?: LineStyle;
29
+ __width?: WidthVariant;
24
30
  static getType(): string;
25
31
  static clone(node: CustomHorizontalRuleNode): CustomHorizontalRuleNode;
26
- constructor(color?: string, strokeWidth?: number, lineStyle?: LineStyle, key?: NodeKey);
32
+ constructor(color?: string, strokeWidth?: number, lineStyle?: LineStyle, width?: WidthVariant, key?: NodeKey);
33
+ /** Applies the width variant (percentage + centering) to a rule element. */
34
+ private applyWidth;
27
35
  createDOM(): HTMLElement;
28
36
  updateDOM(): boolean;
29
37
  static importDOM(): DOMConversionMap | null;
@@ -36,6 +44,8 @@ export declare class CustomHorizontalRuleNode extends BaseHorizontalRuleNode {
36
44
  setStrokeWidth(strokeWidth?: number): void;
37
45
  getLineStyle(): LineStyle | undefined;
38
46
  setLineStyle(lineStyle?: LineStyle): void;
47
+ getWidth(): WidthVariant | undefined;
48
+ setWidth(width?: WidthVariant): void;
39
49
  }
40
- export declare function $createCustomHorizontalRuleNode(color?: string, strokeWidth?: number, lineStyle?: LineStyle): CustomHorizontalRuleNode;
50
+ export declare function $createCustomHorizontalRuleNode(color?: string, strokeWidth?: number, lineStyle?: LineStyle, width?: WidthVariant): CustomHorizontalRuleNode;
41
51
  export declare function $isCustomHorizontalRuleNode(node: LexicalNode | null | undefined): node is CustomHorizontalRuleNode;
@@ -1,6 +1,6 @@
1
1
  import { BaseSelection, LexicalEditor, NodeKey } from '../../../node_modules/lexical';
2
2
  import { default as React } from 'react';
3
- import { LineStyle } from './CustomHorizontalRuleNode';
3
+ import { LineStyle, WidthVariant } from './CustomHorizontalRuleNode';
4
4
  interface HorizontalRuleCustomizationDialogProps {
5
5
  activeEditor: LexicalEditor;
6
6
  onClose: () => void;
@@ -10,6 +10,7 @@ interface HorizontalRuleCustomizationDialogProps {
10
10
  color: string;
11
11
  strokeWidth: number;
12
12
  lineStyle: LineStyle;
13
+ width?: WidthVariant;
13
14
  } | null;
14
15
  }
15
16
  declare const HorizontalRuleCustomizationDialog: React.FC<HorizontalRuleCustomizationDialogProps>;