@collabchron/notiq 0.3.0 → 1.0.1

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 (282) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +230 -39
  3. package/dist/CodeActionMenuPlugin-EINOY4U4.mjs +15 -0
  4. package/dist/DynamicBlockComponent-NRQJ4WW4.mjs +161 -0
  5. package/dist/EquationComponent-CB6DFIHV.mjs +154 -0
  6. package/dist/ExcalidrawComponent-XW6646OH.mjs +528 -0
  7. package/dist/ExcalidrawPlugin-ZFHT62IF.mjs +14 -0
  8. package/dist/ExportPlugin-V2RLM63S.mjs +11 -0
  9. package/dist/FloatingLinkEditorPlugin-TRTCMSP4.mjs +12 -0
  10. package/dist/FloatingTextFormatToolbarPlugin-F2GY6LMI.mjs +30 -0
  11. package/dist/HintComponet-BRL6EAMS.mjs +217 -0
  12. package/dist/InlineImageComponent-UWIUWBHI.mjs +453 -0
  13. package/dist/MobileToolbar-BOOZAMQE.mjs +268 -0
  14. package/dist/SlashCommand-GMT5JI33.mjs +28 -0
  15. package/dist/StoryBuilderComponent-JGDBM5JU.mjs +562 -0
  16. package/{src/components/editor/plugins/TableCellActionMenuPlugin/index.tsx → dist/TableCellActionMenuPlugin-PGK2K3VG.mjs} +667 -759
  17. package/{src/components/editor/plugins/TableHoverActionsPlugin/index.tsx → dist/TableHoverActionsPlugin-GJVE6VRW.mjs} +258 -314
  18. package/dist/TemplatePlugin-ZD3QEVTI.mjs +9 -0
  19. package/dist/ToolbarPlugin-YKYA4NB4.mjs +1547 -0
  20. package/dist/babel-JZ2EV6AX.mjs +7233 -0
  21. package/dist/background-color-XZTYLGO2.mjs +362 -0
  22. package/dist/block-format-YJCV2DIY.mjs +15 -0
  23. package/dist/chunk-2FNEAMSP.mjs +127 -0
  24. package/dist/chunk-3CPBODXA.mjs +84 -0
  25. package/dist/chunk-3G37YKTV.mjs +83 -0
  26. package/dist/chunk-3JVFG7ER.mjs +184 -0
  27. package/dist/chunk-456TN7IM.mjs +110 -0
  28. package/dist/chunk-4EXYCTGJ.mjs +27 -0
  29. package/{src/utils/getSelectedNode.ts → dist/chunk-4HBCVSE6.mjs} +26 -27
  30. package/dist/chunk-4MEDW3T6.mjs +125 -0
  31. package/dist/chunk-4VWFVWYP.mjs +36 -0
  32. package/dist/chunk-5BAKY5KN.mjs +84 -0
  33. package/dist/chunk-5QSNIVIG.mjs +333 -0
  34. package/dist/chunk-64Z3FI7T.mjs +37 -0
  35. package/{src/components/editor/nodes/Stepper/index.tsx → dist/chunk-6RNZQOH2.mjs} +214 -260
  36. package/dist/chunk-77KXU36M.mjs +64 -0
  37. package/dist/chunk-77UA6HYR.mjs +165 -0
  38. package/dist/chunk-7NZAPJ4G.mjs +102 -0
  39. package/dist/chunk-7VUMHWWL.mjs +152 -0
  40. package/dist/chunk-AMMKBSST.mjs +1256 -0
  41. package/dist/chunk-BIU7WTLX.mjs +95 -0
  42. package/dist/chunk-EGMI62PP.mjs +83 -0
  43. package/dist/chunk-EHNQD5KO.mjs +88 -0
  44. package/dist/chunk-FSM26655.mjs +37 -0
  45. package/{src/components/editor/nodes/Hint/index.tsx → dist/chunk-G53GLEAY.mjs} +158 -190
  46. package/dist/chunk-GK35L7UY.mjs +28 -0
  47. package/dist/chunk-GXYD4VZM.mjs +193 -0
  48. package/dist/chunk-GYIOYVCN.mjs +538 -0
  49. package/dist/chunk-GZPNVR7L.mjs +157 -0
  50. package/dist/chunk-JXDPPUJI.mjs +52 -0
  51. package/dist/chunk-K36V4SIW.mjs +141 -0
  52. package/dist/chunk-KJ6AJ44Q.mjs +128 -0
  53. package/dist/chunk-KJV3FAZ7.mjs +142 -0
  54. package/{src/components/editor/plugins/ImagesPlugin/index.tsx → dist/chunk-LGG4IUIA.mjs} +189 -222
  55. package/dist/chunk-LQN3CMKV.mjs +1906 -0
  56. package/dist/chunk-N3WN46VL.mjs +236 -0
  57. package/dist/chunk-PBD6LMLC.mjs +366 -0
  58. package/dist/chunk-POGRR73N.mjs +33 -0
  59. package/{src/components/editor/utils/editorFormatting.ts → dist/chunk-PZSUSXQG.mjs} +238 -282
  60. package/dist/chunk-QEIFVK5M.mjs +29 -0
  61. package/dist/chunk-QHIQKMVN.mjs +427 -0
  62. package/dist/chunk-TCYK7DM7.mjs +36 -0
  63. package/dist/chunk-TTHQCW5F.mjs +47 -0
  64. package/dist/chunk-U47ABU5Z.mjs +53 -0
  65. package/dist/chunk-WDG7J2DY.mjs +116 -0
  66. package/dist/chunk-WJRHXI2C.mjs +733 -0
  67. package/dist/chunk-XLER2DHM.mjs +357 -0
  68. package/dist/chunk-XWC4TK2N.mjs +315 -0
  69. package/dist/chunk-YHPNOWFH.mjs +15 -0
  70. package/dist/chunk-YKC3SO4Z.mjs +32 -0
  71. package/dist/chunk-YMBXLRW5.mjs +374 -0
  72. package/dist/chunk-YPHOEJ46.mjs +64 -0
  73. package/dist/chunk-YUDCJRJM.mjs +25 -0
  74. package/dist/chunk-Z4EWP7BI.mjs +65 -0
  75. package/dist/chunk-ZB5LZQKC.mjs +191 -0
  76. package/dist/chunk-ZJRKATOJ.mjs +65 -0
  77. package/dist/color-BPKOPQKN.mjs +12 -0
  78. package/dist/estree-XC56IUFX.mjs +4414 -0
  79. package/dist/font-FEZ3GKSF.mjs +13 -0
  80. package/dist/font-size-EK775WRH.mjs +15 -0
  81. package/dist/html-S3ACX7NI.mjs +2738 -0
  82. package/dist/image-2PJIAYAT.mjs +993 -0
  83. package/dist/index.d.mts +145 -0
  84. package/dist/index.d.ts +145 -0
  85. package/dist/index.js +57855 -0
  86. package/dist/index.mjs +1790 -0
  87. package/dist/insert-gif-SAIDYURE.mjs +100 -0
  88. package/dist/insert-image-U3RJN3OW.mjs +259 -0
  89. package/dist/insert-node-5P2CRJ7S.mjs +201 -0
  90. package/dist/insert-poll-HCPM7MO6.mjs +33 -0
  91. package/dist/insert-table-24XYUS2W.mjs +66 -0
  92. package/dist/markdown-SNVBOSRA.mjs +3487 -0
  93. package/dist/poll-component-2R4MDLHS.mjs +303 -0
  94. package/dist/postcss-ONF3VDIM.mjs +5051 -0
  95. package/dist/standalone-EOIALU3M.mjs +2373 -0
  96. package/dist/stepper-FSARL6X6.mjs +304 -0
  97. package/dist/styles/notiq.css +1149 -0
  98. package/dist/text-align-VLECWO4H.mjs +118 -0
  99. package/dist/text-format-BG5WOOPZ.mjs +16 -0
  100. package/dist/typescript-AMPI6OVS.mjs +13135 -0
  101. package/package.json +67 -11
  102. package/src/styles/notiq.css +1149 -0
  103. package/src/styles/tailwind-plugin.ts +134 -0
  104. package/components.json +0 -21
  105. package/eslint.config.mjs +0 -16
  106. package/next.config.ts +0 -12
  107. package/postcss.config.mjs +0 -5
  108. package/public/file.svg +0 -1
  109. package/public/globe.svg +0 -1
  110. package/public/images/icons/plus.svg +0 -10
  111. package/public/next.svg +0 -1
  112. package/public/vercel.svg +0 -1
  113. package/public/window.svg +0 -1
  114. package/src/app/actions.ts +0 -2
  115. package/src/app/api/ai/route.ts +0 -175
  116. package/src/app/api/edgestore/[...edgestore]/route.ts +0 -28
  117. package/src/app/favicon.ico +0 -0
  118. package/src/app/globals.css +0 -205
  119. package/src/app/layout.tsx +0 -38
  120. package/src/app/page.tsx +0 -12
  121. package/src/components/editor/Core.tsx +0 -220
  122. package/src/components/editor/hooks/instructions-messages.ts +0 -300
  123. package/src/components/editor/hooks/use-mobile.ts +0 -19
  124. package/src/components/editor/hooks/useReport.ts +0 -67
  125. package/src/components/editor/hooks/useResizeObservert.ts +0 -22
  126. package/src/components/editor/index.tsx +0 -39
  127. package/src/components/editor/lexical-on-change.tsx +0 -28
  128. package/src/components/editor/nodes/CollapsibleNode/CollapsibleContainerNode.ts +0 -92
  129. package/src/components/editor/nodes/CollapsibleNode/CollapsibleContentNode.ts +0 -65
  130. package/src/components/editor/nodes/CollapsibleNode/CollapsibleTitleNode.ts +0 -105
  131. package/src/components/editor/nodes/EquationNode/EquationComponent.tsx +0 -143
  132. package/src/components/editor/nodes/EquationNode/EquationNode.tsx +0 -170
  133. package/src/components/editor/nodes/ExcalidrawNode/ExcalidrawComponent.tsx +0 -228
  134. package/src/components/editor/nodes/ExcalidrawNode/ExcalidrawImage.tsx +0 -137
  135. package/src/components/editor/nodes/ExcalidrawNode/ImageResizer.tsx +0 -317
  136. package/src/components/editor/nodes/ExcalidrawNode/index.tsx +0 -204
  137. package/src/components/editor/nodes/FigmaNode/FigmaNode.tsx +0 -134
  138. package/src/components/editor/nodes/Hint/HintComponet.tsx +0 -221
  139. package/src/components/editor/nodes/ImageNode/index.tsx +0 -328
  140. package/src/components/editor/nodes/InlineImageNode/InlineImageComponent.tsx +0 -383
  141. package/src/components/editor/nodes/InlineImageNode/InlineImageNode.css +0 -94
  142. package/src/components/editor/nodes/InlineImageNode/InlineImageNode.tsx +0 -309
  143. package/src/components/editor/nodes/LayoutNode/LayoutContainerNode.ts +0 -146
  144. package/src/components/editor/nodes/LayoutNode/LayoutItemNode.ts +0 -79
  145. package/src/components/editor/nodes/PollNode/index.tsx +0 -204
  146. package/src/components/editor/nodes/TweetNode/index.tsx +0 -214
  147. package/src/components/editor/nodes/index.ts +0 -81
  148. package/src/components/editor/plugins/AutoEmbedPlugin/index.tsx +0 -350
  149. package/src/components/editor/plugins/AutoLinkPlugin/index.tsx +0 -56
  150. package/src/components/editor/plugins/CodeActionMenuPlugin/components/CopyButton.tsx +0 -70
  151. package/src/components/editor/plugins/CodeActionMenuPlugin/components/PrettierButton.tsx +0 -192
  152. package/src/components/editor/plugins/CodeActionMenuPlugin/index.tsx +0 -217
  153. package/src/components/editor/plugins/CodeActionMenuPlugin/utils.ts +0 -26
  154. package/src/components/editor/plugins/CodeHighlightPlugin/index.ts +0 -21
  155. package/src/components/editor/plugins/CollapsiblePlugin/Collapsible.css +0 -76
  156. package/src/components/editor/plugins/CollapsiblePlugin/index.ts +0 -228
  157. package/src/components/editor/plugins/DragDropPastePlugin/index.tsx +0 -44
  158. package/src/components/editor/plugins/DraggableBlockPlugin/index.tsx +0 -52
  159. package/src/components/editor/plugins/EquationsPlugin/index.tsx +0 -85
  160. package/src/components/editor/plugins/ExcalidrawPlugin/index.tsx +0 -98
  161. package/src/components/editor/plugins/FigmaPlugin/index.tsx +0 -42
  162. package/src/components/editor/plugins/FloatingLinkEditorPlugin/index.tsx +0 -445
  163. package/src/components/editor/plugins/FloatingTextFormatToolbarPlugin/index.tsx +0 -275
  164. package/src/components/editor/plugins/InlineImagePlugin/index.tsx +0 -351
  165. package/src/components/editor/plugins/LayoutPlugin/index.tsx +0 -238
  166. package/src/components/editor/plugins/LinkPlugin/index.tsx +0 -36
  167. package/src/components/editor/plugins/LinkWithMetaData/index.tsx +0 -271
  168. package/src/components/editor/plugins/MarkdownShortcutPlugin/index.tsx +0 -11
  169. package/src/components/editor/plugins/MarkdownTransformers/index.tsx +0 -304
  170. package/src/components/editor/plugins/PollPlugin/index.tsx +0 -49
  171. package/src/components/editor/plugins/ShortcutsPlugin/index.tsx +0 -180
  172. package/src/components/editor/plugins/ShortcutsPlugin/shortcuts.ts +0 -253
  173. package/src/components/editor/plugins/SlashCommand/index.tsx +0 -621
  174. package/src/components/editor/plugins/SpeechToTextPlugin/index.ts +0 -127
  175. package/src/components/editor/plugins/TabFocusPlugin/index.ts +0 -58
  176. package/src/components/editor/plugins/TableCellResizer/index.tsx +0 -438
  177. package/src/components/editor/plugins/TablePlugin/index.tsx +0 -99
  178. package/src/components/editor/plugins/ToolbarPlugin/index.tsx +0 -522
  179. package/src/components/editor/plugins/TwitterPlugin/index.ts +0 -35
  180. package/src/components/editor/plugins/YouTubeNode/index.tsx +0 -179
  181. package/src/components/editor/plugins/YouTubePlugin/index.ts +0 -41
  182. package/src/components/editor/themes/editor-theme.ts +0 -113
  183. package/src/components/editor/themes/theme.css +0 -377
  184. package/src/components/editor/utils/ai.ts +0 -291
  185. package/src/components/editor/utils/canUseDOM.ts +0 -12
  186. package/src/components/editor/utils/environment.ts +0 -50
  187. package/src/components/editor/utils/extract-data.ts +0 -166
  188. package/src/components/editor/utils/getAllLexicalChildren.ts +0 -13
  189. package/src/components/editor/utils/getDOMRangeRect.ts +0 -27
  190. package/src/components/editor/utils/getSelectedNode.ts +0 -27
  191. package/src/components/editor/utils/gif.ts +0 -29
  192. package/src/components/editor/utils/invariant.ts +0 -15
  193. package/src/components/editor/utils/setFloatingElemPosition.ts +0 -51
  194. package/src/components/editor/utils/setFloatingElemPositionForLinkEditor.ts +0 -40
  195. package/src/components/editor/utils/setNodePlaceholderFromSelection/getNodePlaceholder.ts +0 -51
  196. package/src/components/editor/utils/setNodePlaceholderFromSelection/setNodePlaceholderFromSelection.ts +0 -15
  197. package/src/components/editor/utils/setNodePlaceholderFromSelection/setPlaceholderOnSelection.ts +0 -114
  198. package/src/components/editor/utils/setNodePlaceholderFromSelection/styles.css +0 -6
  199. package/src/components/editor/utils/url.ts +0 -109
  200. package/src/components/editor/utils/useLayoutEffect.ts +0 -13
  201. package/src/components/providers/QueryProvider.tsx +0 -15
  202. package/src/components/providers/SharedHistoryContext.tsx +0 -28
  203. package/src/components/providers/ToolbarContext.tsx +0 -123
  204. package/src/components/providers/theme-provider.tsx +0 -11
  205. package/src/components/theme/ModeToggle.tsx +0 -40
  206. package/src/components/ui/FileInput.tsx +0 -40
  207. package/src/components/ui/Input.css +0 -32
  208. package/src/components/ui/Select.css +0 -42
  209. package/src/components/ui/Select.tsx +0 -36
  210. package/src/components/ui/TextInput.tsx +0 -48
  211. package/src/components/ui/ai/ai-button.tsx +0 -574
  212. package/src/components/ui/ai/border.tsx +0 -99
  213. package/src/components/ui/ai/placeholder-input-vanish.tsx +0 -282
  214. package/src/components/ui/button.tsx +0 -89
  215. package/src/components/ui/card.tsx +0 -76
  216. package/src/components/ui/checkbox.tsx +0 -30
  217. package/src/components/ui/command.tsx +0 -153
  218. package/src/components/ui/dialog/Dialog.css +0 -25
  219. package/src/components/ui/dialog/Dialog.tsx +0 -34
  220. package/src/components/ui/dialog.tsx +0 -122
  221. package/src/components/ui/drop-downs/background-color.tsx +0 -183
  222. package/src/components/ui/drop-downs/block-format.tsx +0 -159
  223. package/src/components/ui/drop-downs/code.tsx +0 -42
  224. package/src/components/ui/drop-downs/color.tsx +0 -177
  225. package/src/components/ui/drop-downs/font-size.tsx +0 -138
  226. package/src/components/ui/drop-downs/font.tsx +0 -155
  227. package/src/components/ui/drop-downs/index.tsx +0 -122
  228. package/src/components/ui/drop-downs/insert-node.tsx +0 -213
  229. package/src/components/ui/drop-downs/text-align.tsx +0 -123
  230. package/src/components/ui/drop-downs/text-format.tsx +0 -104
  231. package/src/components/ui/dropdown-menu.tsx +0 -201
  232. package/src/components/ui/equation/EquationEditor.css +0 -38
  233. package/src/components/ui/equation/EquationEditor.tsx +0 -56
  234. package/src/components/ui/equation/KatexEquationAlterer.css +0 -41
  235. package/src/components/ui/equation/KatexEquationAlterer.tsx +0 -83
  236. package/src/components/ui/equation/KatexRenderer.tsx +0 -66
  237. package/src/components/ui/excalidraw/ExcalidrawModal.css +0 -64
  238. package/src/components/ui/excalidraw/ExcalidrawModal.tsx +0 -234
  239. package/src/components/ui/excalidraw/Modal.css +0 -62
  240. package/src/components/ui/excalidraw/Modal.tsx +0 -110
  241. package/src/components/ui/hover-card.tsx +0 -29
  242. package/src/components/ui/image/error-image.tsx +0 -17
  243. package/src/components/ui/image/file-upload.tsx +0 -240
  244. package/src/components/ui/image/image-resizer.tsx +0 -297
  245. package/src/components/ui/image/image-toolbar.tsx +0 -264
  246. package/src/components/ui/image/index.tsx +0 -408
  247. package/src/components/ui/image/lazy-image.tsx +0 -68
  248. package/src/components/ui/image/lazy-video.tsx +0 -71
  249. package/src/components/ui/input.tsx +0 -22
  250. package/src/components/ui/models/custom-dialog.tsx +0 -320
  251. package/src/components/ui/models/insert-gif.tsx +0 -90
  252. package/src/components/ui/models/insert-image.tsx +0 -52
  253. package/src/components/ui/models/insert-poll.tsx +0 -29
  254. package/src/components/ui/models/insert-table.tsx +0 -62
  255. package/src/components/ui/models/use-model.tsx +0 -91
  256. package/src/components/ui/poll/poll-component.tsx +0 -304
  257. package/src/components/ui/popover.tsx +0 -33
  258. package/src/components/ui/progress.tsx +0 -28
  259. package/src/components/ui/scroll-area.tsx +0 -48
  260. package/src/components/ui/separator.tsx +0 -31
  261. package/src/components/ui/skeleton.tsx +0 -15
  262. package/src/components/ui/sonner.tsx +0 -31
  263. package/src/components/ui/stepper/step.tsx +0 -179
  264. package/src/components/ui/stepper/stepper.tsx +0 -89
  265. package/src/components/ui/textarea.tsx +0 -22
  266. package/src/components/ui/toggle.tsx +0 -71
  267. package/src/components/ui/tooltip.tsx +0 -32
  268. package/src/components/ui/write/text-format-floting-toolbar.tsx +0 -346
  269. package/src/lib/edgestore.ts +0 -9
  270. package/src/lib/pinecone-client.ts +0 -0
  271. package/src/lib/utils.ts +0 -6
  272. package/src/utils/docSerialization.ts +0 -77
  273. package/src/utils/emoji-list.ts +0 -16615
  274. package/src/utils/getDOMRangeRect.ts +0 -27
  275. package/src/utils/getThemeSelector.ts +0 -25
  276. package/src/utils/isMobileWidth.ts +0 -7
  277. package/src/utils/joinClasses.ts +0 -13
  278. package/src/utils/setFloatingElemPosition.ts +0 -74
  279. package/src/utils/setFloatingElemPositionForLinkEditor.ts +0 -46
  280. package/src/utils/swipe.ts +0 -127
  281. package/src/utils/url.ts +0 -38
  282. package/tsconfig.json +0 -27
