mtxuilib 0.0.308 → 0.0.310

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 (273) hide show
  1. package/dist/App.cjs +17 -1
  2. package/dist/MtmButton.cjs +2 -1
  3. package/dist/NovelEditorLoader.cjs +8 -4
  4. package/dist/browser/index.min.js +2 -1
  5. package/dist/common/FullCenter.cjs +2 -1
  6. package/dist/common/MtImage.cjs +2 -1
  7. package/dist/common/mtlink.cjs +2 -1
  8. package/dist/common/table/cells/ExpenderCell.cjs +9 -4
  9. package/dist/common/table/cells/SelectCell.cjs +8 -4
  10. package/dist/common/table/cells/Text.cjs +2 -1
  11. package/dist/common/table/cells/ViewLink.cjs +8 -4
  12. package/dist/common/table/cells/container/cellWrapper.cjs +2 -1
  13. package/dist/common/table/cells/number.cjs +2 -1
  14. package/dist/common/table/cells/string.cjs +2 -1
  15. package/dist/common/table/data-table-pagination.cjs +89 -51
  16. package/dist/common/table/data-table-view-options.cjs +32 -22
  17. package/dist/common/tailwind-indicator.cjs +9 -1
  18. package/dist/entry-client.cjs +2 -1
  19. package/dist/entry-server.cjs +2 -1
  20. package/dist/esm/App.js +17 -1
  21. package/dist/esm/MtmButton.js +2 -1
  22. package/dist/esm/NovelEditorLoader.js +8 -4
  23. package/dist/esm/common/FullCenter.js +2 -1
  24. package/dist/esm/common/MtImage.js +2 -1
  25. package/dist/esm/common/mtlink.js +2 -1
  26. package/dist/esm/common/table/cells/ExpenderCell.js +9 -4
  27. package/dist/esm/common/table/cells/SelectCell.js +8 -4
  28. package/dist/esm/common/table/cells/Text.js +2 -1
  29. package/dist/esm/common/table/cells/ViewLink.js +8 -4
  30. package/dist/esm/common/table/cells/container/cellWrapper.js +2 -1
  31. package/dist/esm/common/table/cells/number.js +2 -1
  32. package/dist/esm/common/table/cells/string.js +2 -1
  33. package/dist/esm/common/table/data-table-pagination.js +89 -51
  34. package/dist/esm/common/table/data-table-view-options.js +32 -22
  35. package/dist/esm/common/tailwind-indicator.js +9 -1
  36. package/dist/esm/entry-client.js +2 -1
  37. package/dist/esm/entry-server.js +2 -1
  38. package/dist/esm/icons/icons.js +41 -31
  39. package/dist/esm/index.js +2 -1
  40. package/dist/esm/lib/connectquery/use-transport.js +2 -1
  41. package/dist/esm/lib/render copy.js +2 -1
  42. package/dist/esm/lib/render.js +2 -1
  43. package/dist/esm/store/MtConnectProvider.js +2 -1
  44. package/dist/esm/store/ReactQueryProvider.js +18 -10
  45. package/dist/esm/store/StorybookDecorator.js +5 -4
  46. package/dist/esm/store/appContext.js +28 -18
  47. package/dist/esm/store/hydrateCore.js +6 -5
  48. package/dist/esm/store/logger.context.js +3 -2
  49. package/dist/esm/store/pageMeta.js +5 -1
  50. package/dist/esm/tailwind.d.cts +88 -1
  51. package/dist/esm/ui/accordion.js +19 -11
  52. package/dist/esm/ui/alert copy.js +4 -3
  53. package/dist/esm/ui/alert-dialog.js +21 -17
  54. package/dist/esm/ui/alert.js +4 -3
  55. package/dist/esm/ui/avatar.js +4 -3
  56. package/dist/esm/ui/badge.js +2 -2
  57. package/dist/esm/ui/button.js +2 -1
  58. package/dist/esm/ui/calendar.js +4 -4
  59. package/dist/esm/ui/card.js +7 -6
  60. package/dist/esm/ui/checkbox.js +15 -10
  61. package/dist/esm/ui/command.js +25 -18
  62. package/dist/esm/ui/context-menu.js +35 -22
  63. package/dist/esm/ui/dialog.js +30 -17
  64. package/dist/esm/ui/drawer.js +28 -18
  65. package/dist/esm/ui/dropdown-menu.js +35 -22
  66. package/dist/esm/ui/form copy.js +14 -9
  67. package/dist/esm/ui/form.js +14 -9
  68. package/dist/esm/ui/hover-card.js +2 -1
  69. package/dist/esm/ui/input.js +2 -1
  70. package/dist/esm/ui/label.js +2 -1
  71. package/dist/esm/ui/menubar.js +37 -24
  72. package/dist/esm/ui/navigation-menu.js +36 -25
  73. package/dist/esm/ui/novel/novel/src/components/editor-bubble-item.js +2 -1
  74. package/dist/esm/ui/novel/novel/src/components/editor-bubble.js +5 -1
  75. package/dist/esm/ui/novel/novel/src/components/editor-command-item.js +5 -4
  76. package/dist/esm/ui/novel/novel/src/components/editor-command.js +21 -14
  77. package/dist/esm/ui/novel/novel/src/components/editor.js +7 -6
  78. package/dist/esm/ui/novel/novel/src/extensions/image-resizer.js +2 -1
  79. package/dist/esm/ui/novel/tailwind/advanced-editor.js +58 -35
  80. package/dist/esm/ui/novel/tailwind/generative/ai-completion-command.js +45 -30
  81. package/dist/esm/ui/novel/tailwind/generative/ai-selector-commands.js +37 -28
  82. package/dist/esm/ui/novel/tailwind/generative/ai-selector.js +58 -43
  83. package/dist/esm/ui/novel/tailwind/generative/generative-menu-switch.js +23 -15
  84. package/dist/esm/ui/novel/tailwind/selectors/color-selector.js +78 -55
  85. package/dist/esm/ui/novel/tailwind/selectors/link-selector.js +58 -50
  86. package/dist/esm/ui/novel/tailwind/selectors/node-selector.js +31 -19
  87. package/dist/esm/ui/novel/tailwind/selectors/text-buttons.js +13 -12
  88. package/dist/esm/ui/novel/tailwind/slash-command.js +12 -11
  89. package/dist/esm/ui/novel/tailwind/ui/button.js +2 -1
  90. package/dist/esm/ui/novel/tailwind/ui/command.js +25 -18
  91. package/dist/esm/ui/novel/tailwind/ui/dialog.js +30 -17
  92. package/dist/esm/ui/novel/tailwind/ui/icons/crazy-spinner.js +6 -1
  93. package/dist/esm/ui/novel/tailwind/ui/icons/font-default.js +20 -17
  94. package/dist/esm/ui/novel/tailwind/ui/icons/font-mono.js +20 -17
  95. package/dist/esm/ui/novel/tailwind/ui/icons/font-serif.js +20 -17
  96. package/dist/esm/ui/novel/tailwind/ui/icons/github.js +5 -4
  97. package/dist/esm/ui/novel/tailwind/ui/icons/loading-circle.js +20 -17
  98. package/dist/esm/ui/novel/tailwind/ui/icons/magic.js +27 -24
  99. package/dist/esm/ui/novel/tailwind/ui/menu.js +28 -16
  100. package/dist/esm/ui/novel/tailwind/ui/popover.js +3 -2
  101. package/dist/esm/ui/novel/tailwind/ui/scroll-area.js +18 -10
  102. package/dist/esm/ui/novel/tailwind/ui/separator.js +2 -1
  103. package/dist/esm/ui/pagination.js +32 -19
  104. package/dist/esm/ui/popover.js +3 -2
  105. package/dist/esm/ui/progress.js +15 -10
  106. package/dist/esm/ui/radio-group.js +7 -5
  107. package/dist/esm/ui/resizable.js +10 -5
  108. package/dist/esm/ui/scroll-area.js +26 -18
  109. package/dist/esm/ui/select.js +37 -26
  110. package/dist/esm/ui/separator.js +2 -1
  111. package/dist/esm/ui/sheet.js +24 -14
  112. package/dist/esm/ui/skeleton.js +2 -1
  113. package/dist/esm/ui/slider.js +12 -5
  114. package/dist/esm/ui/sonner.js +2 -1
  115. package/dist/esm/ui/switch.js +12 -11
  116. package/dist/esm/ui/table.js +10 -9
  117. package/dist/esm/ui/tabs.js +4 -3
  118. package/dist/esm/ui/textarea.js +2 -1
  119. package/dist/esm/ui/toast.js +14 -9
  120. package/dist/esm/ui/toaster.js +18 -4
  121. package/dist/esm/ui/toggle.js +2 -1
  122. package/dist/esm/ui/tooltip.js +2 -1
  123. package/dist/esm/ui/ui-mt/NavTag.js +5 -4
  124. package/dist/esm/ui/ui-mt/SimpleModel.js +12 -11
  125. package/dist/esm/ui/ui-mt/inputField/InputField.js +27 -20
  126. package/dist/esm/ui/ui-mt/inputField/SingleUploadForm.js +67 -56
  127. package/dist/esm/ui/ui-mt/inputField/TextArea.js +20 -16
  128. package/dist/esm/ui/ui-mt/inputField/TextFileInput.js +18 -15
  129. package/dist/esm/ui/ui-mt/inputField/select/InputSelect.js +35 -27
  130. package/dist/esm/ui/ui-mt/inputs/SearchInput.js +2 -1
  131. package/dist/esm/ui/ui-mt/inputs/searchBar.js +12 -8
  132. package/dist/esm/ui/ui-mt/skeleton/skeleton-card.js +9 -4
  133. package/dist/esm/ui/ui-mt/skeleton/skeleton2.js +5 -1
  134. package/dist/esm/ui/ui-mt/skeleton/skeletons.js +9 -1
  135. package/dist/esm/ui/ui-vamp/alert.js +30 -24
  136. package/dist/esm/ui/ui-vamp/avatar.js +12 -7
  137. package/dist/esm/ui/ui-vamp/button.js +2 -1
  138. package/dist/esm/ui/ui-vamp/card.js +15 -8
  139. package/dist/esm/ui/ui-vamp/checkbox.js +15 -8
  140. package/dist/esm/ui/ui-vamp/chip.js +2 -1
  141. package/dist/esm/ui/ui-vamp/dropdown.js +7 -6
  142. package/dist/esm/ui/ui-vamp/external-link.js +9 -4
  143. package/dist/esm/ui/ui-vamp/headline.js +5 -1
  144. package/dist/esm/ui/ui-vamp/input.js +3 -2
  145. package/dist/esm/ui/ui-vamp/keyvalue.js +5 -1
  146. package/dist/esm/ui/ui-vamp/label.js +2 -1
  147. package/dist/esm/ui/ui-vamp/mobile-nav-button.js +6 -5
  148. package/dist/esm/ui/ui-vamp/modal.js +17 -13
  149. package/dist/esm/ui/ui-vamp/pagination.js +57 -35
  150. package/dist/esm/ui/ui-vamp/scroll-area.js +5 -4
  151. package/dist/esm/ui/ui-vamp/skeleton.js +2 -2
  152. package/dist/esm/ui/ui-vamp/stripe-not-connected-modal.js +13 -2
  153. package/dist/esm/ui/ui-vamp/textarea.js +12 -8
  154. package/dist/esm/ui/ui-vamp/toggle-group.js +3 -2
  155. package/dist/icons/icons.cjs +41 -31
  156. package/dist/index.cjs +2 -1
  157. package/dist/lib/connectquery/use-transport.cjs +2 -1
  158. package/dist/lib/render copy.cjs +2 -1
  159. package/dist/lib/render.cjs +2 -1
  160. package/dist/store/MtConnectProvider.cjs +2 -1
  161. package/dist/store/ReactQueryProvider.cjs +18 -10
  162. package/dist/store/StorybookDecorator.cjs +5 -4
  163. package/dist/store/appContext.cjs +28 -28
  164. package/dist/store/hydrateCore.cjs +6 -5
  165. package/dist/store/logger.context.cjs +3 -2
  166. package/dist/store/pageMeta.cjs +5 -1
  167. package/dist/tailwind.cjs +72 -2
  168. package/dist/tsconfig.type.tsbuildinfo +1 -1
  169. package/dist/ui/accordion.cjs +19 -11
  170. package/dist/ui/alert copy.cjs +4 -3
  171. package/dist/ui/alert-dialog.cjs +21 -17
  172. package/dist/ui/alert.cjs +4 -3
  173. package/dist/ui/avatar.cjs +4 -3
  174. package/dist/ui/badge.cjs +2 -12
  175. package/dist/ui/button.cjs +2 -1
  176. package/dist/ui/calendar.cjs +4 -14
  177. package/dist/ui/card.cjs +7 -6
  178. package/dist/ui/checkbox.cjs +15 -10
  179. package/dist/ui/command.cjs +25 -18
  180. package/dist/ui/context-menu.cjs +35 -22
  181. package/dist/ui/dialog.cjs +30 -17
  182. package/dist/ui/drawer.cjs +28 -18
  183. package/dist/ui/dropdown-menu.cjs +35 -22
  184. package/dist/ui/form copy.cjs +14 -9
  185. package/dist/ui/form.cjs +14 -9
  186. package/dist/ui/hover-card.cjs +2 -1
  187. package/dist/ui/input.cjs +2 -1
  188. package/dist/ui/label.cjs +2 -1
  189. package/dist/ui/menubar.cjs +37 -24
  190. package/dist/ui/navigation-menu.cjs +36 -25
  191. package/dist/ui/novel/novel/src/components/editor-bubble-item.cjs +2 -1
  192. package/dist/ui/novel/novel/src/components/editor-bubble.cjs +5 -1
  193. package/dist/ui/novel/novel/src/components/editor-command-item.cjs +5 -4
  194. package/dist/ui/novel/novel/src/components/editor-command.cjs +21 -14
  195. package/dist/ui/novel/novel/src/components/editor.cjs +7 -6
  196. package/dist/ui/novel/novel/src/extensions/image-resizer.cjs +2 -1
  197. package/dist/ui/novel/tailwind/advanced-editor.cjs +58 -35
  198. package/dist/ui/novel/tailwind/generative/ai-completion-command.cjs +45 -30
  199. package/dist/ui/novel/tailwind/generative/ai-selector-commands.cjs +37 -28
  200. package/dist/ui/novel/tailwind/generative/ai-selector.cjs +58 -43
  201. package/dist/ui/novel/tailwind/generative/generative-menu-switch.cjs +23 -15
  202. package/dist/ui/novel/tailwind/selectors/color-selector.cjs +78 -55
  203. package/dist/ui/novel/tailwind/selectors/link-selector.cjs +58 -50
  204. package/dist/ui/novel/tailwind/selectors/node-selector.cjs +31 -19
  205. package/dist/ui/novel/tailwind/selectors/text-buttons.cjs +13 -12
  206. package/dist/ui/novel/tailwind/slash-command.cjs +12 -11
  207. package/dist/ui/novel/tailwind/ui/button.cjs +2 -1
  208. package/dist/ui/novel/tailwind/ui/command.cjs +25 -18
  209. package/dist/ui/novel/tailwind/ui/dialog.cjs +30 -17
  210. package/dist/ui/novel/tailwind/ui/icons/crazy-spinner.cjs +6 -1
  211. package/dist/ui/novel/tailwind/ui/icons/font-default.cjs +20 -17
  212. package/dist/ui/novel/tailwind/ui/icons/font-mono.cjs +20 -17
  213. package/dist/ui/novel/tailwind/ui/icons/font-serif.cjs +20 -17
  214. package/dist/ui/novel/tailwind/ui/icons/github.cjs +5 -4
  215. package/dist/ui/novel/tailwind/ui/icons/loading-circle.cjs +20 -17
  216. package/dist/ui/novel/tailwind/ui/icons/magic.cjs +27 -24
  217. package/dist/ui/novel/tailwind/ui/menu.cjs +28 -16
  218. package/dist/ui/novel/tailwind/ui/popover.cjs +3 -2
  219. package/dist/ui/novel/tailwind/ui/scroll-area.cjs +18 -10
  220. package/dist/ui/novel/tailwind/ui/separator.cjs +2 -1
  221. package/dist/ui/pagination.cjs +32 -19
  222. package/dist/ui/popover.cjs +3 -2
  223. package/dist/ui/progress.cjs +15 -10
  224. package/dist/ui/radio-group.cjs +7 -5
  225. package/dist/ui/resizable.cjs +10 -5
  226. package/dist/ui/scroll-area.cjs +26 -18
  227. package/dist/ui/select.cjs +37 -26
  228. package/dist/ui/separator.cjs +2 -1
  229. package/dist/ui/sheet.cjs +24 -14
  230. package/dist/ui/skeleton.cjs +2 -1
  231. package/dist/ui/slider.cjs +12 -5
  232. package/dist/ui/sonner.cjs +2 -1
  233. package/dist/ui/switch.cjs +12 -11
  234. package/dist/ui/table.cjs +10 -9
  235. package/dist/ui/tabs.cjs +4 -3
  236. package/dist/ui/textarea.cjs +2 -1
  237. package/dist/ui/toast.cjs +14 -9
  238. package/dist/ui/toaster.cjs +18 -4
  239. package/dist/ui/toggle.cjs +2 -1
  240. package/dist/ui/tooltip.cjs +2 -1
  241. package/dist/ui/ui-mt/NavTag.cjs +5 -4
  242. package/dist/ui/ui-mt/SimpleModel.cjs +12 -11
  243. package/dist/ui/ui-mt/inputField/InputField.cjs +27 -20
  244. package/dist/ui/ui-mt/inputField/SingleUploadForm.cjs +67 -56
  245. package/dist/ui/ui-mt/inputField/TextArea.cjs +20 -16
  246. package/dist/ui/ui-mt/inputField/TextFileInput.cjs +18 -25
  247. package/dist/ui/ui-mt/inputField/select/InputSelect.cjs +35 -27
  248. package/dist/ui/ui-mt/inputs/SearchInput.cjs +2 -1
  249. package/dist/ui/ui-mt/inputs/searchBar.cjs +12 -8
  250. package/dist/ui/ui-mt/skeleton/skeleton-card.cjs +9 -4
  251. package/dist/ui/ui-mt/skeleton/skeleton2.cjs +5 -1
  252. package/dist/ui/ui-mt/skeleton/skeletons.cjs +9 -1
  253. package/dist/ui/ui-vamp/alert.cjs +30 -24
  254. package/dist/ui/ui-vamp/avatar.cjs +12 -7
  255. package/dist/ui/ui-vamp/button.cjs +2 -1
  256. package/dist/ui/ui-vamp/card.cjs +15 -18
  257. package/dist/ui/ui-vamp/checkbox.cjs +15 -8
  258. package/dist/ui/ui-vamp/chip.cjs +2 -1
  259. package/dist/ui/ui-vamp/dropdown.cjs +7 -6
  260. package/dist/ui/ui-vamp/external-link.cjs +9 -4
  261. package/dist/ui/ui-vamp/headline.cjs +5 -1
  262. package/dist/ui/ui-vamp/input.cjs +3 -2
  263. package/dist/ui/ui-vamp/keyvalue.cjs +5 -1
  264. package/dist/ui/ui-vamp/label.cjs +2 -1
  265. package/dist/ui/ui-vamp/mobile-nav-button.cjs +6 -5
  266. package/dist/ui/ui-vamp/modal.cjs +17 -13
  267. package/dist/ui/ui-vamp/pagination.cjs +57 -35
  268. package/dist/ui/ui-vamp/scroll-area.cjs +5 -4
  269. package/dist/ui/ui-vamp/skeleton.cjs +2 -12
  270. package/dist/ui/ui-vamp/stripe-not-connected-modal.cjs +13 -2
  271. package/dist/ui/ui-vamp/textarea.cjs +12 -8
  272. package/dist/ui/ui-vamp/toggle-group.cjs +3 -2
  273. package/package.json +5 -4
