@collabchron/notiq 1.1.12 → 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 (146) hide show
  1. package/dist/AICommandBarPlugin-ZEC755KY.mjs +27 -0
  2. package/dist/{AIDialog-RHRYHSVN.mjs → AIDialog-HJW6PQPR.mjs} +11 -12
  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-BMSYIPP6.mjs → ExcalidrawComponent-POMYXDSG.mjs} +33 -6
  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-JN4ZPZOW.mjs → StoryBuilderComponent-CBRFPFTR.mjs} +8 -9
  11. package/dist/{chunk-6UVNHT3T.mjs → chunk-4SYRK2NH.mjs} +23 -1
  12. package/dist/chunk-5CJZC5IB.mjs +9086 -0
  13. package/dist/{chunk-FO7M3X2B.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-ZYJ7KABY.mjs → chunk-CQCS5YPS.mjs} +3 -5
  18. package/dist/{chunk-T2UBAZ66.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-ELBTVBTS.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-QNIY45SF.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-5D4JF3ZZ.mjs → chunk-XAJ4GACN.mjs} +171 -49
  35. package/dist/{chunk-7QRJVZQY.mjs → chunk-YVUQRJVV.mjs} +63 -18
  36. package/dist/components/editor/index.d.ts +1 -1
  37. package/dist/components/editor/nodes/EquationNode/EquationNode.d.ts +1 -0
  38. package/dist/components/editor/nodes/Hint/index.d.ts +2 -1
  39. package/dist/components/editor/plugins/AICommandBarPlugin/index.d.ts +73 -1
  40. package/dist/components/editor/plugins/DraggableBlockPlugin/index.d.ts +25 -3
  41. package/dist/components/editor/plugins/InlineCopilotPlugin/index.d.ts +16 -3
  42. package/dist/components/editor/plugins/LinkWithMetaData/index.d.ts +20 -25
  43. package/dist/components/editor/plugins/MarkdownPastePlugin/index.d.ts +5 -0
  44. package/dist/components/editor/plugins/MarkdownTransformers/index.d.ts +2 -0
  45. package/dist/components/editor/plugins/SlashCommand/index.d.ts +18 -1
  46. package/dist/components/editor/plugins/SmartTypographyPlugin/index.d.ts +26 -0
  47. package/dist/components/editor/utils/aiStream.d.ts +27 -0
  48. package/dist/components/editor/utils/excalidrawDiagramBuilder.d.ts +29 -0
  49. package/dist/components/editor/utils/markdownTransformers.d.ts +4 -1
  50. package/dist/components/editor/utils/url.d.ts +16 -4
  51. package/dist/components/providers/AIContext.d.ts +8 -0
  52. package/dist/components/ui/equation/equationTypography.d.ts +23 -0
  53. package/dist/core/extension.d.ts +3 -1
  54. package/dist/core/extensions/blocks-kit.d.ts +22 -1
  55. package/dist/core/extensions/copilot-and-collab.d.ts +15 -1
  56. package/dist/core/react/NotiqContent.d.ts +4 -1
  57. package/dist/core/react/index.d.ts +1 -0
  58. package/dist/core/react/node-renderers.d.ts +73 -0
  59. package/dist/core.js +15429 -13116
  60. package/dist/core.mjs +47 -39
  61. package/dist/hooks/instructions-messages.d.ts +13 -4
  62. package/dist/{image-QPB2CVXP.mjs → image-AL6PHM2A.mjs} +17 -12
  63. package/dist/index.js +15526 -13194
  64. package/dist/index.mjs +64 -60
  65. package/dist/{insert-audio-I3PD6JFS.mjs → insert-audio-CRWR7EO5.mjs} +4 -6
  66. package/dist/{insert-file-PHR7XL4V.mjs → insert-file-I73AZW3L.mjs} +4 -6
  67. package/dist/{insert-gif-R5ZO4JHC.mjs → insert-gif-KWRC3ACT.mjs} +1 -1
  68. package/dist/{insert-image-PLBZELHK.mjs → insert-image-XIY6BGW5.mjs} +4 -3
  69. package/dist/{insert-poll-6BCIFY5G.mjs → insert-poll-J5YVZNZ4.mjs} +4 -3
  70. package/dist/{insert-table-ZRJP6X52.mjs → insert-table-OIMJRFFK.mjs} +1 -1
  71. package/dist/{poll-component-VHMM5KKZ.mjs → poll-component-TVHXIKGQ.mjs} +3 -2
  72. package/dist/react.js +14747 -12554
  73. package/dist/react.mjs +40 -38
  74. package/dist/{stepper-KNITDVLG.mjs → stepper-ILF7YXTO.mjs} +63 -73
  75. package/dist/styles/notiq.css +1 -1
  76. package/package.json +2 -2
  77. package/src/styles/notiq.css +20 -0
  78. package/dist/AICommandBarPlugin-TADJ3X2Y.mjs +0 -12
  79. package/dist/CodeActionMenuPlugin-FGH6HZLL.mjs +0 -14
  80. package/dist/CollaborationPlugin-TIZOQBUT.mjs +0 -405
  81. package/dist/CollaboratorsBar-AMPIAUOY.mjs +0 -20
  82. package/dist/CommentsPlugin-SDJJTUGK.mjs +0 -19
  83. package/dist/ExcalidrawPlugin-QLPGJPSX.mjs +0 -14
  84. package/dist/ExportPlugin-MJHYKQZJ.mjs +0 -43
  85. package/dist/FloatingLinkEditorPlugin-MABB34L7.mjs +0 -12
  86. package/dist/FloatingTextFormatToolbarPlugin-BXCPN3KD.mjs +0 -45
  87. package/dist/InlineCopilotPlugin-PNS5Y6OO.mjs +0 -360
  88. package/dist/MobileToolbar-KV5DX4ED.mjs +0 -982
  89. package/dist/SlashCommand-SPR7G5EI.mjs +0 -39
  90. package/dist/TableCellActionMenuPlugin-YWBA64J7.mjs +0 -838
  91. package/dist/TableHoverActionsPlugin-2EIXHEXN.mjs +0 -265
  92. package/dist/TemplatePlugin-HNTPEXBB.mjs +0 -9
  93. package/dist/ToolbarPlugin-F52PVNXU.mjs +0 -823
  94. package/dist/VersionHistoryPlugin-YWGCREKA.mjs +0 -371
  95. package/dist/background-color-RW5JYLMG.mjs +0 -425
  96. package/dist/block-format-TODFREE2.mjs +0 -14
  97. package/dist/chunk-22ZIL6NH.mjs +0 -88
  98. package/dist/chunk-2LNT36RL.mjs +0 -555
  99. package/dist/chunk-37LC44W3.mjs +0 -2677
  100. package/dist/chunk-3IILA3IP.mjs +0 -28
  101. package/dist/chunk-4DVIYZVB.mjs +0 -193
  102. package/dist/chunk-4FFTOZGJ.mjs +0 -103
  103. package/dist/chunk-4UMUPCDK.mjs +0 -68
  104. package/dist/chunk-6D6QLRYR.mjs +0 -238
  105. package/dist/chunk-6FQFPPLG.mjs +0 -785
  106. package/dist/chunk-ACV47ZKE.mjs +0 -201
  107. package/dist/chunk-BGV62GC2.mjs +0 -26
  108. package/dist/chunk-C4JWLBYN.mjs +0 -132
  109. package/dist/chunk-CLRSETYQ.mjs +0 -431
  110. package/dist/chunk-D3IOUQFR.mjs +0 -441
  111. package/dist/chunk-EEBA6OAH.mjs +0 -59
  112. package/dist/chunk-EIZMKFHF.mjs +0 -32
  113. package/dist/chunk-ENH2IOHI.mjs +0 -1828
  114. package/dist/chunk-EVPWKNE4.mjs +0 -27
  115. package/dist/chunk-HOZ4QRFV.mjs +0 -536
  116. package/dist/chunk-IAFCQV3Z.mjs +0 -349
  117. package/dist/chunk-J6ZUY5BY.mjs +0 -202
  118. package/dist/chunk-K5OAFEVY.mjs +0 -191
  119. package/dist/chunk-KXRLARGI.mjs +0 -26
  120. package/dist/chunk-LBGM4VVZ.mjs +0 -409
  121. package/dist/chunk-LLGVCM7M.mjs +0 -809
  122. package/dist/chunk-LU2XWLOE.mjs +0 -219
  123. package/dist/chunk-LVRJM45C.mjs +0 -171
  124. package/dist/chunk-MSAO3YFB.mjs +0 -144
  125. package/dist/chunk-N3KDPSRI.mjs +0 -496
  126. package/dist/chunk-OXWTZV3U.mjs +0 -174
  127. package/dist/chunk-PD5K4AGP.mjs +0 -64
  128. package/dist/chunk-PFH63ZU4.mjs +0 -33
  129. package/dist/chunk-R7WFRENU.mjs +0 -262
  130. package/dist/chunk-RAVYEEIC.mjs +0 -36
  131. package/dist/chunk-RJQTA6HG.mjs +0 -358
  132. package/dist/chunk-SAOJHVPE.mjs +0 -153
  133. package/dist/chunk-SYUCM5G5.mjs +0 -111
  134. package/dist/chunk-VGAX6YEY.mjs +0 -399
  135. package/dist/chunk-VNDDDXGH.mjs +0 -682
  136. package/dist/chunk-WUVIQCX7.mjs +0 -944
  137. package/dist/chunk-XNJNT6PC.mjs +0 -1701
  138. package/dist/chunk-XYLTLGY5.mjs +0 -775
  139. package/dist/chunk-ZKZ7MLSS.mjs +0 -165
  140. package/dist/color-S55XFDYQ.mjs +0 -13
  141. package/dist/font-IJKFR4BM.mjs +0 -12
  142. package/dist/font-size-3HMJHKO2.mjs +0 -15
  143. package/dist/insert-node-DGCZBGKG.mjs +0 -243
  144. package/dist/table-dropdown-4VCRSQB6.mjs +0 -391
  145. package/dist/text-align-TEB4S52S.mjs +0 -121
  146. package/dist/text-format-T3IY7FBI.mjs +0 -15