@@ -1,213 +0,0 @@
1
- import { LexicalEditor } from "lexical";
2
- import React, { useMemo, lazy, Suspense } from "react";
3
- import useModal from "../models/use-model";
4
- import { AlertCircle, Columns2, Columns3, Columns4, DraftingCompassIcon, Figma, FlipHorizontal2, Image, ImagePlay, PencilRuler, Plus, SquareChevronRight, SquarePenIcon, Table, Twitter, Youtube } from "lucide-react";
5
- import { INSERT_HORIZONTAL_RULE_COMMAND } from "@lexical/react/LexicalHorizontalRuleNode";
6
- import { DropDown } from ".";
7
- import { INSERT_IMAGE_COMMAND, InsertImagePayload } from "../../editor/plugins/ImagesPlugin";
8
- import { Skeleton } from "@/components/ui/skeleton";
9
- import { INSERT_LAYOUT_COMMAND } from "../../editor/plugins/LayoutPlugin";
10
- import { INSERT_COLLAPSIBLE_COMMAND } from "../../editor/plugins/CollapsiblePlugin";
11
- import { AutoEmbedDialog, FigmaEmbedConfig, TwitterEmbedConfig, YoutubeEmbedConfig } from "../../editor/plugins/AutoEmbedPlugin";
12
- import { INSERT_HINT_COMMAND } from "../../editor/nodes/Hint";
13
- import { INSERT_EXCALIDRAW_COMMAND } from "../../editor/plugins/ExcalidrawPlugin";
14
-
15
- const InsertImageDialog = lazy(() => import("@/components/ui/models/insert-image").then(module => ({ default: module.InsertImageDialog })));
16
- const InsertGif = lazy(() => import("../models/insert-gif"));
17
- const InsertTableBody = lazy(() => import("@/components/ui/models/insert-table").then(module => ({ default: module.InsertTable })));
18
- const InsertPoll = lazy(() =>
19
- import("@/components/ui/models/insert-poll").then(module => ({ default: module.InsertPoll }))
20
- );
21
-
22
- interface Items {
23
- label: string;
24
- icon: React.ReactNode;
25
- func: () => void;
26
- shortcuts?: string;
27
- }
28
-
29
- export default function InsertNode({
30
- disabled,
31
- editor,
32
- }: {
33
- disabled: boolean;
34
- editor: LexicalEditor;
35
- }) {
36
- const [model, showModal] = useModal();
37
- const insertGifOnClick = (payload: InsertImagePayload) => {
38
- editor.dispatchCommand(INSERT_IMAGE_COMMAND, payload);
39
- };
40
-
41
- const items: Items[] = useMemo(
42
- () => [
43
- {
44
- label: "Horizontal Rule",
45
- icon: <FlipHorizontal2 className="w-4 h-4" />,
46
- func: () => editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined),
47
- },
48
- {
49
- label: "Image",
50
- icon: <Image className="size-4" />,
51
- func: () => {
52
- showModal(
53
- "Insert Image",
54
- "Please select an image to upload.",
55
- (onClose) => (
56
- <Suspense fallback={<Skeleton className="mx-2 w-[350px] h-[350px]" />}>
57
- <InsertImageDialog activeEditor={editor} onClose={onClose} />
58
- </Suspense>
59
- ),
60
- true
61
- );
62
- },
63
- },
64
- {
65
- label: "GIF",
66
- icon: <ImagePlay className="w-4 h-4" />,
67
- func: () => {
68
- showModal(
69
- "Insert GIF",
70
- "Please select a GIF to upload.",
71
- (onClose) => (
72
- <Suspense fallback={<Skeleton className="mx-2 w-[400px] h-[400px]" />}>
73
- <InsertGif insertGifOnClick={insertGifOnClick} onClose={onClose} />
74
- </Suspense>
75
- ),
76
- true
77
- );
78
- },
79
- },
80
- {
81
- label: "Table",
82
- icon: <Table className="w-4 h-4" />,
83
- func: () => {
84
- showModal(
85
- "Insert Table",
86
- "Please configure your table.",
87
- (onClose) => (
88
- <Suspense fallback={<Skeleton className="mx-2 w-[400px] h-[100px]" />}>
89
- <InsertTableBody activeEditor={editor} onClose={onClose} />
90
- </Suspense>
91
- ),
92
- true
93
- );
94
- },
95
- },
96
- {
97
- label: "ExcaliDraw",
98
- icon: <DraftingCompassIcon className="w-4 h-4" />,
99
- func: () => {
100
- editor.dispatchCommand(INSERT_EXCALIDRAW_COMMAND, undefined);
101
- },
102
- },
103
- {
104
- label: "Poll",
105
- icon: <SquarePenIcon className="w-4 h-4" />,
106
- func: () => {
107
- showModal(
108
- "Create Poll",
109
- "Please type your question.",
110
- (onClose) => (
111
- <Suspense fallback={<Skeleton className="mx-2 w-[400px] h-[100px]" />}>
112
- <InsertPoll activeEditor={editor} onClose={onClose} />
113
- </Suspense>
114
- ),
115
- true
116
- );
117
- },
118
- },
119
- {
120
- label: "2 columns (equal width)",
121
- icon: <Columns2 className="w-4 h-4" />,
122
- func: () => {
123
- editor.dispatchCommand(INSERT_LAYOUT_COMMAND, "1fr 1fr");
124
- },
125
- },
126
- {
127
- label: "3 columns (equal width)",
128
- icon: <Columns3 className="w-4 h-4" />,
129
- func: () => {
130
- editor.dispatchCommand(INSERT_LAYOUT_COMMAND, "1fr 1fr 1fr");
131
- },
132
- },
133
- {
134
- label: "4 columns (equal width)",
135
- icon: <Columns4 className="w-4 h-4" />,
136
- func: () => {
137
- editor.dispatchCommand(INSERT_LAYOUT_COMMAND, "1fr 1fr 1fr 1fr");
138
- },
139
- },
140
- {
141
- label: "2 columns (25% - 75%)",
142
- icon: <Columns2 className="w-4 h-4" />,
143
- func: () => {
144
- editor.dispatchCommand(INSERT_LAYOUT_COMMAND, "1fr 3fr");
145
- },
146
- },
147
- {
148
- label: "Collapsible container",
149
- icon: <SquareChevronRight className="w-4 h-4" />,
150
- func: () => {
151
- editor.dispatchCommand(INSERT_COLLAPSIBLE_COMMAND, undefined);
152
- },
153
- },
154
- {
155
- label: "Twitter",
156
- icon: <Twitter className="w-4 h-4" />,
157
- func: () => {
158
-
159
- showModal("Twitter tweet", "Insert a URL to embed a live preview. Works with Twitter, Google Drive, Vimeo, and more.", (onClose) => (
160
- <AutoEmbedDialog embedConfig={TwitterEmbedConfig} onClose={onClose} />
161
- ), true);
162
- },
163
- },
164
- {
165
- label: "Youtube",
166
- icon: <Youtube />,
167
- func: () => {
168
-
169
- showModal("Youtube", "Insert a URL to embed a live preview. Works with YouTube, Google Drive, Vimeo, and more.", (onClose) => (
170
- <AutoEmbedDialog embedConfig={YoutubeEmbedConfig} onClose={onClose} />
171
- ), true);
172
- },
173
- },
174
- {
175
- label: "Figma",
176
- icon: <Figma />,
177
- func: () => {
178
-
179
- showModal("Figma", "Insert a URL to embed a live preview. Works with Figma.", (onClose) => (
180
- <AutoEmbedDialog embedConfig={FigmaEmbedConfig} onClose={onClose} />
181
- ), true);
182
- },
183
- },
184
- {
185
- label: "Hint",
186
- icon: <AlertCircle />,
187
- func: () => {
188
- editor.dispatchCommand(INSERT_HINT_COMMAND, 'info')
189
- }
190
- }
191
-
192
- ],
193
- [editor, showModal]
194
- );
195
-
196
- return (
197
- <>
198
- <DropDown
199
- values={items}
200
- TriggerClassName={{ width: "115px", border: "none" }}
201
- className="cursor-pointer"
202
- TriggerLabel={
203
- <>
204
- <Plus />
205
- <span>Insert</span>
206
- </>
207
- }
208
- disabled={disabled}
209
- />
210
- {model}
211
- </>
212
- );
213
- }
@@ -1,123 +0,0 @@
1
- import React, { useMemo } from "react";
2
- import {
3
- ElementFormatType,
4
- FORMAT_ELEMENT_COMMAND,
5
- INDENT_CONTENT_COMMAND,
6
- LexicalEditor,
7
- OUTDENT_CONTENT_COMMAND,
8
- } from "lexical";
9
- import { SHORTCUTS } from "../../editor/plugins/ShortcutsPlugin/shortcuts";
10
- import {
11
- AlignCenter,
12
- AlignLeft,
13
- AlignRight,
14
- AlignJustify,
15
- OutdentIcon,
16
- Indent,
17
- } from "lucide-react";
18
- import { DropDown } from ".";
19
-
20
- export default function textAlign({
21
- editor,
22
- value,
23
- isRTL,
24
- disabled = false,
25
- }: {
26
- editor: LexicalEditor;
27
- value: ElementFormatType | "left" | "center" | "right" | "justify" | null;
28
- isRTL: boolean;
29
- disabled: boolean;
30
- }) {
31
- const ELEMENT_FORMAT_OPTIONS: {
32
- [key in Exclude<ElementFormatType, "">]: {
33
- icon: React.ReactNode;
34
- shortcuts?: string;
35
- func: () => void;
36
- label: string;
37
- };
38
- } = useMemo(
39
- () => ({
40
- center: {
41
- icon: <AlignCenter className="w-4 h-4" />,
42
- func: () => {
43
- editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "center");
44
- },
45
- shortcuts: SHORTCUTS.CENTER_ALIGN,
46
- label: "Center Align",
47
- },
48
- end: {
49
- icon: <AlignRight className="w-4 h-4" />,
50
- func: () => {
51
- editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "end");
52
- },
53
- shortcuts: SHORTCUTS.LEFT_ALIGN,
54
-
55
- label: "End Align",
56
- },
57
- justify: {
58
- icon: <AlignJustify className="w-4 h-4" />,
59
- func: () => {
60
- editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "justify");
61
- },
62
- shortcuts: SHORTCUTS.JUSTIFY_ALIGN,
63
-
64
- label: "Justify Align",
65
- },
66
- left: {
67
- icon: <AlignLeft className="w-4 h-4" />,
68
- func: () => {
69
- editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "left");
70
- },
71
- shortcuts: SHORTCUTS.LEFT_ALIGN,
72
-
73
- label: "Left Align",
74
- },
75
- right: {
76
- icon: <AlignRight className="w-4 h-4" />,
77
- func: () => {
78
- editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "right");
79
- },
80
- shortcuts: SHORTCUTS.RIGHT_ALIGN,
81
-
82
- label: "Right Align",
83
- },
84
- start: {
85
- icon: <AlignLeft className="w-4 h-4" />,
86
- func: () => {
87
- editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "start");
88
- },
89
- label: "Start Align",
90
- },
91
- Outdent: {
92
- icon: <OutdentIcon className="w-4 h-4" />,
93
- func: () => {
94
- editor.dispatchCommand(OUTDENT_CONTENT_COMMAND, undefined);
95
- },
96
- label: "Outdent",
97
- },
98
- func: {
99
- icon: <Indent className="w-4 h-4" />,
100
- func: () => {
101
- editor.dispatchCommand(INDENT_CONTENT_COMMAND, undefined);
102
- },
103
- label: "Indent",
104
- },
105
- }),
106
- [editor]
107
- );
108
- return (
109
- <DropDown
110
- values={Object.values(ELEMENT_FORMAT_OPTIONS)}
111
- TriggerClassName={{ width: "120px", border: "none" }}
112
- PopoverContentClassName={{width:"220px"}}
113
- className="cursor-pointer"
114
- TriggerLabel={
115
- <>
116
- {value ? ELEMENT_FORMAT_OPTIONS[value].icon : ELEMENT_FORMAT_OPTIONS["left"].icon }
117
- {value || "left"}
118
- </>
119
- }
120
- disabled={disabled}
121
- />
122
- );
123
- }
@@ -1,104 +0,0 @@
1
- import { FORMAT_TEXT_COMMAND, LexicalEditor } from "lexical";
2
- import {
3
- CaseSensitive,
4
- CaseUpper,
5
- HighlighterIcon,
6
- LucideRemoveFormatting,
7
- Strikethrough,
8
- Subscript,
9
- Superscript,
10
- Trash,
11
- } from "lucide-react";
12
- import React, { useMemo } from "react";
13
- import { SHORTCUTS } from "../../editor/plugins/ShortcutsPlugin/shortcuts";
14
- import { clearFormatting } from "../../editor/utils/editorFormatting";
15
- import { DropDown } from ".";
16
-
17
- export default function TextFormat({
18
- disabled = false,
19
- editor,
20
- toolbarState,
21
- style,
22
- ShowChevronsUpDown,
23
- side,
24
- sideOffset
25
- }: {
26
- disabled: boolean;
27
- editor: LexicalEditor;
28
- toolbarState: any;
29
- style?: React.CSSProperties;
30
- ShowChevronsUpDown?:boolean
31
- side?: "top" | "right" | "bottom" | "left" | undefined
32
- sideOffset?:number
33
- }) {
34
- const items: any = useMemo(
35
- () => [
36
- {
37
- label: "Lowercase",
38
- icon: <CaseSensitive className="w-4 h-4" />,
39
- func: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, "lowercase"),
40
- shortcuts: SHORTCUTS.LOWERCASE,
41
- selected: toolbarState.isLowercase,
42
- },
43
- {
44
- label: "Uppercase",
45
- icon: <CaseUpper className="w-4 h-4" />,
46
- func: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, "uppercase"),
47
- shortcuts: SHORTCUTS.UPPERCASE,
48
- selected: toolbarState.isUppercase,
49
- },
50
- {
51
- label: "Strikethrough",
52
- icon: <Strikethrough className="w-4 h-4" />,
53
- func: () =>
54
- editor.dispatchCommand(FORMAT_TEXT_COMMAND, "strikethrough"),
55
- shortcuts: SHORTCUTS.STRIKETHROUGH,
56
- selected: toolbarState.isStrikethrough,
57
- },
58
- {
59
- label: "Subscript",
60
- icon: <Subscript className="w-4 h-4" />,
61
- func: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, "subscript"),
62
- shortcuts: SHORTCUTS.SUBSCRIPT,
63
- selected: toolbarState.isSubscript,
64
- },
65
- {
66
- label: "Superscript",
67
- icon: <Superscript className="w-4 h-4" />,
68
- func: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, "superscript"),
69
- shortcuts: SHORTCUTS.SUPERSCRIPT,
70
- selected: toolbarState.isSuperscript,
71
- },
72
- {
73
- label: "Highlight",
74
- icon: <HighlighterIcon className="w-4 h-4" />,
75
- func: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, "highlight"),
76
- selected: toolbarState.isHighlight,
77
- },
78
- {
79
- label: "Clear Formatting",
80
- icon: <Trash className="w-4 h-4" />,
81
- func: () => clearFormatting(editor),
82
- shortcuts: SHORTCUTS.CLEAR_FORMATTING,
83
- selected: false,
84
- },
85
- ],
86
- [editor, toolbarState]
87
- );
88
-
89
- return (
90
- <DropDown
91
- PopoverContentClassName={{ width:"100%"}}
92
- TriggerClassName={{ ...style,width:"100%", border: "none"}}
93
- disabled={disabled}
94
- sideOffset={sideOffset}
95
- side={side}
96
- className="cursor-pointer"
97
- ShowChevronsUpDown={ShowChevronsUpDown}
98
- TriggerLabel={
99
- <LucideRemoveFormatting />
100
- }
101
- values={items}
102
- />
103
- );
104
- }
@@ -1,201 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
5
- import { Check, ChevronRight, Circle } from "lucide-react"
6
-
7
- import { cn } from "@/lib/utils"
8
-
9
- const DropdownMenu = DropdownMenuPrimitive.Root
10
-
11
- const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger
12
-
13
- const DropdownMenuGroup = DropdownMenuPrimitive.Group
14
-
15
- const DropdownMenuPortal = DropdownMenuPrimitive.Portal
16
-
17
- const DropdownMenuSub = DropdownMenuPrimitive.Sub
18
-
19
- const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
20
-
21
- const DropdownMenuSubTrigger = React.forwardRef<
22
- React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
23
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
24
- inset?: boolean
25
- }
26
- >(({ className, inset, children, ...props }, ref) => (
27
- <DropdownMenuPrimitive.SubTrigger
28
- ref={ref}
29
- className={cn(
30
- "flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
31
- inset && "pl-8",
32
- className
33
- )}
34
- {...props}
35
- >
36
- {children}
37
- <ChevronRight className="ml-auto" />
38
- </DropdownMenuPrimitive.SubTrigger>
39
- ))
40
- DropdownMenuSubTrigger.displayName =
41
- DropdownMenuPrimitive.SubTrigger.displayName
42
-
43
- const DropdownMenuSubContent = React.forwardRef<
44
- React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
45
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
46
- >(({ className, ...props }, ref) => (
47
- <DropdownMenuPrimitive.SubContent
48
- ref={ref}
49
- className={cn(
50
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
51
- className
52
- )}
53
- {...props}
54
- />
55
- ))
56
- DropdownMenuSubContent.displayName =
57
- DropdownMenuPrimitive.SubContent.displayName
58
-
59
- const DropdownMenuContent = React.forwardRef<
60
- React.ElementRef<typeof DropdownMenuPrimitive.Content>,
61
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
62
- >(({ className, sideOffset = 4, ...props }, ref) => (
63
- <DropdownMenuPrimitive.Portal>
64
- <DropdownMenuPrimitive.Content
65
- ref={ref}
66
- sideOffset={sideOffset}
67
- className={cn(
68
- "z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
69
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
70
- className
71
- )}
72
- {...props}
73
- />
74
- </DropdownMenuPrimitive.Portal>
75
- ))
76
- DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
77
-
78
- const DropdownMenuItem = React.forwardRef<
79
- React.ElementRef<typeof DropdownMenuPrimitive.Item>,
80
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
81
- inset?: boolean
82
- }
83
- >(({ className, inset, ...props }, ref) => (
84
- <DropdownMenuPrimitive.Item
85
- ref={ref}
86
- className={cn(
87
- "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
88
- inset && "pl-8",
89
- className
90
- )}
91
- {...props}
92
- />
93
- ))
94
- DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName
95
-
96
- const DropdownMenuCheckboxItem = React.forwardRef<
97
- React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
98
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
99
- >(({ className, children, checked, ...props }, ref) => (
100
- <DropdownMenuPrimitive.CheckboxItem
101
- ref={ref}
102
- className={cn(
103
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
104
- className
105
- )}
106
- checked={checked}
107
- {...props}
108
- >
109
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
110
- <DropdownMenuPrimitive.ItemIndicator>
111
- <Check className="h-4 w-4" />
112
- </DropdownMenuPrimitive.ItemIndicator>
113
- </span>
114
- {children}
115
- </DropdownMenuPrimitive.CheckboxItem>
116
- ))
117
- DropdownMenuCheckboxItem.displayName =
118
- DropdownMenuPrimitive.CheckboxItem.displayName
119
-
120
- const DropdownMenuRadioItem = React.forwardRef<
121
- React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
122
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
123
- >(({ className, children, ...props }, ref) => (
124
- <DropdownMenuPrimitive.RadioItem
125
- ref={ref}
126
- className={cn(
127
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
128
- className
129
- )}
130
- {...props}
131
- >
132
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
133
- <DropdownMenuPrimitive.ItemIndicator>
134
- <Circle className="h-2 w-2 fill-current" />
135
- </DropdownMenuPrimitive.ItemIndicator>
136
- </span>
137
- {children}
138
- </DropdownMenuPrimitive.RadioItem>
139
- ))
140
- DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName
141
-
142
- const DropdownMenuLabel = React.forwardRef<
143
- React.ElementRef<typeof DropdownMenuPrimitive.Label>,
144
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
145
- inset?: boolean
146
- }
147
- >(({ className, inset, ...props }, ref) => (
148
- <DropdownMenuPrimitive.Label
149
- ref={ref}
150
- className={cn(
151
- "px-2 py-1.5 text-sm font-semibold",
152
- inset && "pl-8",
153
- className
154
- )}
155
- {...props}
156
- />
157
- ))
158
- DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName
159
-
160
- const DropdownMenuSeparator = React.forwardRef<
161
- React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
162
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
163
- >(({ className, ...props }, ref) => (
164
- <DropdownMenuPrimitive.Separator
165
- ref={ref}
166
- className={cn("-mx-1 my-1 h-px bg-muted", className)}
167
- {...props}
168
- />
169
- ))
170
- DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
171
-
172
- const DropdownMenuShortcut = ({
173
- className,
174
- ...props
175
- }: React.HTMLAttributes<HTMLSpanElement>) => {
176
- return (
177
- <span
178
- className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
179
- {...props}
180
- />
181
- )
182
- }
183
- DropdownMenuShortcut.displayName = "DropdownMenuShortcut"
184
-
185
- export {
186
- DropdownMenu,
187
- DropdownMenuTrigger,
188
- DropdownMenuContent,
189
- DropdownMenuItem,
190
- DropdownMenuCheckboxItem,
191
- DropdownMenuRadioItem,
192
- DropdownMenuLabel,
193
- DropdownMenuSeparator,
194
- DropdownMenuShortcut,
195
- DropdownMenuGroup,
196
- DropdownMenuPortal,
197
- DropdownMenuSub,
198
- DropdownMenuSubContent,
199
- DropdownMenuSubTrigger,
200
- DropdownMenuRadioGroup,
201
- }
@@ -1,38 +0,0 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- */
9
-
10
- .EquationEditor_inlineEditor {
11
- padding: 0;
12
- margin: 0;
13
- border: 0;
14
- outline: 0;
15
- color: #8421a2;
16
- background-color: inherit;
17
- resize: none;
18
- }
19
-
20
- .EquationEditor_blockEditor {
21
- padding: 0;
22
- margin: 0;
23
- border: 0;
24
- outline: 0;
25
- color: #8421a2;
26
- background-color: inherit;
27
- resize: none;
28
- width: 100%;
29
- }
30
-
31
- .EquationEditor_inputBackground {
32
- background-color: #eee;
33
- }
34
-
35
- .EquationEditor_dollarSign {
36
- text-align: left;
37
- color: #b0b0b0;
38
- }