mtxuilib 0.0.337 → 0.0.338

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.
@@ -33,8 +33,8 @@ import { ReactQueryStreamedHydration } from "@tanstack/react-query-next-experime
33
33
  import { toPlainMessage } from "@bufbuild/protobuf";
34
34
  import { ErrorBoundary } from "react-error-boundary";
35
35
  import { mtmCallUnaryMethod } from "../lib/mtmFetcher";
36
- import { MtButton } from "../ui/ui-mt/Button";
37
36
  import { useExtInfo } from "./appContext";
37
+ import { MtButton } from "../ui/ui-mt/Button";
38
38
  const MtReactQueryProvider = (props) => {
39
39
  const { children } = props;
40
40
  const [queryClient] = useState(() => new QueryClient({
@@ -59,7 +59,7 @@ function RqErrorBoundary(props) {
59
59
  ErrorBoundary,
60
60
  {
61
61
  onReset: reset,
62
- fallbackRender: ({ resetErrorBoundary, error }) => /* @__PURE__ */ jsxs("div", { className: "green-red-100 container prose mx-auto p-8 text-lg dark:prose-invert", children: [
62
+ fallbackRender: ({ resetErrorBoundary, error }) => /* @__PURE__ */ jsxs("div", { className: "green-red-100 prose dark:prose-invert container mx-auto p-8 text-lg", children: [
63
63
  /* @__PURE__ */ jsx("div", { className: " pb-8 text-center", children: "some thing error" }),
64
64
  /* @__PURE__ */ jsx("div", { children: error == null ? void 0 : error.toString() }),
65
65
  /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ jsx(MtButton, { onClick: () => resetErrorBoundary(), children: "Retry" }) })
@@ -28,14 +28,17 @@ import { LinkSelector } from "./selectors/link-selector";
28
28
  import { NodeSelector } from "./selectors/node-selector";
29
29
  import { Separator } from "./ui/separator";
30
30
  import { defaultEditorContent } from "../content";
31
+ import { EditorBubble, EditorCommand, EditorCommandEmpty, EditorCommandItem, EditorCommandList, EditorContent, EditorRoot } from "../novel/src/components";
31
32
  import { ImageResizer, handleCommandNavigation } from "../novel/src/extensions";
32
33
  import { handleImageDrop, handleImagePaste } from "../novel/src/plugins";
33
34
  import GenerativeMenuSwitch from "./generative/generative-menu-switch";
34
35
  import { uploadFn } from "./image-upload";
35
36
  import { TextButtons } from "./selectors/text-buttons";
36
37
  import { slashCommand, suggestionItems } from "./slash-command";
37
- import { EditorCommand, EditorCommandEmpty, EditorCommandItem, EditorCommandList, EditorContent, EditorRoot } from "../novel/src/components";
38
- const extensions = [...defaultExtensions, slashCommand];
38
+ const extensions = [
39
+ ...defaultExtensions,
40
+ slashCommand
41
+ ];
39
42
  const TailwindAdvancedEditor = () => {
40
43
  const [initialContent, setInitialContent] = useState(
41
44
  null
@@ -86,6 +89,21 @@ const TailwindAdvancedEditor = () => {
86
89
  },
87
90
  slotAfter: /* @__PURE__ */ jsx(ImageResizer, {}),
88
91
  children: [
92
+ /* @__PURE__ */ jsxs(
93
+ EditorBubble,
94
+ {
95
+ tippyOptions: {
96
+ placement: openAI ? "bottom-start" : "top"
97
+ },
98
+ className: "border-muted bg-background flex w-fit max-w-[90vw] overflow-hidden rounded border shadow-xl",
99
+ children: [
100
+ /* @__PURE__ */ jsx(NodeSelector, { open: openNode, onOpenChange: setOpenNode }),
101
+ /* @__PURE__ */ jsx(LinkSelector, { open: openLink, onOpenChange: setOpenLink }),
102
+ /* @__PURE__ */ jsx(TextButtons, {}),
103
+ /* @__PURE__ */ jsx(ColorSelector, { open: openColor, onOpenChange: setOpenColor })
104
+ ]
105
+ }
106
+ ),
89
107
  /* @__PURE__ */ jsxs(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: [
90
108
  /* @__PURE__ */ jsx(EditorCommandEmpty, { className: "text-muted-foreground px-2", children: "No results" }),
91
109
  /* @__PURE__ */ jsx(EditorCommandList, { children: suggestionItems.map((item) => /* @__PURE__ */ jsxs(
@@ -1 +1 @@
1
- export declare const defaultExtensions: (import("@tiptap/core").Mark<import("../novel/src/extensions").AIHighlightOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extension-placeholder").PlaceholderOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-horizontal-rule").HorizontalRuleOptions, any> | import("@tiptap/core").Extension<import("@tiptap/starter-kit").StarterKitOptions, any>)[];
1
+ export declare const defaultExtensions: any[];
@@ -1,6 +1,8 @@
1
1
  import { cx } from "class-variance-authority";
2
2
  import { AIHighlight, HorizontalRule, Placeholder, StarterKit, TaskItem, TaskList, TiptapImage, TiptapLink, UpdatedImage } from "../novel/src/extensions";
3
3
  import { UploadImagesPlugin } from "../novel/src/plugins";
4
+ import AutoJoiner from "tiptap-extension-auto-joiner";
5
+ import GlobalDragHandle from "tiptap-extension-global-drag-handle";
4
6
  const aiHighlight = AIHighlight;
5
7
  const placeholder = Placeholder;
6
8
  const tiptapLink = TiptapLink.configure({
@@ -95,7 +97,22 @@ const defaultExtensions = [
95
97
  taskList,
96
98
  taskItem,
97
99
  horizontalRule,
98
- aiHighlight
100
+ aiHighlight,
101
+ //开始 添加更多扩展
102
+ GlobalDragHandle.configure({
103
+ dragHandleWidth: 20,
104
+ // default
105
+ // The scrollTreshold specifies how close the user must drag an element to the edge of the lower/upper screen for automatic
106
+ // scrolling to take place. For example, scrollTreshold = 100 means that scrolling starts automatically when the user drags an
107
+ // element to a position that is max. 99px away from the edge of the screen
108
+ // You can set this to 0 to prevent auto scrolling caused by this extension
109
+ scrollTreshold: 100
110
+ // default
111
+ }),
112
+ AutoJoiner.configure({
113
+ elementsToJoin: ["bulletList", "orderedList"]
114
+ // default
115
+ })
99
116
  ];
100
117
  export {
101
118
  defaultExtensions
@@ -53,8 +53,8 @@ var import_react_query_next_experimental = require("@tanstack/react-query-next-e
53
53
  var import_protobuf = require("@bufbuild/protobuf");
54
54
  var import_react_error_boundary = require("react-error-boundary");
55
55
  var import_mtmFetcher = require("../lib/mtmFetcher");
56
- var import_Button = require("../ui/ui-mt/Button");
57
56
  var import_appContext = require("./appContext");
57
+ var import_Button = require("../ui/ui-mt/Button");
58
58
  const MtReactQueryProvider = (props) => {
59
59
  const { children } = props;
60
60
  const [queryClient] = (0, import_react.useState)(() => new import_react_query.QueryClient({
@@ -79,7 +79,7 @@ function RqErrorBoundary(props) {
79
79
  import_react_error_boundary.ErrorBoundary,
80
80
  {
81
81
  onReset: reset,
82
- fallbackRender: ({ resetErrorBoundary, error }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "green-red-100 container prose mx-auto p-8 text-lg dark:prose-invert", children: [
82
+ fallbackRender: ({ resetErrorBoundary, error }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "green-red-100 prose dark:prose-invert container mx-auto p-8 text-lg", children: [
83
83
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: " pb-8 text-center", children: "some thing error" }),
84
84
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: error == null ? void 0 : error.toString() }),
85
85
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.MtButton, { onClick: () => resetErrorBoundary(), children: "Retry" }) })