@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,984 +0,0 @@
1
- "use client";
2
- import {
3
- INSERT_EXCALIDRAW_COMMAND
4
- } from "./chunk-FYLRS4BG.mjs";
5
- import {
6
- INSERT_COMMENT_COMMAND
7
- } from "./chunk-LAUAYRPC.mjs";
8
- import "./chunk-3JN6QEJR.mjs";
9
- import {
10
- AutoEmbedDialog,
11
- Youtube,
12
- YoutubeEmbedConfig
13
- } from "./chunk-LLCP7NVE.mjs";
14
- import {
15
- useModal
16
- } from "./chunk-IAFCQV3Z.mjs";
17
- import "./chunk-OXWTZV3U.mjs";
18
- import {
19
- SPEECH_TO_TEXT_COMMAND,
20
- SUPPORT_SPEECH_RECOGNITION
21
- } from "./chunk-ZKZ7MLSS.mjs";
22
- import {
23
- INSERT_LAYOUT_COMMAND
24
- } from "./chunk-W6GAJXUS.mjs";
25
- import "./chunk-VGAX6YEY.mjs";
26
- import "./chunk-R7WFRENU.mjs";
27
- import "./chunk-RJQTA6HG.mjs";
28
- import "./chunk-6UVNHT3T.mjs";
29
- import "./chunk-5NRAXWYA.mjs";
30
- import {
31
- Skeleton
32
- } from "./chunk-NBE6FF6L.mjs";
33
- import {
34
- sanitizeUrl
35
- } from "./chunk-RAVYEEIC.mjs";
36
- import "./chunk-TC3IISJZ.mjs";
37
- import "./chunk-XZXGYNTY.mjs";
38
- import "./chunk-H3P47YXJ.mjs";
39
- import "./chunk-OE5JRLCN.mjs";
40
- import {
41
- INSERT_HINT_COMMAND
42
- } from "./chunk-7QRJVZQY.mjs";
43
- import {
44
- cn
45
- } from "./chunk-JHXDLYEV.mjs";
46
- import {
47
- init_react_shim
48
- } from "./chunk-WYCFGRFJ.mjs";
49
-
50
- // src/components/editor/plugins/ToolbarPlugin/MobileToolbar.tsx
51
- init_react_shim();
52
- import { useEffect, useState, useMemo, lazy, Suspense, useCallback, useRef } from "react";
53
- import {
54
- $getSelection,
55
- $isRangeSelection,
56
- FORMAT_TEXT_COMMAND,
57
- FORMAT_ELEMENT_COMMAND,
58
- REDO_COMMAND,
59
- UNDO_COMMAND
60
- } from "lexical";
61
- import {
62
- Bold,
63
- Italic,
64
- Underline,
65
- Strikethrough,
66
- Undo2,
67
- Redo2,
68
- Heading1,
69
- Heading2,
70
- Heading3,
71
- Type,
72
- List,
73
- ListOrdered,
74
- Link as LinkIcon,
75
- Code,
76
- Quote,
77
- CheckSquare,
78
- AlignLeft,
79
- AlignCenter,
80
- AlignRight,
81
- Mic,
82
- Plus,
83
- Image,
84
- FileAudio,
85
- FileText,
86
- Table,
87
- SquarePenIcon,
88
- DraftingCompassIcon,
89
- AlertCircle,
90
- FlipHorizontal2,
91
- Columns2,
92
- ChevronDown,
93
- Palette,
94
- Sparkles,
95
- Eraser,
96
- MessageSquarePlus,
97
- ArrowDownUp
98
- } from "lucide-react";
99
- import { TOGGLE_LINK_COMMAND } from "@lexical/link";
100
- import {
101
- INSERT_ORDERED_LIST_COMMAND,
102
- INSERT_UNORDERED_LIST_COMMAND,
103
- INSERT_CHECK_LIST_COMMAND
104
- } from "@lexical/list";
105
- import { $createHeadingNode, $createQuoteNode } from "@lexical/rich-text";
106
- import { $setBlocksType, $patchStyleText } from "@lexical/selection";
107
- import { INSERT_HORIZONTAL_RULE_COMMAND } from "@lexical/react/LexicalHorizontalRuleNode";
108
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
109
- var InsertImageDialog = lazy(
110
- () => import("./insert-image-CZV6HWQZ.mjs").then((m) => ({ default: m.InsertImageDialog }))
111
- );
112
- var InsertAudioDialog = lazy(
113
- () => import("./insert-audio-C66RZRKY.mjs").then((m) => ({ default: m.InsertAudioDialog }))
114
- );
115
- var InsertFileDialog = lazy(
116
- () => import("./insert-file-3DTGRO7W.mjs").then((m) => ({ default: m.InsertFileDialog }))
117
- );
118
- var InsertTableBody = lazy(
119
- () => import("./insert-table-ZRJP6X52.mjs").then((m) => ({ default: m.InsertTable }))
120
- );
121
- var InsertPoll = lazy(
122
- () => import("./insert-poll-6BCIFY5G.mjs").then((m) => ({ default: m.InsertPoll }))
123
- );
124
- var TEXT_COLORS = [
125
- { label: "Default", color: "inherit", bg: "bg-foreground" },
126
- { label: "Blue", color: "#2563eb", bg: "bg-blue-600" },
127
- { label: "Purple", color: "#7c3aed", bg: "bg-purple-600" },
128
- { label: "Emerald", color: "#059669", bg: "bg-emerald-600" },
129
- { label: "Amber", color: "#d97706", bg: "bg-amber-600" },
130
- { label: "Rose", color: "#e11d48", bg: "bg-rose-600" }
131
- ];
132
- var HIGHLIGHT_COLORS = [
133
- { label: "None", color: "transparent", border: "border-border" },
134
- { label: "Yellow", color: "#fef08a", bg: "bg-yellow-200" },
135
- { label: "Green", color: "#bbf7d0", bg: "bg-green-200" },
136
- { label: "Blue", color: "#bfdbfe", bg: "bg-blue-200" },
137
- { label: "Pink", color: "#fbcfe8", bg: "bg-pink-200" },
138
- { label: "Orange", color: "#fed7aa", bg: "bg-orange-200" }
139
- ];
140
- function MobileToolbar({
141
- editor,
142
- activeEditor,
143
- toolbarState,
144
- setIsLinkEditMode,
145
- isVisible,
146
- toolbarConfig
147
- }) {
148
- const [activeTab, setActiveTab] = useState("format");
149
- const [isKeyboardOpen, setIsKeyboardOpen] = useState(false);
150
- const [bottomOffset, setBottomOffset] = useState(0);
151
- const [isSpeechActive, setIsSpeechActive] = useState(false);
152
- const [isExpanded, setIsExpanded] = useState(false);
153
- const [insertCategory, setInsertCategory] = useState("all");
154
- const [modal, showModal] = useModal();
155
- const targetEditor = activeEditor || editor;
156
- useEffect(() => {
157
- if (isVisible || isKeyboardOpen) {
158
- setIsExpanded(true);
159
- }
160
- }, [isVisible, isKeyboardOpen]);
161
- const scrollContainerRef = useRef(null);
162
- const [canScrollLeft, setCanScrollLeft] = useState(false);
163
- const [canScrollRight, setCanScrollRight] = useState(true);
164
- const checkScrollAffordance = useCallback(() => {
165
- const el = scrollContainerRef.current;
166
- if (!el) return;
167
- setCanScrollLeft(el.scrollLeft > 4);
168
- setCanScrollRight(el.scrollLeft < el.scrollWidth - el.clientWidth - 4);
169
- }, []);
170
- useEffect(() => {
171
- checkScrollAffordance();
172
- }, [activeTab, checkScrollAffordance]);
173
- useEffect(() => {
174
- const visualViewport = window.visualViewport;
175
- if (!visualViewport) return;
176
- const handleResize = () => {
177
- const windowHeight = window.innerHeight;
178
- const viewportHeight = visualViewport.height;
179
- const offsetTop = visualViewport.offsetTop;
180
- const viewportBottom = offsetTop + viewportHeight;
181
- const diff = windowHeight - viewportBottom;
182
- setBottomOffset(Math.max(0, Math.min(diff, windowHeight * 0.55)));
183
- const keyboardIsOpen = viewportHeight < windowHeight * 0.82;
184
- setIsKeyboardOpen(keyboardIsOpen);
185
- if (keyboardIsOpen) {
186
- setIsExpanded(true);
187
- }
188
- };
189
- visualViewport.addEventListener("resize", handleResize);
190
- visualViewport.addEventListener("scroll", handleResize);
191
- handleResize();
192
- return () => {
193
- visualViewport.removeEventListener("resize", handleResize);
194
- visualViewport.removeEventListener("scroll", handleResize);
195
- };
196
- }, []);
197
- const handleOpenDock = useCallback(
198
- (e) => {
199
- if (e) {
200
- e.preventDefault();
201
- e.stopPropagation();
202
- }
203
- setIsExpanded(true);
204
- try {
205
- targetEditor.focus();
206
- } catch (e2) {
207
- }
208
- },
209
- [targetEditor]
210
- );
211
- const handleCloseDock = useCallback((e) => {
212
- if (e) {
213
- e.preventDefault();
214
- e.stopPropagation();
215
- }
216
- setIsExpanded(false);
217
- }, []);
218
- const shouldShow = isExpanded;
219
- const formatHeading = (level) => {
220
- targetEditor.update(() => {
221
- const selection = $getSelection();
222
- if ($isRangeSelection(selection)) {
223
- $setBlocksType(selection, () => $createHeadingNode(level));
224
- }
225
- });
226
- };
227
- const formatQuote = () => {
228
- targetEditor.update(() => {
229
- const selection = $getSelection();
230
- if ($isRangeSelection(selection)) {
231
- $setBlocksType(selection, () => $createQuoteNode());
232
- }
233
- });
234
- };
235
- const applyColor = (color) => {
236
- targetEditor.update(() => {
237
- const selection = $getSelection();
238
- if ($isRangeSelection(selection)) {
239
- $patchStyleText(selection, { color: color === "inherit" ? "" : color });
240
- }
241
- });
242
- };
243
- const applyHighlight = (bgColor) => {
244
- targetEditor.update(() => {
245
- const selection = $getSelection();
246
- if ($isRangeSelection(selection)) {
247
- $patchStyleText(selection, {
248
- "background-color": bgColor === "transparent" ? "" : bgColor
249
- });
250
- }
251
- });
252
- };
253
- const toggleSpeech = () => {
254
- if (!SUPPORT_SPEECH_RECOGNITION) return;
255
- const next = !isSpeechActive;
256
- setIsSpeechActive(next);
257
- targetEditor.dispatchCommand(SPEECH_TO_TEXT_COMMAND, next);
258
- };
259
- const handleInsertLink = () => {
260
- if (!toolbarState.isLink) {
261
- setIsLinkEditMode(true);
262
- targetEditor.dispatchCommand(TOGGLE_LINK_COMMAND, sanitizeUrl("https://"));
263
- } else {
264
- setIsLinkEditMode(false);
265
- targetEditor.dispatchCommand(TOGGLE_LINK_COMMAND, null);
266
- }
267
- };
268
- const INSERT_BLOCKS = useMemo(
269
- () => [
270
- {
271
- id: "image",
272
- category: "media",
273
- label: "Image",
274
- desc: "Upload photo or web URL",
275
- icon: Image,
276
- color: "text-blue-500 bg-blue-500/10 dark:bg-blue-500/20",
277
- action: () => {
278
- showModal(
279
- "Insert Image",
280
- "Upload an image from your device or paste a URL.",
281
- (onClose) => /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "w-full h-48 rounded-xl" }), children: /* @__PURE__ */ jsx(InsertImageDialog, { activeEditor: targetEditor, onClose }) }),
282
- true
283
- );
284
- }
285
- },
286
- {
287
- id: "audio",
288
- category: "media",
289
- label: "Audio Track",
290
- desc: "Interactive player with speed controls",
291
- icon: FileAudio,
292
- color: "text-emerald-500 bg-emerald-500/10 dark:bg-emerald-500/20",
293
- action: () => {
294
- showModal(
295
- "Insert Audio Player",
296
- "Attach an audio clip, voice memo, or music track.",
297
- (onClose) => /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "w-full h-48 rounded-xl" }), children: /* @__PURE__ */ jsx(InsertAudioDialog, { activeEditor: targetEditor, onClose }) }),
298
- true
299
- );
300
- }
301
- },
302
- {
303
- id: "file",
304
- category: "media",
305
- label: "Document File",
306
- desc: "PDF, Word, Excel, ZIP or code file",
307
- icon: FileText,
308
- color: "text-amber-500 bg-amber-500/10 dark:bg-amber-500/20",
309
- action: () => {
310
- showModal(
311
- "Attach Document",
312
- "Upload a document or document archive to download.",
313
- (onClose) => /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "w-full h-48 rounded-xl" }), children: /* @__PURE__ */ jsx(InsertFileDialog, { activeEditor: targetEditor, onClose }) }),
314
- true
315
- );
316
- }
317
- },
318
- {
319
- id: "youtube",
320
- category: "media",
321
- label: "YouTube Video",
322
- desc: "Embed streaming video player",
323
- icon: Youtube,
324
- color: "text-red-500 bg-red-500/10 dark:bg-red-500/20",
325
- action: () => {
326
- showModal(
327
- "Embed YouTube Video",
328
- "Paste a YouTube video URL to embed it in the page.",
329
- (onClose) => /* @__PURE__ */ jsx(AutoEmbedDialog, { embedConfig: YoutubeEmbedConfig, onClose }),
330
- true
331
- );
332
- }
333
- },
334
- {
335
- id: "table",
336
- category: "blocks",
337
- label: "Data Table",
338
- desc: "Configurable rows and columns",
339
- icon: Table,
340
- color: "text-purple-500 bg-purple-500/10 dark:bg-purple-500/20",
341
- action: () => {
342
- showModal(
343
- "Insert Table",
344
- "Choose rows and columns for your data table.",
345
- (onClose) => /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "w-full h-32 rounded-xl" }), children: /* @__PURE__ */ jsx(InsertTableBody, { activeEditor: targetEditor, onClose }) }),
346
- true
347
- );
348
- }
349
- },
350
- {
351
- id: "poll",
352
- category: "blocks",
353
- label: "Voting Poll",
354
- desc: "Interactive multi-choice question",
355
- icon: SquarePenIcon,
356
- color: "text-rose-500 bg-rose-500/10 dark:bg-rose-500/20",
357
- action: () => {
358
- showModal(
359
- "Create Poll",
360
- "Add a voting poll with customizable choices.",
361
- (onClose) => /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "w-full h-32 rounded-xl" }), children: /* @__PURE__ */ jsx(InsertPoll, { activeEditor: targetEditor, onClose }) }),
362
- true
363
- );
364
- }
365
- },
366
- {
367
- id: "excalidraw",
368
- category: "blocks",
369
- label: "Sketch Canvas",
370
- desc: "Hand-drawn diagram and whiteboard",
371
- icon: DraftingCompassIcon,
372
- color: "text-orange-500 bg-orange-500/10 dark:bg-orange-500/20",
373
- action: () => {
374
- targetEditor.dispatchCommand(INSERT_EXCALIDRAW_COMMAND, void 0);
375
- }
376
- },
377
- {
378
- id: "hint",
379
- category: "blocks",
380
- label: "Callout Card",
381
- desc: "Colored highlight note or tip",
382
- icon: AlertCircle,
383
- color: "text-indigo-500 bg-indigo-500/10 dark:bg-indigo-500/20",
384
- action: () => {
385
- targetEditor.dispatchCommand(INSERT_HINT_COMMAND, "info");
386
- }
387
- },
388
- {
389
- id: "columns",
390
- category: "blocks",
391
- label: "2 Columns",
392
- desc: "Side-by-side content container",
393
- icon: Columns2,
394
- color: "text-teal-500 bg-teal-500/10 dark:bg-teal-500/20",
395
- action: () => {
396
- targetEditor.dispatchCommand(INSERT_LAYOUT_COMMAND, "1fr 1fr");
397
- }
398
- },
399
- {
400
- id: "hr",
401
- category: "blocks",
402
- label: "Divider",
403
- desc: "Clean horizontal separator line",
404
- icon: FlipHorizontal2,
405
- color: "text-slate-500 bg-slate-500/10 dark:bg-slate-500/20",
406
- action: () => {
407
- targetEditor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, void 0);
408
- }
409
- }
410
- ],
411
- [targetEditor, showModal]
412
- );
413
- const filteredBlocks = useMemo(() => {
414
- if (insertCategory === "all") return INSERT_BLOCKS;
415
- return INSERT_BLOCKS.filter((b) => b.category === insertCategory);
416
- }, [INSERT_BLOCKS, insertCategory]);
417
- return /* @__PURE__ */ jsxs(Fragment, { children: [
418
- modal,
419
- !shouldShow && /* @__PURE__ */ jsx("div", { className: "fixed bottom-5 right-4 z-40 md:hidden animate-in fade-in zoom-in-95 duration-200", children: /* @__PURE__ */ jsxs(
420
- "button",
421
- {
422
- type: "button",
423
- onClick: handleOpenDock,
424
- className: "flex items-center gap-2 px-4 py-2.5 rounded-full bg-primary text-primary-foreground shadow-2xl shadow-primary/40 text-xs font-semibold active:scale-95 transition-all touch-manipulation border border-primary/20 backdrop-blur-md cursor-pointer",
425
- "aria-label": "Open formatting dock",
426
- children: [
427
- /* @__PURE__ */ jsx(Sparkles, { className: "w-3.5 h-3.5 text-amber-300 animate-pulse" }),
428
- /* @__PURE__ */ jsx("span", { children: "Format & Insert" })
429
- ]
430
- }
431
- ) }),
432
- /* @__PURE__ */ jsx(
433
- "div",
434
- {
435
- className: cn(
436
- "fixed left-0 right-0 w-full z-50 md:hidden transition-transform duration-300 ease-out",
437
- shouldShow ? "translate-y-0" : "translate-y-[120%] pointer-events-none"
438
- ),
439
- style: {
440
- bottom: `${bottomOffset}px`
441
- },
442
- children: /* @__PURE__ */ jsxs(
443
- "div",
444
- {
445
- className: cn(
446
- "w-full bg-background/95 dark:bg-zinc-950/95 backdrop-blur-2xl border-t border-border/80 shadow-2xl pointer-events-auto rounded-t-2xl",
447
- "pb-[max(0.5rem,env(safe-area-inset-bottom))]",
448
- toolbarConfig == null ? void 0 : toolbarConfig.mobileClassName
449
- ),
450
- onMouseDown: (e) => {
451
- if (e.target instanceof Element && e.target.tagName !== "INPUT") {
452
- e.preventDefault();
453
- }
454
- },
455
- children: [
456
- /* @__PURE__ */ jsx("div", { className: "flex justify-center pt-2 pb-1", children: /* @__PURE__ */ jsx("div", { className: "w-10 h-1 rounded-full bg-muted-foreground/25" }) }),
457
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-3 pb-1.5 border-b border-border/50 text-xs", children: [
458
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 bg-muted/50 p-0.5 rounded-xl border border-border/40", children: [
459
- /* @__PURE__ */ jsxs(
460
- "button",
461
- {
462
- type: "button",
463
- onClick: () => setActiveTab("format"),
464
- className: cn(
465
- "flex items-center gap-1 px-2.5 py-1 rounded-lg font-medium transition-all text-xs touch-manipulation",
466
- activeTab === "format" ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
467
- ),
468
- children: [
469
- /* @__PURE__ */ jsx(Type, { className: "w-3.5 h-3.5" }),
470
- /* @__PURE__ */ jsx("span", { children: "Format" })
471
- ]
472
- }
473
- ),
474
- /* @__PURE__ */ jsxs(
475
- "button",
476
- {
477
- type: "button",
478
- onClick: () => setActiveTab("insert"),
479
- className: cn(
480
- "flex items-center gap-1 px-2.5 py-1 rounded-lg font-medium transition-all text-xs touch-manipulation",
481
- activeTab === "insert" ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
482
- ),
483
- children: [
484
- /* @__PURE__ */ jsx(Plus, { className: "w-3.5 h-3.5" }),
485
- /* @__PURE__ */ jsx("span", { children: "Insert" })
486
- ]
487
- }
488
- ),
489
- /* @__PURE__ */ jsxs(
490
- "button",
491
- {
492
- type: "button",
493
- onClick: () => setActiveTab("style"),
494
- className: cn(
495
- "flex items-center gap-1 px-2.5 py-1 rounded-lg font-medium transition-all text-xs touch-manipulation",
496
- activeTab === "style" ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
497
- ),
498
- children: [
499
- /* @__PURE__ */ jsx(Palette, { className: "w-3.5 h-3.5" }),
500
- /* @__PURE__ */ jsx("span", { children: "Style" })
501
- ]
502
- }
503
- )
504
- ] }),
505
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
506
- SUPPORT_SPEECH_RECOGNITION && /* @__PURE__ */ jsxs(
507
- "button",
508
- {
509
- type: "button",
510
- onClick: toggleSpeech,
511
- className: cn(
512
- "flex items-center gap-1 px-2 py-1 rounded-lg text-[11px] font-medium transition-all touch-manipulation",
513
- isSpeechActive ? "bg-rose-500 text-white animate-pulse" : "text-muted-foreground hover:bg-muted"
514
- ),
515
- title: "Speech to Text",
516
- "aria-label": "Toggle voice typing",
517
- children: [
518
- /* @__PURE__ */ jsx(Mic, { className: "w-3.5 h-3.5" }),
519
- /* @__PURE__ */ jsx("span", { className: "hidden sm:inline", children: isSpeechActive ? "Listening..." : "Dictate" })
520
- ]
521
- }
522
- ),
523
- /* @__PURE__ */ jsx(
524
- "button",
525
- {
526
- type: "button",
527
- onClick: handleCloseDock,
528
- className: "p-1.5 rounded-lg text-muted-foreground hover:bg-muted active:scale-95 transition-colors touch-manipulation cursor-pointer",
529
- "aria-label": "Dismiss mobile toolbar",
530
- children: /* @__PURE__ */ jsx(ChevronDown, { className: "w-4 h-4" })
531
- }
532
- )
533
- ] })
534
- ] }),
535
- activeTab === "format" && /* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
536
- /* @__PURE__ */ jsx(
537
- "div",
538
- {
539
- className: cn(
540
- "pointer-events-none absolute left-0 top-0 bottom-0 w-5 bg-gradient-to-r from-background to-transparent z-10 transition-opacity duration-200",
541
- canScrollLeft ? "opacity-100" : "opacity-0"
542
- )
543
- }
544
- ),
545
- /* @__PURE__ */ jsx(
546
- "div",
547
- {
548
- className: cn(
549
- "pointer-events-none absolute right-0 top-0 bottom-0 w-5 bg-gradient-to-l from-background to-transparent z-10 transition-opacity duration-200",
550
- canScrollRight ? "opacity-100" : "opacity-0"
551
- )
552
- }
553
- ),
554
- /* @__PURE__ */ jsxs(
555
- "div",
556
- {
557
- ref: scrollContainerRef,
558
- onScroll: checkScrollAffordance,
559
- className: "flex items-center gap-1.5 px-3 py-2 overflow-x-auto no-scrollbar scroll-smooth w-full",
560
- children: [
561
- /* @__PURE__ */ jsx(
562
- "button",
563
- {
564
- type: "button",
565
- disabled: !toolbarState.canUndo,
566
- onClick: (e) => {
567
- e.preventDefault();
568
- targetEditor.dispatchCommand(UNDO_COMMAND, void 0);
569
- },
570
- className: cn(
571
- "flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all touch-manipulation",
572
- toolbarState.canUndo ? "text-foreground hover:bg-muted active:scale-95" : "text-muted-foreground/30 cursor-not-allowed"
573
- ),
574
- "aria-label": "Undo",
575
- children: /* @__PURE__ */ jsx(Undo2, { className: "w-4 h-4" })
576
- }
577
- ),
578
- /* @__PURE__ */ jsx(
579
- "button",
580
- {
581
- type: "button",
582
- disabled: !toolbarState.canRedo,
583
- onClick: (e) => {
584
- e.preventDefault();
585
- targetEditor.dispatchCommand(REDO_COMMAND, void 0);
586
- },
587
- className: cn(
588
- "flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all touch-manipulation",
589
- toolbarState.canRedo ? "text-foreground hover:bg-muted active:scale-95" : "text-muted-foreground/30 cursor-not-allowed"
590
- ),
591
- "aria-label": "Redo",
592
- children: /* @__PURE__ */ jsx(Redo2, { className: "w-4 h-4" })
593
- }
594
- ),
595
- /* @__PURE__ */ jsx("div", { className: "w-px h-5 bg-border/60 mx-0.5 flex-shrink-0" }),
596
- /* @__PURE__ */ jsx(
597
- "button",
598
- {
599
- type: "button",
600
- onClick: (e) => {
601
- e.preventDefault();
602
- targetEditor.dispatchCommand(FORMAT_TEXT_COMMAND, "bold");
603
- },
604
- className: cn(
605
- "flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
606
- toolbarState.isBold ? "bg-primary text-primary-foreground font-bold shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
607
- ),
608
- "aria-label": "Bold",
609
- children: /* @__PURE__ */ jsx(Bold, { className: "w-4 h-4 stroke-[2.5]" })
610
- }
611
- ),
612
- /* @__PURE__ */ jsx(
613
- "button",
614
- {
615
- type: "button",
616
- onClick: (e) => {
617
- e.preventDefault();
618
- targetEditor.dispatchCommand(FORMAT_TEXT_COMMAND, "italic");
619
- },
620
- className: cn(
621
- "flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
622
- toolbarState.isItalic ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
623
- ),
624
- "aria-label": "Italic",
625
- children: /* @__PURE__ */ jsx(Italic, { className: "w-4 h-4 stroke-[2.5]" })
626
- }
627
- ),
628
- /* @__PURE__ */ jsx(
629
- "button",
630
- {
631
- type: "button",
632
- onClick: (e) => {
633
- e.preventDefault();
634
- targetEditor.dispatchCommand(FORMAT_TEXT_COMMAND, "underline");
635
- },
636
- className: cn(
637
- "flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
638
- toolbarState.isUnderline ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
639
- ),
640
- "aria-label": "Underline",
641
- children: /* @__PURE__ */ jsx(Underline, { className: "w-4 h-4 stroke-[2.5]" })
642
- }
643
- ),
644
- /* @__PURE__ */ jsx(
645
- "button",
646
- {
647
- type: "button",
648
- onClick: (e) => {
649
- e.preventDefault();
650
- targetEditor.dispatchCommand(FORMAT_TEXT_COMMAND, "strikethrough");
651
- },
652
- className: cn(
653
- "flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
654
- toolbarState.isStrikethrough ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
655
- ),
656
- "aria-label": "Strikethrough",
657
- children: /* @__PURE__ */ jsx(Strikethrough, { className: "w-4 h-4 stroke-[2.5]" })
658
- }
659
- ),
660
- /* @__PURE__ */ jsx(
661
- "button",
662
- {
663
- type: "button",
664
- onClick: (e) => {
665
- e.preventDefault();
666
- targetEditor.dispatchCommand(FORMAT_TEXT_COMMAND, "code");
667
- },
668
- className: cn(
669
- "flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation font-mono",
670
- toolbarState.isCode ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
671
- ),
672
- "aria-label": "Inline Code",
673
- children: /* @__PURE__ */ jsx(Code, { className: "w-4 h-4 stroke-[2.5]" })
674
- }
675
- ),
676
- /* @__PURE__ */ jsx(
677
- "button",
678
- {
679
- type: "button",
680
- onClick: (e) => {
681
- e.preventDefault();
682
- handleInsertLink();
683
- },
684
- className: cn(
685
- "flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
686
- toolbarState.isLink ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
687
- ),
688
- "aria-label": "Link",
689
- children: /* @__PURE__ */ jsx(LinkIcon, { className: "w-4 h-4 stroke-[2.5]" })
690
- }
691
- ),
692
- /* @__PURE__ */ jsx("div", { className: "w-px h-5 bg-border/60 mx-0.5 flex-shrink-0" }),
693
- /* @__PURE__ */ jsx(
694
- "button",
695
- {
696
- type: "button",
697
- onClick: (e) => {
698
- e.preventDefault();
699
- formatHeading("h1");
700
- },
701
- className: cn(
702
- "flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
703
- toolbarState.blockType === "h1" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20 font-bold" : "text-muted-foreground hover:bg-muted"
704
- ),
705
- "aria-label": "Heading 1",
706
- children: /* @__PURE__ */ jsx(Heading1, { className: "w-4 h-4 stroke-[2.5]" })
707
- }
708
- ),
709
- /* @__PURE__ */ jsx(
710
- "button",
711
- {
712
- type: "button",
713
- onClick: (e) => {
714
- e.preventDefault();
715
- formatHeading("h2");
716
- },
717
- className: cn(
718
- "flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
719
- toolbarState.blockType === "h2" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20 font-bold" : "text-muted-foreground hover:bg-muted"
720
- ),
721
- "aria-label": "Heading 2",
722
- children: /* @__PURE__ */ jsx(Heading2, { className: "w-4 h-4 stroke-[2.5]" })
723
- }
724
- ),
725
- /* @__PURE__ */ jsx(
726
- "button",
727
- {
728
- type: "button",
729
- onClick: (e) => {
730
- e.preventDefault();
731
- formatHeading("h3");
732
- },
733
- className: cn(
734
- "flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
735
- toolbarState.blockType === "h3" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20 font-bold" : "text-muted-foreground hover:bg-muted"
736
- ),
737
- "aria-label": "Heading 3",
738
- children: /* @__PURE__ */ jsx(Heading3, { className: "w-4 h-4 stroke-[2.5]" })
739
- }
740
- ),
741
- /* @__PURE__ */ jsx("div", { className: "w-px h-5 bg-border/60 mx-0.5 flex-shrink-0" }),
742
- /* @__PURE__ */ jsx(
743
- "button",
744
- {
745
- type: "button",
746
- onClick: (e) => {
747
- e.preventDefault();
748
- targetEditor.dispatchCommand(INSERT_UNORDERED_LIST_COMMAND, void 0);
749
- },
750
- className: cn(
751
- "flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
752
- toolbarState.blockType === "bullet" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
753
- ),
754
- "aria-label": "Bullet list",
755
- children: /* @__PURE__ */ jsx(List, { className: "w-4 h-4 stroke-[2.5]" })
756
- }
757
- ),
758
- /* @__PURE__ */ jsx(
759
- "button",
760
- {
761
- type: "button",
762
- onClick: (e) => {
763
- e.preventDefault();
764
- targetEditor.dispatchCommand(INSERT_ORDERED_LIST_COMMAND, void 0);
765
- },
766
- className: cn(
767
- "flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
768
- toolbarState.blockType === "number" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
769
- ),
770
- "aria-label": "Numbered list",
771
- children: /* @__PURE__ */ jsx(ListOrdered, { className: "w-4 h-4 stroke-[2.5]" })
772
- }
773
- ),
774
- /* @__PURE__ */ jsx(
775
- "button",
776
- {
777
- type: "button",
778
- onClick: (e) => {
779
- e.preventDefault();
780
- targetEditor.dispatchCommand(INSERT_CHECK_LIST_COMMAND, void 0);
781
- },
782
- className: cn(
783
- "flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
784
- toolbarState.blockType === "check" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
785
- ),
786
- "aria-label": "Checklist",
787
- children: /* @__PURE__ */ jsx(CheckSquare, { className: "w-4 h-4 stroke-[2.5]" })
788
- }
789
- ),
790
- /* @__PURE__ */ jsx(
791
- "button",
792
- {
793
- type: "button",
794
- onClick: (e) => {
795
- e.preventDefault();
796
- formatQuote();
797
- },
798
- className: cn(
799
- "flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
800
- toolbarState.blockType === "quote" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
801
- ),
802
- "aria-label": "Quote",
803
- children: /* @__PURE__ */ jsx(Quote, { className: "w-4 h-4 stroke-[2.5]" })
804
- }
805
- ),
806
- /* @__PURE__ */ jsx("div", { className: "w-px h-5 bg-border/60 mx-0.5 flex-shrink-0" }),
807
- /* @__PURE__ */ jsx(
808
- "button",
809
- {
810
- type: "button",
811
- onClick: (e) => {
812
- e.preventDefault();
813
- targetEditor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "left");
814
- },
815
- className: cn(
816
- "flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
817
- toolbarState.elementFormat === "left" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
818
- ),
819
- "aria-label": "Align left",
820
- children: /* @__PURE__ */ jsx(AlignLeft, { className: "w-4 h-4 stroke-[2.5]" })
821
- }
822
- ),
823
- /* @__PURE__ */ jsx(
824
- "button",
825
- {
826
- type: "button",
827
- onClick: (e) => {
828
- e.preventDefault();
829
- targetEditor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "center");
830
- },
831
- className: cn(
832
- "flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
833
- toolbarState.elementFormat === "center" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
834
- ),
835
- "aria-label": "Align center",
836
- children: /* @__PURE__ */ jsx(AlignCenter, { className: "w-4 h-4 stroke-[2.5]" })
837
- }
838
- ),
839
- /* @__PURE__ */ jsx(
840
- "button",
841
- {
842
- type: "button",
843
- onClick: (e) => {
844
- e.preventDefault();
845
- targetEditor.dispatchCommand(FORMAT_ELEMENT_COMMAND, "right");
846
- },
847
- className: cn(
848
- "flex items-center justify-center min-w-[36px] h-9 rounded-xl transition-all active:scale-95 touch-manipulation",
849
- toolbarState.elementFormat === "right" ? "bg-primary text-primary-foreground shadow-md shadow-primary/20" : "text-muted-foreground hover:bg-muted"
850
- ),
851
- "aria-label": "Align right",
852
- children: /* @__PURE__ */ jsx(AlignRight, { className: "w-4 h-4 stroke-[2.5]" })
853
- }
854
- ),
855
- /* @__PURE__ */ jsx("div", { className: "w-px h-5 bg-border/60 mx-0.5 flex-shrink-0" }),
856
- /* @__PURE__ */ jsx(
857
- "button",
858
- {
859
- type: "button",
860
- onClick: (e) => {
861
- e.preventDefault();
862
- targetEditor.dispatchCommand(INSERT_COMMENT_COMMAND, void 0);
863
- },
864
- className: "flex items-center justify-center min-w-[36px] h-9 rounded-xl text-muted-foreground hover:bg-muted active:scale-95 transition-all touch-manipulation",
865
- "aria-label": "Add inline comment",
866
- children: /* @__PURE__ */ jsx(MessageSquarePlus, { className: "w-4 h-4" })
867
- }
868
- ),
869
- /* @__PURE__ */ jsx(
870
- "button",
871
- {
872
- type: "button",
873
- onClick: (e) => {
874
- e.preventDefault();
875
- if (typeof window !== "undefined") {
876
- window.dispatchEvent(
877
- new CustomEvent("notiq:open-import-export", {
878
- detail: { defaultTab: "export" }
879
- })
880
- );
881
- }
882
- },
883
- className: "flex items-center justify-center min-w-[36px] h-9 rounded-xl text-muted-foreground hover:bg-muted active:scale-95 transition-all touch-manipulation",
884
- "aria-label": "Import & Export document",
885
- title: "Import / Export",
886
- children: /* @__PURE__ */ jsx(ArrowDownUp, { className: "w-4 h-4" })
887
- }
888
- )
889
- ]
890
- }
891
- )
892
- ] }),
893
- activeTab === "insert" && /* @__PURE__ */ jsxs("div", { className: "px-3 py-2 space-y-2.5", children: [
894
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5 pb-1 overflow-x-auto no-scrollbar", children: ["all", "media", "blocks"].map((cat) => /* @__PURE__ */ jsx(
895
- "button",
896
- {
897
- type: "button",
898
- onClick: () => setInsertCategory(cat),
899
- className: cn(
900
- "px-3 py-1 rounded-full text-xs font-medium capitalize transition-all touch-manipulation",
901
- insertCategory === cat ? "bg-primary text-primary-foreground shadow-sm" : "bg-muted/60 text-muted-foreground hover:bg-muted"
902
- ),
903
- children: cat === "all" ? "All Blocks" : cat === "media" ? "Media & Files" : "Rich Blocks"
904
- },
905
- cat
906
- )) }),
907
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-2 max-h-[42dvh] overflow-y-auto pr-0.5", children: filteredBlocks.map((block) => {
908
- const Icon = block.icon;
909
- return /* @__PURE__ */ jsxs(
910
- "button",
911
- {
912
- type: "button",
913
- onClick: (e) => {
914
- e.preventDefault();
915
- block.action();
916
- },
917
- className: "flex items-center gap-2.5 p-2.5 rounded-xl bg-card hover:bg-muted/70 active:scale-97 transition-all touch-manipulation border border-border/50 text-left shadow-sm",
918
- children: [
919
- /* @__PURE__ */ jsx("div", { className: cn("flex items-center justify-center w-9 h-9 rounded-xl flex-shrink-0", block.color), children: /* @__PURE__ */ jsx(Icon, { className: "w-4 h-4" }) }),
920
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
921
- /* @__PURE__ */ jsx("div", { className: "text-xs font-semibold text-foreground truncate", children: block.label }),
922
- /* @__PURE__ */ jsx("div", { className: "text-[10px] text-muted-foreground truncate leading-tight mt-0.5", children: block.desc })
923
- ] })
924
- ]
925
- },
926
- block.id
927
- );
928
- }) })
929
- ] }),
930
- activeTab === "style" && /* @__PURE__ */ jsxs("div", { className: "px-3 py-2.5 space-y-3", children: [
931
- /* @__PURE__ */ jsxs("div", { children: [
932
- /* @__PURE__ */ jsx("div", { className: "text-[11px] font-semibold text-muted-foreground uppercase tracking-wider mb-1.5", children: "Text Color" }),
933
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 overflow-x-auto no-scrollbar", children: TEXT_COLORS.map((tc) => /* @__PURE__ */ jsxs(
934
- "button",
935
- {
936
- type: "button",
937
- onClick: () => applyColor(tc.color),
938
- className: "flex flex-col items-center gap-1 min-w-[44px] py-1 rounded-lg hover:bg-muted active:scale-95 transition-all touch-manipulation",
939
- children: [
940
- /* @__PURE__ */ jsx(
941
- "span",
942
- {
943
- className: cn("w-6 h-6 rounded-full border border-border/60 shadow-sm flex items-center justify-center", tc.bg)
944
- }
945
- ),
946
- /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground font-medium", children: tc.label })
947
- ]
948
- },
949
- tc.label
950
- )) })
951
- ] }),
952
- /* @__PURE__ */ jsxs("div", { children: [
953
- /* @__PURE__ */ jsx("div", { className: "text-[11px] font-semibold text-muted-foreground uppercase tracking-wider mb-1.5", children: "Highlight Background" }),
954
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 overflow-x-auto no-scrollbar", children: HIGHLIGHT_COLORS.map((hc) => /* @__PURE__ */ jsxs(
955
- "button",
956
- {
957
- type: "button",
958
- onClick: () => applyHighlight(hc.color),
959
- className: "flex flex-col items-center gap-1 min-w-[44px] py-1 rounded-lg hover:bg-muted active:scale-95 transition-all touch-manipulation",
960
- children: [
961
- /* @__PURE__ */ jsx(
962
- "span",
963
- {
964
- className: cn("w-6 h-6 rounded-lg border shadow-sm flex items-center justify-center", hc.bg || "bg-transparent", hc.border),
965
- children: hc.color === "transparent" && /* @__PURE__ */ jsx(Eraser, { className: "w-3 h-3 text-muted-foreground" })
966
- }
967
- ),
968
- /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground font-medium", children: hc.label })
969
- ]
970
- },
971
- hc.label
972
- )) })
973
- ] })
974
- ] })
975
- ]
976
- }
977
- )
978
- }
979
- )
980
- ] });
981
- }
982
- export {
983
- MobileToolbar as default
984
- };