@@ -31,6 +31,7 @@ __export(image_resizer_exports, {
31
31
  ImageResizer: () => ImageResizer
32
32
  });
33
33
  module.exports = __toCommonJS(image_resizer_exports);
34
+ var import_jsx_runtime = require("react/jsx-runtime");
34
35
  var import_react_moveable = __toESM(require("react-moveable"), 1);
35
36
  var import_react = require("@tiptap/react");
36
37
  const ImageResizer = () => {
@@ -52,7 +53,7 @@ const ImageResizer = () => {
52
53
  editor.commands.setNodeSelection(selection.from);
53
54
  }
54
55
  };
55
- return /* @__PURE__ */ React.createElement(
56
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
56
57
  import_react_moveable.default,
57
58
  {
58
59
  target: document.querySelector(".ProseMirror-selectednode"),
@@ -52,6 +52,7 @@ __export(advanced_editor_exports, {
52
52
  TailwindAdvancedEditor: () => TailwindAdvancedEditor
53
53
  });
54
54
  module.exports = __toCommonJS(advanced_editor_exports);
55
+ var import_jsx_runtime = require("react/jsx-runtime");
55
56
  var import_react = require("react");
56
57
  var import_use_debounce = require("use-debounce");
57
58
  var import_extensions = require("./extensions");
@@ -94,43 +95,65 @@ const TailwindAdvancedEditor = () => {
94
95
  }, []);
95
96
  if (!initialContent)
96
97
  return null;
97
- return /* @__PURE__ */ React.createElement("div", { className: "relative w-full max-w-screen-lg" }, /* @__PURE__ */ React.createElement("div", { className: "bg-accent text-muted-foreground absolute right-5 top-5 z-10 mb-5 rounded-lg px-2 py-1 text-sm" }, saveStatus), /* @__PURE__ */ React.createElement(import_components.EditorRoot, null, /* @__PURE__ */ React.createElement(
98
- import_components.EditorContent,
99
- {
100
- initialContent,
101
- extensions,
102
- className: "border-muted bg-background relative min-h-[500px] w-full max-w-screen-lg sm:mb-[calc(20vh)] sm:rounded-lg sm:border sm:shadow-lg",
103
- editorProps: {
104
- handleDOMEvents: {
105
- keydown: (_view, event) => (0, import_extensions2.handleCommandNavigation)(event)
106
- },
107
- handlePaste: (view, event) => (0, import_plugins.handleImagePaste)(view, event, import_image_upload.uploadFn),
108
- handleDrop: (view, event, _slice, moved) => (0, import_plugins.handleImageDrop)(view, event, moved, import_image_upload.uploadFn),
109
- attributes: {
110
- class: `prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full`
111
- }
112
- },
113
- onUpdate: ({ editor }) => {
114
- debouncedUpdates(editor);
115
- setSaveStatus("Unsaved");
116
- },
117
- slotAfter: /* @__PURE__ */ React.createElement(import_extensions2.ImageResizer, null)
118
- },
119
- /* @__PURE__ */ React.createElement(import_components.EditorCommand, { className: "border-muted bg-background z-50 h-auto max-h-[330px] overflow-y-auto rounded-md border px-1 py-2 shadow-md transition-all" }, /* @__PURE__ */ React.createElement(import_components.EditorCommandEmpty, { className: "text-muted-foreground px-2" }, "No results"), /* @__PURE__ */ React.createElement(import_components.EditorCommandList, null, import_slash_command.suggestionItems.map((item) => /* @__PURE__ */ React.createElement(
120
- import_components.EditorCommandItem,
98
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative w-full max-w-screen-lg", children: [
99
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "bg-accent text-muted-foreground absolute right-5 top-5 z-10 mb-5 rounded-lg px-2 py-1 text-sm", children: saveStatus }),
100
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.EditorRoot, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
101
+ import_components.EditorContent,
121
102
  {
122
- value: item.title,
123
- onCommand: (val) => {
124
- item.command && item.command(val);
103
+ initialContent,
104
+ extensions,
105
+ className: "border-muted bg-background relative min-h-[500px] w-full max-w-screen-lg sm:mb-[calc(20vh)] sm:rounded-lg sm:border sm:shadow-lg",
106
+ editorProps: {
107
+ handleDOMEvents: {
108
+ keydown: (_view, event) => (0, import_extensions2.handleCommandNavigation)(event)
109
+ },
110
+ handlePaste: (view, event) => (0, import_plugins.handleImagePaste)(view, event, import_image_upload.uploadFn),
111
+ handleDrop: (view, event, _slice, moved) => (0, import_plugins.handleImageDrop)(view, event, moved, import_image_upload.uploadFn),
112
+ attributes: {
113
+ class: `prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full`
114
+ }
115
+ },
116
+ onUpdate: ({ editor }) => {
117
+ debouncedUpdates(editor);
118
+ setSaveStatus("Unsaved");
125
119
  },
126
- className: `hover:bg-accent aria-selected:bg-accent flex w-full items-center space-x-2 rounded-md px-2 py-1 text-left text-sm `,
127
- key: item.title
128
- },
129
- /* @__PURE__ */ React.createElement("div", { className: "border-muted bg-background flex h-10 w-10 items-center justify-center rounded-md border" }, item.icon),
130
- /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("p", { className: "font-medium" }, item.title), /* @__PURE__ */ React.createElement("p", { className: "text-muted-foreground text-xs" }, item.description))
131
- )))),
132
- /* @__PURE__ */ React.createElement(import_generative_menu_switch.default, { open: openAI, onOpenChange: setOpenAI }, /* @__PURE__ */ React.createElement(import_separator.Separator, { orientation: "vertical" }), /* @__PURE__ */ React.createElement(import_node_selector.NodeSelector, { open: openNode, onOpenChange: setOpenNode }), /* @__PURE__ */ React.createElement(import_separator.Separator, { orientation: "vertical" }), /* @__PURE__ */ React.createElement(import_link_selector.LinkSelector, { open: openLink, onOpenChange: setOpenLink }), /* @__PURE__ */ React.createElement(import_separator.Separator, { orientation: "vertical" }), /* @__PURE__ */ React.createElement(import_text_buttons.TextButtons, null), /* @__PURE__ */ React.createElement(import_separator.Separator, { orientation: "vertical" }), /* @__PURE__ */ React.createElement(import_color_selector.ColorSelector, { open: openColor, onOpenChange: setOpenColor }))
133
- )));
120
+ slotAfter: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_extensions2.ImageResizer, {}),
121
+ children: [
122
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.EditorCommand, { className: "border-muted bg-background z-50 h-auto max-h-[330px] overflow-y-auto rounded-md border px-1 py-2 shadow-md transition-all", children: [
123
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.EditorCommandEmpty, { className: "text-muted-foreground px-2", children: "No results" }),
124
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.EditorCommandList, { children: import_slash_command.suggestionItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
125
+ import_components.EditorCommandItem,
126
+ {
127
+ value: item.title,
128
+ onCommand: (val) => {
129
+ item.command && item.command(val);
130
+ },
131
+ className: `hover:bg-accent aria-selected:bg-accent flex w-full items-center space-x-2 rounded-md px-2 py-1 text-left text-sm `,
132
+ children: [
133
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "border-muted bg-background flex h-10 w-10 items-center justify-center rounded-md border", children: item.icon }),
134
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
135
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-medium", children: item.title }),
136
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-muted-foreground text-xs", children: item.description })
137
+ ] })
138
+ ]
139
+ },
140
+ item.title
141
+ )) })
142
+ ] }),
143
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_generative_menu_switch.default, { open: openAI, onOpenChange: setOpenAI, children: [
144
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_separator.Separator, { orientation: "vertical" }),
145
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_node_selector.NodeSelector, { open: openNode, onOpenChange: setOpenNode }),
146
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_separator.Separator, { orientation: "vertical" }),
147
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link_selector.LinkSelector, { open: openLink, onOpenChange: setOpenLink }),
148
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_separator.Separator, { orientation: "vertical" }),
149
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_text_buttons.TextButtons, {}),
150
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_separator.Separator, { orientation: "vertical" }),
151
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_color_selector.ColorSelector, { open: openColor, onOpenChange: setOpenColor })
152
+ ] })
153
+ ]
154
+ }
155
+ ) })
156
+ ] });
134
157
  };
