@collabchron/notiq 1.1.11 → 1.1.12

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 (66) hide show
  1. package/dist/{AIDialog-2WZUFWSC.mjs → AIDialog-RHRYHSVN.mjs} +5 -5
  2. package/dist/{CodeActionMenuPlugin-MRKY67ED.mjs → CodeActionMenuPlugin-FGH6HZLL.mjs} +2 -2
  3. package/dist/{CollaboratorsBar-TMKBOBJI.mjs → CollaboratorsBar-AMPIAUOY.mjs} +2 -2
  4. package/dist/{CommentsPlugin-5M4RD6YO.mjs → CommentsPlugin-SDJJTUGK.mjs} +2 -2
  5. package/dist/{ExcalidrawComponent-SIMURTCA.mjs → ExcalidrawComponent-BMSYIPP6.mjs} +2 -2
  6. package/dist/{ExcalidrawPlugin-2SGPIQ6U.mjs → ExcalidrawPlugin-QLPGJPSX.mjs} +2 -2
  7. package/dist/{ExportPlugin-OKZOLBGS.mjs → ExportPlugin-MJHYKQZJ.mjs} +7 -6
  8. package/dist/{FloatingTextFormatToolbarPlugin-SO5VON7Q.mjs → FloatingTextFormatToolbarPlugin-BXCPN3KD.mjs} +19 -19
  9. package/dist/{MobileToolbar-JKP2MLQJ.mjs → MobileToolbar-KV5DX4ED.mjs} +15 -17
  10. package/dist/{SlashCommand-2TNOOUBM.mjs → SlashCommand-SPR7G5EI.mjs} +13 -13
  11. package/dist/{StoryBuilderComponent-WQSNFPMM.mjs → StoryBuilderComponent-JN4ZPZOW.mjs} +8 -8
  12. package/dist/{chunk-PHRVYPVM.mjs → ToolbarPlugin-F52PVNXU.mjs} +33 -18
  13. package/dist/{block-format-MTSIXWID.mjs → block-format-TODFREE2.mjs} +2 -2
  14. package/dist/{chunk-FYLRS4BG.mjs → chunk-22ZIL6NH.mjs} +1 -1
  15. package/dist/{chunk-Z6JAFF55.mjs → chunk-2LNT36RL.mjs} +2 -2
  16. package/dist/chunk-37LC44W3.mjs +2677 -0
  17. package/dist/chunk-5D4JF3ZZ.mjs +624 -0
  18. package/dist/{chunk-MPTE332I.mjs → chunk-6FQFPPLG.mjs} +18 -20
  19. package/dist/{chunk-GYYLZ3MQ.mjs → chunk-ELBTVBTS.mjs} +1 -1
  20. package/dist/{chunk-XYDBUQ6Z.mjs → chunk-ENH2IOHI.mjs} +15 -165
  21. package/dist/{chunk-MW6MAUY3.mjs → chunk-FO7M3X2B.mjs} +1 -1
  22. package/dist/{chunk-YDDBQZ77.mjs → chunk-LBGM4VVZ.mjs} +8 -8
  23. package/dist/{chunk-2KESP7OU.mjs → chunk-LLGVCM7M.mjs} +3 -3
  24. package/dist/chunk-LVRJM45C.mjs +171 -0
  25. package/dist/{chunk-XZXGYNTY.mjs → chunk-QNIY45SF.mjs} +1 -1
  26. package/dist/{chunk-YTLUQJE2.mjs → chunk-T2UBAZ66.mjs} +1 -1
  27. package/dist/{chunk-3AHNLIME.mjs → chunk-XNJNT6PC.mjs} +21 -21
  28. package/dist/{chunk-LLCP7NVE.mjs → chunk-XYLTLGY5.mjs} +355 -29
  29. package/dist/{chunk-XAVQAXOJ.mjs → chunk-ZYJ7KABY.mjs} +1 -1
  30. package/dist/{color-23323E3B.mjs → color-S55XFDYQ.mjs} +2 -2
  31. package/dist/components/editor/Core.d.ts +15 -2
  32. package/dist/components/editor/index.d.ts +15 -4
  33. package/dist/core/index.d.ts +2 -1
  34. package/dist/core/react/NotiqEditor.d.ts +8 -8
  35. package/dist/core/types.d.ts +1 -0
  36. package/dist/core.js +8946 -2207
  37. package/dist/core.mjs +32 -26
  38. package/dist/{font-size-GTL6UVQL.mjs → font-size-3HMJHKO2.mjs} +2 -2
  39. package/dist/{image-TPW7PZZK.mjs → image-QPB2CVXP.mjs} +6 -6
  40. package/dist/index.js +4372 -4382
  41. package/dist/index.mjs +87 -1611
  42. package/dist/{insert-image-CZV6HWQZ.mjs → insert-image-PLBZELHK.mjs} +4 -4
  43. package/dist/{insert-node-MA3FXEYN.mjs → insert-node-DGCZBGKG.mjs} +14 -16
  44. package/dist/react.js +10189 -3980
  45. package/dist/react.mjs +21 -16
  46. package/dist/{stepper-4AO5XMO7.mjs → stepper-KNITDVLG.mjs} +31 -31
  47. package/dist/styles/notiq.css +1 -1
  48. package/dist/{text-format-6L5N3CHZ.mjs → text-format-T3IY7FBI.mjs} +3 -3
  49. package/package.json +1 -1
  50. package/dist/ToolbarPlugin-IIAOU4P5.mjs +0 -35
  51. package/dist/chunk-AYNKORDO.mjs +0 -6
  52. package/dist/chunk-IU2N42JJ.mjs +0 -1763
  53. package/dist/chunk-W6GAJXUS.mjs +0 -334
  54. package/dist/{VersionHistoryPlugin-23MAZB4G.mjs → VersionHistoryPlugin-YWGCREKA.mjs} +3 -3
  55. package/dist/{background-color-OZJCBYCT.mjs → background-color-RW5JYLMG.mjs} +3 -3
  56. package/dist/{chunk-YE7M2VKR.mjs → chunk-C4JWLBYN.mjs} +3 -3
  57. package/dist/{chunk-KDA7ZYMJ.mjs → chunk-CLRSETYQ.mjs} +3 -3
  58. package/dist/{chunk-FMJ7DGWP.mjs → chunk-MSAO3YFB.mjs} +3 -3
  59. package/dist/{chunk-XYT6XM5S.mjs → chunk-N3KDPSRI.mjs} +3 -3
  60. package/dist/{chunk-MTQZWJHR.mjs → chunk-SYUCM5G5.mjs} +4 -4
  61. package/dist/{chunk-6SRMKQSD.mjs → chunk-VNDDDXGH.mjs} +3 -3
  62. package/dist/{chunk-LAUAYRPC.mjs → chunk-WUVIQCX7.mjs} +5 -5
  63. package/dist/{insert-audio-C66RZRKY.mjs → insert-audio-I3PD6JFS.mjs} +6 -6
  64. package/dist/{insert-file-3DTGRO7W.mjs → insert-file-PHR7XL4V.mjs} +6 -6
  65. package/dist/{insert-gif-FIMCCBAI.mjs → insert-gif-R5ZO4JHC.mjs} +3 -3
  66. package/dist/{text-align-CSDLJUDA.mjs → text-align-TEB4S52S.mjs} +3 -3
