@collabchron/notiq 1.1.11 → 1.2.0

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 (152) hide show
  1. package/dist/AICommandBarPlugin-ZEC755KY.mjs +27 -0
  2. package/dist/{AIDialog-2WZUFWSC.mjs → AIDialog-HJW6PQPR.mjs} +12 -13
  3. package/dist/{AudioComponent-CKLMLB5T.mjs → AudioComponent-W5XMZPQB.mjs} +10 -6
  4. package/dist/{DynamicBlockComponent-2LOADZUX.mjs → DynamicBlockComponent-CHRL2GAQ.mjs} +7 -6
  5. package/dist/{EquationComponent-4NFG55NQ.mjs → EquationComponent-GNQHG53L.mjs} +26 -7
  6. package/dist/{ExcalidrawComponent-SIMURTCA.mjs → ExcalidrawComponent-POMYXDSG.mjs} +34 -7
  7. package/dist/{FileComponent-Y56MX5QD.mjs → FileComponent-EOVCH4V5.mjs} +9 -5
  8. package/dist/{HintComponet-ET7M2Q7S.mjs → HintComponet-QXL5ESND.mjs} +32 -8
  9. package/dist/{InlineImageComponent-FVTA4LXZ.mjs → InlineImageComponent-KDN3VGZC.mjs} +8 -3
  10. package/dist/{StoryBuilderComponent-WQSNFPMM.mjs → StoryBuilderComponent-CBRFPFTR.mjs} +9 -10
  11. package/dist/{chunk-6UVNHT3T.mjs → chunk-4SYRK2NH.mjs} +23 -1
  12. package/dist/chunk-5CJZC5IB.mjs +9086 -0
  13. package/dist/{chunk-MW6MAUY3.mjs → chunk-6NK5DONB.mjs} +1 -1
  14. package/dist/{chunk-N6ILV6NF.mjs → chunk-ACW4DLVO.mjs} +21 -7
  15. package/dist/chunk-BCGD2YXP.mjs +574 -0
  16. package/dist/{chunk-TC3IISJZ.mjs → chunk-BTR3TPIN.mjs} +18 -5
  17. package/dist/{chunk-XAVQAXOJ.mjs → chunk-CQCS5YPS.mjs} +3 -5
  18. package/dist/{chunk-YTLUQJE2.mjs → chunk-D4UBNSUW.mjs} +1 -1
  19. package/dist/{chunk-KNW2CGIP.mjs → chunk-DBRZIA43.mjs} +4 -1
  20. package/dist/{chunk-CDAMHK63.mjs → chunk-GJK2L7ZM.mjs} +23 -2
  21. package/dist/{chunk-GYYLZ3MQ.mjs → chunk-IKYVBTCJ.mjs} +43 -20
  22. package/dist/chunk-IXRA5D53.mjs +10447 -0
  23. package/dist/{chunk-W6VQSFE5.mjs → chunk-J2CEQXG4.mjs} +1 -1
  24. package/dist/{chunk-43Z4Z2KD.mjs → chunk-JTNLN4JI.mjs} +1 -1
  25. package/dist/{chunk-OE5JRLCN.mjs → chunk-ONOHG5NB.mjs} +6 -4
  26. package/dist/{chunk-XZXGYNTY.mjs → chunk-OO42URWA.mjs} +27 -6
  27. package/dist/chunk-PBVRSNGU.mjs +129 -0
  28. package/dist/chunk-QCS57TIF.mjs +1794 -0
  29. package/dist/chunk-RNEIJRUS.mjs +60 -0
  30. package/dist/chunk-TJPTGECP.mjs +1556 -0
  31. package/dist/{chunk-XYMXGU4T.mjs → chunk-TMYRA2W4.mjs} +1 -1
  32. package/dist/{chunk-ZFV2HGD3.mjs → chunk-UNEFOZTS.mjs} +1 -1
  33. package/dist/chunk-X4NI7EQS.mjs +282 -0
  34. package/dist/chunk-XAJ4GACN.mjs +746 -0
  35. package/dist/{chunk-7QRJVZQY.mjs → chunk-YVUQRJVV.mjs} +63 -18
  36. package/dist/components/editor/Core.d.ts +15 -2
  37. package/dist/components/editor/index.d.ts +16 -5
  38. package/dist/components/editor/nodes/EquationNode/EquationNode.d.ts +1 -0
  39. package/dist/components/editor/nodes/Hint/index.d.ts +2 -1
  40. package/dist/components/editor/plugins/AICommandBarPlugin/index.d.ts +73 -1
  41. package/dist/components/editor/plugins/DraggableBlockPlugin/index.d.ts +25 -3
  42. package/dist/components/editor/plugins/InlineCopilotPlugin/index.d.ts +16 -3
  43. package/dist/components/editor/plugins/LinkWithMetaData/index.d.ts +20 -25
  44. package/dist/components/editor/plugins/MarkdownPastePlugin/index.d.ts +5 -0
  45. package/dist/components/editor/plugins/MarkdownTransformers/index.d.ts +2 -0
  46. package/dist/components/editor/plugins/SlashCommand/index.d.ts +18 -1
  47. package/dist/components/editor/plugins/SmartTypographyPlugin/index.d.ts +26 -0
  48. package/dist/components/editor/utils/aiStream.d.ts +27 -0
  49. package/dist/components/editor/utils/excalidrawDiagramBuilder.d.ts +29 -0
  50. package/dist/components/editor/utils/markdownTransformers.d.ts +4 -1
  51. package/dist/components/editor/utils/url.d.ts +16 -4
  52. package/dist/components/providers/AIContext.d.ts +8 -0
  53. package/dist/components/ui/equation/equationTypography.d.ts +23 -0
  54. package/dist/core/extension.d.ts +3 -1
  55. package/dist/core/extensions/blocks-kit.d.ts +22 -1
  56. package/dist/core/extensions/copilot-and-collab.d.ts +15 -1
  57. package/dist/core/index.d.ts +2 -1
  58. package/dist/core/react/NotiqContent.d.ts +4 -1
  59. package/dist/core/react/NotiqEditor.d.ts +8 -8
  60. package/dist/core/react/index.d.ts +1 -0
  61. package/dist/core/react/node-renderers.d.ts +73 -0
  62. package/dist/core/types.d.ts +1 -0
  63. package/dist/core.js +18136 -9084
  64. package/dist/core.mjs +58 -44
  65. package/dist/hooks/instructions-messages.d.ts +13 -4
  66. package/dist/{image-TPW7PZZK.mjs → image-AL6PHM2A.mjs} +18 -13
  67. package/dist/index.js +15180 -12858
  68. package/dist/index.mjs +121 -1641
  69. package/dist/{insert-audio-C66RZRKY.mjs → insert-audio-CRWR7EO5.mjs} +6 -8
  70. package/dist/{insert-file-3DTGRO7W.mjs → insert-file-I73AZW3L.mjs} +6 -8
  71. package/dist/{insert-gif-FIMCCBAI.mjs → insert-gif-KWRC3ACT.mjs} +4 -4
  72. package/dist/{insert-image-CZV6HWQZ.mjs → insert-image-XIY6BGW5.mjs} +6 -5
  73. package/dist/{insert-poll-6BCIFY5G.mjs → insert-poll-J5YVZNZ4.mjs} +4 -3
  74. package/dist/{insert-table-ZRJP6X52.mjs → insert-table-OIMJRFFK.mjs} +1 -1
  75. package/dist/{poll-component-VHMM5KKZ.mjs → poll-component-TVHXIKGQ.mjs} +3 -2
  76. package/dist/react.js +17933 -9531
  77. package/dist/react.mjs +41 -34
  78. package/dist/{stepper-4AO5XMO7.mjs → stepper-ILF7YXTO.mjs} +64 -74
  79. package/dist/styles/notiq.css +1 -1
  80. package/package.json +2 -2
  81. package/src/styles/notiq.css +20 -0
  82. package/dist/AICommandBarPlugin-TADJ3X2Y.mjs +0 -12
  83. package/dist/CodeActionMenuPlugin-MRKY67ED.mjs +0 -14
  84. package/dist/CollaborationPlugin-TIZOQBUT.mjs +0 -405
  85. package/dist/CollaboratorsBar-TMKBOBJI.mjs +0 -20
  86. package/dist/CommentsPlugin-5M4RD6YO.mjs +0 -19
  87. package/dist/ExcalidrawPlugin-2SGPIQ6U.mjs +0 -14
  88. package/dist/ExportPlugin-OKZOLBGS.mjs +0 -42
  89. package/dist/FloatingLinkEditorPlugin-MABB34L7.mjs +0 -12
  90. package/dist/FloatingTextFormatToolbarPlugin-SO5VON7Q.mjs +0 -45
  91. package/dist/InlineCopilotPlugin-PNS5Y6OO.mjs +0 -360
  92. package/dist/MobileToolbar-JKP2MLQJ.mjs +0 -984
  93. package/dist/SlashCommand-2TNOOUBM.mjs +0 -39
  94. package/dist/TableCellActionMenuPlugin-YWBA64J7.mjs +0 -838
  95. package/dist/TableHoverActionsPlugin-2EIXHEXN.mjs +0 -265
  96. package/dist/TemplatePlugin-HNTPEXBB.mjs +0 -9
  97. package/dist/ToolbarPlugin-IIAOU4P5.mjs +0 -35
  98. package/dist/VersionHistoryPlugin-23MAZB4G.mjs +0 -371
  99. package/dist/background-color-OZJCBYCT.mjs +0 -425
  100. package/dist/block-format-MTSIXWID.mjs +0 -14
  101. package/dist/chunk-2KESP7OU.mjs +0 -809
  102. package/dist/chunk-3AHNLIME.mjs +0 -1701
  103. package/dist/chunk-3IILA3IP.mjs +0 -28
  104. package/dist/chunk-4DVIYZVB.mjs +0 -193
  105. package/dist/chunk-4FFTOZGJ.mjs +0 -103
  106. package/dist/chunk-4UMUPCDK.mjs +0 -68
  107. package/dist/chunk-6D6QLRYR.mjs +0 -238
  108. package/dist/chunk-6SRMKQSD.mjs +0 -682
  109. package/dist/chunk-ACV47ZKE.mjs +0 -201
  110. package/dist/chunk-AYNKORDO.mjs +0 -6
  111. package/dist/chunk-BGV62GC2.mjs +0 -26
  112. package/dist/chunk-D3IOUQFR.mjs +0 -441
  113. package/dist/chunk-EEBA6OAH.mjs +0 -59
  114. package/dist/chunk-EIZMKFHF.mjs +0 -32
  115. package/dist/chunk-EVPWKNE4.mjs +0 -27
  116. package/dist/chunk-FMJ7DGWP.mjs +0 -144
  117. package/dist/chunk-FYLRS4BG.mjs +0 -88
  118. package/dist/chunk-HOZ4QRFV.mjs +0 -536
  119. package/dist/chunk-IAFCQV3Z.mjs +0 -349
  120. package/dist/chunk-IU2N42JJ.mjs +0 -1763
  121. package/dist/chunk-J6ZUY5BY.mjs +0 -202
  122. package/dist/chunk-K5OAFEVY.mjs +0 -191
  123. package/dist/chunk-KDA7ZYMJ.mjs +0 -431
  124. package/dist/chunk-KXRLARGI.mjs +0 -26
  125. package/dist/chunk-LAUAYRPC.mjs +0 -944
  126. package/dist/chunk-LLCP7NVE.mjs +0 -449
  127. package/dist/chunk-LU2XWLOE.mjs +0 -219
  128. package/dist/chunk-MPTE332I.mjs +0 -787
  129. package/dist/chunk-MTQZWJHR.mjs +0 -111
  130. package/dist/chunk-OXWTZV3U.mjs +0 -174
  131. package/dist/chunk-PD5K4AGP.mjs +0 -64
  132. package/dist/chunk-PFH63ZU4.mjs +0 -33
  133. package/dist/chunk-PHRVYPVM.mjs +0 -808
  134. package/dist/chunk-R7WFRENU.mjs +0 -262
  135. package/dist/chunk-RAVYEEIC.mjs +0 -36
  136. package/dist/chunk-RJQTA6HG.mjs +0 -358
  137. package/dist/chunk-SAOJHVPE.mjs +0 -153
  138. package/dist/chunk-VGAX6YEY.mjs +0 -399
  139. package/dist/chunk-W6GAJXUS.mjs +0 -334
  140. package/dist/chunk-XYDBUQ6Z.mjs +0 -1978
  141. package/dist/chunk-XYT6XM5S.mjs +0 -496
  142. package/dist/chunk-YDDBQZ77.mjs +0 -409
  143. package/dist/chunk-YE7M2VKR.mjs +0 -132
  144. package/dist/chunk-Z6JAFF55.mjs +0 -555
  145. package/dist/chunk-ZKZ7MLSS.mjs +0 -165
  146. package/dist/color-23323E3B.mjs +0 -13
  147. package/dist/font-IJKFR4BM.mjs +0 -12
  148. package/dist/font-size-GTL6UVQL.mjs +0 -15
  149. package/dist/insert-node-MA3FXEYN.mjs +0 -245
  150. package/dist/table-dropdown-4VCRSQB6.mjs +0 -391
  151. package/dist/text-align-CSDLJUDA.mjs +0 -121
  152. package/dist/text-format-6L5N3CHZ.mjs +0 -15