135
158
  // Annotate the CommonJS export names for ESM import in node:
136
159
  0 && (module.exports = {
@@ -21,6 +21,7 @@ __export(ai_completion_command_exports, {
21
21
  default: () => ai_completion_command_default
22
22
  });
23
23
  module.exports = __toCommonJS(ai_completion_command_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
24
25
  var import_lucide_react = require("lucide-react");
25
26
  var import_command = require("../ui/command");
26
27
  var import_components = require("../../novel/src/components");
@@ -32,36 +33,50 @@ const AICompletionCommands = ({
32
33
  if (!editor) {
33
34
  return null;
34
35
  }
35
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(import_command.CommandGroup, null, /* @__PURE__ */ React.createElement(
36
- import_command.CommandItem,
37
- {
38
- className: "gap-2 px-4",
39
- value: "replace",
40
- onSelect: () => {
41
- const selection = editor.view.state.selection;
42
- editor.chain().focus().insertContentAt(
43
- {
44
- from: selection.from,
45
- to: selection.to
36
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
37
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_command.CommandGroup, { children: [
38
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
39
+ import_command.CommandItem,
40
+ {
41
+ className: "gap-2 px-4",
42
+ value: "replace",
43
+ onSelect: () => {
44
+ const selection = editor.view.state.selection;
45
+ editor.chain().focus().insertContentAt(
46
+ {
47
+ from: selection.from,
48
+ to: selection.to
49
+ },
50
+ completion
51
+ ).run();
46
52
  },
47
- completion
48
- ).run();
49
- }
50
- },
51
- /* @__PURE__ */ React.createElement(import_lucide_react.Check, { className: "text-muted-foreground h-4 w-4" }),
52
- "Replace selection"
53
- ), /* @__PURE__ */ React.createElement(
54
- import_command.CommandItem,
55
- {
56
- className: "gap-2 px-4",
57
- value: "insert",
58
- onSelect: () => {
59
- const selection = editor.view.state.selection;
60
- editor.chain().focus().insertContentAt(selection.to + 1, completion).run();
61
- }
62
- },
63
- /* @__PURE__ */ React.createElement(import_lucide_react.TextQuote, { className: "text-muted-foreground h-4 w-4" }),
64
- "Insert below"
65
- )), /* @__PURE__ */ React.createElement(import_command.CommandSeparator, null), /* @__PURE__ */ React.createElement(import_command.CommandGroup, null, /* @__PURE__ */ React.createElement(import_command.CommandItem, { onSelect: onDiscard, value: "thrash", className: "gap-2 px-4" }, /* @__PURE__ */ React.createElement(import_lucide_react.TrashIcon, { className: "text-muted-foreground h-4 w-4" }), "Discard")));
53
+ children: [
54
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Check, { className: "text-muted-foreground h-4 w-4" }),
55
+ "Replace selection"
56
+ ]
57
+ }
58
+ ),
59
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
60
+ import_command.CommandItem,
61
+ {
62
+ className: "gap-2 px-4",
63
+ value: "insert",
64
+ onSelect: () => {
65
+ const selection = editor.view.state.selection;
66
+ editor.chain().focus().insertContentAt(selection.to + 1, completion).run();
67
+ },
68
+ children: [
69
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.TextQuote, { className: "text-muted-foreground h-4 w-4" }),
70
+ "Insert below"
71
+ ]
72
+ }
73
+ )
74
+ ] }),
75
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_command.CommandSeparator, {}),
76
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_command.CommandGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_command.CommandItem, { onSelect: onDiscard, value: "thrash", className: "gap-2 px-4", children: [
77
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.TrashIcon, { className: "text-muted-foreground h-4 w-4" }),
78
+ "Discard"
79
+ ] }) })
80
+ ] });
66
81
  };