@@ -92,6 +92,326 @@ function Figma(_a) {
92
92
  );
93
93
  }
94
94
 
95
+ // src/components/editor/plugins/LayoutPlugin/index.tsx
96
+ init_react_shim();
97
+ import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
98
+ import {
99
+ $findMatchingParent,
100
+ $insertNodeToNearestRoot,
101
+ mergeRegister
102
+ } from "@lexical/utils";
103
+ import {
104
+ $createParagraphNode,
105
+ $getNodeByKey,
106
+ $getSelection,
107
+ $isRangeSelection,
108
+ COMMAND_PRIORITY_EDITOR,
109
+ COMMAND_PRIORITY_LOW,
110
+ createCommand,
111
+ KEY_ARROW_DOWN_COMMAND,
112
+ KEY_ARROW_LEFT_COMMAND,
113
+ KEY_ARROW_RIGHT_COMMAND,
114
+ KEY_ARROW_UP_COMMAND
115
+ } from "lexical";
116
+ import { useEffect } from "react";
117
+
118
+ // src/components/editor/nodes/LayoutNode/LayoutContainerNode.ts
119
+ init_react_shim();
120
+ import { addClassNamesToElement } from "@lexical/utils";
121
+ import { ElementNode } from "lexical";
122
+ function $convertLayoutContainerElement(domNode) {
123
+ const styleAttributes = window.getComputedStyle(domNode);
124
+ const templateColumns = styleAttributes.getPropertyValue(
125
+ "grid-template-columns"
126
+ );
127
+ if (templateColumns) {
128
+ const node = $createLayoutContainerNode(templateColumns);
129
+ return { node };
130
+ }
131
+ return null;
132
+ }
133
+ var LayoutContainerNode = class _LayoutContainerNode extends ElementNode {
134
+ constructor(templateColumns, key) {
135
+ super(key);
136
+ this.__templateColumns = templateColumns;
137
+ }
138
+ static getType() {
139
+ return "layout-container";
140
+ }
141
+ static clone(node) {
142
+ return new _LayoutContainerNode(node.__templateColumns, node.__key);
143
+ }
144
+ createDOM(config) {
145
+ const dom = document.createElement("div");
146
+ dom.style.gridTemplateColumns = this.__templateColumns;
147
+ if (typeof config.theme.layoutContainer === "string") {
148
+ addClassNamesToElement(dom, config.theme.layoutContainer);
149
+ }
150
+ return dom;
151
+ }
152
+ exportDOM() {
153
+ const element = document.createElement("div");
154
+ element.style.gridTemplateColumns = this.__templateColumns;
155
+ element.setAttribute("data-lexical-layout-container", "true");
156
+ return { element };
157
+ }
158
+ updateDOM(prevNode, dom) {
159
+ if (prevNode.__templateColumns !== this.__templateColumns) {
160
+ dom.style.gridTemplateColumns = this.__templateColumns;
161
+ }
162
+ return false;
163
+ }
164
+ static importDOM() {
165
+ return {
166
+ div: (domNode) => {
167
+ if (!domNode.hasAttribute("data-lexical-layout-container")) {
168
+ return null;
169
+ }
170
+ return {
171
+ conversion: $convertLayoutContainerElement,
172
+ priority: 2
173
+ };
174
+ }
175
+ };
176
+ }
177
+ static importJSON(json) {
178
+ return $createLayoutContainerNode().updateFromJSON(json);
179
+ }
180
+ updateFromJSON(serializedNode) {
181
+ return super.updateFromJSON(serializedNode).setTemplateColumns(serializedNode.templateColumns);
182
+ }
183
+ isShadowRoot() {
184
+ return true;
185
+ }
186
+ canBeEmpty() {
187
+ return false;
188
+ }
189
+ exportJSON() {
190
+ return __spreadProps(__spreadValues({}, super.exportJSON()), {
191
+ templateColumns: this.__templateColumns
192
+ });
193
+ }
194
+ getTemplateColumns() {
195
+ return this.getLatest().__templateColumns;
196
+ }
197
+ setTemplateColumns(templateColumns) {
198
+ const self = this.getWritable();
199
+ self.__templateColumns = templateColumns;
200
+ return self;
201
+ }
202
+ };
203
+ function $createLayoutContainerNode(templateColumns = "") {
204
+ return new LayoutContainerNode(templateColumns);
205
+ }
206
+ function $isLayoutContainerNode(node) {
207
+ return node instanceof LayoutContainerNode;
208
+ }
209
+
210
+ // src/components/editor/nodes/LayoutNode/LayoutItemNode.ts
211
+ init_react_shim();
212
+ import { addClassNamesToElement as addClassNamesToElement2 } from "@lexical/utils";
213
+ import { ElementNode as ElementNode2 } from "lexical";
214
+ function $convertLayoutItemElement() {
215
+ return { node: $createLayoutItemNode() };
216
+ }
217
+ var LayoutItemNode = class _LayoutItemNode extends ElementNode2 {
218
+ static getType() {
219
+ return "layout-item";
220
+ }
221
+ static clone(node) {
222
+ return new _LayoutItemNode(node.__key);
223
+ }
224
+ createDOM(config) {
225
+ const dom = document.createElement("div");
226
+ dom.setAttribute("data-lexical-layout-item", "true");
227
+ if (typeof config.theme.layoutItem === "string") {
228
+ addClassNamesToElement2(dom, config.theme.layoutItem);
229
+ }
230
+ return dom;
231
+ }
232
+ updateDOM() {
233
+ return false;
234
+ }
235
+ static importDOM() {
236
+ return {
237
+ div: (domNode) => {
238
+ if (!domNode.hasAttribute("data-lexical-layout-item")) {
239
+ return null;
240
+ }
241
+ return {
242
+ conversion: $convertLayoutItemElement,
243
+ priority: 2
244
+ };
245
+ }
246
+ };
247
+ }
248
+ static importJSON(serializedNode) {
249
+ return $createLayoutItemNode().updateFromJSON(serializedNode);
250
+ }
251
+ isShadowRoot() {
252
+ return true;
253
+ }
254
+ };
255
+ function $createLayoutItemNode() {
256
+ return new LayoutItemNode();
257
+ }
258
+ function $isLayoutItemNode(node) {
259
+ return node instanceof LayoutItemNode;
260
+ }
261
+
262
+ // src/components/editor/plugins/LayoutPlugin/index.tsx
263
+ var INSERT_LAYOUT_COMMAND = createCommand();
264
+ var UPDATE_LAYOUT_COMMAND = createCommand();
265
+ function LayoutPlugin() {
266
+ const [editor] = useLexicalComposerContext();
267
+ useEffect(() => {
268
+ if (!editor.hasNodes([LayoutContainerNode, LayoutItemNode])) {
269
+ throw new Error(
270
+ "LayoutPlugin: LayoutContainerNode, or LayoutItemNode not registered on editor"
271
+ );
272
+ }
273
+ const $onEscape = (before) => {
274
+ var _a, _b;
275
+ const selection = $getSelection();
276
+ if ($isRangeSelection(selection) && selection.isCollapsed() && selection.anchor.offset === 0) {
277
+ const container = $findMatchingParent(
278
+ selection.anchor.getNode(),
279
+ $isLayoutContainerNode
280
+ );
281
+ if ($isLayoutContainerNode(container)) {
282
+ const parent = container.getParent();
283
+ const child = parent && (before ? parent.getFirstChild() : parent == null ? void 0 : parent.getLastChild());
284
+ const descendant = before ? (_a = container.getFirstDescendant()) == null ? void 0 : _a.getKey() : (_b = container.getLastDescendant()) == null ? void 0 : _b.getKey();
285
+ if (parent !== null && child === container && selection.anchor.key === descendant) {
286
+ if (before) {
287
+ container.insertBefore($createParagraphNode());
288
+ } else {
289
+ container.insertAfter($createParagraphNode());
290
+ }
291
+ }
292
+ }
293
+ }
294
+ return false;
295
+ };
296
+ const $fillLayoutItemIfEmpty = (node) => {
297
+ if (node.isEmpty()) {
298
+ node.append($createParagraphNode());
299
+ }
300
+ };
301
+ const $removeIsolatedLayoutItem = (node) => {
302
+ const parent = node.getParent();
303
+ if (!$isLayoutContainerNode(parent)) {
304
+ const children = node.getChildren();
305
+ for (const child of children) {
306
+ node.insertBefore(child);
307
+ }
308
+ node.remove();
309
+ return true;
310
+ }
311
+ return false;
312
+ };
313
+ return mergeRegister(
314
+ // When layout is the last child pressing down/right arrow will insert paragraph
315
+ // below it to allow adding more content. It's similar what $insertBlockNode
316
+ // (mainly for decorators), except it'll always be possible to continue adding
317
+ // new content even if trailing paragraph is accidentally deleted
318
+ editor.registerCommand(
319
+ KEY_ARROW_DOWN_COMMAND,
320
+ () => $onEscape(false),
321
+ COMMAND_PRIORITY_LOW
322
+ ),
323
+ editor.registerCommand(
324
+ KEY_ARROW_RIGHT_COMMAND,
325
+ () => $onEscape(false),
326
+ COMMAND_PRIORITY_LOW
327
+ ),
328
+ // When layout is the first child pressing up/left arrow will insert paragraph
329
+ // above it to allow adding more content. It's similar what $insertBlockNode
330
+ // (mainly for decorators), except it'll always be possible to continue adding
331
+ // new content even if leading paragraph is accidentally deleted
332
+ editor.registerCommand(
333
+ KEY_ARROW_UP_COMMAND,
334
+ () => $onEscape(true),
335
+ COMMAND_PRIORITY_LOW
336
+ ),
337
+ editor.registerCommand(
338
+ KEY_ARROW_LEFT_COMMAND,
339
+ () => $onEscape(true),
340
+ COMMAND_PRIORITY_LOW
341
+ ),
342
+ editor.registerCommand(
343
+ INSERT_LAYOUT_COMMAND,
344
+ (template) => {
345
+ editor.update(() => {
346
+ const container = $createLayoutContainerNode(template);
347
+ const itemsCount = getItemsCountFromTemplate(template);
348
+ for (let i = 0; i < itemsCount; i++) {
349
+ container.append(
350
+ $createLayoutItemNode().append($createParagraphNode())
351
+ );
352
+ }
353
+ $insertNodeToNearestRoot(container);
354
+ container.selectStart();
355
+ });
356
+ return true;
357
+ },
358
+ COMMAND_PRIORITY_EDITOR
359
+ ),
360
+ editor.registerCommand(
361
+ UPDATE_LAYOUT_COMMAND,
362
+ ({ template, nodeKey }) => {
363
+ editor.update(() => {
364
+ const container = $getNodeByKey(nodeKey);
365
+ if (!$isLayoutContainerNode(container)) {
366
+ return;
367
+ }
368
+ const itemsCount = getItemsCountFromTemplate(template);
369
+ const prevItemsCount = getItemsCountFromTemplate(
370
+ container.getTemplateColumns()
371
+ );
372
+ if (itemsCount > prevItemsCount) {
373
+ for (let i = prevItemsCount; i < itemsCount; i++) {
374
+ container.append(
375
+ $createLayoutItemNode().append($createParagraphNode())
376
+ );
377
+ }
378
+ } else if (itemsCount < prevItemsCount) {
379
+ for (let i = prevItemsCount - 1; i >= itemsCount; i--) {
380
+ const layoutItem = container.getChildAtIndex(i);
381
+ if ($isLayoutItemNode(layoutItem)) {
382
+ layoutItem.remove();
383
+ }
384
+ }
385
+ }
386
+ container.setTemplateColumns(template);
387
+ });
388
+ return true;
389
+ },
390
+ COMMAND_PRIORITY_EDITOR
391
+ ),
392
+ editor.registerNodeTransform(LayoutItemNode, (node) => {
393
+ const isRemoved = $removeIsolatedLayoutItem(node);
394
+ if (!isRemoved) {
395
+ $fillLayoutItemIfEmpty(node);
396
+ }
397
+ }),
398
+ editor.registerNodeTransform(LayoutContainerNode, (node) => {
399
+ const children = node.getChildren();
400
+ if (!children.every($isLayoutItemNode)) {
401
+ for (const child of children) {
402
+ node.insertBefore(child);
403
+ }
404
+ node.remove();
405
+ }
406
+ })
407
+ );
408
+ }, [editor]);
409
+ return null;
410
+ }
411
+ function getItemsCountFromTemplate(template) {
412
+ return template.trim().split(/\s+/).length;
413
+ }
414
+
95
415
  // src/components/editor/plugins/AutoEmbedPlugin/index.tsx
