@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,787 +0,0 @@
1
- import {
2
- INSERT_DYNAMIC_BLOCK_COMMAND,
3
- INSERT_STORY_BUILDER_COMMAND,
4
- InsertEquationDialog,
5
- InsertInlineImageDialog,
6
- createDefaultDynamicBlock
7
- } from "./chunk-Z6JAFF55.mjs";
8
- import {
9
- INSERT_POLL_COMMAND
10
- } from "./chunk-W6VQSFE5.mjs";
11
- import {
12
- INSERT_COLLAPSIBLE_COMMAND
13
- } from "./chunk-ACV47ZKE.mjs";
14
- import {
15
- AutoEmbedDialog,
16
- Figma,
17
- FigmaEmbedConfig,
18
- Twitter,
19
- TwitterEmbedConfig,
20
- Youtube,
21
- YoutubeEmbedConfig
22
- } from "./chunk-LLCP7NVE.mjs";
23
- import {
24
- useModal
25
- } from "./chunk-IAFCQV3Z.mjs";
26
- import {
27
- INSERT_IMAGE_COMMAND
28
- } from "./chunk-MW6MAUY3.mjs";
29
- import {
30
- INSERT_LAYOUT_COMMAND
31
- } from "./chunk-W6GAJXUS.mjs";
32
- import {
33
- SHORTCUTS
34
- } from "./chunk-K5OAFEVY.mjs";
35
- import {
36
- EXPORT_HTML_COMMAND,
37
- EXPORT_JSON_COMMAND,
38
- EXPORT_MARKDOWN_COMMAND,
39
- EXPORT_PDF_COMMAND,
40
- OPEN_IMPORT_EXPORT_MODAL_COMMAND
41
- } from "./chunk-XYDBUQ6Z.mjs";
42
- import {
43
- INSERT_STEPPER_COMMAND,
44
- initialEditorState
45
- } from "./chunk-2KESP7OU.mjs";
46
- import {
47
- Skeleton
48
- } from "./chunk-NBE6FF6L.mjs";
49
- import {
50
- INSERT_HINT_COMMAND
51
- } from "./chunk-7QRJVZQY.mjs";
52
- import {
53
- cn
54
- } from "./chunk-JHXDLYEV.mjs";
55
- import {
56
- init_react_shim
57
- } from "./chunk-WYCFGRFJ.mjs";
58
-
59
- // src/components/editor/plugins/SlashCommand/index.tsx
60
- init_react_shim();
61
- import { $createCodeNode } from "@lexical/code";
62
- import {
63
- INSERT_CHECK_LIST_COMMAND,
64
- INSERT_ORDERED_LIST_COMMAND,
65
- INSERT_UNORDERED_LIST_COMMAND
66
- } from "@lexical/list";
67
- import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
68
- import { INSERT_HORIZONTAL_RULE_COMMAND } from "@lexical/react/LexicalHorizontalRuleNode";
69
- import {
70
- LexicalTypeaheadMenuPlugin,
71
- MenuOption,
72
- useBasicTypeaheadTriggerMatch
73
- } from "@lexical/react/LexicalTypeaheadMenuPlugin";
74
- import { $createHeadingNode, $createQuoteNode } from "@lexical/rich-text";
75
- import { $setBlocksType } from "@lexical/selection";
76
- import { INSERT_TABLE_COMMAND } from "@lexical/table";
77
- import {
78
- $createParagraphNode,
79
- $getSelection,
80
- $isRangeSelection,
81
- createEditor
82
- } from "lexical";
83
- import { useCallback, useMemo, useRef, useState } from "react";
84
- import * as React from "react";
85
- import * as ReactDOM from "react-dom";
86
- import {
87
- Code2,
88
- Columns2,
89
- Columns3,
90
- Columns4,
91
- ImageIcon,
92
- ImagePlayIcon,
93
- ListCheck,
94
- Pilcrow,
95
- QuoteIcon,
96
- SquarePenIcon,
97
- StepForward,
98
- Heading1,
99
- Heading2,
100
- Heading3,
101
- Minus,
102
- List,
103
- ListOrdered,
104
- Table,
105
- SigmaIcon,
106
- GitBranch,
107
- Zap,
108
- Sparkles,
109
- Music,
110
- Paperclip,
111
- Lightbulb,
112
- Printer,
113
- FileText,
114
- FileDown,
115
- FileUp,
116
- FileJson
117
- } from "lucide-react";
118
- import { Fragment as Fragment2, jsx, jsxs } from "react/jsx-runtime";
119
- var InsertGif = React.lazy(() => import("./insert-gif-FIMCCBAI.mjs"));
120
- var InsertImageDialog = React.lazy(
121
- () => import("./insert-image-CZV6HWQZ.mjs").then((module) => ({
122
- default: module.InsertImageDialog
123
- }))
124
- );
125
- var AIDialog = React.lazy(() => import("./AIDialog-2WZUFWSC.mjs"));
126
- var InsertAudioDialog = React.lazy(() => import("./insert-audio-C66RZRKY.mjs"));
127
- var InsertFileDialog = React.lazy(() => import("./insert-file-3DTGRO7W.mjs"));
128
- var CATEGORY_CONFIG = {
129
- ai: {
130
- label: "AI Actions",
131
- badgeClasses: "text-purple-600 dark:text-purple-400 bg-purple-500/10"
132
- },
133
- basic: {
134
- label: "Basic Blocks",
135
- badgeClasses: "text-zinc-600 dark:text-zinc-400 bg-zinc-500/10"
136
- },
137
- media: {
138
- label: "Media & Content",
139
- badgeClasses: "text-emerald-600 dark:text-emerald-400 bg-emerald-500/10"
140
- },
141
- layout: {
142
- label: "Layout & Structure",
143
- badgeClasses: "text-amber-600 dark:text-amber-400 bg-amber-500/10"
144
- },
145
- embeds: {
146
- label: "Embeds & Social",
147
- badgeClasses: "text-blue-600 dark:text-blue-400 bg-blue-500/10"
148
- },
149
- export: {
150
- label: "Publishing & Export",
151
- badgeClasses: "text-cyan-600 dark:text-cyan-400 bg-cyan-500/10"
152
- }
153
- };
154
- var ComponentPickerOption = class extends MenuOption {
155
- constructor(title, options) {
156
- super(title);
157
- this.title = title;
158
- this.keywords = options.keywords || [];
159
- this.icon = options.icon;
160
- this.keyboardShortcut = options.keyboardShortcut;
161
- this.onSelect = options.onSelect.bind(this);
162
- this.desc = options.desc;
163
- this.category = options.category || "basic";
164
- }
165
- };
166
- function getDynamicOptions(editor, queryString) {
167
- const options = [];
168
- if (queryString == null) {
169
- return options;
170
- }
171
- const tableMatch = queryString.match(/^([1-9]\d?)(?:x([1-9]\d?)?)?$/);
172
- if (tableMatch !== null) {
173
- const rows = tableMatch[1];
174
- const colOptions = tableMatch[2] ? [tableMatch[2]] : [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(String);
175
- options.push(
176
- ...colOptions.map(
177
- (columns) => new ComponentPickerOption(`${rows}x${columns} Table`, {
178
- icon: /* @__PURE__ */ jsx(Table, { className: "h-4 w-4" }),
179
- keywords: ["table"],
180
- category: "media",
181
- desc: `Insert a ${rows} rows by ${columns} columns table`,
182
- onSelect: () => editor.dispatchCommand(INSERT_TABLE_COMMAND, { columns, rows })
183
- })
184
- )
185
- );
186
- }
187
- return options;
188
- }
189
- function getBaseOptions(editor, showModal) {
190
- return [
191
- // 1. AI Actions
192
- new ComponentPickerOption("Ask AI Assistant", {
193
- icon: /* @__PURE__ */ jsx(Sparkles, { className: "h-4 w-4 text-purple-500" }),
194
- keywords: ["ai", "assistant", "generate", "write", "gpt", "gemini", "smart", "summarize", "prompt"],
195
- desc: "Generate content, outline, brainstorm, or write with AI",
196
- keyboardShortcut: "\u2318K",
197
- category: "ai",
198
- onSelect: () => showModal(
199
- "Notiq AI Assistant",
200
- "Ask AI to write, generate, expand, or format content directly into your document.",
201
- (onClose) => /* @__PURE__ */ jsx(React.Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "mx-2 w-[400px] h-[300px]" }), children: /* @__PURE__ */ jsx(AIDialog, { editor, onClose }) }),
202
- true
203
- )
204
- }),
205
- // 2. Basic Blocks
206
- new ComponentPickerOption("Text", {
207
- icon: /* @__PURE__ */ jsx(Pilcrow, { className: "h-4 w-4" }),
208
- keywords: ["normal", "paragraph", "p", "text"],
209
- desc: "Plain text writing block",
210
- category: "basic",
211
- onSelect: () => editor.update(() => {
212
- const selection = $getSelection();
213
- if ($isRangeSelection(selection)) {
214
- $setBlocksType(selection, () => $createParagraphNode());
215
- }
216
- })
217
- }),
218
- ...[1, 2, 3].map(
219
- (n) => new ComponentPickerOption(`Heading ${n}`, {
220
- icon: n === 1 ? /* @__PURE__ */ jsx(Heading1, { className: "h-4 w-4" }) : n === 2 ? /* @__PURE__ */ jsx(Heading2, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Heading3, { className: "h-4 w-4" }),
221
- keywords: ["heading", "header", `h${n}`, `heading ${n}`],
222
- category: "basic",
223
- keyboardShortcut: n === 1 ? SHORTCUTS.HEADING1 : n === 2 ? SHORTCUTS.HEADING2 : SHORTCUTS.HEADING3,
224
- onSelect: () => editor.update(() => {
225
- const selection = $getSelection();
226
- if ($isRangeSelection(selection)) {
227
- $setBlocksType(selection, () => $createHeadingNode(`h${n}`));
228
- }
229
- }),
230
- desc: n === 1 ? "Large section heading" : n === 2 ? "Medium section heading" : "Small section heading"
231
- })
232
- ),
233
- new ComponentPickerOption("Bulleted List", {
234
- icon: /* @__PURE__ */ jsx(List, { className: "h-4 w-4" }),
235
- keywords: ["bulleted list", "unordered list", "ul", "bullets"],
236
- desc: "Create a list with bullet points",
237
- category: "basic",
238
- keyboardShortcut: SHORTCUTS.BULLET_LIST,
239
- onSelect: () => editor.dispatchCommand(INSERT_UNORDERED_LIST_COMMAND, void 0)
240
- }),
241
- new ComponentPickerOption("Numbered List", {
242
- icon: /* @__PURE__ */ jsx(ListOrdered, { className: "h-4 w-4" }),
243
- keywords: ["numbered list", "ordered list", "ol", "numbers"],
244
- desc: "Create a sequential numbered list",
245
- category: "basic",
246
- keyboardShortcut: SHORTCUTS.NUMBERED_LIST,
247
- onSelect: () => editor.dispatchCommand(INSERT_ORDERED_LIST_COMMAND, void 0)
248
- }),
249
- new ComponentPickerOption("Check List", {
250
- icon: /* @__PURE__ */ jsx(ListCheck, { className: "h-4 w-4" }),
251
- keywords: ["check list", "todo list", "task", "checkbox"],
252
- desc: "Track tasks with a to-do checklist",
253
- category: "basic",
254
- keyboardShortcut: SHORTCUTS.CHECK_LIST,
255
- onSelect: () => editor.dispatchCommand(INSERT_CHECK_LIST_COMMAND, void 0)
256
- }),
257
- new ComponentPickerOption("Quote", {
258
- icon: /* @__PURE__ */ jsx(QuoteIcon, { className: "h-4 w-4" }),
259
- keywords: ["block quote", "quote", "citation"],
260
- desc: "Capture a prominent quote or excerpt",
261
- category: "basic",
262
- keyboardShortcut: SHORTCUTS.QUOTE,
263
- onSelect: () => editor.update(() => {
264
- const selection = $getSelection();
265
- if ($isRangeSelection(selection)) {
266
- $setBlocksType(selection, () => $createQuoteNode());
267
- }
268
- })
269
- }),
270
- new ComponentPickerOption("Divider", {
271
- icon: /* @__PURE__ */ jsx(Minus, { className: "h-4 w-4" }),
272
- keywords: ["horizontal rule", "divider", "hr", "separator", "line"],
273
- desc: "Visually separate content sections",
274
- category: "basic",
275
- keyboardShortcut: "---",
276
- onSelect: () => editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, void 0)
277
- }),
278
- // 3. Media & Content
279
- new ComponentPickerOption("Code Block", {
280
- icon: /* @__PURE__ */ jsx(Code2, { className: "h-4 w-4" }),
281
- keywords: ["javascript", "python", "js", "ts", "codeblock", "code", "syntax"],
282
- desc: "Syntax highlighted code snippet with line numbers",
283
- category: "media",
284
- keyboardShortcut: SHORTCUTS.CODE_BLOCK,
285
- onSelect: () => editor.update(() => {
286
- const selection = $getSelection();
287
- if ($isRangeSelection(selection)) {
288
- if (selection.isCollapsed()) {
289
- $setBlocksType(selection, () => $createCodeNode());
290
- } else {
291
- const textContent = selection.getTextContent();
292
- const codeNode = $createCodeNode();
293
- selection.insertNodes([codeNode]);
294
- selection.insertRawText(textContent);
295
- }
296
- }
297
- })
298
- }),
299
- new ComponentPickerOption("Table", {
300
- icon: /* @__PURE__ */ jsx(Table, { className: "h-4 w-4" }),
301
- keywords: ["table", "grid", "spreadsheet", "rows", "columns"],
302
- desc: "Customizable table with cell actions",
303
- category: "media",
304
- keyboardShortcut: "/table",
305
- onSelect: () => editor.dispatchCommand(INSERT_TABLE_COMMAND, {
306
- rows: "4",
307
- columns: "4"
308
- })
309
- }),
310
- new ComponentPickerOption("Callout", {
311
- icon: /* @__PURE__ */ jsx(Lightbulb, { className: "h-4 w-4 text-emerald-500" }),
312
- keywords: [
313
- "callout",
314
- "hint",
315
- "note",
316
- "tip",
317
- "info",
318
- "admonition",
319
- "alert",
320
- "warning",
321
- "important",
322
- "caution"
323
- ],
324
- desc: "Notion-style callout box with icon and style picker",
325
- category: "media",
326
- keyboardShortcut: "/callout",
327
- onSelect: () => editor.dispatchCommand(INSERT_HINT_COMMAND, "tip")
328
- }),
329
- new ComponentPickerOption("Image", {
330
- icon: /* @__PURE__ */ jsx(ImageIcon, { className: "h-4 w-4" }),
331
- keywords: ["image", "photo", "picture", "file", "img", "upload"],
332
- desc: "Upload or embed an image with caption",
333
- category: "media",
334
- onSelect: () => showModal(
335
- "Insert Image",
336
- "Please select an image to upload.",
337
- (onClose) => /* @__PURE__ */ jsx(
338
- React.Suspense,
339
- {
340
- fallback: /* @__PURE__ */ jsx(Skeleton, { className: "mx-2 w-[350px] h-[350px]" }),
341
- children: /* @__PURE__ */ jsx(InsertImageDialog, { activeEditor: editor, onClose })
342
- }
343
- ),
344
- true
345
- )
346
- }),
347
- new ComponentPickerOption("Inline Image", {
348
- icon: /* @__PURE__ */ jsx(ImageIcon, { className: "h-4 w-4" }),
349
- keywords: ["image", "inline", "photo", "picture", "img"],
350
- desc: "Insert an inline image into text",
351
- category: "media",
352
- onSelect: () => showModal(
353
- "Insert Image",
354
- "Please select an image to upload.",
355
- (onClose) => /* @__PURE__ */ jsx(
356
- React.Suspense,
357
- {
358
- fallback: /* @__PURE__ */ jsx(Skeleton, { className: "mx-2 w-[350px] h-[350px]" }),
359
- children: /* @__PURE__ */ jsx(
360
- InsertInlineImageDialog,
361
- {
362
- activeEditor: editor,
363
- onClose
364
- }
365
- )
366
- }
367
- ),
368
- true
369
- )
370
- }),
371
- new ComponentPickerOption("Audio Player", {
372
- icon: /* @__PURE__ */ jsx(Music, { className: "h-4 w-4 text-cyan-500" }),
373
- keywords: ["audio", "music", "sound", "podcast", "mp3", "track", "voice"],
374
- desc: "Embed an audio player, podcast, or sound track",
375
- category: "media",
376
- onSelect: () => showModal(
377
- "Insert Audio",
378
- "Embed an audio file or stream",
379
- (onClose) => /* @__PURE__ */ jsx(
380
- React.Suspense,
381
- {
382
- fallback: /* @__PURE__ */ jsx(Skeleton, { className: "mx-2 w-[350px] h-[250px]" }),
383
- children: /* @__PURE__ */ jsx(InsertAudioDialog, { activeEditor: editor, onClose })
384
- }
385
- ),
386
- true
387
- )
388
- }),
389
- new ComponentPickerOption("Attach File", {
390
- icon: /* @__PURE__ */ jsx(Paperclip, { className: "h-4 w-4 text-emerald-500" }),
391
- keywords: ["file", "attachment", "doc", "pdf", "zip", "upload", "download"],
392
- desc: "Embed a downloadable document attachment card",
393
- category: "media",
394
- onSelect: () => showModal(
395
- "Attach File",
396
- "Upload or link a document",
397
- (onClose) => /* @__PURE__ */ jsx(
398
- React.Suspense,
399
- {
400
- fallback: /* @__PURE__ */ jsx(Skeleton, { className: "mx-2 w-[350px] h-[250px]" }),
401
- children: /* @__PURE__ */ jsx(InsertFileDialog, { activeEditor: editor, onClose })
402
- }
403
- ),
404
- true
405
- )
406
- }),
407
- new ComponentPickerOption("Equation", {
408
- icon: /* @__PURE__ */ jsx(SigmaIcon, { className: "w-4 h-4" }),
409
- keywords: ["equation", "latex", "math", "formula"],
410
- desc: "Mathematical equations using LaTeX syntax",
411
- category: "media",
412
- keyboardShortcut: "$$",
413
- onSelect: () => showModal(
414
- "Insert Equation",
415
- "Insert mathematical equations using LaTeX syntax.",
416
- (onClose) => /* @__PURE__ */ jsx(
417
- React.Suspense,
418
- {
419
- fallback: /* @__PURE__ */ jsx(Skeleton, { className: "mx-2 w-[350px] h-[350px]" }),
420
- children: /* @__PURE__ */ jsx(
421
- InsertEquationDialog,
422
- {
423
- activeEditor: editor,
424
- onClose
425
- }
426
- )
427
- }
428
- ),
429
- true
430
- )
431
- }),
432
- new ComponentPickerOption("Gifs", {
433
- icon: /* @__PURE__ */ jsx(ImagePlayIcon, { className: "h-4 w-4" }),
434
- keywords: ["gif", "gifs", "videos", "short video", "animation"],
435
- desc: "Search and insert animated GIFs",
436
- category: "media",
437
- onSelect: () => {
438
- showModal(
439
- "Insert GIF",
440
- "Please select a GIF to upload.",
441
- (onClose) => /* @__PURE__ */ jsx(
442
- React.Suspense,
443
- {
444
- fallback: /* @__PURE__ */ jsx(Skeleton, { className: "mx-2 w-[400px] h-[400px]" }),
445
- children: /* @__PURE__ */ jsx(
446
- InsertGif,
447
- {
448
- insertGifOnClick: (payload) => {
449
- editor.dispatchCommand(INSERT_IMAGE_COMMAND, payload);
450
- },
451
- onClose
452
- }
453
- )
454
- }
455
- ),
456
- true
457
- );
458
- }
459
- }),
460
- new ComponentPickerOption("Poll", {
461
- icon: /* @__PURE__ */ jsx(SquarePenIcon, { className: "h-4 w-4" }),
462
- keywords: ["poll", "vote", "survey", "choice"],
463
- desc: "Interactive community voting poll",
464
- category: "media",
465
- onSelect: () => editor.dispatchCommand(INSERT_POLL_COMMAND, "Type the Question")
466
- }),
467
- // 4. Layout & Structure
468
- new ComponentPickerOption("2 columns", {
469
- icon: /* @__PURE__ */ jsx(Columns2, { className: "h-4 w-4" }),
470
- keywords: ["columns", "flex", "row", "layout", "grid", "2columns", "two columns"],
471
- desc: "Split your content into 2 equal columns",
472
- category: "layout",
473
- onSelect: () => editor.dispatchCommand(INSERT_LAYOUT_COMMAND, "1fr 1fr")
474
- }),
475
- new ComponentPickerOption("3 columns", {
476
- icon: /* @__PURE__ */ jsx(Columns3, { className: "h-4 w-4" }),
477
- keywords: ["3columns", "3", "flex", "row", "layout", "grid", "three columns"],
478
- desc: "Split your content into 3 equal columns",
479
- category: "layout",
480
- onSelect: () => editor.dispatchCommand(INSERT_LAYOUT_COMMAND, "1fr 1fr 1fr")
481
- }),
482
- new ComponentPickerOption("4 columns", {
483
- icon: /* @__PURE__ */ jsx(Columns4, { className: "h-4 w-4" }),
484
- keywords: ["4columns", "4", "flex", "row", "layout", "grid", "four columns"],
485
- desc: "Split your content into 4 equal columns",
486
- category: "layout",
487
- onSelect: () => editor.dispatchCommand(INSERT_LAYOUT_COMMAND, "1fr 1fr 1fr 1fr")
488
- }),
489
- new ComponentPickerOption("Collapsible", {
490
- icon: /* @__PURE__ */ jsx(StepForward, { className: "h-4 w-4" }),
491
- keywords: ["collapse", "collapsible", "toggle", "accordion"],
492
- desc: "Expandable/collapsible toggle section",
493
- category: "layout",
494
- onSelect: () => editor.dispatchCommand(INSERT_COLLAPSIBLE_COMMAND, void 0)
495
- }),
496
- new ComponentPickerOption("Stepper", {
497
- icon: /* @__PURE__ */ jsx("svg", { className: "h-4 w-4", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxs("g", { fill: "none", fillRule: "evenodd", children: [
498
- /* @__PURE__ */ jsx("path", { d: "m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z" }),
499
- /* @__PURE__ */ jsx(
500
- "path",
501
- {
502
- fill: "currentColor",
503
- d: "M5 6a3 3 0 0 1 6 0v2a3 3 0 0 1-6 0zm3-1a1 1 0 0 0-1 1v2a1 1 0 0 0 2 0V6a1 1 0 0 0-1-1m9.707-.707a1 1 0 0 0-1.414 0L13.465 7.12a1 1 0 0 0 1.414 1.415L16 7.414V20a1 1 0 1 0 2 0V7.414l1.121 1.122a1 1 0 1 0 1.415-1.415zM5 15a3 3 0 0 1 5.995-.176l.005.186c0 .408-.039.799-.107 1.171c-.264 1.433-.964 2.58-1.57 3.352c-.307.39-.598.694-.815.904c-.124.12-.25.238-.385.345a1 1 0 0 1-1.34-1.479L7.118 19l.224-.228A7 7 0 0 0 7.971 18A3 3 0 0 1 5 15m3-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2"
504
- }
505
- )
506
- ] }) }),
507
- keywords: ["stepper", "step", "lines", "routes", "docs", "number", "workflow", "process"],
508
- desc: "Numbered step-by-step documentation workflow",
509
- category: "layout",
510
- onSelect: () => {
511
- const newEditor = createEditor();
512
- const parsedEditorState = newEditor.parseEditorState(
513
- JSON.stringify(initialEditorState)
514
- );
515
- newEditor.setEditorState(parsedEditorState);
516
- const newStep = {
517
- id: 0,
518
- title: `New step 0`,
519
- content: newEditor
520
- };
521
- editor.dispatchCommand(INSERT_STEPPER_COMMAND, [newStep]);
522
- }
523
- }),
524
- // 5. Embeds & Social
525
- new ComponentPickerOption("YouTube", {
526
- icon: /* @__PURE__ */ jsx(Youtube, { className: "h-4 w-4" }),
527
- keywords: ["Youtube", "youtube", "video", "stream", "media"],
528
- desc: "Embed responsive YouTube videos",
529
- category: "embeds",
530
- onSelect: () => {
531
- showModal(
532
- "YouTube Video",
533
- "Insert a URL to embed a live preview. Works with YouTube",
534
- (onClose) => /* @__PURE__ */ jsx(
535
- AutoEmbedDialog,
536
- {
537
- embedConfig: YoutubeEmbedConfig,
538
- onClose
539
- }
540
- ),
541
- true
542
- );
543
- }
544
- }),
545
- new ComponentPickerOption("Figma", {
546
- icon: /* @__PURE__ */ jsx(Figma, { className: "h-4 w-4" }),
547
- keywords: ["figma", "figma.com", "ui", "design", "prototype"],
548
- desc: "Embed interactive Figma design preview",
549
- category: "embeds",
550
- onSelect: () => {
551
- showModal(
552
- "Figma",
553
- "Insert a URL to embed a live preview. Works with Figma",
554
- (onClose) => /* @__PURE__ */ jsx(
555
- AutoEmbedDialog,
556
- {
557
- embedConfig: FigmaEmbedConfig,
558
- onClose
559
- }
560
- ),
561
- true
562
- );
563
- }
564
- }),
565
- new ComponentPickerOption("Twitter / X", {
566
- icon: /* @__PURE__ */ jsx(Twitter, { className: "h-4 w-4" }),
567
- keywords: ["Twitter", "tweet", "x", "twitter", "post"],
568
- desc: "Embed live tweet post",
569
- category: "embeds",
570
- onSelect: () => {
571
- showModal(
572
- "Twitter / X Post",
573
- "Insert a URL to embed a live preview. Works with Twitter",
574
- (onClose) => /* @__PURE__ */ jsx(
575
- AutoEmbedDialog,
576
- {
577
- embedConfig: TwitterEmbedConfig,
578
- onClose
579
- }
580
- ),
581
- true
582
- );
583
- }
584
- }),
585
- new ComponentPickerOption("Interactive Story", {
586
- icon: /* @__PURE__ */ jsx(GitBranch, { className: "h-4 w-4" }),
587
- keywords: ["story", "interactive", "branching", "narrative", "choose", "adventure"],
588
- desc: "Create branching narratives with reader choices",
589
- category: "embeds",
590
- onSelect: () => editor.dispatchCommand(INSERT_STORY_BUILDER_COMMAND, {
591
- nodes: [],
592
- currentNodeId: "",
593
- title: "Interactive Story"
594
- })
595
- }),
596
- new ComponentPickerOption("Dynamic Block", {
597
- icon: /* @__PURE__ */ jsx(Zap, { className: "h-4 w-4" }),
598
- keywords: ["dynamic", "interactive", "content", "block", "trigger", "animation", "responsive"],
599
- desc: "Create interactive content that responds to user actions",
600
- category: "embeds",
601
- onSelect: () => editor.dispatchCommand(INSERT_DYNAMIC_BLOCK_COMMAND, createDefaultDynamicBlock())
602
- }),
603
- // 6. Publishing & Export
604
- new ComponentPickerOption("Import / Export Hub", {
605
- icon: /* @__PURE__ */ jsx(FileDown, { className: "h-4 w-4 text-primary" }),
606
- keywords: ["export", "import", "hub", "share", "backup", "markdown", "pdf", "html", "json"],
607
- desc: "Open unified Document Import & Export Hub",
608
- category: "export",
609
- onSelect: () => editor.dispatchCommand(OPEN_IMPORT_EXPORT_MODAL_COMMAND, { defaultTab: "export" })
610
- }),
611
- new ComponentPickerOption("Import Document", {
612
- icon: /* @__PURE__ */ jsx(FileUp, { className: "h-4 w-4 text-emerald-500" }),
613
- keywords: ["import", "upload", "load", "markdown", "html", "json", "open"],
614
- desc: "Import Markdown, HTML, JSON, or Plain text",
615
- category: "export",
616
- onSelect: () => editor.dispatchCommand(OPEN_IMPORT_EXPORT_MODAL_COMMAND, { defaultTab: "import" })
617
- }),
618
- new ComponentPickerOption("Export to PDF", {
619
- icon: /* @__PURE__ */ jsx(Printer, { className: "h-4 w-4 text-red-500" }),
620
- keywords: ["export", "pdf", "print", "save", "document"],
621
- desc: "Export document as print-ready PDF",
622
- category: "export",
623
- onSelect: () => editor.dispatchCommand(EXPORT_PDF_COMMAND, void 0)
624
- }),
625
- new ComponentPickerOption("Export to Markdown", {
626
- icon: /* @__PURE__ */ jsx(FileText, { className: "h-4 w-4 text-blue-500" }),
627
- keywords: ["export", "markdown", "md", "github"],
628
- desc: "Export document as clean Markdown (.md)",
629
- category: "export",
630
- onSelect: () => editor.dispatchCommand(EXPORT_MARKDOWN_COMMAND, void 0)
631
- }),
632
- new ComponentPickerOption("Export to HTML", {
633
- icon: /* @__PURE__ */ jsx(Code2, { className: "h-4 w-4 text-orange-500" }),
634
- keywords: ["export", "html", "web", "download"],
635
- desc: "Export document as standalone styled HTML",
636
- category: "export",
637
- onSelect: () => editor.dispatchCommand(EXPORT_HTML_COMMAND, void 0)
638
- }),
639
- new ComponentPickerOption("Export JSON State", {
640
- icon: /* @__PURE__ */ jsx(FileJson, { className: "h-4 w-4 text-emerald-600" }),
641
- keywords: ["export", "json", "backup", "state", "lexical"],
642
- desc: "Export full document state snapshot for backup",
643
- category: "export",
644
- onSelect: () => editor.dispatchCommand(EXPORT_JSON_COMMAND, void 0)
645
- })
646
- ];
647
- }
648
- function SlashCommand() {
649
- const [editor] = useLexicalComposerContext();
650
- const [Modal, showModal] = useModal();
651
- const [queryString, setQueryString] = useState(null);
652
- const activeItemRef = useRef(null);
653
- const checkForTriggerMatch = useBasicTypeaheadTriggerMatch("/", {
654
- minLength: 0
655
- });
656
- const options = useMemo(() => {
657
- const baseOptions = getBaseOptions(editor, showModal);
658
- if (!queryString) {
659
- return baseOptions;
660
- }
661
- const regex = new RegExp(queryString, "i");
662
- return [
663
- ...getDynamicOptions(editor, queryString),
664
- ...baseOptions.filter(
665
- (option) => regex.test(option.title) || regex.test(option.category) || option.keywords.some((keyword) => regex.test(keyword))
666
- )
667
- ];
668
- }, [editor, queryString, showModal]);
669
- const onSelectOption = useCallback(
670
- (selectedOption, nodeToRemove, closeMenu, matchingString) => {
671
- editor.update(() => {
672
- nodeToRemove == null ? void 0 : nodeToRemove.remove();
673
- selectedOption.onSelect(matchingString);
674
- closeMenu();
675
- });
676
- },
677
- [editor]
678
- );
679
- return /* @__PURE__ */ jsxs(Fragment2, { children: [
680
- /* @__PURE__ */ jsx(
681
- LexicalTypeaheadMenuPlugin,
682
- {
683
- onQueryChange: setQueryString,
684
- onSelectOption,
685
- triggerFn: checkForTriggerMatch,
686
- options,
687
- menuRenderFn: (anchorElementRef, { selectedIndex, selectOptionAndCleanUp, setHighlightedIndex }) => {
688
- if (!anchorElementRef.current || !options.length) {
689
- return null;
690
- }
691
- let lastCategory = "";
692
- return ReactDOM.createPortal(
693
- /* @__PURE__ */ jsxs(
694
- "div",
695
- {
696
- id: "slash-command-menu",
697
- className: "z-[100] relative max-w-[360px] w-88 max-h-[420px] rounded-2xl border border-zinc-200/90 dark:border-zinc-800 bg-white/95 dark:bg-zinc-900/95 text-zinc-900 dark:text-zinc-100 shadow-2xl backdrop-blur-xl overflow-hidden flex flex-col animate-in fade-in-0 zoom-in-95 duration-100",
698
- children: [
699
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-3.5 py-2.5 border-b border-zinc-200/70 dark:border-zinc-800/80 bg-zinc-50/60 dark:bg-zinc-900/60 select-none", children: [
700
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-zinc-500 dark:text-zinc-400", children: [
701
- /* @__PURE__ */ jsx("span", { className: "font-mono px-1.5 py-0.5 rounded bg-zinc-200/70 dark:bg-zinc-800 text-[11px] font-semibold text-zinc-700 dark:text-zinc-300", children: "/" }),
702
- /* @__PURE__ */ jsx("span", { className: "font-medium", children: queryString ? `Filter: "${queryString}"` : "Commands & Blocks" })
703
- ] }),
704
- /* @__PURE__ */ jsxs("span", { className: "text-[10px] text-zinc-400 dark:text-zinc-500 font-mono", children: [
705
- options.length,
706
- " ",
707
- options.length === 1 ? "option" : "options"
708
- ] })
709
- ] }),
710
- /* @__PURE__ */ jsx(
711
- "div",
712
- {
713
- className: "max-h-[360px] overflow-y-auto p-1.5 overscroll-contain",
714
- role: "listbox",
715
- "aria-label": "Slash commands",
716
- children: options.map((option, i) => {
717
- const showCategoryHeader = option.category !== lastCategory;
718
- lastCategory = option.category;
719
- const isSelected = selectedIndex === i;
720
- const catConfig = CATEGORY_CONFIG[option.category];
721
- return /* @__PURE__ */ jsxs(React.Fragment, { children: [
722
- showCategoryHeader && /* @__PURE__ */ jsx("div", { className: "px-2.5 pt-3 pb-1 first:pt-1 text-[11px] font-semibold text-zinc-400 dark:text-zinc-500 uppercase tracking-wider select-none flex items-center justify-between", children: /* @__PURE__ */ jsx("span", { children: (catConfig == null ? void 0 : catConfig.label) || option.category }) }),
723
- /* @__PURE__ */ jsxs(
724
- "div",
725
- {
726
- ref: (el) => {
727
- if (isSelected) {
728
- activeItemRef.current = el;
729
- el == null ? void 0 : el.scrollIntoView({ block: "nearest" });
730
- }
731
- },
732
- role: "option",
733
- "aria-selected": isSelected,
734
- className: cn(
735
- "group flex items-center gap-2.5 rounded-xl px-2.5 py-2 text-sm transition-all cursor-pointer select-none",
736
- isSelected ? "bg-zinc-100 dark:bg-zinc-800/90 text-zinc-900 dark:text-zinc-50 font-medium shadow-2xs" : "hover:bg-zinc-50 dark:hover:bg-zinc-800/50 text-zinc-700 dark:text-zinc-300"
737
- ),
738
- onClick: () => {
739
- setHighlightedIndex(i);
740
- selectOptionAndCleanUp(option);
741
- },
742
- onMouseEnter: () => {
743
- setHighlightedIndex(i);
744
- },
745
- children: [
746
- /* @__PURE__ */ jsx(
747
- "div",
748
- {
749
- className: cn(
750
- "flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-zinc-200/80 dark:border-zinc-800/80 bg-zinc-50 dark:bg-zinc-800/60 text-zinc-600 dark:text-zinc-300 transition-colors",
751
- isSelected && "border-primary/40 bg-primary/10 text-primary dark:text-primary-foreground",
752
- option.category === "ai" && "border-purple-300 dark:border-purple-800/50 bg-purple-50 dark:bg-purple-950/30 text-purple-600 dark:text-purple-400"
753
- ),
754
- children: option.icon
755
- }
756
- ),
757
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 min-w-0", children: [
758
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
759
- /* @__PURE__ */ jsx("span", { className: "truncate text-sm", children: option.title }),
760
- option.keyboardShortcut && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[10px] font-mono px-1.5 py-0.5 rounded border border-zinc-200/60 dark:border-zinc-800 bg-zinc-100/60 dark:bg-zinc-800/60 text-zinc-500 dark:text-zinc-400", children: option.keyboardShortcut })
761
- ] }),
762
- option.desc && /* @__PURE__ */ jsx("span", { className: "truncate text-xs text-zinc-500 dark:text-zinc-400 font-normal", children: option.desc })
763
- ] })
764
- ]
765
- }
766
- )
767
- ] }, option.key);
768
- })
769
- }
770
- )
771
- ]
772
- }
773
- ),
774
- anchorElementRef.current
775
- );
776
- }
777
- }
778
- ),
779
- Modal
780
- ] });
781
- }
782
-
783
- export {
784
- CATEGORY_CONFIG,
785
- ComponentPickerOption,
786
- SlashCommand
787
- };