67
82
  var ai_completion_command_default = AICompletionCommands;
@@ -21,6 +21,7 @@ __export(ai_selector_commands_exports, {
21
21
  default: () => ai_selector_commands_default
22
22
  });
23
23
  module.exports = __toCommonJS(ai_selector_commands_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
24
25
  var import_lucide_react = require("lucide-react");
25
26
  var import_extensions = require("../../novel/src/extensions");
26
27
  var import_command = require("../ui/command");
@@ -51,34 +52,42 @@ const AISelectorCommands = ({ onSelect }) => {
51
52
  const { editor } = (0, import_components.useEditor)();
52
53
  if (!editor)
53
54
  return null;
54
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(import_command.CommandGroup, { heading: "Edit or review selection" }, options.map((option) => /* @__PURE__ */ React.createElement(
55
- import_command.CommandItem,
56
- {
57
- onSelect: (value) => {
58
- const slice = editor.state.selection.content();
59
- const text = editor.storage.markdown.serializer.serialize(
60
- slice.content
61
- );
62
- onSelect(text, value);
55
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
56
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_command.CommandGroup, { heading: "Edit or review selection", children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
57
+ import_command.CommandItem,
58
+ {
59
+ onSelect: (value) => {
60
+ const slice = editor.state.selection.content();
61
+ const text = editor.storage.markdown.serializer.serialize(
62
+ slice.content
63
+ );
64
+ onSelect(text, value);
65
+ },
66
+ className: "flex gap-2 px-4",
67
+ value: option.value,
68
+ children: [
69
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(option.icon, { className: "h-4 w-4 text-purple-500" }),
70
+ option.label
71
+ ]
63
72
  },
64
- className: "flex gap-2 px-4",
65
- key: option.value,
66
- value: option.value
67
- },
68
- /* @__PURE__ */ React.createElement(option.icon, { className: "h-4 w-4 text-purple-500" }),
69
- option.label
70
- ))), /* @__PURE__ */ React.createElement(import_command.CommandSeparator, null), /* @__PURE__ */ React.createElement(import_command.CommandGroup, { heading: "Use AI to do more" }, /* @__PURE__ */ React.createElement(
71
- import_command.CommandItem,
72
- {
73
- onSelect: () => {
74
- const text = (0, import_extensions.getPrevText)(editor, { chars: 5e3 });
75
- onSelect(text, "continue");
76
- },
77
- value: "continue",
78
- className: "gap-2 px-4"
79
- },
80
- /* @__PURE__ */ React.createElement(import_lucide_react.StepForward, { className: "h-4 w-4 text-purple-500" }),
81
- "Continue writing"
82
- )));
73
+ option.value
74
+ )) }),
75
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_command.CommandSeparator, {}),
76
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_command.CommandGroup, { heading: "Use AI to do more", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
77
+ import_command.CommandItem,
78
+ {
79
+ onSelect: () => {
80
+ const text = (0, import_extensions.getPrevText)(editor, { chars: 5e3 });
81
+ onSelect(text, "continue");
82
+ },
83
+ value: "continue",
84
+ className: "gap-2 px-4",
85
+ children: [
86
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.StepForward, { className: "h-4 w-4 text-purple-500" }),
87
+ "Continue writing"
88
+ ]
89
+ }
90
+ ) })
91
+ ] });
83
92
  };