@@ -1,3 +1,6 @@
1
+ import {
2
+ NodeRendererSlot
3
+ } from "./chunk-RNEIJRUS.mjs";
1
4
  import {
2
5
  __spreadProps,
3
6
  __spreadValues,
@@ -10,24 +13,32 @@ import {
10
13
  createCommand,
11
14
  createEditor,
12
15
  DecoratorNode,
16
+ ParagraphNode,
17
+ TextNode,
13
18
  $getSelection,
14
19
  $isRangeSelection,
15
20
  COMMAND_PRIORITY_LOW
16
21
  } from "lexical";
22
+ import { LinkNode } from "@lexical/link";
23
+ import { $generateHtmlFromNodes } from "@lexical/html";
17
24
  import React, { Suspense, useEffect } from "react";
18
25
  import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
19
26
  import { jsx } from "react/jsx-runtime";
20
- var HintComponent = React.lazy(() => import("./HintComponet-ET7M2Q7S.mjs"));
27
+ var HintComponent = React.lazy(() => import("./HintComponet-QXL5ESND.mjs"));
21
28
  var Hint = class _Hint extends DecoratorNode {
22
29
  constructor(variant = "tip", emojiOrCaption, caption, key) {
23
30
  super(key);
24
31
  this.__variant = variant;
25
32
  let initialEditor;
26
- if (typeof emojiOrCaption === "string") {
27
- this.__emoji = emojiOrCaption;
33
+ if (caption) {
28
34
  initialEditor = caption;
29
- } else {
35
+ if (typeof emojiOrCaption === "string") {
36
+ this.__emoji = emojiOrCaption;
37
+ }
38
+ } else if (emojiOrCaption && typeof emojiOrCaption !== "string") {
30
39
  initialEditor = emojiOrCaption;
40
+ } else if (typeof emojiOrCaption === "string") {
41
+ this.__emoji = emojiOrCaption;
31
42
  }
32
43
  if (!initialEditor) {
33
44
  const initialEditorState = {
@@ -61,7 +72,9 @@ var Hint = class _Hint extends DecoratorNode {
61
72
  version: 1
62
73
  }
63
74
  };
64
- const newEditor = createEditor();
75
+ const newEditor = createEditor({
76
+ nodes: [ParagraphNode, TextNode, LinkNode]
77
+ });
65
78
  const parsedEditorState = newEditor.parseEditorState(JSON.stringify(initialEditorState));
66
79
  newEditor.setEditorState(parsedEditorState);
67
80
  this.__caption = newEditor;
@@ -76,11 +89,12 @@ var Hint = class _Hint extends DecoratorNode {
76
89
  return new _Hint(node.__variant, node.__emoji, node.__caption, node.__key);
77
90
  }
78
91
  static importJSON(serializedNode) {
79
- return new _Hint(
92
+ const hint = new _Hint(
80
93
  serializedNode.variant || "tip",
81
94
  serializedNode.emoji,
82
95
  void 0
83
- ).updateFromJSON(serializedNode);
96
+ );
97
+ return hint.updateFromJSON(serializedNode);
84
98
  }
85
99
  setVariant(variant) {
86
100
  const self = this.getWritable();
@@ -97,6 +111,24 @@ var Hint = class _Hint extends DecoratorNode {
97
111
  element.className = `hint-${this.__variant || "tip"}`;
98
112
  return element;
99
113
  }
114
+ exportDOM(editor) {
115
+ const element = document.createElement("div");
116
+ element.className = `notiq-callout notiq-callout-${this.__variant || "tip"}`;
117
+ element.setAttribute("data-callout-type", this.__variant || "tip");
118
+ if (this.__emoji) {
119
+ element.setAttribute("data-callout-emoji", this.__emoji);
120
+ }
121
+ let html = "";
122
+ try {
123
+ this.__caption.getEditorState().read(() => {
124
+ html = $generateHtmlFromNodes(this.__caption, null);
125
+ });
126
+ } catch (e) {
127
+ html = "";
128
+ }
129
+ element.innerHTML = html;
130
+ return { element };
131
+ }
100
132
  updateFromJSON(serializedNode) {
101
133
  var _a;
102
134
  super.updateFromJSON(serializedNode);
@@ -104,10 +136,11 @@ var Hint = class _Hint extends DecoratorNode {
104
136
  this.__emoji = serializedNode.emoji;
105
137
  const nestedEditor = this.__caption;
106
138
  if ((_a = serializedNode.caption) == null ? void 0 : _a.editorState) {
107
- const editorState = nestedEditor.parseEditorState(serializedNode.caption.editorState);
108
- if (!editorState.isEmpty()) {
109
- nestedEditor.setEditorState(editorState);
110
- }
139
+ const raw = serializedNode.caption.editorState;
140
+ const editorState = nestedEditor.parseEditorState(
141
+ typeof raw === "string" ? raw : JSON.stringify(raw)
142
+ );
143
+ nestedEditor.setEditorState(editorState);
111
144
  }
112
145
  return this;
113
146
  }
@@ -123,15 +156,27 @@ var Hint = class _Hint extends DecoratorNode {
123
156
  return false;
124
157
  }
125
158
  decorate() {
126
- return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
127
- HintComponent,
159
+ return /* @__PURE__ */ jsx(
160
+ NodeRendererSlot,
128
161
  {
129
- type: this.__variant,
130
- emoji: this.__emoji,
131
- captionEditor: this.__caption,
132
- nodeKey: this.getKey()
162
+ nodeType: "hint",
163
+ rendererProps: {
164
+ type: this.__variant,
165
+ emoji: this.__emoji,
166
+ captionEditor: this.__caption,
167
+ nodeKey: this.getKey()
168
+ },
169
+ fallback: /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
170
+ HintComponent,
171
+ {
172
+ type: this.__variant,
173
+ emoji: this.__emoji,
174
+ captionEditor: this.__caption,
175
+ nodeKey: this.getKey()
176
+ }
177
+ ) })
133
178
  }
134
- ) });
179
+ );
135
180
  }
136
181
  };
