@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,449 +0,0 @@
1
- import {
2
- useModal
3
- } from "./chunk-IAFCQV3Z.mjs";
4
- import {
5
- $createFigmaNode,
6
- $createTweetNode,
7
- $createYouTubeNode,
8
- FigmaNode,
9
- TweetNode,
10
- YouTubeNode
11
- } from "./chunk-VGAX6YEY.mjs";
12
- import {
13
- Input
14
- } from "./chunk-5NRAXWYA.mjs";
15
- import {
16
- Button
17
- } from "./chunk-OE5JRLCN.mjs";
18
- import {
19
- __objRest,
20
- __spreadProps,
21
- __spreadValues,
22
- init_react_shim
23
- } from "./chunk-WYCFGRFJ.mjs";
24
-
25
- // src/components/ui/icons/brand-icons.tsx
26
- init_react_shim();
27
- import { jsx, jsxs } from "react/jsx-runtime";
28
- function Youtube(_a) {
29
- var _b = _a, { className = "w-4 h-4" } = _b, props = __objRest(_b, ["className"]);
30
- return /* @__PURE__ */ jsxs(
31
- "svg",
32
- __spreadProps(__spreadValues({
33
- viewBox: "0 0 24 24",
34
- width: "24",
35
- height: "24",
36
- stroke: "currentColor",
37
- strokeWidth: "2",
38
- fill: "none",
39
- strokeLinecap: "round",
40
- strokeLinejoin: "round",
41
- className
42
- }, props), {
43
- children: [
44
- /* @__PURE__ */ jsx("path", { d: "M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17" }),
45
- /* @__PURE__ */ jsx("polygon", { points: "10 15 15 12 10 9 10 15", fill: "currentColor" })
46
- ]
47
- })
48
- );
49
- }
50
- function Twitter(_a) {
51
- var _b = _a, { className = "w-4 h-4" } = _b, props = __objRest(_b, ["className"]);
52
- return /* @__PURE__ */ jsx(
53
- "svg",
54
- __spreadProps(__spreadValues({
55
- viewBox: "0 0 24 24",
56
- width: "24",
57
- height: "24",
58
- stroke: "currentColor",
59
- strokeWidth: "2",
60
- fill: "none",
61
- strokeLinecap: "round",
62
- strokeLinejoin: "round",
63
- className
64
- }, props), {
65
- children: /* @__PURE__ */ jsx("path", { d: "M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z" })
66
- })
67
- );
68
- }
69
- function Figma(_a) {
70
- var _b = _a, { className = "w-4 h-4" } = _b, props = __objRest(_b, ["className"]);
71
- return /* @__PURE__ */ jsxs(
72
- "svg",
73
- __spreadProps(__spreadValues({
74
- viewBox: "0 0 24 24",
75
- width: "24",
76
- height: "24",
77
- stroke: "currentColor",
78
- strokeWidth: "2",
79
- fill: "none",
80
- strokeLinecap: "round",
81
- strokeLinejoin: "round",
82
- className
83
- }, props), {
84
- children: [
85
- /* @__PURE__ */ jsx("path", { d: "M5 5.5A3.5 3.5 0 0 1 8.5 2H12v7H8.5A3.5 3.5 0 0 1 5 5.5z" }),
86
- /* @__PURE__ */ jsx("path", { d: "M12 2h3.5a3.5 3.5 0 1 1 0 7H12V2z" }),
87
- /* @__PURE__ */ jsx("path", { d: "M12 12.5a3.5 3.5 0 1 1 7 0 3.5 3.5 0 1 1-7 0z" }),
88
- /* @__PURE__ */ jsx("path", { d: "M5 19.5A3.5 3.5 0 0 1 8.5 16H12v3.5a3.5 3.5 0 1 1-7 0z" }),
89
- /* @__PURE__ */ jsx("path", { d: "M5 12.5A3.5 3.5 0 0 1 8.5 9H12v7H8.5A3.5 3.5 0 0 1 5 12.5z" })
90
- ]
91
- })
92
- );
93
- }
94
-
95
- // src/components/editor/plugins/AutoEmbedPlugin/index.tsx
96
- init_react_shim();
97
- import {
98
- AutoEmbedOption,
99
- LexicalAutoEmbedPlugin,
100
- URL_MATCHER
101
- } from "@lexical/react/LexicalAutoEmbedPlugin";
102
- import { useLexicalComposerContext as useLexicalComposerContext4 } from "@lexical/react/LexicalComposerContext";
103
- import { useMemo, useState } from "react";
104
- import * as ReactDOM from "react-dom";
105
-
106
- // src/components/editor/plugins/FigmaPlugin/index.tsx
107
- 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(
113
- "INSERT_FIGMA_COMMAND"
114
- );
115
- function FigmaPlugin() {
116
- const [editor] = useLexicalComposerContext();
117
- useEffect(() => {
118
- if (!editor.hasNodes([FigmaNode])) {
119
- throw new Error("FigmaPlugin: FigmaNode not registered on editor");
120
- }
121
- return editor.registerCommand(
122
- INSERT_FIGMA_COMMAND,
123
- (payload) => {
124
- const figmaNode = $createFigmaNode(payload);
125
- $insertNodeToNearestRoot(figmaNode);
126
- return true;
127
- },
128
- COMMAND_PRIORITY_EDITOR
129
- );
130
- }, [editor]);
131
- return null;
132
- }
133
-
134
- // src/components/editor/plugins/YouTubePlugin/index.ts
135
- 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(
141
- "INSERT_YOUTUBE_COMMAND"
142
- );
143
- function YouTubePlugin() {
144
- const [editor] = useLexicalComposerContext2();
145
- useEffect2(() => {
146
- if (!editor.hasNodes([YouTubeNode])) {
147
- throw new Error("YouTubePlugin: YouTubeNode not registered on editor");
148
- }
149
- return editor.registerCommand(
150
- INSERT_YOUTUBE_COMMAND,
151
- (payload) => {
152
- const youTubeNode = $createYouTubeNode(payload);
153
- $insertNodeToNearestRoot2(youTubeNode);
154
- return true;
155
- },
156
- COMMAND_PRIORITY_EDITOR2
157
- );
158
- }, [editor]);
159
- return null;
160
- }
161
-
162
- // src/components/editor/plugins/TwitterPlugin/index.ts
163
- 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(
169
- "INSERT_TWEET_COMMAND"
170
- );
171
- function TwitterPlugin() {
172
- const [editor] = useLexicalComposerContext3();
173
- useEffect3(() => {
174
- if (!editor.hasNodes([TweetNode])) {
175
- throw new Error("TwitterPlugin: TweetNode not registered on editor");
176
- }
177
- return editor.registerCommand(
178
- INSERT_TWEET_COMMAND,
179
- (payload) => {
180
- const tweetNode = $createTweetNode(payload);
181
- $insertNodeToNearestRoot3(tweetNode);
182
- return true;
183
- },
184
- COMMAND_PRIORITY_EDITOR3
185
- );
186
- }, [editor]);
187
- return null;
188
- }
189
-
190
- // src/components/editor/plugins/AutoEmbedPlugin/index.tsx
191
- import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
192
- var YoutubeEmbedConfig = {
193
- contentName: "Youtube Video",
194
- exampleUrl: "https://www.youtube.com/watch?v=jNQXAC9IVRw",
195
- // Icon for display.
196
- icon: /* @__PURE__ */ jsx2(Youtube, { className: "h-4 w-4" }),
197
- insertNode: (editor, result) => {
198
- editor.dispatchCommand(INSERT_YOUTUBE_COMMAND, result.id);
199
- },
200
- keywords: ["youtube", "video"],
201
- // Determine if a given URL is a match and return url data.
202
- parseUrl: async (url) => {
203
- const match = /^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/.exec(url);
204
- const id = match ? (match == null ? void 0 : match[2].length) === 11 ? match[2] : null : null;
205
- if (id != null) {
206
- return {
207
- id,
208
- url
209
- };
210
- }
211
- return null;
212
- },
213
- type: "youtube-video"
214
- };
215
- var TwitterEmbedConfig = {
216
- // e.g. Tweet or Google Map.
217
- contentName: "Tweet",
218
- exampleUrl: "https://twitter.com/jack/status/20",
219
- // Icon for display.
220
- icon: /* @__PURE__ */ jsx2(Twitter, { className: "h-4 w-4" }),
221
- // Create the Lexical embed node from the url data.
222
- insertNode: (editor, result) => {
223
- editor.dispatchCommand(INSERT_TWEET_COMMAND, result.id);
224
- },
225
- // For extra searching.
226
- keywords: ["tweet", "twitter"],
227
- // Determine if a given URL is a match and return url data.
228
- parseUrl: (text) => {
229
- const match = /^https:\/\/(twitter|x)\.com\/(#!\/)?(\w+)\/status(es)*\/(\d+)/.exec(
230
- text
231
- );
232
- if (match != null) {
233
- return {
234
- id: match[5],
235
- url: match[1]
236
- };
237
- }
238
- return null;
239
- },
240
- type: "tweet"
241
- };
242
- var FigmaEmbedConfig = {
243
- contentName: "Figma Document",
244
- exampleUrl: "https://www.figma.com/file/LKQ4FJ4bTnCSjedbRpk931/Sample-File",
245
- icon: /* @__PURE__ */ jsx2(Figma, { className: "h-4 w-4" }),
246
- insertNode: (editor, result) => {
247
- editor.dispatchCommand(INSERT_FIGMA_COMMAND, result.id);
248
- },
249
- keywords: ["figma", "figma.com", "mock-up"],
250
- // Determine if a given URL is a match and return url data.
251
- parseUrl: (text) => {
252
- const match = /https:\/\/([\w.-]+\.)?figma.com\/(file|proto)\/([0-9a-zA-Z]{22,128})(?:\/.*)?$/.exec(
253
- text
254
- );
255
- if (match != null) {
256
- return {
257
- id: match[3],
258
- url: match[0]
259
- };
260
- }
261
- return null;
262
- },
263
- type: "figma"
264
- };
265
- var EmbedConfigs = [
266
- TwitterEmbedConfig,
267
- YoutubeEmbedConfig,
268
- FigmaEmbedConfig
269
- ];
270
- function AutoEmbedMenuItem({
271
- index,
272
- isSelected,
273
- onClick,
274
- onMouseEnter,
275
- option
276
- }) {
277
- let className = "item";
278
- if (isSelected) {
279
- className += " selected";
280
- }
281
- return /* @__PURE__ */ jsx2(
282
- "li",
283
- {
284
- tabIndex: -1,
285
- className,
286
- ref: option.setRefElement,
287
- role: "option",
288
- "aria-selected": isSelected,
289
- id: "typeahead-item-" + index,
290
- onMouseEnter,
291
- onClick,
292
- children: /* @__PURE__ */ jsx2("span", { className: "text", children: option.title })
293
- },
294
- option.key
295
- );
296
- }
297
- function AutoEmbedMenu({
298
- options,
299
- selectedItemIndex,
300
- onOptionClick,
301
- onOptionMouseEnter
302
- }) {
303
- return /* @__PURE__ */ jsx2("div", { className: "typeahead-popover", children: /* @__PURE__ */ jsx2("ul", { children: options.map((option, i) => /* @__PURE__ */ jsx2(
304
- AutoEmbedMenuItem,
305
- {
306
- index: i,
307
- isSelected: selectedItemIndex === i,
308
- onClick: () => onOptionClick(option, i),
309
- onMouseEnter: () => onOptionMouseEnter(i),
310
- option
311
- },
312
- option.key
313
- )) }) });
314
- }
315
- var debounce = (callback, delay) => {
316
- let timeoutId;
317
- return (text) => {
318
- window.clearTimeout(timeoutId);
319
- timeoutId = window.setTimeout(() => {
320
- callback(text);
321
- }, delay);
322
- };
323
- };
324
- function AutoEmbedDialog({
325
- embedConfig,
326
- onClose
327
- }) {
328
- const [text, setText] = useState("");
329
- const [editor] = useLexicalComposerContext4();
330
- const [embedResult, setEmbedResult] = useState(null);
331
- const validateText = useMemo(
332
- () => debounce((inputText) => {
333
- const urlMatch = URL_MATCHER.exec(inputText);
334
- if (embedConfig != null && inputText != null && urlMatch != null) {
335
- Promise.resolve(embedConfig.parseUrl(inputText)).then(
336
- (parseResult) => {
337
- setEmbedResult(parseResult);
338
- }
339
- );
340
- } else if (embedResult != null) {
341
- setEmbedResult(null);
342
- }
343
- }, 200),
344
- [embedConfig, embedResult]
345
- );
346
- const onClick = () => {
347
- if (embedResult != null) {
348
- embedConfig.insertNode(editor, embedResult);
349
- onClose();
350
- }
351
- };
352
- return /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-center flex-col space-y-3", children: [
353
- /* @__PURE__ */ jsx2("div", { children: /* @__PURE__ */ jsx2(
354
- Input,
355
- {
356
- type: "text",
357
- className: "Input__input",
358
- placeholder: embedConfig.exampleUrl,
359
- value: text,
360
- "data-test-id": `${embedConfig.type}-embed-modal-url`,
361
- onChange: (e) => {
362
- const { value } = e.target;
363
- setText(value);
364
- validateText(value);
365
- }
366
- }
367
- ) }),
368
- /* @__PURE__ */ jsx2(
369
- Button,
370
- {
371
- disabled: !embedResult,
372
- onClick,
373
- "data-test-id": `${embedConfig.type}-embed-modal-submit-btn`,
374
- children: "Embed"
375
- }
376
- )
377
- ] });
378
- }
379
- function AutoEmbedPlugin() {
380
- const [modal, showModal] = useModal();
381
- const openEmbedModal = (embedConfig) => {
382
- showModal(`Embed ${embedConfig.contentName}`, "type the url", (onClose) => /* @__PURE__ */ jsx2(AutoEmbedDialog, { embedConfig, onClose }));
383
- };
384
- const getMenuOptions = (activeEmbedConfig, embedFn, dismissFn) => {
385
- return [
386
- new AutoEmbedOption("Dismiss", {
387
- onSelect: dismissFn
388
- }),
389
- new AutoEmbedOption(`Embed ${activeEmbedConfig.contentName}`, {
390
- onSelect: embedFn
391
- })
392
- ];
393
- };
394
- return /* @__PURE__ */ jsxs2(Fragment, { children: [
395
- modal,
396
- /* @__PURE__ */ jsx2(
397
- LexicalAutoEmbedPlugin,
398
- {
399
- embedConfigs: EmbedConfigs,
400
- onOpenEmbedModalForConfig: openEmbedModal,
401
- getMenuOptions,
402
- menuRenderFn: (anchorElementRef, { selectedIndex, options, selectOptionAndCleanUp, setHighlightedIndex }) => anchorElementRef.current ? ReactDOM.createPortal(
403
- /* @__PURE__ */ jsx2(
404
- "div",
405
- {
406
- className: "typeahead-popover flex items-center auto-embed-menu",
407
- style: {
408
- marginLeft: `${Math.max(
409
- parseFloat(anchorElementRef.current.style.width) - 200,
410
- 0
411
- )}px`,
412
- width: 200
413
- },
414
- children: /* @__PURE__ */ jsx2(
415
- AutoEmbedMenu,
416
- {
417
- options,
418
- selectedItemIndex: selectedIndex,
419
- onOptionClick: (option, index) => {
420
- setHighlightedIndex(index);
421
- selectOptionAndCleanUp(option);
422
- },
423
- onOptionMouseEnter: (index) => {
424
- setHighlightedIndex(index);
425
- }
426
- }
427
- )
428
- }
429
- ),
430
- anchorElementRef.current
431
- ) : null
432
- }
433
- )
434
- ] });
435
- }
436
-
437
- export {
438
- Youtube,
439
- Twitter,
440
- Figma,
441
- FigmaPlugin,
442
- YouTubePlugin,
443
- TwitterPlugin,
444
- YoutubeEmbedConfig,
445
- TwitterEmbedConfig,
446
- FigmaEmbedConfig,
447
- AutoEmbedDialog,
448
- AutoEmbedPlugin
449
- };
@@ -1,219 +0,0 @@
1
- import {
2
- Button
3
- } from "./chunk-OE5JRLCN.mjs";
4
- import {
5
- Popover,
6
- PopoverContent,
7
- PopoverTrigger
8
- } from "./chunk-IIVB6JNE.mjs";
9
- import {
10
- cn
11
- } from "./chunk-JHXDLYEV.mjs";
12
- import {
13
- __objRest,
14
- __spreadValues,
15
- init_react_shim
16
- } from "./chunk-WYCFGRFJ.mjs";
17
-
18
- // src/components/ui/drop-downs/index.tsx
19
- init_react_shim();
20
- import * as React2 from "react";
21
- import { ChevronsUpDown } from "lucide-react";
22
-
23
- // src/components/ui/command.tsx
24
- init_react_shim();
25
- import * as React from "react";
26
- import { Command as CommandPrimitive } from "cmdk";
27
- import { Search } from "lucide-react";
28
- import { jsx, jsxs } from "react/jsx-runtime";
29
- var Command = React.forwardRef((_a, ref) => {
30
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
31
- return /* @__PURE__ */ jsx(
32
- CommandPrimitive,
33
- __spreadValues({
34
- ref,
35
- className: cn(
36
- "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover dark:bg-[#020b19]/95 bg-white/90 text-popover-foreground",
37
- className
38
- )
39
- }, props)
40
- );
41
- });
42
- Command.displayName = CommandPrimitive.displayName;
43
- var CommandInput = React.forwardRef((_a, ref) => {
44
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
45
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
46
- /* @__PURE__ */ jsx(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
47
- /* @__PURE__ */ jsx(
48
- CommandPrimitive.Input,
49
- __spreadValues({
50
- ref,
51
- className: cn(
52
- "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
53
- className
54
- )
55
- }, props)
56
- )
57
- ] });
58
- });
59
- CommandInput.displayName = CommandPrimitive.Input.displayName;
60
- var CommandList = React.forwardRef((_a, ref) => {
61
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
62
- return /* @__PURE__ */ jsx(
63
- CommandPrimitive.List,
64
- __spreadValues({
65
- ref,
66
- className: cn("max-h-[300px] overflow-y-auto scrollbar-none overflow-x-hidden", className)
67
- }, props)
68
- );
69
- });
70
- CommandList.displayName = CommandPrimitive.List.displayName;
71
- var CommandEmpty = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(
72
- CommandPrimitive.Empty,
73
- __spreadValues({
74
- ref,
75
- className: "py-6 text-center text-sm"
76
- }, props)
77
- ));
78
- CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
79
- var CommandGroup = React.forwardRef((_a, ref) => {
80
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
81
- return /* @__PURE__ */ jsx(
82
- CommandPrimitive.Group,
83
- __spreadValues({
84
- ref,
85
- className: cn(
86
- "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
87
- className
88
- )
89
- }, props)
90
- );
91
- });
92
- CommandGroup.displayName = CommandPrimitive.Group.displayName;
93
- var CommandSeparator = React.forwardRef((_a, ref) => {
94
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
95
- return /* @__PURE__ */ jsx(
96
- CommandPrimitive.Separator,
97
- __spreadValues({
98
- ref,
99
- className: cn("-mx-1 h-px bg-border", className)
100
- }, props)
101
- );
102
- });
103
- CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
104
- var CommandItem = React.forwardRef((_a, ref) => {
105
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
106
- return /* @__PURE__ */ jsx(
107
- CommandPrimitive.Item,
108
- __spreadValues({
109
- ref,
110
- className: cn(
111
- "relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
112
- className
113
- )
114
- }, props)
115
- );
116
- });
117
- CommandItem.displayName = CommandPrimitive.Item.displayName;
118
- var CommandShortcut = (_a) => {
119
- var _b = _a, {
120
- className
121
- } = _b, props = __objRest(_b, [
122
- "className"
123
- ]);
124
- return /* @__PURE__ */ jsx(
125
- "span",
126
- __spreadValues({
127
- className: cn(
128
- "ml-auto text-xs tracking-widest text-muted-foreground",
129
- className
130
- )
131
- }, props)
132
- );
133
- };
134
- CommandShortcut.displayName = "CommandShortcut";
135
-
136
- // src/components/ui/drop-downs/index.tsx
137
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
138
- function DropDown({
139
- className,
140
- TriggerLabel,
141
- TriggerClassName,
142
- values,
143
- disabled,
144
- PopoverContentClassName,
145
- triggerVariants = "outline",
146
- ShowChevronsUpDown = true,
147
- side = "bottom",
148
- sideOffset = 5
149
- }) {
150
- const [value, setValue] = React2.useState("");
151
- return /* @__PURE__ */ jsxs2(Popover, { modal: false, children: [
152
- /* @__PURE__ */ jsx2(PopoverTrigger, { disabled, asChild: true, children: /* @__PURE__ */ jsxs2(
153
- Button,
154
- {
155
- variant: triggerVariants,
156
- role: "combobox",
157
- size: "Toolbar",
158
- style: TriggerClassName,
159
- className,
160
- children: [
161
- /* @__PURE__ */ jsx2("div", { className: "flex flex-row justify-center gap-x-3 items-center", children: TriggerLabel }),
162
- ShowChevronsUpDown && /* @__PURE__ */ jsx2(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
163
- ]
164
- }
165
- ) }),
166
- /* @__PURE__ */ jsx2(
167
- PopoverContent,
168
- {
169
- side,
170
- sideOffset,
171
- style: PopoverContentClassName,
172
- className: "w-[200px] p-0 dropdown-portal",
173
- children: /* @__PURE__ */ jsxs2(Command, { children: [
174
- /* @__PURE__ */ jsx2(CommandInput, { placeholder: "Search..." }),
175
- /* @__PURE__ */ jsxs2(CommandList, { children: [
176
- /* @__PURE__ */ jsx2(CommandEmpty, { children: "No found." }),
177
- /* @__PURE__ */ jsx2(CommandGroup, { children: values.map((framework) => /* @__PURE__ */ jsx2(
178
- CommandItem,
179
- {
180
- value: framework.label,
181
- style: framework.style,
182
- className: cn(
183
- "cursor-pointer",
184
- value === framework.label && "bg-gray-300/10"
185
- ),
186
- onSelect: (currentValue) => {
187
- setValue(currentValue === value ? "" : currentValue);
188
- if (framework.func) framework == null ? void 0 : framework.func();
189
- },
190
- children: /* @__PURE__ */ jsxs2("div", { className: "flex w-full flex-row items-center justify-between", children: [
191
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-4 flex-row", children: [
192
- framework.icon,
193
- /* @__PURE__ */ jsxs2("div", { className: "flex flex-col", children: [
194
- framework.label,
195
- /* @__PURE__ */ jsx2("span", { className: "text-sm text-muted-foreground", children: framework.desc })
196
- ] })
197
- ] }),
198
- framework.shortcuts && /* @__PURE__ */ jsx2(CommandShortcut, { children: framework.shortcuts })
199
- ] })
200
- },
201
- framework.label
202
- )) })
203
- ] })
204
- ] })
205
- }
206
- )
207
- ] });
208
- }
209
-
210
- export {
211
- Command,
212
- CommandInput,
213
- CommandList,
214
- CommandEmpty,
215
- CommandGroup,
216
- CommandSeparator,
217
- CommandItem,
218
- DropDown
219
- };