@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
@@ -12,7 +12,7 @@ import {
12
12
  } from "@lexical/react/LexicalDecoratorBlockNode";
13
13
  import * as React from "react";
14
14
  import { jsx } from "react/jsx-runtime";
15
- var AudioComponent = React.lazy(() => import("./AudioComponent-CKLMLB5T.mjs"));
15
+ var AudioComponent = React.lazy(() => import("./AudioComponent-W5XMZPQB.mjs"));
16
16
  var INSERT_AUDIO_COMMAND = createCommand("INSERT_AUDIO_COMMAND");
17
17
  function $convertAudioElement(domNode) {
18
18
  var _a;
@@ -12,7 +12,7 @@ import {
12
12
  } from "@lexical/react/LexicalDecoratorBlockNode";
13
13
  import * as React from "react";
14
14
  import { jsx } from "react/jsx-runtime";
15
- var FileComponent = React.lazy(() => import("./FileComponent-Y56MX5QD.mjs"));
15
+ var FileComponent = React.lazy(() => import("./FileComponent-EOVCH4V5.mjs"));
16
16
  var INSERT_FILE_COMMAND = createCommand("INSERT_FILE_COMMAND");
17
17
  function $convertFileElement(domNode) {
18
18
  const link = domNode;
@@ -0,0 +1,282 @@
1
+ import {
2
+ init_react_shim
3
+ } from "./chunk-WYCFGRFJ.mjs";
4
+
5
+ // src/components/editor/utils/url.ts
6
+ init_react_shim();
7
+ var SUPPORTED_URL_PROTOCOLS = /* @__PURE__ */ new Set([
8
+ "http:",
9
+ "https:",
10
+ "mailto:",
11
+ "sms:",
12
+ "tel:",
13
+ "ftp:"
14
+ ]);
15
+ function sanitizeUrl(url) {
16
+ try {
17
+ const parsedUrl = new URL(url);
18
+ if (!SUPPORTED_URL_PROTOCOLS.has(parsedUrl.protocol)) {
19
+ return "about:blank";
20
+ }
21
+ } catch (e) {
22
+ return url;
23
+ }
24
+ return url;
25
+ }
26
+ var urlRegExp = new RegExp(
27
+ /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/
28
+ );
29
+ function validateUrl(url) {
30
+ return url === "https://" || urlRegExp.test(url);
31
+ }
32
+ function normalizeUrl(rawUrl) {
33
+ let trimmed = (rawUrl || "").trim();
34
+ if (/^www\./i.test(trimmed)) {
35
+ trimmed = `https://${trimmed}`;
36
+ }
37
+ return trimmed;
38
+ }
39
+ function extractYouTubeId(url) {
40
+ try {
41
+ const match = url.match(
42
+ /(?:youtube\.com\/(?:watch\?.*v=|embed\/|shorts\/|live\/)|youtu\.be\/)([a-zA-Z0-9_-]{11})/i
43
+ );
44
+ return match ? match[1] : null;
45
+ } catch (e) {
46
+ return null;
47
+ }
48
+ }
49
+ function cleanTitleFromUrl(urlStr) {
50
+ try {
51
+ const parsed = new URL(urlStr);
52
+ const path = parsed.pathname.replace(/\/+$/, "");
53
+ if (!path || path === "/") {
54
+ return parsed.hostname.replace(/^www\./, "");
55
+ }
56
+ const segment = path.split("/").pop() || "";
57
+ const clean = segment.replace(/\.[a-zA-Z0-9]+$/, "").replace(/[-_]+/g, " ").trim();
58
+ if (clean.length > 2) {
59
+ return clean.split(" ").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
60
+ }
61
+ return parsed.hostname.replace(/^www\./, "");
62
+ } catch (e) {
63
+ return urlStr;
64
+ }
65
+ }
66
+ function getInitialMetadata(rawUrl) {
67
+ const url = normalizeUrl(rawUrl);
68
+ let hostname = "link";
69
+ try {
70
+ hostname = new URL(url).hostname.replace(/^www\./, "");
71
+ } catch (e) {
72
+ }
73
+ const defaultFavicon = `https://www.google.com/s2/favicons?domain=${hostname}&sz=64`;
74
+ const ytId = extractYouTubeId(url);
75
+ if (ytId) {
76
+ return {
77
+ title: "YouTube Video",
78
+ description: "Watch on YouTube",
79
+ image: `https://i.ytimg.com/vi/${ytId}/hqdefault.jpg`,
80
+ website: "YouTube",
81
+ logo: "https://www.youtube.com/s/desktop/28b0985e/img/favicon.ico"
82
+ };
83
+ }
84
+ const ghMatch = url.match(
85
+ /^https?:\/\/github\.com\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+)/i
86
+ );
87
+ if (ghMatch) {
88
+ const [, owner, repo] = ghMatch;
89
+ return {
90
+ title: `${owner}/${repo}`,
91
+ description: "GitHub repository",
92
+ image: `https://opengraph.githubassets.com/1/${owner}/${repo}`,
93
+ website: "GitHub",
94
+ logo: "https://github.githubassets.com/favicons/favicon.svg"
95
+ };
96
+ }
97
+ if (/\.(png|jpe?g|gif|webp|svg)(\?.*)?$/i.test(url)) {
98
+ return {
99
+ title: cleanTitleFromUrl(url),
100
+ description: "Image",
101
+ image: url,
102
+ website: hostname,
103
+ logo: defaultFavicon
104
+ };
105
+ }
106
+ return {
107
+ title: cleanTitleFromUrl(url) || hostname,
108
+ description: `Open link on ${hostname}`,
109
+ image: void 0,
110
+ website: hostname,
111
+ logo: defaultFavicon
112
+ };
113
+ }
114
+ async function fetchMetadata(rawUrl) {
115
+ var _a, _b;
116
+ const url = normalizeUrl(rawUrl);
117
+ const fallback = getInitialMetadata(url);
118
+ const ytId = extractYouTubeId(url);
119
+ if (ytId) {
120
+ try {
121
+ const res = await fetch(
122
+ `https://noembed.com/embed?url=${encodeURIComponent(url)}`,
123
+ { signal: AbortSignal.timeout(4e3) }
124
+ );
125
+ if (res.ok) {
126
+ const data = await res.json();
127
+ if (data && data.title) {
128
+ return {
129
+ title: data.title,
130
+ description: data.author_name ? `by ${data.author_name} \u2022 YouTube` : "Watch on YouTube",
131
+ image: data.thumbnail_url || `https://i.ytimg.com/vi/${ytId}/hqdefault.jpg`,
132
+ website: "YouTube",
133
+ logo: fallback.logo
134
+ };
135
+ }
136
+ }
137
+ } catch (e) {
138
+ }
139
+ return fallback;
140
+ }
141
+ const ghMatch = url.match(
142
+ /^https?:\/\/github\.com\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+)/i
143
+ );
144
+ if (ghMatch) {
145
+ const [, owner, repo] = ghMatch;
146
+ try {
147
+ const res = await fetch(
148
+ `https://api.github.com/repos/${owner}/${repo}`,
149
+ {
150
+ headers: { Accept: "application/vnd.github.v3+json" },
151
+ signal: AbortSignal.timeout(4e3)
152
+ }
153
+ );
154
+ if (res.ok) {
155
+ const data = await res.json();
156
+ return {
157
+ title: data.full_name || `${owner}/${repo}`,
158
+ description: data.description || (data.stargazers_count != null ? `\u2605 ${data.stargazers_count.toLocaleString()} on GitHub` : "GitHub repository"),
159
+ image: `https://opengraph.githubassets.com/1/${owner}/${repo}`,
160
+ website: "GitHub",
161
+ logo: fallback.logo
162
+ };
163
+ }
164
+ } catch (e) {
165
+ }
166
+ return fallback;
167
+ }
168
+ if (/vimeo\.com\/\d+/i.test(url)) {
169
+ try {
170
+ const res = await fetch(
171
+ `https://vimeo.com/api/oembed.json?url=${encodeURIComponent(url)}`,
172
+ { signal: AbortSignal.timeout(4e3) }
173
+ );
174
+ if (res.ok) {
175
+ const data = await res.json();
176
+ return {
177
+ title: data.title || fallback.title,
178
+ description: data.description || (data.author_name ? `by ${data.author_name} \u2022 Vimeo` : "Vimeo Video"),
179
+ image: data.thumbnail_url || fallback.image,
180
+ website: "Vimeo",
181
+ logo: fallback.logo
182
+ };
183
+ }
184
+ } catch (e) {
185
+ }
186
+ }
187
+ if (/spotify\.com/i.test(url)) {
188
+ try {
189
+ const res = await fetch(
190
+ `https://open.spotify.com/oembed?url=${encodeURIComponent(url)}`,
191
+ { signal: AbortSignal.timeout(4e3) }
192
+ );
193
+ if (res.ok) {
194
+ const data = await res.json();
195
+ return {
196
+ title: data.title || fallback.title,
197
+ description: "Listen on Spotify",
198
+ image: data.thumbnail_url || fallback.image,
199
+ website: "Spotify",
200
+ logo: fallback.logo
201
+ };
202
+ }
203
+ } catch (e) {
204
+ }
205
+ }
206
+ if (/soundcloud\.com/i.test(url)) {
207
+ try {
208
+ const res = await fetch(
209
+ `https://soundcloud.com/oembed?url=${encodeURIComponent(url)}&format=json`,
210
+ { signal: AbortSignal.timeout(4e3) }
211
+ );
212
+ if (res.ok) {
213
+ const data = await res.json();
214
+ return {
215
+ title: data.title || fallback.title,
216
+ description: data.author_name ? `by ${data.author_name} \u2022 SoundCloud` : "SoundCloud",
217
+ image: data.thumbnail_url || fallback.image,
218
+ website: "SoundCloud",
219
+ logo: fallback.logo
220
+ };
221
+ }
222
+ } catch (e) {
223
+ }
224
+ }
225
+ try {
226
+ const res = await fetch(
227
+ `https://noembed.com/embed?url=${encodeURIComponent(url)}`,
228
+ { signal: AbortSignal.timeout(4e3) }
229
+ );
230
+ if (res.ok) {
231
+ const data = await res.json();
232
+ if (data && data.title && !data.error) {
233
+ return {
234
+ title: data.title,
235
+ description: data.author_name ? `by ${data.author_name}` : data.provider_name || fallback.description,
236
+ image: data.thumbnail_url || fallback.image,
237
+ website: data.provider_name || fallback.website,
238
+ logo: fallback.logo
239
+ };
240
+ }
241
+ }
242
+ } catch (e) {
243
+ }
244
+ try {
245
+ const proxyUrl = "https://api.allorigins.win/get?url=";
246
+ const response = await fetch(`${proxyUrl}${encodeURIComponent(url)}`, {
247
+ signal: AbortSignal.timeout(4e3)
248
+ });
249
+ if (response.ok) {
250
+ const data = await response.json();
251
+ if (data && data.contents && typeof DOMParser !== "undefined") {
252
+ const parser = new DOMParser();
253
+ const doc = parser.parseFromString(data.contents, "text/html");
254
+ const getMetaTagContent = (property) => {
255
+ const element = doc.querySelector(`meta[property="${property}"]`) || doc.querySelector(`meta[name="${property}"]`);
256
+ return element ? element.getAttribute("content") : null;
257
+ };
258
+ const title = getMetaTagContent("og:title") || getMetaTagContent("twitter:title") || ((_b = (_a = doc.querySelector("title")) == null ? void 0 : _a.textContent) == null ? void 0 : _b.trim()) || fallback.title;
259
+ const description = getMetaTagContent("og:description") || getMetaTagContent("twitter:description") || getMetaTagContent("description") || fallback.description;
260
+ const image = getMetaTagContent("og:image") || getMetaTagContent("twitter:image") || fallback.image;
261
+ const website = getMetaTagContent("og:site_name") || fallback.website;
262
+ return {
263
+ title,
264
+ description,
265
+ image: image || void 0,
266
+ website,
267
+ logo: fallback.logo
268
+ };
269
+ }
270
+ }
271
+ } catch (e) {
272
+ }
273
+ return fallback;
274
+ }
275
+
276
+ export {
277
+ sanitizeUrl,
278
+ validateUrl,
279
+ normalizeUrl,
280
+ getInitialMetadata,
281
+ fetchMetadata
282
+ };
@@ -1,56 +1,66 @@
1
1
  import {
2
- Extension
3
- } from "./chunk-37LC44W3.mjs";
2
+ CollaborationPluginWrapper,
3
+ DraggableBlockPlugin,
4
+ Extension,
5
+ InlineCopilotPlugin
6
+ } from "./chunk-5CJZC5IB.mjs";
4
7
  import {
8
+ INSERT_LAYOUT_COMMAND,
9
+ SlashCommand
10
+ } from "./chunk-IXRA5D53.mjs";
11
+ import {
12
+ AICommandBarPlugin,
5
13
  OPEN_AI_COMMAND_BAR_COMMAND
6
- } from "./chunk-HOZ4QRFV.mjs";
14
+ } from "./chunk-TJPTGECP.mjs";
7
15
  import {
8
- INSERT_LAYOUT_COMMAND,
9
16
  LayoutContainerNode,
10
17
  LayoutItemNode
11
- } from "./chunk-XYLTLGY5.mjs";
12
- import {
13
- $createStepperNode,
14
- StepperNode
15
- } from "./chunk-LLGVCM7M.mjs";
18
+ } from "./chunk-BCGD2YXP.mjs";
16
19
  import {
17
20
  $createFigmaNode,
21
+ $createStepperNode,
18
22
  $createTweetNode,
19
23
  $createYouTubeNode,
20
24
  FigmaNode,
25
+ StepperNode,
21
26
  TweetNode,
22
27
  YouTubeNode
23
- } from "./chunk-VGAX6YEY.mjs";
28
+ } from "./chunk-QCS57TIF.mjs";
24
29
  import {
25
30
  $createPollNode,
26
31
  PollNode,
27
32
  createPollOption
28
- } from "./chunk-N6ILV6NF.mjs";
33
+ } from "./chunk-ACW4DLVO.mjs";
29
34
  import {
30
35
  $createAudioNode,
31
36
  AudioNode
32
- } from "./chunk-XYMXGU4T.mjs";
37
+ } from "./chunk-TMYRA2W4.mjs";
33
38
  import {
34
39
  $createFileNode,
35
40
  FileNode
36
- } from "./chunk-ZFV2HGD3.mjs";
41
+ } from "./chunk-UNEFOZTS.mjs";
37
42
  import {
38
43
  $createImageNode,
39
44
  ImageNode
40
- } from "./chunk-ELBTVBTS.mjs";
45
+ } from "./chunk-IKYVBTCJ.mjs";
41
46
  import {
42
47
  $createExcalidrawNode,
43
48
  ExcalidrawNode
44
- } from "./chunk-QNIY45SF.mjs";
49
+ } from "./chunk-OO42URWA.mjs";
45
50
  import {
46
51
  $createEquationNode,
47
52
  EquationNode
48
- } from "./chunk-KNW2CGIP.mjs";
53
+ } from "./chunk-DBRZIA43.mjs";
49
54
  import {
50
55
  $createHintNode,
51
56
  Hint
52
- } from "./chunk-7QRJVZQY.mjs";
57
+ } from "./chunk-YVUQRJVV.mjs";
53
58
  import {
59
+ clearEditorNodeRenderers,
60
+ setEditorNodeRenderers
61
+ } from "./chunk-RNEIJRUS.mjs";
62
+ import {
63
+ __spreadValues,
54
64
  init_react_shim
55
65
  } from "./chunk-WYCFGRFJ.mjs";