96
416
  init_react_shim();
97
417
  import {
@@ -99,22 +419,22 @@ import {
99
419
  LexicalAutoEmbedPlugin,
100
420
  URL_MATCHER
101
421
  } from "@lexical/react/LexicalAutoEmbedPlugin";
102
- import { useLexicalComposerContext as useLexicalComposerContext4 } from "@lexical/react/LexicalComposerContext";
422
+ import { useLexicalComposerContext as useLexicalComposerContext5 } from "@lexical/react/LexicalComposerContext";
103
423
  import { useMemo, useState } from "react";
104
424
  import * as ReactDOM from "react-dom";
105
425
 
106
426
  // src/components/editor/plugins/FigmaPlugin/index.tsx
107
427
  init_react_shim();
108
- import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
109
- import { $insertNodeToNearestRoot } from "@lexical/utils";
110
- import { COMMAND_PRIORITY_EDITOR, createCommand } from "lexical";
111
- import { useEffect } from "react";
112
- var INSERT_FIGMA_COMMAND = createCommand(
428
+ import { useLexicalComposerContext as useLexicalComposerContext2 } from "@lexical/react/LexicalComposerContext";
429
+ import { $insertNodeToNearestRoot as $insertNodeToNearestRoot2 } from "@lexical/utils";
430
+ import { COMMAND_PRIORITY_EDITOR as COMMAND_PRIORITY_EDITOR2, createCommand as createCommand2 } from "lexical";
431
+ import { useEffect as useEffect2 } from "react";
432
+ var INSERT_FIGMA_COMMAND = createCommand2(
113
433
  "INSERT_FIGMA_COMMAND"
114
434
  );
115
435
  function FigmaPlugin() {
116
- const [editor] = useLexicalComposerContext();
117
- useEffect(() => {
436
+ const [editor] = useLexicalComposerContext2();
437
+ useEffect2(() => {
118
438
  if (!editor.hasNodes([FigmaNode])) {
119
439
  throw new Error("FigmaPlugin: FigmaNode not registered on editor");
120
440
  }
@@ -122,10 +442,10 @@ function FigmaPlugin() {
122
442
  INSERT_FIGMA_COMMAND,
123
443
  (payload) => {
124
444
  const figmaNode = $createFigmaNode(payload);
125
- $insertNodeToNearestRoot(figmaNode);
445
+ $insertNodeToNearestRoot2(figmaNode);
126
446
  return true;
127
447
  },
128
- COMMAND_PRIORITY_EDITOR
448
+ COMMAND_PRIORITY_EDITOR2
129
449
  );
130
450
  }, [editor]);
131
451
  return null;
@@ -133,16 +453,16 @@ function FigmaPlugin() {
133
453
 
134
454
  // src/components/editor/plugins/YouTubePlugin/index.ts
135
455
  init_react_shim();
136
- import { useLexicalComposerContext as useLexicalComposerContext2 } from "@lexical/react/LexicalComposerContext";
137
- import { $insertNodeToNearestRoot as $insertNodeToNearestRoot2 } from "@lexical/utils";
138
- import { COMMAND_PRIORITY_EDITOR as COMMAND_PRIORITY_EDITOR2, createCommand as createCommand2 } from "lexical";
139
- import { useEffect as useEffect2 } from "react";
140
- var INSERT_YOUTUBE_COMMAND = createCommand2(
456
+ import { useLexicalComposerContext as useLexicalComposerContext3 } from "@lexical/react/LexicalComposerContext";
457
+ import { $insertNodeToNearestRoot as $insertNodeToNearestRoot3 } from "@lexical/utils";
458
+ import { COMMAND_PRIORITY_EDITOR as COMMAND_PRIORITY_EDITOR3, createCommand as createCommand3 } from "lexical";
459
+ import { useEffect as useEffect3 } from "react";
460
+ var INSERT_YOUTUBE_COMMAND = createCommand3(
141
461
  "INSERT_YOUTUBE_COMMAND"
142
462
  );
143
463
  function YouTubePlugin() {
144
- const [editor] = useLexicalComposerContext2();
145
- useEffect2(() => {
464
+ const [editor] = useLexicalComposerContext3();
465
+ useEffect3(() => {
146
466
  if (!editor.hasNodes([YouTubeNode])) {
147
467
  throw new Error("YouTubePlugin: YouTubeNode not registered on editor");
148
468
  }
@@ -150,10 +470,10 @@ function YouTubePlugin() {
150
470
  INSERT_YOUTUBE_COMMAND,
151
471
  (payload) => {
152
472
  const youTubeNode = $createYouTubeNode(payload);
153
- $insertNodeToNearestRoot2(youTubeNode);
473
+ $insertNodeToNearestRoot3(youTubeNode);
154
474
  return true;
155
475
  },
156
- COMMAND_PRIORITY_EDITOR2
476
+ COMMAND_PRIORITY_EDITOR3
157
477
  );
158
478
  }, [editor]);
159
479
  return null;
@@ -161,16 +481,16 @@ function YouTubePlugin() {
161
481
 
162
482
  // src/components/editor/plugins/TwitterPlugin/index.ts
163
483
  init_react_shim();
164
- import { useLexicalComposerContext as useLexicalComposerContext3 } from "@lexical/react/LexicalComposerContext";
165
- import { $insertNodeToNearestRoot as $insertNodeToNearestRoot3 } from "@lexical/utils";
166
- import { COMMAND_PRIORITY_EDITOR as COMMAND_PRIORITY_EDITOR3, createCommand as createCommand3 } from "lexical";
167
- import { useEffect as useEffect3 } from "react";
168
- var INSERT_TWEET_COMMAND = createCommand3(
484
+ import { useLexicalComposerContext as useLexicalComposerContext4 } from "@lexical/react/LexicalComposerContext";
485
+ import { $insertNodeToNearestRoot as $insertNodeToNearestRoot4 } from "@lexical/utils";
486
+ import { COMMAND_PRIORITY_EDITOR as COMMAND_PRIORITY_EDITOR4, createCommand as createCommand4 } from "lexical";
487
+ import { useEffect as useEffect4 } from "react";
488
+ var INSERT_TWEET_COMMAND = createCommand4(
169
489
  "INSERT_TWEET_COMMAND"
170
490
  );
171
491
  function TwitterPlugin() {
172
- const [editor] = useLexicalComposerContext3();
173
- useEffect3(() => {
492
+ const [editor] = useLexicalComposerContext4();
493
+ useEffect4(() => {
174
494
  if (!editor.hasNodes([TweetNode])) {
175
495
  throw new Error("TwitterPlugin: TweetNode not registered on editor");
176
496
  }
@@ -178,10 +498,10 @@ function TwitterPlugin() {
178
498
  INSERT_TWEET_COMMAND,
179
499
  (payload) => {
180
500
  const tweetNode = $createTweetNode(payload);
181
- $insertNodeToNearestRoot3(tweetNode);
501
+ $insertNodeToNearestRoot4(tweetNode);
182
502
  return true;
183
503
  },
184
- COMMAND_PRIORITY_EDITOR3
504
+ COMMAND_PRIORITY_EDITOR4
185
505
  );
186
506
  }, [editor]);
187
507
  return null;
@@ -326,7 +646,7 @@ function AutoEmbedDialog({
326
646
  onClose
327
647
  }) {
328
648
  const [text, setText] = useState("");
329
- const [editor] = useLexicalComposerContext4();
649
+ const [editor] = useLexicalComposerContext5();
330
650
  const [embedResult, setEmbedResult] = useState(null);
331
651
  const validateText = useMemo(
332
652
  () => debounce((inputText) => {
@@ -435,9 +755,15 @@ function AutoEmbedPlugin() {
435
755
  }
436
756
 
437
757
  export {
758
+ LayoutItemNode,
759
+ $createLayoutItemNode,
760
+ LayoutContainerNode,
761
+ $createLayoutContainerNode,
438
762
  Youtube,
439
763
  Twitter,
440
764
  Figma,
765
+ INSERT_LAYOUT_COMMAND,
766
+ LayoutPlugin,
441
767
  FigmaPlugin,
442
768
  YouTubePlugin,
443
769
  TwitterPlugin,
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  $createStepperNode,
7
7
  NOTIQ_TRANSFORMERS
8
- } from "./chunk-2KESP7OU.mjs";
8
+ } from "./chunk-LLGVCM7M.mjs";
9
9
  import {
10
10
  __spreadProps,
11
11
  __spreadValues,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  Color
3
- } from "./chunk-KDA7ZYMJ.mjs";
4
- import "./chunk-PFH63ZU4.mjs";
3
+ } from "./chunk-CLRSETYQ.mjs";
5
4
  import "./chunk-6UVNHT3T.mjs";
5
+ import "./chunk-PFH63ZU4.mjs";
6
6
  import "./chunk-5NRAXWYA.mjs";
7
7
  import "./chunk-OE5JRLCN.mjs";
8
8
  import "./chunk-IIVB6JNE.mjs";
@@ -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";
@@ -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;
@@ -1,4 +1,5 @@
1
- export type { NotiqEditor, NotiqEditorOptions, NotiqEventType, NotiqEventListener, NotiqEventData, ExtensionConfig, ExtensionContext, ChainedCommands, CanCommands, CommandFunction, SelectionType, } from "./types";
1
+ export type { NotiqEditor as NotiqEditorInstance, NotiqEditorOptions, NotiqEventType, NotiqEventListener, NotiqEventData, ExtensionConfig, ExtensionContext, ChainedCommands, CanCommands, CommandFunction, SelectionType, } from "./types";
2
+ export type { NotiqEditor } from "./types";
2
3
  export * from "./extension";
3
4
  export * from "./chain";
4
5
  export * from "./editor";
@@ -1,9 +1,8 @@
1
1
  import React from "react";
2
- import type { NotiqEditor as INotiqEditor } from "../types";
3
- import { type CollabConfig } from "../../components/providers/CollabContext";
4
- import { type AIConfig } from "../../components/providers/AIContext";
5
- import { type UploadConfig } from "../../components/providers/UploadContext";
6
- import { ToolbarConfig } from "../../components/editor";
2
+ import { type ToolbarConfig } from "../../components/editor";
3
+ import type { CollabConfig } from "../../components/providers/CollabContext";
4
+ import type { AIConfig } from "../../components/providers/AIContext";
5
+ import type { UploadConfig } from "../../components/providers/UploadContext";
7
6
  export interface NotiqEditorProps {
8
7
  content?: string | Record<string, any>;
9
8
  extensions?: any[];
@@ -17,13 +16,14 @@ export interface NotiqEditorProps {
17
16
  uploadConfig?: UploadConfig;
18
17
  className?: string;
19
18
  editorClassName?: string;
19
+ onChange?: (editorState: any, editor: any) => void;
20
20
  onUpdate?: (event: {
21
- editor: INotiqEditor;
21
+ editor: any;
22
22
  markdown: string;
23
23
  json: any;
24
24
  html: string;
25
25
  }) => void;
26
- onEditorReady?: (editor: INotiqEditor) => void;
26
+ onEditorReady?: (editor: any) => void;
27
27
  children?: React.ReactNode;
28
28
  }
29
- export declare function NotiqEditor({ content, extensions, editable, autofocus, placeholder, showToolbar, toolbarConfig, collabConfig, aiConfig, uploadConfig, className, editorClassName, onUpdate, onEditorReady, children, }: NotiqEditorProps): React.JSX.Element | null;
29
+ export declare function NotiqEditor({ content, editable, toolbarConfig, collabConfig, aiConfig, uploadConfig, className, editorClassName, onChange, onUpdate, onEditorReady, children, }: NotiqEditorProps): React.JSX.Element;
@@ -36,6 +36,7 @@ export interface ExtensionConfig<Options = any, Storage = any> {
36
36
  export interface NotiqEditorOptions {
37
37
  extensions?: any[];
38
38
  content?: string | SerializedEditorState | Record<string, any>;
39
+ theme?: any;
39
40
  editable?: boolean;
40
41
  autofocus?: boolean | "start" | "end" | "all";
41
42
  placeholder?: string | React.ReactNode;