84
93
  var ai_selector_commands_default = AISelectorCommands;
@@ -32,6 +32,7 @@ __export(ai_selector_exports, {
32
32
  AISelector: () => AISelector
33
33
  });
34
34
  module.exports = __toCommonJS(ai_selector_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
35
36
  var import_react = require("ai/react");
36
37
  var import_lucide_react = require("lucide-react");
37
38
  var import_react2 = require("react");
@@ -65,49 +66,63 @@ function AISelector({ onOpenChange }) {
65
66
  const hasCompletion = completion.length > 0;
66
67
  if (!editor)
67
68
  return null;
68
- return /* @__PURE__ */ React.createElement(import_command.Command, { className: "w-[350px]" }, hasCompletion && /* @__PURE__ */ React.createElement("div", { className: "flex max-h-[400px]" }, /* @__PURE__ */ React.createElement(import_scroll_area.ScrollArea, null, /* @__PURE__ */ React.createElement("div", { className: "prose prose-sm p-2 px-4" }, /* @__PURE__ */ React.createElement(import_react_markdown.default, null, completion)))), isLoading && /* @__PURE__ */ React.createElement("div", { className: "text-muted-foreground flex h-12 w-full items-center px-4 text-sm font-medium text-purple-500" }, /* @__PURE__ */ React.createElement(import_magic.default, { className: "mr-2 h-4 w-4 shrink-0 " }), "AI is thinking", /* @__PURE__ */ React.createElement("div", { className: "ml-2 mt-1" }, /* @__PURE__ */ React.createElement(import_crazy_spinner.default, null))), !isLoading && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "relative" }, /* @__PURE__ */ React.createElement(
69
- import_command.CommandInput,
70
- {
71
- value: inputValue,
72
- onValueChange: setInputValue,
73
- autoFocus: true,
74
- placeholder: hasCompletion ? "Tell AI what to do next" : "Ask AI to edit or generate...",
75
- onFocus: () => (0, import_extensions.addAIHighlight)(editor)
76
- }
77
- ), /* @__PURE__ */ React.createElement(
78
- import_button.Button,
79
- {
80
- size: "icon",
81
- className: "absolute right-2 top-1/2 h-6 w-6 -translate-y-1/2 rounded-full bg-purple-500 hover:bg-purple-900",
82
- onClick: () => {
83
- if (completion)
84
- return complete(completion, {
85
- body: { option: "zap", command: inputValue }
86
- }).then(() => setInputValue(""));
87
- const slice = editor.state.selection.content();
88
- const text = editor.storage.markdown.serializer.serialize(
89
- slice.content
90
- );
91
- complete(text, {
92
- body: { option: "zap", command: inputValue }
93
- }).then(() => setInputValue(""));
94
- }
95
- },
96
- /* @__PURE__ */ React.createElement(import_lucide_react.ArrowUp, { className: "h-4 w-4" })
97
- )), hasCompletion ? /* @__PURE__ */ React.createElement(
98
- import_ai_completion_command.default,
99
- {
100
- onDiscard: () => {
101
- onOpenChange(false);
102
- },
103
- completion
104
- }
105
- ) : /* @__PURE__ */ React.createElement(
106
- import_ai_selector_commands.default,
107
- {
108
- onSelect: (value, option) => complete(value, { body: { option } })
109
- }
110
- )));
69
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_command.Command, { className: "w-[350px]", children: [
70
+ hasCompletion && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex max-h-[400px]", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_scroll_area.ScrollArea, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "prose prose-sm p-2 px-4", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_markdown.default, { children: completion }) }) }) }),
71
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "text-muted-foreground flex h-12 w-full items-center px-4 text-sm font-medium text-purple-500", children: [
72
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_magic.default, { className: "mr-2 h-4 w-4 shrink-0 " }),
73
+ "AI is thinking",
74
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "ml-2 mt-1", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_crazy_spinner.default, {}) })
75
+ ] }),
76
+ !isLoading && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
77
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative", children: [
78
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
79
+ import_command.CommandInput,
80
+ {
81
+ value: inputValue,
82
+ onValueChange: setInputValue,
83
+ autoFocus: true,
84
+ placeholder: hasCompletion ? "Tell AI what to do next" : "Ask AI to edit or generate...",
85
+ onFocus: () => (0, import_extensions.addAIHighlight)(editor)
86
+ }
87
+ ),
88
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
89
+ import_button.Button,
90
+ {
91
+ size: "icon",
92
+ className: "absolute right-2 top-1/2 h-6 w-6 -translate-y-1/2 rounded-full bg-purple-500 hover:bg-purple-900",
93
+ onClick: () => {
94
+ if (completion)
95
+ return complete(completion, {
96
+ body: { option: "zap", command: inputValue }
97
+ }).then(() => setInputValue(""));
98
+ const slice = editor.state.selection.content();
99
+ const text = editor.storage.markdown.serializer.serialize(
100
+ slice.content
101
+ );
102
+ complete(text, {
103
+ body: { option: "zap", command: inputValue }
104
+ }).then(() => setInputValue(""));
105
+ },
106
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowUp, { className: "h-4 w-4" })
107
+ }
108
+ )
109
+ ] }),
110
+ hasCompletion ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
111
+ import_ai_completion_command.default,
112
+ {
113
+ onDiscard: () => {
114
+ onOpenChange(false);
115
+ },
116
+ completion
117
+ }
118
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
119
+ import_ai_selector_commands.default,
120
+ {
121
+ onSelect: (value, option) => complete(value, { body: { option } })
122
+ }
123
+ )
124
+ ] })
125
+ ] });
111
126
  }