@@ -2,7 +2,7 @@ import {
2
2
  $createPollNode,
3
3
  PollNode,
4
4
  createPollOption
5
- } from "./chunk-N6ILV6NF.mjs";
5
+ } from "./chunk-ACW4DLVO.mjs";
6
6
  import {
7
7
  init_react_shim
8
8
  } from "./chunk-WYCFGRFJ.mjs";
@@ -73,7 +73,7 @@ var DynamicBlockNode = class _DynamicBlockNode extends DecoratorBlockNode {
73
73
  function $createDynamicBlockNode(payload) {
74
74
  return new DynamicBlockNode(payload);
75
75
  }
76
- var DynamicBlockComponent = React.lazy(() => import("./DynamicBlockComponent-2LOADZUX.mjs"));
76
+ var DynamicBlockComponent = React.lazy(() => import("./DynamicBlockComponent-CHRL2GAQ.mjs"));
77
77
 
78
78
  export {
79
79
  DynamicBlockNode,
@@ -7,6 +7,12 @@ import {
7
7
  init_react_shim
8
8
  } from "./chunk-WYCFGRFJ.mjs";
9
9
 
10
+ // src/components/ui/button.tsx
11
+ init_react_shim();
12
+ import * as React2 from "react";
13
+ import { Slot } from "@radix-ui/react-slot";
14
+ import { cva } from "class-variance-authority";
15
+
10
16
  // src/components/ui/tooltip.tsx
11
17
  init_react_shim();
12
18
  import * as React from "react";
@@ -32,10 +38,6 @@ var TooltipContent = React.forwardRef((_a, ref) => {
32
38
  TooltipContent.displayName = TooltipPrimitive.Content.displayName;
33
39
 
34
40
  // src/components/ui/button.tsx
35
- init_react_shim();
36
- import * as React2 from "react";
37
- import { Slot } from "@radix-ui/react-slot";
38
- import { cva } from "class-variance-authority";
39
41
  import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
40
42
  var buttonVariants = cva(
41
43
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
@@ -1,3 +1,6 @@
1
+ import {
2
+ NodeRendererSlot
3
+ } from "./chunk-RNEIJRUS.mjs";
1
4
  import {
2
5
  __spreadProps,
3
6
  __spreadValues,
@@ -9,7 +12,7 @@ init_react_shim();
9
12
  import { DecoratorNode } from "lexical";
10
13
  import * as React from "react";
11
14
  import { jsx } from "react/jsx-runtime";
12
- var ExcalidrawComponent = React.lazy(() => import("./ExcalidrawComponent-BMSYIPP6.mjs"));
15
+ var ExcalidrawComponent = React.lazy(() => import("./ExcalidrawComponent-POMYXDSG.mjs"));
13
16
  function $convertExcalidrawElement(domNode) {
14
17
  const excalidrawData = domNode.getAttribute("data-lexical-excalidraw-json");
15
18
  const styleAttributes = window.getComputedStyle(domNode);
@@ -119,12 +122,30 @@ var ExcalidrawNode = class _ExcalidrawNode extends DecoratorNode {
119
122
  }
120
123
  decorate(editor, config) {
121
124
  return /* @__PURE__ */ jsx(
122
- ExcalidrawComponent,
125
+ NodeRendererSlot,
123
126
  {
124
- nodeKey: this.getKey(),
125
- data: this.__data,
126
- width: this.__width,
127
- height: this.__height
127
+ nodeType: "excalidraw",
128
+ rendererProps: {
129
+ nodeKey: this.getKey(),
130
+ data: this.__data,
131
+ width: this.__width,
132
+ height: this.__height
133
+ },
134
+ fallback: /* @__PURE__ */ jsx(
135
+ React.Suspense,
136
+ {
137
+ fallback: /* @__PURE__ */ jsx("div", { className: "my-4 h-36 w-full max-w-md animate-pulse rounded-2xl border border-border/50 bg-muted/40" }),
138
+ children: /* @__PURE__ */ jsx(
139
+ ExcalidrawComponent,
140
+ {
141
+ nodeKey: this.getKey(),
142
+ data: this.__data,
143
+ width: this.__width,
144
+ height: this.__height
145
+ }
146
+ )
147
+ }
148
+ )
128
149
  }
129
150
  );
130
151
  }
@@ -0,0 +1,129 @@
1
+ import {
2
+ init_react_shim
3
+ } from "./chunk-WYCFGRFJ.mjs";
4
+
5
+ // src/components/ui/equation/KatexRenderer.tsx
6
+ init_react_shim();
7
+ import katex from "katex";
8
+ import { useEffect, useRef } from "react";
9
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
+ function KatexRenderer({
11
+ equation,
12
+ inline,
13
+ onDoubleClick
14
+ }) {
15
+ const katexElementRef = useRef(null);
16
+ useEffect(() => {
17
+ const katexElement = katexElementRef.current;
18
+ if (katexElement !== null) {
19
+ katex.render(equation, katexElement, {
20
+ displayMode: !inline,
21
+ // true === block display //
22
+ errorColor: "#cc0000",
23
+ output: "html",
24
+ strict: "warn",
25
+ throwOnError: false,
26
+ trust: false
27
+ });
28
+ }
29
+ }, [equation, inline]);
30
+ return (
31
+ // We use an empty image tag either side to ensure Android doesn't try and compose from the
32
+ // inner text from Katex. There didn't seem to be any other way of making this work,
33
+ // without having a physical space.
34
+ /* @__PURE__ */ jsxs(Fragment, { children: [
35
+ /* @__PURE__ */ jsx(
36
+ "img",
37
+ {
38
+ src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
39
+ width: "0",
40
+ height: "0",
41
+ alt: "",
42
+ style: { display: "inline" }
43
+ }
44
+ ),
45
+ /* @__PURE__ */ jsx(
46
+ "span",
47
+ {
48
+ role: "button",
49
+ tabIndex: -1,
50
+ onDoubleClick,
51
+ ref: katexElementRef,
52
+ className: inline ? "inline-block align-baseline" : "block"
53
+ }
54
+ ),
55
+ /* @__PURE__ */ jsx(
56
+ "img",
57
+ {
58
+ src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
59
+ width: "0",
60
+ height: "0",
61
+ alt: "",
62
+ style: { display: "inline" }
63
+ }
64
+ )
65
+ ] })
66
+ );
67
+ }
68
+
69
+ // src/components/ui/equation/equationTypography.ts
70
+ init_react_shim();
71
+ var EQUATION_TYPOGRAPHY_RULES = [
72
+ // Chained expansions when typing `>` after `<=` (\le ) or `<-` (\leftarrow )
73
+ { pattern: /\\le\s*>$/, replacement: "\\Leftrightarrow " },
74
+ { pattern: /\\leftarrow\s*>$/, replacement: "\\leftrightarrow " },
75
+ { pattern: /<=>$/, replacement: "\\Leftrightarrow " },
76
+ { pattern: /<->$/, replacement: "\\leftrightarrow " },
77
+ // Arrows
78
+ { pattern: /=>$/, replacement: "\\Rightarrow " },
79
+ { pattern: /->$/, replacement: "\\to " },
80
+ { pattern: /<-$/, replacement: "\\leftarrow " },
81
+ // Comparisons & math operators
82
+ { pattern: /<=$/, replacement: "\\le " },
83
+ { pattern: />=$/, replacement: "\\ge " },
84
+ { pattern: /!=$/, replacement: "\\neq " },
85
+ { pattern: /~=$/, replacement: "\\approx " },
86
+ { pattern: /\+-$/, replacement: "\\pm " },
87
+ { pattern: /\.\.\.$/, replacement: "\\dots " }
88
+ ];
89
+ function applyEquationTypography(text, cursorOffset) {
90
+ if (cursorOffset <= 0 || cursorOffset > text.length) {
91
+ return null;
92
+ }
93
+ const before = text.slice(0, cursorOffset);
94
+ const after = text.slice(cursorOffset);
95
+ for (const rule of EQUATION_TYPOGRAPHY_RULES) {
96
+ const match = before.match(rule.pattern);
97
+ if (match) {
98
+ const matchedStr = match[0];
99
+ const prefix = before.slice(0, before.length - matchedStr.length);
100
+ const nextBefore = prefix + rule.replacement;
101
+ return {
102
+ text: nextBefore + after,
103
+ offset: nextBefore.length
104
+ };
105
+ }
106
+ }
107
+ return null;
108
+ }
109
+ function handleEquationInputChange(target, setEquation) {
110
+ var _a;
111
+ const rawValue = target.value;
112
+ const cursor = (_a = target.selectionStart) != null ? _a : rawValue.length;
113
+ const transformed = applyEquationTypography(rawValue, cursor);
114
+ if (transformed) {
115
+ setEquation(transformed.text);
116
+ requestAnimationFrame(() => {
117
+ if (typeof target.setSelectionRange === "function") {
118
+ target.setSelectionRange(transformed.offset, transformed.offset);
119
+ }
120
+ });
121
+ return;
122
+ }
123
+ setEquation(rawValue);
124
+ }
125
+
126
+ export {
127
+ handleEquationInputChange,
128
+ KatexRenderer
129
+ };