137
182
  function $isHintNode(node) {
@@ -1,6 +1,19 @@
1
+ import { type EditorState, type LexicalEditor } from "lexical";
1
2
  import { ToolbarConfig } from "./index";
2
- export default function Core({ toolbarConfig, content, showCollaboratorsBar, }: {
3
+ export interface CoreProps {
3
4
  toolbarConfig?: ToolbarConfig;
4
5
  content?: unknown;
5
6
  showCollaboratorsBar?: boolean;
6
- }): import("react").JSX.Element;
7
+ className?: string;
8
+ editorClassName?: string;
9
+ onChange?: (editorState: EditorState, editor: LexicalEditor) => void;
10
+ onUpdate?: (payload: {
11
+ json: any;
12
+ html: string;
13
+ markdown: string;
14
+ editor: LexicalEditor;
15
+ }) => void;
16
+ onEditorReady?: (editor: LexicalEditor) => void;
17
+ children?: React.ReactNode;
18
+ }
19
+ export default function Core({ toolbarConfig, content, showCollaboratorsBar, className, editorClassName, onChange, onUpdate, onEditorReady, children, }: CoreProps): import("react").JSX.Element;
@@ -1,5 +1,4 @@
1
1
  import React from "react";
2
- import "./themes/theme.css";
3
2
  import { CollabProvider, useCollab, type CollabConfig, type CollabUser, type CollabConnectionStatus } from "../providers/CollabContext";
4
3
  import { CommentsProvider, useComments, type CommentThread } from "../providers/CommentsContext";
5
4
  import { VersionHistoryProvider, useVersionHistory, type DocumentVersion } from "../providers/VersionHistoryContext";
@@ -7,7 +6,7 @@ import CollaboratorsBar, { OfflineBanner } from "./plugins/CollaborationPlugin/C
7
6
  import { type AIConfig } from "../providers/AIContext";
8
7
  import { type UploadConfig } from "../providers/UploadContext";
9
8
  export { CollaboratorsBar, OfflineBanner, CollabProvider, useCollab, type CollabConfig, type CollabUser, type CollabConnectionStatus, CommentsProvider, useComments, type CommentThread, VersionHistoryProvider, useVersionHistory, type DocumentVersion, };
10
- export type ToolbarItem = "undo" | "redo" | "block-format" | "font-family" | "font-size" | "bold" | "italic" | "underline" | "code" | "link" | "table" | "color" | "bg-color" | "text-format" | "insert" | "align" | "speech" | "template" | "download" | "export-md" | "export-pdf" | "separator";
9
+ export type ToolbarItem = "undo" | "redo" | "ai" | "block-format" | "font-family" | "font-size" | "bold" | "italic" | "underline" | "code" | "link" | "table" | "color" | "bg-color" | "text-format" | "insert" | "align" | "speech" | "template" | "download" | "export-md" | "export-pdf" | "separator";
11
10
  export type ToolbarConfig = {
12
11
  items?: ToolbarItem[];
13
12
  className?: string;
@@ -16,12 +15,24 @@ export type ToolbarConfig = {
16
15
  mobileClassName?: string;
17
16
  mobileItemClassName?: string;
18
17
  };
19
- export default function Editor({ isEditable, content, aiConfig, uploadConfig, toolbarConfig, collabConfig, showCollaboratorsBar, }: {
20
- isEditable: boolean;
18
+ export type EditorProps = {
19
+ isEditable?: boolean;
21
20
  content?: unknown;
22
21
  aiConfig?: AIConfig;
23
22
  uploadConfig?: UploadConfig;
24
23
  toolbarConfig?: ToolbarConfig;
25
24
  collabConfig?: CollabConfig;
26
25
  showCollaboratorsBar?: boolean;
27
- }): React.JSX.Element;
26
+ className?: string;
27
+ editorClassName?: string;
28
+ onChange?: (editorState: any, editor: any) => void;
29
+ onUpdate?: (payload: {
30
+ json: any;
31
+ html: string;
32
+ markdown: string;
33
+ editor: any;
34
+ }) => void;
35
+ onEditorReady?: (editor: any) => void;
36
+ children?: React.ReactNode;
37
+ };
38
+ export default function Editor({ isEditable, content, aiConfig, uploadConfig, toolbarConfig, collabConfig, showCollaboratorsBar, className, editorClassName, onChange, onUpdate, onEditorReady, children, }: EditorProps): React.JSX.Element;
@@ -24,6 +24,7 @@ export declare class EquationNode extends DecoratorNode<JSX.Element> {
24
24
  exportDOM(): DOMExportOutput;
25
25
  static importDOM(): DOMConversionMap | null;
26
26
  updateDOM(prevNode: this): boolean;
27
+ isInline(): boolean;
27
28
  getTextContent(): string;
28
29
  getEquation(): string;
29
30
  setEquation(equation: string): void;
@@ -1,4 +1,4 @@
1
- import { DecoratorNode, LexicalCommand, LexicalEditor, LexicalNode, NodeKey, SerializedEditor, SerializedLexicalNode, Spread } from "lexical";
1
+ import { DecoratorNode, DOMExportOutput, LexicalCommand, LexicalEditor, LexicalNode, NodeKey, SerializedEditor, SerializedLexicalNode, Spread } from "lexical";
2
2
  import React from "react";
3
3
  export type HintType = "hint" | "note" | "info" | "tip" | "important" | "warning" | "caution" | "error" | "success" | "neutral";
4
4
  export type SerializedHint = Spread<{
@@ -18,6 +18,7 @@ export declare class Hint extends DecoratorNode<React.ReactElement> {
18
18
  setVariant(variant: HintType): this;
19
19
  setEmoji(emoji?: string): this;
20
20
  createDOM(): HTMLElement;
21
+ exportDOM(editor: LexicalEditor): DOMExportOutput;
21
22
  updateFromJSON(serializedNode: SerializedHint): this;
22
23
  exportJSON(): SerializedHint;
23
24
  updateDOM(): false;
@@ -4,4 +4,76 @@ export declare const OPEN_AI_COMMAND_BAR_COMMAND: LexicalCommand<{
4
4
  initialPrompt?: string;
5
5
  action?: string;
6
6
  } | void>;
7
- export default function AICommandBarPlugin(): React.ReactPortal | null;
7
+ type AIPhase = "closed" | "prompt" | "streaming" | "review";
8
+ export interface ResearchSource {
9
+ title: string;
10
+ url: string;
11
+ }
12
+ /**
13
+ * Splits `<thinking>...</thinking>` reasoning blocks and `<!--SOURCES:[...]-->`
14
+ * metadata out of a streaming AI response so they never pollute the editor canvas.
15
+ */
16
+ export declare function extractThinkingAndSources(raw: string): {
17
+ thinking: string;
18
+ sources: ResearchSource[];
19
+ content: string;
20
+ };
21
+ interface AIPreset {
22
+ id: string;
23
+ action: string;
24
+ label: string;
25
+ keywords: string[];
26
+ prompt?: string;
27
+ icon: React.ComponentType<{
28
+ className?: string;
29
+ }>;
30
+ badge?: string;
31
+ hasSubmenu?: "tone" | "language";
32
+ think?: boolean;
33
+ research?: boolean;
34
+ }
35
+ export interface AICommandBarRenderProps {
36
+ phase: AIPhase;
37
+ coords: {
38
+ top: number;
39
+ left: number;
40
+ } | null;
41
+ prompt: string;
42
+ setPrompt: (value: string) => void;
43
+ followUpPrompt: string;
44
+ setFollowUpPrompt: (value: string) => void;
45
+ selectedText: string;
46
+ streamedText: string;
47
+ thinking: string;
48
+ sources: ResearchSource[];
49
+ content: string;
50
+ thinkEnabled: boolean;
51
+ setThinkEnabled: (value: boolean) => void;
52
+ researchEnabled: boolean;
53
+ setResearchEnabled: (value: boolean) => void;
54
+ activeLabel: string;
55
+ errorMsg: string | null;
56
+ presets: AIPreset[];
57
+ open: (payload?: {
58
+ initialPrompt?: string;
59
+ action?: string;
60
+ }) => void;
61
+ close: () => void;
62
+ runAction: (action: string, contextText: string, customQuestion?: string, label?: string, options?: {
63
+ think?: boolean;
64
+ research?: boolean;
65
+ }) => Promise<void>;
66
+ executePreset: (preset: AIPreset) => void;
67
+ accept: () => void;
68
+ discard: () => void;
69
+ retry: () => void;
70
+ stopStreaming: () => void;
71
+ }
72
+ export interface AICommandBarPluginProps {
73
+ headless?: boolean;
74
+ apiEndpoint?: string;
75
+ render?: (state: AICommandBarRenderProps) => React.ReactNode;
76
+ onStateChange?: (state: AICommandBarRenderProps) => void;
77
+ }
78
+ export default function AICommandBarPlugin({ headless, apiEndpoint: propApiEndpoint, render, onStateChange, }?: AICommandBarPluginProps): React.JSX.Element | null;
79
+ export {};
@@ -1,5 +1,27 @@
1
- import { JSX } from "react";
2
- export default function DraggableBlockPlugin({ anchorElem, className, }: {
1
+ import React, { JSX } from "react";
2
+ export type DraggableBlockTurnIntoType = "h1" | "h2" | "h3" | "quote" | "code" | "bullet" | "number";
3
+ export interface DraggableBlockRenderProps {
4
+ menuRef: React.RefObject<HTMLDivElement | null>;
5
+ targetLineRef: React.RefObject<HTMLDivElement | null>;
6
+ isMenuOpen: boolean;
7
+ setIsMenuOpen: React.Dispatch<React.SetStateAction<boolean>>;
8
+ insertBelow: () => void;
9
+ turnInto: (type: DraggableBlockTurnIntoType) => void;
10
+ splitColumns: (columns: 2 | 3) => void;
11
+ duplicate: () => void;
12
+ remove: () => void;
13
+ askAI: () => void;
14
+ }
15
+ export interface DraggableBlockPluginProps {
3
16
  anchorElem?: HTMLElement;
4
17
  className?: string;
5
- }): JSX.Element | null;
18
+ /** When true, suppresses the default React/Tailwind/Radix handle & menu UI. */
19
+ headless?: boolean;
20
+ /** Custom renderer for the block handle/menu. Receives refs and block action helpers. */
21
+ render?: (state: DraggableBlockRenderProps) => React.ReactNode;
22
+ /** Custom renderer for the drop indicator target line. */
23
+ renderTargetLine?: (targetLineRef: React.RefObject<HTMLDivElement | null>) => React.ReactNode;
24
+ /** Callback fired when handle menu state changes. */
25
+ onStateChange?: (state: DraggableBlockRenderProps) => void;
26
+ }
27
+ export default function DraggableBlockPlugin({ anchorElem, className, headless, render, renderTargetLine, onStateChange, }?: DraggableBlockPluginProps): JSX.Element | null;
@@ -6,6 +6,21 @@ export interface CaretCoordinates {
6
6
  maxWidth: number;
7
7
  isNextLine: boolean;
8
8
  }
9
+ export interface InlineCopilotRenderProps {
10
+ isEnabled: boolean;
11
+ isLoading: boolean;
12
+ suggestion: string | null;
13
+ caretCoords: CaretCoordinates | null;
14
+ accept: () => void;
15
+ reject: () => void;
16
+ toggleEnabled: () => void;
17
+ }
18
+ export interface InlineCopilotPluginProps {
19
+ enabledDefault?: boolean;
20
+ headless?: boolean;
21
+ render?: (state: InlineCopilotRenderProps) => React.ReactNode;
22
+ onStateChange?: (state: InlineCopilotRenderProps) => void;
23
+ }
9
24
  /**
10
25
  * Pure helper function to compute safe, non-overflowing positioning for AI copilot ghost text.
11
26
  */
@@ -27,6 +42,4 @@ export declare function computeCopilotPositioning({ caretRect, rootRect, padding
27
42
  suggestionText: string;
28
43
  rightObstacleLeft?: number;
29
44
  }): CaretCoordinates;
30
- export default function InlineCopilotPlugin({ enabledDefault, }: {
31
- enabledDefault?: boolean;
32
- }): React.JSX.Element;
45
+ export default function InlineCopilotPlugin({ enabledDefault, headless, render, onStateChange, }: InlineCopilotPluginProps): React.JSX.Element | null;
@@ -1,14 +1,10 @@
1
- import { ElementNode, LexicalEditor, LexicalNode, NodeKey } from "lexical";
1
+ import { DOMExportOutput, EditorConfig, ElementNode, LexicalCommand, LexicalEditor, LexicalNode, NodeKey } from "lexical";
2
+ import { Metadata } from "../../utils/url";
2
3
  export declare class LinkWithMetaDataNode extends ElementNode {
3
4
  __url: string | null;
4
- __metadata: {
5
- title: string;
6
- description: string;
7
- image?: string | undefined | null;
8
- website: string;
9
- } | null;
10
- __editor: LexicalEditor;
11
- constructor(url: string | null, editor: LexicalEditor, key?: NodeKey);
5
+ __metadata: Metadata | null;
6
+ __editor?: LexicalEditor;
7
+ constructor(url: string | null, editor?: LexicalEditor, metadata?: Metadata | null, key?: NodeKey);
12
8
  static clone(node: LinkWithMetaDataNode): LinkWithMetaDataNode;
13
9
  static importJSON(serializedNode: any): LinkWithMetaDataNode;
14
10
  exportJSON(): {
@@ -21,26 +17,25 @@ export declare class LinkWithMetaDataNode extends ElementNode {
21
17
  $?: Record<string, unknown>;
22
18
  $slots?: Record<string, import("lexical").SerializedLexicalNode>;
23
19
  url: string | null;
24
- metadata: {
25
- title: string;
26
- description: string;
27
- image?: string | undefined | null;
28
- website: string;
29
- } | null;
20
+ metadata: Metadata | null;
30
21
  type: string;
31
22
  version: number;
32
23
  };
33
24
  static getType(): string;
34
- setMetadata(metadata: {
35
- title: string;
36
- description: string;
37
- image?: string;
38
- website: string;
39
- }): void;
40
- createDOM(): HTMLElement;
25
+ isInline(): boolean;
26
+ canBeEmpty(): boolean;
27
+ isKeyboardSelectable(): boolean;
28
+ setMetadata(metadata: Metadata): void;
29
+ getMetadata(): Metadata | null;
30
+ getUrl(): string | null;
31
+ createDOM(config?: EditorConfig, editor?: LexicalEditor): HTMLElement;
41
32
  updateDOM(prevNode: LinkWithMetaDataNode, dom: HTMLElement): boolean;
33
+ exportDOM(editor: LexicalEditor): DOMExportOutput;
42
34
  }
43
- export declare function $createLinkNode(url: string | null, editor: LexicalEditor): LinkWithMetaDataNode;
44
- export declare function $isLinkNode(node: LexicalNode): node is LinkWithMetaDataNode;
45
- export declare const TOGGLE_LINK_COMMAND_LinkWithMetaDataNode: import("lexical").LexicalCommand<string | null>;
35
+ export declare function $createLinkNode(url: string | null, editor?: LexicalEditor, metadata?: Metadata | null): LinkWithMetaDataNode;
36
+ export declare function $isLinkNode(node: LexicalNode | null | undefined): node is LinkWithMetaDataNode;
37
+ export declare const TOGGLE_LINK_COMMAND_LinkWithMetaDataNode: LexicalCommand<string | null | {
38
+ url: string;
39
+ metadata?: Metadata | null;
40
+ }>;
46
41
  export declare function LinkWithMetaDataPlugin(): null;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Returns true if plain clipboard text contains recognizable Markdown or math syntax.
3
+ */
4
+ export declare function looksLikeMarkdown(text: string): boolean;
5
+ export default function MarkdownPastePlugin(): null;
@@ -8,5 +8,7 @@
8
8
  import { ElementTransformer, TextMatchTransformer, Transformer } from "@lexical/markdown";
9
9
  export declare const HR: ElementTransformer;
10
10
  export declare const IMAGE: TextMatchTransformer;
11
+ export declare const BLOCK_EQUATION: TextMatchTransformer;
12
+ export declare const EQUATION: TextMatchTransformer;
11
13
  export declare const TABLE: ElementTransformer;
12
14
  export declare const PLAYGROUND_TRANSFORMERS: Array<Transformer>;
@@ -22,4 +22,21 @@ export declare class ComponentPickerOption extends MenuOption {
22
22
  category?: CommandCategory;
23
23
  });
24
24
  }
25
- export default function SlashCommand(): React.JSX.Element;
25
+ export interface SlashCommandRenderProps {
26
+ isOpen: boolean;
27
+ anchorElement: HTMLElement | null;
28
+ options: ComponentPickerOption[];
29
+ selectedIndex: number | null;
30
+ queryString: string | null;
31
+ selectOptionAndCleanUp: (option: ComponentPickerOption) => void;
32
+ setHighlightedIndex: (index: number) => void;
33
+ }
34
+ export interface SlashCommandPluginProps {
35
+ /** When true, suppresses the default React/Tailwind portal UI. */
36
+ headless?: boolean;
37
+ /** Custom renderer for the slash command menu. Receives full menu state & actions. */
38
+ render?: (state: SlashCommandRenderProps) => React.ReactNode;
39
+ /** Callback fired when the menu state changes (useful for external headless UIs). */
40
+ onStateChange?: (state: SlashCommandRenderProps) => void;
41
+ }
42
+ export default function SlashCommand({ headless, render, onStateChange, }?: SlashCommandPluginProps): React.JSX.Element;
@@ -0,0 +1,26 @@
1
+ export interface SmartTypographyResult {
2
+ text: string;
3
+ offset: number;
4
+ original: string;
5
+ replacement: string;
6
+ }
7
+ export interface LastTypographyReplacement {
8
+ nodeKey: string;
9
+ endOffset: number;
10
+ original: string;
11
+ replacement: string;
12
+ }
13
+ /**
14
+ * Checks the text immediately before `cursorOffset` for a smart typography
15
+ * sequence and returns the updated text + adjusted cursor offset, or null.
16
+ */
17
+ export declare function applySmartTypography(text: string, cursorOffset: number): SmartTypographyResult | null;
18
+ /**
19
+ * Reverts a previously applied smart typography replacement when the user
20
+ * presses Backspace immediately after the replacement.
21
+ */
22
+ export declare function revertSmartTypography(text: string, cursorOffset: number, original: string, replacement: string): {
23
+ text: string;
24
+ offset: number;
25
+ } | null;
26
+ export default function SmartTypographyPlugin(): null;
@@ -0,0 +1,27 @@
1
+ import { type Klass, type LexicalEditor, type LexicalNode, type SerializedLexicalNode } from "lexical";
2
+ export declare const AI_GENERATED_STYLE = "color: #7c3aed; background-color: rgba(139, 92, 246, 0.08); border-radius: 3px;";
3
+ export declare const AI_CARET_STYLE = "color: #7c3aed; font-size: 0.78em; animation: notiq-ai-pulse 1s ease-in-out infinite;";
4
+ export declare const AI_CARET_TEXT = " \u25CF";
5
+ /**
6
+ * Sanitizes an in-flight markdown stream so incomplete fences, math blocks,
7
+ * or raw HTML/MDX tags don't flash as broken literal syntax while streaming.
8
+ */
9
+ export declare function sanitizeStreamingMarkdown(raw: string): string;
10
+ /**
11
+ * Parses a markdown string into serialized Lexical nodes using a detached editor.
12
+ */
13
+ export declare function serializeMarkdownToNodes(markdown: string, nodes: ReadonlyArray<Klass<LexicalNode>>): SerializedLexicalNode[];
14
+ /**
15
+ * Hydrates serialized nodes inside the active editor's update() transaction
16
+ * and marks all TextNodes with the AI-generated purple highlight style.
17
+ */
18
+ export declare function hydrateSerializedAINodes(serialized: SerializedLexicalNode[], options?: {
19
+ showCaret?: boolean;
20
+ }): LexicalNode[];
21
+ export declare function markSubtreeAsAIGenerated(node: LexicalNode): void;
22
+ export declare function stripAIStyleFromSubtree(node: LexicalNode): void;
23
+ /**
24
+ * Builds a structured context string containing the document's heading outline
25
+ * and the blocks immediately surrounding the cursor, avoiding noisy full-doc dumps.
26
+ */
27
+ export declare function extractSurroundingContext(editor: LexicalEditor, maxBlocksBefore?: number, maxBlocksAfter?: number): string;
@@ -0,0 +1,29 @@
1
+ export interface DiagramNodeSpec {
2
+ id: string;
3
+ label: string;
4
+ x?: number;
5
+ y?: number;
6
+ width?: number;
7
+ height?: number;
8
+ color?: string;
9
+ }
10
+ export interface DiagramEdgeSpec {
11
+ from: string;
12
+ to: string;
13
+ label?: string;
14
+ }
15
+ export interface DiagramSpec {
16
+ nodes: DiagramNodeSpec[];
17
+ edges?: DiagramEdgeSpec[];
18
+ }
19
+ /**
20
+ * Normalizes partial / skeleton Excalidraw elements (e.g. LLM-generated rectangles
21
+ * with `label` or arrows missing `points`/metadata) into valid Excalidraw elements
22
+ * that `exportToSvg` and `ExcalidrawModal` can render reliably.
23
+ */
24
+ export declare function normalizeExcalidrawElements(rawElements: unknown[]): Record<string, unknown>[];
25
+ /**
26
+ * Compiles either a raw Excalidraw elements array or a declarative `{ nodes, edges }`
27
+ * diagram specification into a serialized Excalidraw elements JSON string.
28
+ */
29
+ export declare function compileExcalidrawDiagram(rawJson: string): string | null;
@@ -1,4 +1,4 @@
1
- import { ElementTransformer } from "@lexical/markdown";
1
+ import { ElementTransformer, MultilineElementTransformer, TextMatchTransformer } from "@lexical/markdown";
2
2
  export declare const HR_TRANSFORMER: ElementTransformer;
3
3
  export declare const IMAGE_TRANSFORMER: ElementTransformer;
4
4
  export declare const YOUTUBE_TRANSFORMER: ElementTransformer;
@@ -10,6 +10,7 @@ export declare const STEPPER_TRANSFORMER: ElementTransformer;
10
10
  export declare const POLL_TRANSFORMER: ElementTransformer;
11
11
  export declare const EXCALIDRAW_TRANSFORMER: ElementTransformer;
12
12
  export declare const TABLE_TRANSFORMER: ElementTransformer;
13
+ export declare const INLINE_EQUATION_TRANSFORMER: TextMatchTransformer;
13
14
  export declare const AUDIO_TRANSFORMER: ElementTransformer;
14
15
  export declare const FILE_TRANSFORMER: ElementTransformer;
15
16
  /**
@@ -17,4 +18,6 @@ export declare const FILE_TRANSFORMER: ElementTransformer;
17
18
  * Guarantees that YouTube, Tweets, Figma, Images, Tables, Steppers,
18
19
  * Equations, Polls, Audio, and Files are fully preserved when exporting to Markdown.
19
20
  */
21
+ export declare const INLINE_IMAGE_TRANSFORMER: TextMatchTransformer;
22
+ export declare const EXCALIDRAW_BLOCK_TRANSFORMER: MultilineElementTransformer;
20
23
  export declare const NOTIQ_TRANSFORMERS: import("@lexical/markdown").Transformer[];
@@ -1,11 +1,23 @@
1
1
  export declare function sanitizeUrl(url: string): string;
2
2
  export declare function validateUrl(url: string): boolean;
3
- interface Metadata {
3
+ export interface Metadata {
4
4
  title: string;
5
5
  description: string;
6
- image: string | undefined;
6
+ image?: string;
7
7
  website: string;
8
8
  logo: string;
9
9
  }
10
- export declare function fetchMetadata(url: string): Promise<Metadata>;
11
- export {};
10
+ export declare function normalizeUrl(rawUrl: string): string;
11
+ export declare function extractYouTubeId(url: string): string | null;
12
+ export declare function cleanTitleFromUrl(urlStr: string): string;
13
+ /**
14
+ * Synchronous instant metadata preloader - returns rich preview information
15
+ * immediately without waiting for network requests (e.g. YouTube thumbnail & provider,
16
+ * GitHub repo card, direct image preview, or formatted URL metadata).
17
+ */
18
+ export declare function getInitialMetadata(rawUrl: string): Metadata;
19
+ /**
20
+ * Asynchronously fetches full metadata (oEmbed, OpenGraph, title, description, thumbnail)
21
+ * using resilient fallbacks so link previews always succeed.
22
+ */
23
+ export declare function fetchMetadata(rawUrl: string): Promise<Metadata>;
@@ -7,6 +7,14 @@ export interface AIConfig {
7
7
  * The API endpoint for AI completions. Defaults to "/api/ai".
8
8
  */
9
9
  apiEndpoint?: string;
10
+ /**
11
+ * Default writing style preset ("balanced" | "technical" | "editorial" | "executive" | "academic").
12
+ */
13
+ writingStyle?: string;
14
+ /**
15
+ * Custom brand voice / style guide instructions injected into AI prompts.
16
+ */
17
+ styleGuide?: string;
10
18
  }
11
19
  /**
12
20
  * Hook to access the current AI configuration.
@@ -0,0 +1,23 @@
1
+ export interface EquationTypographyRule {
2
+ pattern: RegExp;
3
+ replacement: string;
4
+ }
5
+ /**
6
+ * Ordered LaTeX shorthand rules applied as the user types inside an equation input.
7
+ * Chained rules must appear before single-token rules so `<=>` and `<->` work
8
+ * smoothly even when `<=` or `<-` was already expanded on the previous keystroke.
9
+ */
10
+ export declare const EQUATION_TYPOGRAPHY_RULES: ReadonlyArray<EquationTypographyRule>;
11
+ /**
12
+ * Pure helper that applies LaTeX shorthand replacements immediately before `cursorOffset`.
13
+ * Returns the updated equation text and new cursor offset, or `null` if no rule matched.
14
+ */
15
+ export declare function applyEquationTypography(text: string, cursorOffset: number): {
16
+ text: string;
17
+ offset: number;
18
+ } | null;
19
+ /**
20
+ * Handles an `<input>` or `<textarea>` change event for equation editors,
21
+ * applying LaTeX shorthand replacements and preserving the caret position.
22
+ */
23
+ export declare function handleEquationInputChange(target: HTMLInputElement | HTMLTextAreaElement, setEquation: (equation: string) => void): void;