112
127
  // Annotate the CommonJS export names for ESM import in node:
113
128
  0 && (module.exports = {
@@ -31,6 +31,7 @@ __export(generative_menu_switch_exports, {
31
31
  default: () => generative_menu_switch_default
32
32
  });
33
33
  module.exports = __toCommonJS(generative_menu_switch_exports);
34
+ var import_jsx_runtime = require("react/jsx-runtime");
34
35
  var import_react = require("react");
35
36
  var import_extensions = require("../../novel/src/extensions");
36
37
  var import_button = require("../ui/button");
@@ -51,7 +52,7 @@ const GenerativeMenuSwitch = ({
51
52
  }, [open]);
52
53
  if (!editor)
53
54
  return;
54
- return /* @__PURE__ */ React.createElement(
55
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
55
56
  import_components.EditorBubble,
56
57
  {
57
58
  tippyOptions: {
@@ -60,20 +61,27 @@ const GenerativeMenuSwitch = ({
60
61
  onOpenChange(false);
61
62
  }
62
63
  },
63
- className: "border-muted bg-background flex w-fit max-w-[90vw] overflow-hidden rounded-md border shadow-xl"
64
- },
65
- open && /* @__PURE__ */ React.createElement(import_ai_selector.AISelector, { open, onOpenChange }),
66
- !open && /* @__PURE__ */ React.createElement(import_react.Fragment, null, /* @__PURE__ */ React.createElement(
67
- import_button.Button,
68
- {
69
- className: "gap-1 rounded-none text-purple-500",
70
- variant: "ghost",
71
- onClick: () => onOpenChange(true),
72
- size: "sm"
73
- },
74
- /* @__PURE__ */ React.createElement(import_magic.default, { className: "h-5 w-5" }),
75
- "Ask AI"
76
- ), children)
64
+ className: "border-muted bg-background flex w-fit max-w-[90vw] overflow-hidden rounded-md border shadow-xl",
65
+ children: [
66
+ open && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ai_selector.AISelector, { open, onOpenChange }),
67
+ !open && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
68
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
69
+ import_button.Button,
70
+ {
71
+ className: "gap-1 rounded-none text-purple-500",
72
+ variant: "ghost",
73
+ onClick: () => onOpenChange(true),
74
+ size: "sm",
75
+ children: [
76
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_magic.default, { className: "h-5 w-5" }),
77
+ "Ask AI"
78
+ ]
79
+ }
80
+ ),
81
+ children
82
+ ] })
83
+ ]
84
+ }
77
85
  );
