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.
- package/dist/App.cjs +17 -1
- package/dist/MtmButton.cjs +2 -1
- package/dist/NovelEditorLoader.cjs +8 -4
- package/dist/browser/index.min.js +2 -1
- package/dist/common/FullCenter.cjs +2 -1
- package/dist/common/MtImage.cjs +2 -1
- package/dist/common/mtlink.cjs +2 -1
- package/dist/common/table/cells/ExpenderCell.cjs +9 -4
- package/dist/common/table/cells/SelectCell.cjs +8 -4
- package/dist/common/table/cells/Text.cjs +2 -1
- package/dist/common/table/cells/ViewLink.cjs +8 -4
- package/dist/common/table/cells/container/cellWrapper.cjs +2 -1
- package/dist/common/table/cells/number.cjs +2 -1
- package/dist/common/table/cells/string.cjs +2 -1
- package/dist/common/table/data-table-pagination.cjs +89 -51
- package/dist/common/table/data-table-view-options.cjs +32 -22
- package/dist/common/tailwind-indicator.cjs +9 -1
- package/dist/entry-client.cjs +2 -1
- package/dist/entry-server.cjs +2 -1
- package/dist/esm/App.js +17 -1
- package/dist/esm/MtmButton.js +2 -1
- package/dist/esm/NovelEditorLoader.js +8 -4
- package/dist/esm/common/FullCenter.js +2 -1
- package/dist/esm/common/MtImage.js +2 -1
- package/dist/esm/common/mtlink.js +2 -1
- package/dist/esm/common/table/cells/ExpenderCell.js +9 -4
- package/dist/esm/common/table/cells/SelectCell.js +8 -4
- package/dist/esm/common/table/cells/Text.js +2 -1
- package/dist/esm/common/table/cells/ViewLink.js +8 -4
- package/dist/esm/common/table/cells/container/cellWrapper.js +2 -1
- package/dist/esm/common/table/cells/number.js +2 -1
- package/dist/esm/common/table/cells/string.js +2 -1
- package/dist/esm/common/table/data-table-pagination.js +89 -51
- package/dist/esm/common/table/data-table-view-options.js +32 -22
- package/dist/esm/common/tailwind-indicator.js +9 -1
- package/dist/esm/entry-client.js +2 -1
- package/dist/esm/entry-server.js +2 -1
- package/dist/esm/icons/icons.js +41 -31
- package/dist/esm/index.js +2 -1
- package/dist/esm/lib/connectquery/use-transport.js +2 -1
- package/dist/esm/lib/render copy.js +2 -1
- package/dist/esm/lib/render.js +2 -1
- package/dist/esm/store/MtConnectProvider.js +2 -1
- package/dist/esm/store/ReactQueryProvider.js +18 -10
- package/dist/esm/store/StorybookDecorator.js +5 -4
- package/dist/esm/store/appContext.js +28 -18
- package/dist/esm/store/hydrateCore.js +6 -5
- package/dist/esm/store/logger.context.js +3 -2
- package/dist/esm/store/pageMeta.js +5 -1
- package/dist/esm/tailwind.d.cts +88 -1
- package/dist/esm/ui/accordion.js +19 -11
- package/dist/esm/ui/alert copy.js +4 -3
- package/dist/esm/ui/alert-dialog.js +21 -17
- package/dist/esm/ui/alert.js +4 -3
- package/dist/esm/ui/avatar.js +4 -3
- package/dist/esm/ui/badge.js +2 -2
- package/dist/esm/ui/button.js +2 -1
- package/dist/esm/ui/calendar.js +4 -4
- package/dist/esm/ui/card.js +7 -6
- package/dist/esm/ui/checkbox.js +15 -10
- package/dist/esm/ui/command.js +25 -18
- package/dist/esm/ui/context-menu.js +35 -22
- package/dist/esm/ui/dialog.js +30 -17
- package/dist/esm/ui/drawer.js +28 -18
- package/dist/esm/ui/dropdown-menu.js +35 -22
- package/dist/esm/ui/form copy.js +14 -9
- package/dist/esm/ui/form.js +14 -9
- package/dist/esm/ui/hover-card.js +2 -1
- package/dist/esm/ui/input.js +2 -1
- package/dist/esm/ui/label.js +2 -1
- package/dist/esm/ui/menubar.js +37 -24
- package/dist/esm/ui/navigation-menu.js +36 -25
- package/dist/esm/ui/novel/novel/src/components/editor-bubble-item.js +2 -1
- package/dist/esm/ui/novel/novel/src/components/editor-bubble.js +5 -1
- package/dist/esm/ui/novel/novel/src/components/editor-command-item.js +5 -4
- package/dist/esm/ui/novel/novel/src/components/editor-command.js +21 -14
- package/dist/esm/ui/novel/novel/src/components/editor.js +7 -6
- package/dist/esm/ui/novel/novel/src/extensions/image-resizer.js +2 -1
- package/dist/esm/ui/novel/tailwind/advanced-editor.js +58 -35
- package/dist/esm/ui/novel/tailwind/generative/ai-completion-command.js +45 -30
- package/dist/esm/ui/novel/tailwind/generative/ai-selector-commands.js +37 -28
- package/dist/esm/ui/novel/tailwind/generative/ai-selector.js +58 -43
- package/dist/esm/ui/novel/tailwind/generative/generative-menu-switch.js +23 -15
- package/dist/esm/ui/novel/tailwind/selectors/color-selector.js +78 -55
- package/dist/esm/ui/novel/tailwind/selectors/link-selector.js +58 -50
- package/dist/esm/ui/novel/tailwind/selectors/node-selector.js +31 -19
- package/dist/esm/ui/novel/tailwind/selectors/text-buttons.js +13 -12
- package/dist/esm/ui/novel/tailwind/slash-command.js +12 -11
- package/dist/esm/ui/novel/tailwind/ui/button.js +2 -1
- package/dist/esm/ui/novel/tailwind/ui/command.js +25 -18
- package/dist/esm/ui/novel/tailwind/ui/dialog.js +30 -17
- package/dist/esm/ui/novel/tailwind/ui/icons/crazy-spinner.js +6 -1
- package/dist/esm/ui/novel/tailwind/ui/icons/font-default.js +20 -17
- package/dist/esm/ui/novel/tailwind/ui/icons/font-mono.js +20 -17
- package/dist/esm/ui/novel/tailwind/ui/icons/font-serif.js +20 -17
- package/dist/esm/ui/novel/tailwind/ui/icons/github.js +5 -4
- package/dist/esm/ui/novel/tailwind/ui/icons/loading-circle.js +20 -17
- package/dist/esm/ui/novel/tailwind/ui/icons/magic.js +27 -24
- package/dist/esm/ui/novel/tailwind/ui/menu.js +28 -16
- package/dist/esm/ui/novel/tailwind/ui/popover.js +3 -2
- package/dist/esm/ui/novel/tailwind/ui/scroll-area.js +18 -10
- package/dist/esm/ui/novel/tailwind/ui/separator.js +2 -1
- package/dist/esm/ui/pagination.js +32 -19
- package/dist/esm/ui/popover.js +3 -2
- package/dist/esm/ui/progress.js +15 -10
- package/dist/esm/ui/radio-group.js +7 -5
- package/dist/esm/ui/resizable.js +10 -5
- package/dist/esm/ui/scroll-area.js +26 -18
- package/dist/esm/ui/select.js +37 -26
- package/dist/esm/ui/separator.js +2 -1
- package/dist/esm/ui/sheet.js +24 -14
- package/dist/esm/ui/skeleton.js +2 -1
- package/dist/esm/ui/slider.js +12 -5
- package/dist/esm/ui/sonner.js +2 -1
- package/dist/esm/ui/switch.js +12 -11
- package/dist/esm/ui/table.js +10 -9
- package/dist/esm/ui/tabs.js +4 -3
- package/dist/esm/ui/textarea.js +2 -1
- package/dist/esm/ui/toast.js +14 -9
- package/dist/esm/ui/toaster.js +18 -4
- package/dist/esm/ui/toggle.js +2 -1
- package/dist/esm/ui/tooltip.js +2 -1
- package/dist/esm/ui/ui-mt/NavTag.js +5 -4
- package/dist/esm/ui/ui-mt/SimpleModel.js +12 -11
- package/dist/esm/ui/ui-mt/inputField/InputField.js +27 -20
- package/dist/esm/ui/ui-mt/inputField/SingleUploadForm.js +67 -56
- package/dist/esm/ui/ui-mt/inputField/TextArea.js +20 -16
- package/dist/esm/ui/ui-mt/inputField/TextFileInput.js +18 -15
- package/dist/esm/ui/ui-mt/inputField/select/InputSelect.js +35 -27
- package/dist/esm/ui/ui-mt/inputs/SearchInput.js +2 -1
- package/dist/esm/ui/ui-mt/inputs/searchBar.js +12 -8
- package/dist/esm/ui/ui-mt/skeleton/skeleton-card.js +9 -4
- package/dist/esm/ui/ui-mt/skeleton/skeleton2.js +5 -1
- package/dist/esm/ui/ui-mt/skeleton/skeletons.js +9 -1
- package/dist/esm/ui/ui-vamp/alert.js +30 -24
- package/dist/esm/ui/ui-vamp/avatar.js +12 -7
- package/dist/esm/ui/ui-vamp/button.js +2 -1
- package/dist/esm/ui/ui-vamp/card.js +15 -8
- package/dist/esm/ui/ui-vamp/checkbox.js +15 -8
- package/dist/esm/ui/ui-vamp/chip.js +2 -1
- package/dist/esm/ui/ui-vamp/dropdown.js +7 -6
- package/dist/esm/ui/ui-vamp/external-link.js +9 -4
- package/dist/esm/ui/ui-vamp/headline.js +5 -1
- package/dist/esm/ui/ui-vamp/input.js +3 -2
- package/dist/esm/ui/ui-vamp/keyvalue.js +5 -1
- package/dist/esm/ui/ui-vamp/label.js +2 -1
- package/dist/esm/ui/ui-vamp/mobile-nav-button.js +6 -5
- package/dist/esm/ui/ui-vamp/modal.js +17 -13
- package/dist/esm/ui/ui-vamp/pagination.js +57 -35
- package/dist/esm/ui/ui-vamp/scroll-area.js +5 -4
- package/dist/esm/ui/ui-vamp/skeleton.js +2 -2
- package/dist/esm/ui/ui-vamp/stripe-not-connected-modal.js +13 -2
- package/dist/esm/ui/ui-vamp/textarea.js +12 -8
- package/dist/esm/ui/ui-vamp/toggle-group.js +3 -2
- package/dist/icons/icons.cjs +41 -31
- package/dist/index.cjs +2 -1
- package/dist/lib/connectquery/use-transport.cjs +2 -1
- package/dist/lib/render copy.cjs +2 -1
- package/dist/lib/render.cjs +2 -1
- package/dist/store/MtConnectProvider.cjs +2 -1
- package/dist/store/ReactQueryProvider.cjs +18 -10
- package/dist/store/StorybookDecorator.cjs +5 -4
- package/dist/store/appContext.cjs +28 -28
- package/dist/store/hydrateCore.cjs +6 -5
- package/dist/store/logger.context.cjs +3 -2
- package/dist/store/pageMeta.cjs +5 -1
- package/dist/tailwind.cjs +72 -2
- package/dist/tsconfig.type.tsbuildinfo +1 -1
- package/dist/ui/accordion.cjs +19 -11
- package/dist/ui/alert copy.cjs +4 -3
- package/dist/ui/alert-dialog.cjs +21 -17
- package/dist/ui/alert.cjs +4 -3
- package/dist/ui/avatar.cjs +4 -3
- package/dist/ui/badge.cjs +2 -12
- package/dist/ui/button.cjs +2 -1
- package/dist/ui/calendar.cjs +4 -14
- package/dist/ui/card.cjs +7 -6
- package/dist/ui/checkbox.cjs +15 -10
- package/dist/ui/command.cjs +25 -18
- package/dist/ui/context-menu.cjs +35 -22
- package/dist/ui/dialog.cjs +30 -17
- package/dist/ui/drawer.cjs +28 -18
- package/dist/ui/dropdown-menu.cjs +35 -22
- package/dist/ui/form copy.cjs +14 -9
- package/dist/ui/form.cjs +14 -9
- package/dist/ui/hover-card.cjs +2 -1
- package/dist/ui/input.cjs +2 -1
- package/dist/ui/label.cjs +2 -1
- package/dist/ui/menubar.cjs +37 -24
- package/dist/ui/navigation-menu.cjs +36 -25
- package/dist/ui/novel/novel/src/components/editor-bubble-item.cjs +2 -1
- package/dist/ui/novel/novel/src/components/editor-bubble.cjs +5 -1
- package/dist/ui/novel/novel/src/components/editor-command-item.cjs +5 -4
- package/dist/ui/novel/novel/src/components/editor-command.cjs +21 -14
- package/dist/ui/novel/novel/src/components/editor.cjs +7 -6
- package/dist/ui/novel/novel/src/extensions/image-resizer.cjs +2 -1
- package/dist/ui/novel/tailwind/advanced-editor.cjs +58 -35
- package/dist/ui/novel/tailwind/generative/ai-completion-command.cjs +45 -30
- package/dist/ui/novel/tailwind/generative/ai-selector-commands.cjs +37 -28
- package/dist/ui/novel/tailwind/generative/ai-selector.cjs +58 -43
- package/dist/ui/novel/tailwind/generative/generative-menu-switch.cjs +23 -15
- package/dist/ui/novel/tailwind/selectors/color-selector.cjs +78 -55
- package/dist/ui/novel/tailwind/selectors/link-selector.cjs +58 -50
- package/dist/ui/novel/tailwind/selectors/node-selector.cjs +31 -19
- package/dist/ui/novel/tailwind/selectors/text-buttons.cjs +13 -12
- package/dist/ui/novel/tailwind/slash-command.cjs +12 -11
- package/dist/ui/novel/tailwind/ui/button.cjs +2 -1
- package/dist/ui/novel/tailwind/ui/command.cjs +25 -18
- package/dist/ui/novel/tailwind/ui/dialog.cjs +30 -17
- package/dist/ui/novel/tailwind/ui/icons/crazy-spinner.cjs +6 -1
- package/dist/ui/novel/tailwind/ui/icons/font-default.cjs +20 -17
- package/dist/ui/novel/tailwind/ui/icons/font-mono.cjs +20 -17
- package/dist/ui/novel/tailwind/ui/icons/font-serif.cjs +20 -17
- package/dist/ui/novel/tailwind/ui/icons/github.cjs +5 -4
- package/dist/ui/novel/tailwind/ui/icons/loading-circle.cjs +20 -17
- package/dist/ui/novel/tailwind/ui/icons/magic.cjs +27 -24
- package/dist/ui/novel/tailwind/ui/menu.cjs +28 -16
- package/dist/ui/novel/tailwind/ui/popover.cjs +3 -2
- package/dist/ui/novel/tailwind/ui/scroll-area.cjs +18 -10
- package/dist/ui/novel/tailwind/ui/separator.cjs +2 -1
- package/dist/ui/pagination.cjs +32 -19
- package/dist/ui/popover.cjs +3 -2
- package/dist/ui/progress.cjs +15 -10
- package/dist/ui/radio-group.cjs +7 -5
- package/dist/ui/resizable.cjs +10 -5
- package/dist/ui/scroll-area.cjs +26 -18
- package/dist/ui/select.cjs +37 -26
- package/dist/ui/separator.cjs +2 -1
- package/dist/ui/sheet.cjs +24 -14
- package/dist/ui/skeleton.cjs +2 -1
- package/dist/ui/slider.cjs +12 -5
- package/dist/ui/sonner.cjs +2 -1
- package/dist/ui/switch.cjs +12 -11
- package/dist/ui/table.cjs +10 -9
- package/dist/ui/tabs.cjs +4 -3
- package/dist/ui/textarea.cjs +2 -1
- package/dist/ui/toast.cjs +14 -9
- package/dist/ui/toaster.cjs +18 -4
- package/dist/ui/toggle.cjs +2 -1
- package/dist/ui/tooltip.cjs +2 -1
- package/dist/ui/ui-mt/NavTag.cjs +5 -4
- package/dist/ui/ui-mt/SimpleModel.cjs +12 -11
- package/dist/ui/ui-mt/inputField/InputField.cjs +27 -20
- package/dist/ui/ui-mt/inputField/SingleUploadForm.cjs +67 -56
- package/dist/ui/ui-mt/inputField/TextArea.cjs +20 -16
- package/dist/ui/ui-mt/inputField/TextFileInput.cjs +18 -25
- package/dist/ui/ui-mt/inputField/select/InputSelect.cjs +35 -27
- package/dist/ui/ui-mt/inputs/SearchInput.cjs +2 -1
- package/dist/ui/ui-mt/inputs/searchBar.cjs +12 -8
- package/dist/ui/ui-mt/skeleton/skeleton-card.cjs +9 -4
- package/dist/ui/ui-mt/skeleton/skeleton2.cjs +5 -1
- package/dist/ui/ui-mt/skeleton/skeletons.cjs +9 -1
- package/dist/ui/ui-vamp/alert.cjs +30 -24
- package/dist/ui/ui-vamp/avatar.cjs +12 -7
- package/dist/ui/ui-vamp/button.cjs +2 -1
- package/dist/ui/ui-vamp/card.cjs +15 -18
- package/dist/ui/ui-vamp/checkbox.cjs +15 -8
- package/dist/ui/ui-vamp/chip.cjs +2 -1
- package/dist/ui/ui-vamp/dropdown.cjs +7 -6
- package/dist/ui/ui-vamp/external-link.cjs +9 -4
- package/dist/ui/ui-vamp/headline.cjs +5 -1
- package/dist/ui/ui-vamp/input.cjs +3 -2
- package/dist/ui/ui-vamp/keyvalue.cjs +5 -1
- package/dist/ui/ui-vamp/label.cjs +2 -1
- package/dist/ui/ui-vamp/mobile-nav-button.cjs +6 -5
- package/dist/ui/ui-vamp/modal.cjs +17 -13
- package/dist/ui/ui-vamp/pagination.cjs +57 -35
- package/dist/ui/ui-vamp/scroll-area.cjs +5 -4
- package/dist/ui/ui-vamp/skeleton.cjs +2 -12
- package/dist/ui/ui-vamp/stripe-not-connected-modal.cjs +13 -2
- package/dist/ui/ui-vamp/textarea.cjs +12 -8
- package/dist/ui/ui-vamp/toggle-group.cjs +3 -2
- 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__ */
|
|
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__ */
|
|
98
|
-
|
|
99
|
-
{
|
|
100
|
-
|
|
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
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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__ */
|
|
36
|
-
import_command.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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__ */
|
|
55
|
-
import_command.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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__ */
|
|
69
|
-
|
|
70
|
-
{
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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__ */
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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__ */
|
|
115
|
-
"
|
|
116
|
-
|
|
117
|
-
|
|
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
|
|
145
|
-
style: {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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 = {
|