56
66
 
@@ -328,6 +338,8 @@ var StarterKit = Extension.create({
328
338
 
329
339
  // src/core/extensions/blocks-kit.ts
330
340
  init_react_shim();
341
+ import React2 from "react";
342
+ import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
331
343
  import { $getSelection as $getSelection2, $isRangeSelection as $isRangeSelection2 } from "lexical";
332
344
  var Excalidraw = Extension.create({
333
345
  name: "excalidraw",
@@ -525,42 +537,130 @@ var ColumnsLayout = Extension.create({
525
537
  }
526
538
  })
527
539
  });
540
+ var SlashMenu = Extension.create({
541
+ name: "slashMenu",
542
+ defaultOptions: {
543
+ headless: false
544
+ },
545
+ plugins: ({ options }) => {
546
+ const BoundSlashMenu = () => React2.createElement(
547
+ SlashCommand,
548
+ {
549
+ headless: options.headless,
550
+ render: options.render,
551
+ onStateChange: options.onStateChange
552
+ }
553
+ );
554
+ BoundSlashMenu.displayName = "NotiqSlashMenu";
555
+ return [BoundSlashMenu];
556
+ }
557
+ });
558
+ var BlockHandle = Extension.create({
559
+ name: "blockHandle",
560
+ defaultOptions: {
561
+ headless: false
562
+ },
563
+ plugins: ({ options }) => {
564
+ const BoundBlockHandle = () => React2.createElement(
565
+ DraggableBlockPlugin,
566
+ {
567
+ anchorElem: options.anchorElem,
568
+ className: options.className,
569
+ headless: options.headless,
570
+ render: options.render,
571
+ renderTargetLine: options.renderTargetLine,
572
+ onStateChange: options.onStateChange
573
+ }
574
+ );
575
+ BoundBlockHandle.displayName = "NotiqBlockHandle";
576
+ return [BoundBlockHandle];
577
+ }
578
+ });
579
+ var NodeRenderers = Extension.create({
580
+ name: "nodeRenderers",
581
+ defaultOptions: {
582
+ renderers: {}
583
+ },
584
+ plugins: ({ options }) => {
585
+ const BoundNodeRenderersPlugin = () => {
586
+ const [editor] = useLexicalComposerContext();
587
+ React2.useEffect(() => {
588
+ setEditorNodeRenderers(editor, options.renderers);
589
+ return () => {
590
+ clearEditorNodeRenderers(editor);
591
+ };
592
+ }, [editor]);
593
+ return null;
594
+ };
595
+ BoundNodeRenderersPlugin.displayName = "NotiqNodeRenderers";
596
+ return [BoundNodeRenderersPlugin];
597
+ }
598
+ });
528
599
  var BlocksKit = Extension.create({
529
600
  name: "blocksKit",
530
- addExtensions: () => [
531
- Excalidraw,
532
- Figma,
533
- Equation,
534
- HintBlock,
535
- Stepper,
536
- Poll,
537
- Image,
538
- Tweet,
539
- YouTube,
540
- Audio,
541
- File,
542
- ColumnsLayout
543
- ]
601
+ defaultOptions: {
602
+ headless: false,
603
+ slashMenu: true,
604
+ handles: true
605
+ },
606
+ addExtensions: ({ options }) => {
607
+ const extensions = [
608
+ Excalidraw,
609
+ Figma,
610
+ Equation,
611
+ HintBlock,
612
+ Stepper,
613
+ Poll,
614
+ Image,
615
+ Tweet,
616
+ YouTube,
617
+ Audio,
618
+ File,
619
+ ColumnsLayout
620
+ ];
621
+ if (options.renderers) {
622
+ extensions.push(NodeRenderers.configure({ renderers: options.renderers }));
623
+ }
624
+ if (options.slashMenu !== false) {
625
+ const slashOpts = typeof options.slashMenu === "object" ? options.slashMenu : {};
626
+ extensions.push(
627
+ SlashMenu.configure(__spreadValues({
628
+ headless: options.headless
629
+ }, slashOpts))
630
+ );
631
+ }
632
+ if (options.handles !== false) {
633
+ const handleOpts = typeof options.handles === "object" ? options.handles : {};
634
+ extensions.push(
635
+ BlockHandle.configure(__spreadValues({
636
+ headless: options.headless
637
+ }, handleOpts))
638
+ );
639
+ }
640
+ return extensions;
641
+ }
544
642
  });
545
643
 
546
644
  // src/core/extensions/copilot-and-collab.ts
547
645
  init_react_shim();
548
- import dynamic from "next/dynamic";
549
- var InlineCopilotPlugin = dynamic(
550
- () => import("./InlineCopilotPlugin-PNS5Y6OO.mjs"),
551
- { ssr: false }
552
- );
553
- var CollaborationPlugin = dynamic(
554
- () => import("./CollaborationPlugin-TIZOQBUT.mjs"),
555
- { ssr: false }
556
- );
557
- var AICommandBarPlugin = dynamic(
558
- () => import("./AICommandBarPlugin-TADJ3X2Y.mjs"),
559
- { ssr: false }
560
- );
646
+ import React3 from "react";
561
647
  var AICommandBar = Extension.create({
562
648
  name: "aiCommandBar",
563
- plugins: () => [AICommandBarPlugin],
649
+ defaultOptions: {
650
+ headless: false
651
+ },
652
+ plugins: ({ options }) => {
653
+ const BoundCommandBar = () => React3.createElement(
654
+ AICommandBarPlugin,
655
+ {
656
+ headless: options.headless,
657
+ apiEndpoint: options.apiEndpoint,
658
+ render: options.render,
659
+ onStateChange: options.onStateChange
660
+ }
661
+ );
662
+ return [BoundCommandBar];
663
+ },
564
664
  addCommands: () => ({
565
665
  openAICommandBar: (payload) => ({ lexical }) => {
566
666
  lexical.dispatchCommand(OPEN_AI_COMMAND_BAR_COMMAND, payload);
@@ -571,12 +671,31 @@ var AICommandBar = Extension.create({
571
671
  var AICopilot = Extension.create({
572
672
  name: "aiCopilot",
573
673
  defaultOptions: {
574
- enabled: true
674
+ enabled: true,
675
+ headless: false
676
+ },
677
+ addExtensions: ({ options }) => {
678
+ var _a, _b, _c, _d, _e;
679
+ return [
680
+ AICommandBar.configure({
681
+ headless: (_b = (_a = options.commandBar) == null ? void 0 : _a.headless) != null ? _b : options.headless,
682
+ apiEndpoint: (_c = options.commandBar) == null ? void 0 : _c.apiEndpoint,
683
+ render: (_d = options.commandBar) == null ? void 0 : _d.render,
684
+ onStateChange: (_e = options.commandBar) == null ? void 0 : _e.onStateChange
685
+ })
686
+ ];
575
687
  },
576
- addExtensions: () => [AICommandBar],
577
688
  plugins: ({ options }) => {
578
689
  if (options.enabled === false) return [];
579
- return [InlineCopilotPlugin];
690
+ const BoundCopilot = () => React3.createElement(
691
+ InlineCopilotPlugin,
692
+ {
693
+ headless: options.headless,
694
+ render: options.render,
695
+ onStateChange: options.onStateChange
696
+ }
697
+ );
698
+ return [BoundCopilot];
580
699
  }
581
700
  });
582
701
  var Collaboration = Extension.create({
@@ -586,7 +705,7 @@ var Collaboration = Extension.create({
586
705
  },
587
706
  plugins: ({ options }) => {
588
707
  if (options.enabled === false) return [];
589
- return [CollaborationPlugin];
708
+ return [CollaborationPluginWrapper];
590
709
  }
591
710
  });
592
711
 
@@ -617,6 +736,9 @@ export {
617
736
  Audio,
618
737
  File,
619
738
  ColumnsLayout,
739
+ SlashMenu,
740
+ BlockHandle,
741
+ NodeRenderers,
620
742
  BlocksKit,
621
743
  AICommandBar,
622
744
  AICopilot,