78
86
  };
79
87
  var generative_menu_switch_default = GenerativeMenuSwitch;
@@ -21,6 +21,7 @@ __export(color_selector_exports, {
21
21
  ColorSelector: () => ColorSelector
22
22
  });
23
23
  module.exports = __toCommonJS(color_selector_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
24
25
  var import_lucide_react = require("lucide-react");
25
26
  var import_button = require("../ui/button");
26
27
  var import_popover = require("../ui/popover");
@@ -111,63 +112,85 @@ const ColorSelector = (props) => {
111
112
  const activeHighlightItem = HIGHLIGHT_COLORS.find(
112
113
  ({ color }) => editor.isActive("highlight", { color })
113
114
  );
114
- return /* @__PURE__ */ React.createElement(import_popover.Popover, { modal: true, open: props.open, onOpenChange: props.onOpenChange }, /* @__PURE__ */ React.createElement(import_popover.PopoverTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(import_button.Button, { size: "sm", className: "gap-2 rounded-none", variant: "ghost" }, /* @__PURE__ */ React.createElement(
115
- "span",
116
- {
117
- className: "rounded-sm px-1",
118
- style: {
119
- color: activeColorItem == null ? void 0 : activeColorItem.color,
120
- backgroundColor: activeHighlightItem == null ? void 0 : activeHighlightItem.color
121
- }
122
- },
123
- "A"
124
- ), /* @__PURE__ */ React.createElement(import_lucide_react.ChevronDown, { className: "h-4 w-4" }))), /* @__PURE__ */ React.createElement(
125
- import_popover.PopoverContent,
126
- {
127
- sideOffset: 5,
128
- className: "my-1 flex max-h-80 w-48 flex-col overflow-hidden overflow-y-auto rounded border p-1 shadow-xl ",
129
- align: "start"
130
- },
131
- /* @__PURE__ */ React.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React.createElement("div", { className: "text-muted-foreground my-1 px-2 text-sm font-semibold" }, "Color"), TEXT_COLORS.map(({ name, color }, index) => /* @__PURE__ */ React.createElement(
132
- import_components.EditorBubbleItem,
133
- {
134
- key: index,
135
- onSelect: () => {
136
- editor.commands.unsetColor();
137
- name !== "Default" && editor.chain().focus().setColor(color || "").run();
138
- },
139
- className: "hover:bg-accent flex cursor-pointer items-center justify-between px-2 py-1 text-sm"
140
- },
141
- /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement(
142
- "div",
115
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_popover.Popover, { modal: true, open: props.open, onOpenChange: props.onOpenChange, children: [
116
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popover.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_button.Button, { size: "sm", className: "gap-2 rounded-none", variant: "ghost", children: [
117
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
118
+ "span",
143
119
  {
144
- className: "rounded-sm border px-2 py-px font-medium",
145
- style: { color }
146
- },
147
- "A"
148
- ), /* @__PURE__ */ React.createElement("span", null, name))
149
- ))),
150
- /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "text-muted-foreground my-1 px-2 text-sm font-semibold" }, "Background"), HIGHLIGHT_COLORS.map(({ name, color }, index) => /* @__PURE__ */ React.createElement(
151
- import_components.EditorBubbleItem,
120
+ className: "rounded-sm px-1",
121
+ style: {
122
+ color: activeColorItem == null ? void 0 : activeColorItem.color,
123
+ backgroundColor: activeHighlightItem == null ? void 0 : activeHighlightItem.color
124
+ },
125
+ children: "A"
126
+ }
127
+ ),
128
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronDown, { className: "h-4 w-4" })
129
+ ] }) }),
130
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
131
+ import_popover.PopoverContent,
152
132
  {
153
- key: index,
154
- onSelect: () => {
155
- editor.commands.unsetHighlight();
156
- name !== "Default" && editor.commands.setHighlight({ color });
157
- },
158
- className: "hover:bg-accent flex cursor-pointer items-center justify-between px-2 py-1 text-sm"
159
- },
160
- /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement(
161
- "div",
162
- {
163
- className: "rounded-sm border px-2 py-px font-medium",
164
- style: { backgroundColor: color }
165
- },
166
- "A"
167
- ), /* @__PURE__ */ React.createElement("span", null, name)),
168
- editor.isActive("highlight", { color }) && /* @__PURE__ */ React.createElement(import_lucide_react.Check, { className: "h-4 w-4" })
169
- )))
170
- ));
133
+ sideOffset: 5,
134
+ className: "my-1 flex max-h-80 w-48 flex-col overflow-hidden overflow-y-auto rounded border p-1 shadow-xl ",
135
+ align: "start",
136
+ children: [
137
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col", children: [
138
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-muted-foreground my-1 px-2 text-sm font-semibold", children: "Color" }),
139
+ TEXT_COLORS.map(({ name, color }, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
140
+ import_components.EditorBubbleItem,
141
+ {
142
+ onSelect: () => {
143
+ editor.commands.unsetColor();
144
+ name !== "Default" && editor.chain().focus().setColor(color || "").run();
145
+ },
146
+ className: "hover:bg-accent flex cursor-pointer items-center justify-between px-2 py-1 text-sm",
147
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
148
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
149
+ "div",
150
+ {
151
+ className: "rounded-sm border px-2 py-px font-medium",
152
+ style: { color },
153
+ children: "A"
154
+ }
155
+ ),
156
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: name })
157
+ ] })
158
+ },
159
+ index
160
+ ))
161
+ ] }),
162
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
163
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-muted-foreground my-1 px-2 text-sm font-semibold", children: "Background" }),
164
+ HIGHLIGHT_COLORS.map(({ name, color }, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
165
+ import_components.EditorBubbleItem,
166
+ {
167
+ onSelect: () => {
168
+ editor.commands.unsetHighlight();
169
+ name !== "Default" && editor.commands.setHighlight({ color });
170
+ },
171
+ className: "hover:bg-accent flex cursor-pointer items-center justify-between px-2 py-1 text-sm",
172
+ children: [
173
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
174
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
175
+ "div",
176
+ {
177
+ className: "rounded-sm border px-2 py-px font-medium",
178
+ style: { backgroundColor: color },
179
+ children: "A"
180
+ }
181
+ ),
182
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: name })
183
+ ] }),
184
+ editor.isActive("highlight", { color }) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Check, { className: "h-4 w-4" })
185
+ ]
186
+ },
187
+ index
188
+ ))
189
+ ] })
190
+ ]
191
+ }
192
+ )
193
+ ] });
171
194
  };
172
195
  // Annotate the CommonJS export names for ESM import in node:
173
196
  0 && (module.exports = {