mtxuilib 0.1.184 → 0.1.186

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 (64) hide show
  1. package/dist/common/HtmlChangesObserver.d.ts +1 -0
  2. package/dist/common/MtImage.d.ts +2 -2
  3. package/dist/common/MtImage.js +6 -8
  4. package/dist/common/SlntTree/SlntChildrenTabs.js +1 -1
  5. package/dist/common/pip/ReactDocumentPictureInPicture.d.ts +1 -1
  6. package/dist/common/pip/ReactDocumentPictureInPicture.js +48 -35
  7. package/dist/common/react-markdown/ReactMarkdownExample.js +7 -9
  8. package/dist/common/schema-form/SchemaFormView.d.ts +19 -4
  9. package/dist/common/schema-form/schema-form.z.d.ts +2 -2
  10. package/dist/common/table/cells/ExpenderCell.js +3 -1
  11. package/dist/common/tiptap/TiptapEditor.d.ts +2 -2
  12. package/dist/components/external-link.d.ts +1 -0
  13. package/dist/components/message.d.ts +1 -0
  14. package/dist/demos/suspense-ssr/ExampleProviderProviders.d.ts +1 -0
  15. package/dist/form/EditFormToolbar.d.ts +8 -8
  16. package/dist/form/ZodForm.d.ts +1 -0
  17. package/dist/hooks/use-router.d.ts +3 -3
  18. package/dist/hooks/use-scroll-anchor.d.ts +1 -0
  19. package/dist/hooks/useLayoutPath.js +2 -4
  20. package/dist/icons/icons.d.ts +1 -0
  21. package/dist/lib/clientlib.d.ts +1 -0
  22. package/dist/lib/render.d.ts +1 -0
  23. package/dist/lib/utils.d.ts +1 -1
  24. package/dist/lib/zustand.js +1 -1
  25. package/dist/misc/ExampleErrorDemo.d.ts +1 -0
  26. package/dist/misc/MtErrorBoundaryV2.stories.d.ts +4 -1
  27. package/dist/mtapp/History.d.ts +1 -0
  28. package/dist/mtapp/MtAppProvider.d.ts +2 -1
  29. package/dist/mtedtior/LzMtEditor.d.ts +4 -3
  30. package/dist/mtedtior/components/editor-command-item.d.ts +5 -4
  31. package/dist/mtedtior/components/editor-command.d.ts +8 -8
  32. package/dist/mtedtior/components/editor.d.ts +2 -2
  33. package/dist/mtedtior/extensions/index.d.ts +3 -3
  34. package/dist/mtedtior/mtextesions/tw_extensions.d.ts +1 -1
  35. package/dist/mtedtior/utils/utils.d.ts +1 -1
  36. package/dist/mtedtior/utils.d.ts +1 -1
  37. package/dist/tools/devTools/ollamaService.js +3 -5
  38. package/dist/types/common.d.ts +1 -0
  39. package/dist/ui/aspect-ratio.d.ts +1 -0
  40. package/dist/ui/breadcrumb.d.ts +1 -1
  41. package/dist/ui/collapsible.d.ts +1 -0
  42. package/dist/ui/command.d.ts +17 -17
  43. package/dist/ui/context-menu.d.ts +3 -3
  44. package/dist/ui/drawer.d.ts +1 -1
  45. package/dist/ui/dropdown-menu.d.ts +3 -3
  46. package/dist/ui/form.d.ts +1 -1
  47. package/dist/ui/menubar.d.ts +3 -3
  48. package/dist/ui/mt/Button.d.ts +1 -0
  49. package/dist/ui/mt/MtForm.d.ts +1 -0
  50. package/dist/ui/mt/Separator.d.ts +1 -0
  51. package/dist/ui/mt/SimpleModel.d.ts +1 -0
  52. package/dist/ui/mt/Tree.d.ts +5 -5
  53. package/dist/ui/mt/headline.d.ts +1 -0
  54. package/dist/ui/mt/inputs/TaskStatusInput.js +3 -3
  55. package/dist/ui/mt/inputs/input.d.ts +1 -0
  56. package/dist/ui/mt/modal/MtModal.d.ts +1 -0
  57. package/dist/ui/mt/mt-tree-view/mt-tree-view-api.d.ts +11 -11
  58. package/dist/ui/mt/mt-tree-view/mt-treeview.d.ts +2 -2
  59. package/dist/ui/mt/skeleton/skeleton-card.d.ts +1 -1
  60. package/dist/ui/mt/types.d.ts +1 -0
  61. package/dist/ui/resizable.d.ts +16 -2
  62. package/dist/ui/skeleton.d.ts +1 -0
  63. package/dist/ui/sonner.d.ts +1 -0
  64. package/package.json +297 -297
@@ -1 +1,2 @@
1
+ /// <reference types="react" />
1
2
  export declare function HtmlChangesObserver({ children }: React.PropsWithChildren): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
- import Image from 'next/image';
2
- import { ComponentProps } from "react";
1
+ import Image from "next/image";
2
+ import type { ComponentProps } from "react";
3
3
  type Props = ComponentProps<typeof Image>;
4
4
  export declare const MtImage: (props: Props) => import("react/jsx-runtime").JSX.Element;
5
5
  export {};
@@ -1,15 +1,15 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { isCloudflarePage } from 'mtxlib/utils';
3
- import Image from 'next/image';
2
+ import { isCloudflarePage } from "mtxlib/utils";
3
+ import Image from "next/image";
4
4
  const normalizeSrc = (src) => {
5
- return src.startsWith('/') ? src.slice(1) : src;
5
+ return src.startsWith("/") ? src.slice(1) : src;
6
6
  };
7
7
  const cloudflareLoader = ({ src, width, quality }) => {
8
8
  const params = [`width=${width}`];
9
9
  if (quality) {
10
10
  params.push(`quality=${quality}`);
11
11
  }
12
- const paramsString = params.join(',');
12
+ const paramsString = params.join(",");
13
13
  return `https://cfgomtm.yuepa8.com/cdn-cgi/image/${paramsString}/${normalizeSrc(src)}`;
14
14
  };
15
15
  const exampleImageLoader = ({ src, width, quality }) => {
@@ -19,10 +19,8 @@ function getImageLoader() {
19
19
  if (isCloudflarePage()) {
20
20
  return cloudflareLoader;
21
21
  }
22
- else {
23
- exampleImageLoader;
24
- }
22
+ exampleImageLoader;
25
23
  }
26
24
  export const MtImage = (props) => {
27
- return _jsx(Image, { ...props, loader: getImageLoader() });
25
+ return (_jsx(Image, { ...props, loader: getImageLoader() }));
28
26
  };
@@ -11,7 +11,7 @@ export const SlntChildrenTabs = () => {
11
11
  const segments = useSelectedLayoutSegments();
12
12
  const segment = useSelectedLayoutSegment();
13
13
  const basePath = pathName.slice(0, -segments.join("/").length);
14
- const basePath3 = "/" + segments.join("/");
14
+ const basePath3 = `/${segments.join("/")}`;
15
15
  return (_jsx("div", { className: "flex gap-1 ", children: parentData?.children?.map((item, i) => {
16
16
  let href = `${urlJoinPaths(basePath, item.routeName || "")}`;
17
17
  if (!segments?.length) {
@@ -1,4 +1,4 @@
1
- import { ReactNode } from "react";
1
+ import { type ReactNode } from "react";
2
2
  export type ReactDocumentPictureInPictureForwardRefType = {
3
3
  window: () => Window | undefined;
4
4
  isOpen: boolean;
@@ -1,35 +1,36 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { forwardRef, useCallback, useImperativeHandle, useMemo, useRef, useState } from "react";
3
+ import { forwardRef, useCallback, useImperativeHandle, useMemo, useRef, useState, } from "react";
4
4
  export var FeatureUnavailableReasonEnum;
5
5
  (function (FeatureUnavailableReasonEnum) {
6
6
  FeatureUnavailableReasonEnum["USING_UNSECURE_PROTOCOL"] = "USING_UNSECURE_PROTOCOL";
7
7
  FeatureUnavailableReasonEnum["API_NOT_SUPPORTED"] = "API_NOT_SUPPORTED";
8
8
  })(FeatureUnavailableReasonEnum || (FeatureUnavailableReasonEnum = {}));
9
- ;
10
9
  const ReactDocumentPictureInPicture = forwardRef((props, ref) => {
11
10
  const contentRef = useRef();
12
11
  const pipWindow = useRef();
13
12
  const [isOpen, setIsOpen] = useState(false);
14
13
  const absoluteDimensions = useMemo(() => {
15
- if (typeof window != "undefined") {
14
+ if (typeof window !== "undefined") {
16
15
  let absoluteWidth = 500;
17
16
  let absoluteHeight = 400;
18
17
  if (typeof props.width === "number")
19
18
  absoluteWidth = props.width;
20
19
  else if (typeof props.width === "string") {
21
- if (props.width.endsWith('px'))
22
- absoluteWidth = parseInt(props.width);
23
- else if (props.width.endsWith('%'))
24
- absoluteWidth = window?.innerWidth * (parseInt(props.width) / 100);
20
+ if (props.width.endsWith("px"))
21
+ absoluteWidth = Number.parseInt(props.width);
22
+ else if (props.width.endsWith("%"))
23
+ absoluteWidth =
24
+ window?.innerWidth * (Number.parseInt(props.width) / 100);
25
25
  }
26
26
  if (typeof props.height === "number")
27
27
  absoluteHeight = props.height;
28
28
  else if (typeof props.height === "string") {
29
- if (props.height.endsWith('px'))
30
- absoluteHeight = parseInt(props.height);
31
- else if (props.height.endsWith('%'))
32
- absoluteHeight = window?.innerHeight * (parseInt(props.height) / 100);
29
+ if (props.height.endsWith("px"))
30
+ absoluteHeight = Number.parseInt(props.height);
31
+ else if (props.height.endsWith("%"))
32
+ absoluteHeight =
33
+ window?.innerHeight * (Number.parseInt(props.height) / 100);
33
34
  }
34
35
  return { width: absoluteWidth, height: absoluteHeight };
35
36
  }
@@ -45,20 +46,24 @@ const ReactDocumentPictureInPicture = forwardRef((props, ref) => {
45
46
  const open = useCallback(async () => {
46
47
  if (contentRef.current == null)
47
48
  return;
48
- if (typeof window != "undefined") {
49
+ if (typeof window !== "undefined") {
49
50
  const contentElement = contentRef.current;
50
- pipWindow.current = await window?.documentPictureInPicture.requestWindow({ ...absoluteDimensions });
51
+ pipWindow.current = await window?.documentPictureInPicture.requestWindow({
52
+ ...absoluteDimensions,
53
+ });
51
54
  if (props.shareStyles === true) {
52
55
  [...document.styleSheets].forEach((styleSheet) => {
53
56
  try {
54
- const cssRules = [...styleSheet.cssRules].map((rule) => rule.cssText).join('');
55
- const style = document.createElement('style');
57
+ const cssRules = [...styleSheet.cssRules]
58
+ .map((rule) => rule.cssText)
59
+ .join("");
60
+ const style = document.createElement("style");
56
61
  style.textContent = cssRules;
57
62
  pipWindow?.current.document.head.appendChild(style);
58
63
  }
59
64
  catch (e) {
60
- const link = document.createElement('link');
61
- link.rel = 'stylesheet';
65
+ const link = document.createElement("link");
66
+ link.rel = "stylesheet";
62
67
  link.type = styleSheet.type;
63
68
  if (styleSheet.media.length > 0) {
64
69
  link.media = styleSheet.media.mediaText;
@@ -69,8 +74,8 @@ const ReactDocumentPictureInPicture = forwardRef((props, ref) => {
69
74
  });
70
75
  }
71
76
  pipWindow.current.document.body.append(contentElement);
72
- pipWindow.current.addEventListener('pagehide', () => close());
73
- pipWindow.current.addEventListener('resize', (event) => {
77
+ pipWindow.current.addEventListener("pagehide", () => close());
78
+ pipWindow.current.addEventListener("resize", (event) => {
74
79
  if (props.onResize)
75
80
  props.onResize(event.target.innerWidth, event.target.innerHeight);
76
81
  });
@@ -78,39 +83,47 @@ const ReactDocumentPictureInPicture = forwardRef((props, ref) => {
78
83
  if (props.onOpen)
79
84
  props.onOpen();
80
85
  }
81
- }, [contentRef, pipWindow, setIsOpen, close, absoluteDimensions, props.shareStyles]);
82
- const toggle = useCallback(() => isOpen ? close() : open(), [isOpen]);
86
+ }, [
87
+ contentRef,
88
+ pipWindow,
89
+ setIsOpen,
90
+ close,
91
+ absoluteDimensions,
92
+ props.shareStyles,
93
+ ]);
94
+ const toggle = useCallback(() => (isOpen ? close() : open()), [isOpen]);
83
95
  useImperativeHandle(ref, () => ({
84
96
  window: () => pipWindow.current,
85
97
  isOpen,
86
98
  close,
87
- }), [
88
- pipWindow,
89
- isOpen,
90
- close,
91
- ]);
99
+ }), [pipWindow, isOpen, close]);
92
100
  const featureUnavailableReason = (() => {
93
- if (typeof window != "undefined") {
94
- const isUsingSecureProtocol = window?.location.protocol === 'https:';
101
+ if (typeof window !== "undefined") {
102
+ const isUsingSecureProtocol = window?.location.protocol === "https:";
95
103
  if (isUsingSecureProtocol === false)
96
104
  return FeatureUnavailableReasonEnum.USING_UNSECURE_PROTOCOL;
97
- const featureIsAvailable = 'documentPictureInPicture' in window;
105
+ const featureIsAvailable = "documentPictureInPicture" in window;
98
106
  if (featureIsAvailable === false)
99
107
  return FeatureUnavailableReasonEnum.API_NOT_SUPPORTED;
100
108
  }
101
109
  return null;
102
110
  })();
103
- if (featureUnavailableReason != null && props.featureUnavailableRenderer == null)
111
+ if (featureUnavailableReason != null &&
112
+ props.featureUnavailableRenderer == null)
104
113
  return;
105
114
  if (featureUnavailableReason != null) {
106
- const featureUnavailableRenderer = typeof props.featureUnavailableRenderer === "function" ? props.featureUnavailableRenderer(featureUnavailableReason) : props.featureUnavailableRenderer;
115
+ const featureUnavailableRenderer = typeof props.featureUnavailableRenderer === "function"
116
+ ? props.featureUnavailableRenderer(featureUnavailableReason)
117
+ : props.featureUnavailableRenderer;
107
118
  return featureUnavailableRenderer;
108
119
  }
109
- const buttonRenderer = typeof props.buttonRenderer === "function" ? props.buttonRenderer({ open, close, toggle, isOpen }) : props.buttonRenderer;
120
+ const buttonRenderer = typeof props.buttonRenderer === "function"
121
+ ? props.buttonRenderer({ open, close, toggle, isOpen })
122
+ : props.buttonRenderer;
110
123
  return (_jsxs("div", { children: [buttonRenderer, _jsx("div", { ref: contentRef, style: {
111
- display: isOpen ? 'block' : 'none',
112
- width: '100%',
113
- height: '100%',
124
+ display: isOpen ? "block" : "none",
125
+ width: "100%",
126
+ height: "100%",
114
127
  }, children: props.children })] }));
115
128
  });
116
129
  ReactDocumentPictureInPicture.displayName = "ReactDocumentPictureInPicture";
@@ -1,19 +1,17 @@
1
- 'use client';
1
+ "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import Markdown from 'react-markdown';
4
- import rehypeExternalLinks from 'rehype-external-links';
5
- import rehypeSanitize from 'rehype-sanitize';
6
- import remarkGfm from 'remark-gfm';
3
+ import Markdown from "react-markdown";
4
+ import rehypeExternalLinks from "rehype-external-links";
5
+ import rehypeSanitize from "rehype-sanitize";
6
+ import remarkGfm from "remark-gfm";
7
7
  import { CodeBlock, Pre } from "./Code";
8
8
  export const ReactMarkdownExample = () => {
9
9
  const options = {
10
10
  code: CodeBlock,
11
11
  pre: Pre,
12
12
  };
13
- return (_jsx("div", { className: 'bg-slate-500', children: _jsx("div", { className: 'flex h-screen justify-between', children: _jsx("article", { className: 'w-full pl-6 pt-5', children: _jsx(Markdown, { className: 'prose prose-invert min-w-full', remarkPlugins: [remarkGfm], rehypePlugins: [
13
+ return (_jsx("div", { className: "bg-slate-500", children: _jsx("div", { className: "flex h-screen justify-between", children: _jsx("article", { className: "w-full pl-6 pt-5", children: _jsx(Markdown, { className: "prose prose-invert min-w-full", remarkPlugins: [remarkGfm], rehypePlugins: [
14
14
  rehypeSanitize,
15
- [rehypeExternalLinks,
16
- { content: { type: 'text', value: '🔗' } }
17
- ],
15
+ [rehypeExternalLinks, { content: { type: "text", value: "🔗" } }],
18
16
  ], components: options }) }) }) }));
19
17
  };
@@ -2,11 +2,26 @@ import type { MaybePromise } from "../../types/common";
2
2
  import type { SchemaForm } from "./schema-form.z";
3
3
  type SchemaFormViewVaranit = "auto" | "modal" | "card";
4
4
  export declare const SchemaFormView: (props: {
5
- formSchema?: SchemaForm;
5
+ formSchema?: {
6
+ fields: {
7
+ name: string;
8
+ type?: string | undefined;
9
+ label?: string | undefined;
10
+ defaultValue?: any;
11
+ placeholder?: string | undefined;
12
+ valueType?: "string" | "number" | "email" | "date" | undefined;
13
+ description?: string | undefined;
14
+ }[];
15
+ title?: string | undefined;
16
+ description?: string | undefined;
17
+ action?: string | undefined;
18
+ loadingDetailDataProcedure?: string | undefined;
19
+ loadingDetailDataParams?: any;
20
+ } | undefined;
6
21
  defaultValues?: any;
7
22
  onSubmit: (values: any) => MaybePromise<void>;
8
- onCancel?: () => void;
9
- isLoading?: boolean;
10
- variants?: SchemaFormViewVaranit;
23
+ onCancel?: (() => void) | undefined;
24
+ isLoading?: boolean | undefined;
25
+ variants?: SchemaFormViewVaranit | undefined;
11
26
  }) => import("react/jsx-runtime").JSX.Element;
12
27
  export {};
@@ -67,8 +67,8 @@ export declare const schemaFormSchema: z.ZodObject<{
67
67
  description?: string | undefined;
68
68
  }[];
69
69
  title?: string | undefined;
70
- action?: string | undefined;
71
70
  description?: string | undefined;
71
+ action?: string | undefined;
72
72
  loadingDetailDataProcedure?: string | undefined;
73
73
  loadingDetailDataParams?: any;
74
74
  }, {
@@ -82,8 +82,8 @@ export declare const schemaFormSchema: z.ZodObject<{
82
82
  description?: string | undefined;
83
83
  }[];
84
84
  title?: string | undefined;
85
- action?: string | undefined;
86
85
  description?: string | undefined;
86
+ action?: string | undefined;
87
87
  loadingDetailDataProcedure?: string | undefined;
88
88
  loadingDetailDataParams?: any;
89
89
  }>;
@@ -3,5 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { ChevronRight } from 'lucide-react';
4
4
  import { cn } from "../../../lib/utils";
5
5
  export const ExpenderCell = (info) => {
6
- return info.row.getCanExpand() ? (_jsx("button", { className: "pointer", onClick: info.row.getToggleExpandedHandler(), children: _jsx(ChevronRight, { className: cn(info.row.getIsExpanded() && "rotate-90") }) })) : ('🔵');
6
+ return info.row.getCanExpand() ? (_jsx("button", { className: "pointer", ...{
7
+ onClick: info.row.getToggleExpandedHandler(),
8
+ }, children: _jsx(ChevronRight, { className: cn(info.row.getIsExpanded() && "rotate-90") }) })) : ('🔵');
7
9
  };
@@ -1,5 +1,5 @@
1
1
  import { type EditorEvents } from "@tiptap/react";
2
2
  export declare const TiptapEditorV1: (props: {
3
- value?: string;
4
- onUpdate?: (props: EditorEvents["update"]) => void;
3
+ value?: string | undefined;
4
+ onUpdate?: ((props: EditorEvents["update"]) => void) | undefined;
5
5
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare function ExternalLink({ href, children, }: {
2
3
  href: string;
3
4
  children: React.ReactNode;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type StreamableValue } from "ai/rsc";
2
3
  export declare function UserMessage({ children }: {
3
4
  children: React.ReactNode;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare function ExampleProviderProviders({ children }: {
2
3
  children: React.ReactNode;
3
4
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,13 +1,13 @@
1
1
  import type React from "react";
2
2
  import type { AnyZodForm } from "./ZodForm";
3
3
  export declare const EditFormToolbar: React.ForwardRefExoticComponent<{
4
- onCancel?: () => void;
5
- form?: AnyZodForm;
6
- submitText?: string;
7
- enableCancelConform?: boolean;
8
- enableDeleteButton?: boolean;
9
- onDelete?: () => void;
10
- onSubmit?: (values: any) => void;
4
+ onCancel?: (() => void) | undefined;
5
+ form?: AnyZodForm | undefined;
6
+ submitText?: string | undefined;
7
+ enableCancelConform?: boolean | undefined;
8
+ enableDeleteButton?: boolean | undefined;
9
+ onDelete?: (() => void) | undefined;
10
+ onSubmit?: ((values: any) => void) | undefined;
11
11
  } & {
12
- children?: React.ReactNode | undefined;
12
+ children?: React.ReactNode;
13
13
  } & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type FieldValues, type SubmitHandler, type UseFormProps, type UseFormReturn } from "react-hook-form";
2
3
  import { z } from "zod";
3
4
  export type UseZodForm<TInput extends FieldValues> = UseFormReturn<TInput> & {
@@ -1,7 +1,7 @@
1
1
  export declare const useMtRouter: () => {
2
- push: (href: string, options?: import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions, NProgressOptions?: import("next-nprogress-bar").RouterNProgressOptions) => void;
3
- replace: (href: string, options?: import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions, NProgressOptions?: import("next-nprogress-bar").RouterNProgressOptions) => void;
4
- back: (NProgressOptions?: import("next-nprogress-bar").RouterNProgressOptions) => void;
2
+ push: (href: string, options?: import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions | undefined, NProgressOptions?: import("next-nprogress-bar").RouterNProgressOptions | undefined) => void;
3
+ replace: (href: string, options?: import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions | undefined, NProgressOptions?: import("next-nprogress-bar").RouterNProgressOptions | undefined) => void;
4
+ back: (NProgressOptions?: import("next-nprogress-bar").RouterNProgressOptions | undefined) => void;
5
5
  forward(): void;
6
6
  refresh(): void;
7
7
  prefetch(href: string, options?: import("next/dist/shared/lib/app-router-context.shared-runtime").PrefetchOptions | undefined): void;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const useScrollAnchor: () => {
2
3
  messagesRef: import("react").RefObject<HTMLDivElement>;
3
4
  scrollRef: import("react").RefObject<HTMLDivElement>;
@@ -6,12 +6,10 @@ export const useLayoutPath = () => {
6
6
  const segments = useSelectedLayoutSegments();
7
7
  const pathname = usePathname();
8
8
  const layoutBasePath = useMemo(() => {
9
- if (segments.length == 0) {
9
+ if (segments.length === 0) {
10
10
  return pathname;
11
11
  }
12
- else {
13
- return pathname.slice(0, -urlJoinPaths(...segments).length);
14
- }
12
+ return pathname.slice(0, -urlJoinPaths(...segments).length);
15
13
  }, [pathname, segments]);
16
14
  return layoutBasePath;
17
15
  };
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  type IconProps = React.HTMLAttributes<SVGElement>;
2
3
  import { LucideProps } from "lucide-react";
3
4
  import type { LucideIcon } from "lucide-react";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare function mergeRefs<T>(refs: Array<React.MutableRefObject<T> | React.LegacyRef<T>>): React.RefCallback<T>;
2
3
  export declare function getCookie(name: string): string | undefined;
3
4
  export declare function deleteCookie(name: string): void;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export type Renderable<TProps> = React.ReactNode | React.ComponentType<TProps>;
2
3
  export declare function flexRender<TProps extends object>(Comp: Renderable<TProps>, props: TProps): React.ReactNode | JSX.Element;
3
4
  export declare function isReactComponent<TProps>(component: unknown): component is React.ComponentType<TProps>;
@@ -25,7 +25,7 @@ export declare function humanize(input: string): string;
25
25
  export declare function stringsRemovePrefix(inputString: string, prefix: string): string;
26
26
  export declare function fetcher<JSON>(input: RequestInfo, init?: RequestInit): Promise<JSON>;
27
27
  export declare const formatNumber: (value: number) => string;
28
- export declare const runAsyncFnWithoutBlocking: (fn: (...args: any) => Promise) => void;
28
+ export declare const runAsyncFnWithoutBlocking: (fn: (...args: any[]) => any) => void;
29
29
  export declare const getStringFromBuffer: (buffer: ArrayBuffer) => string;
30
30
  export declare enum ResultCode {
31
31
  InvalidCredentials = "INVALID_CREDENTIALS",
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { deleteCookie, getCookie, setCookie } from "mtxlib/clientlib";
2
+ import { deleteCookie, getCookie, setCookie } from "./clientlib";
3
3
  export const customCookieStorage = {
4
4
  getItem: async (name) => {
5
5
  return getCookie(name) || null;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const ExampleError2: () => import("react/jsx-runtime").JSX.Element;
2
3
  export declare const ExampleError1: () => never;
3
4
  export declare const WiehErrorExample: import("react").ForwardRefExoticComponent<object & import("react").RefAttributes<any>>;
@@ -1,7 +1,10 @@
1
+ /// <reference types="react" />
1
2
  import type { StoryObj } from '@storybook/react';
2
3
  declare const meta: {
3
4
  title: string;
4
- component: (props: {} & import("react").PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
5
+ component: (props: {
6
+ children?: import("react").ReactNode;
7
+ }) => import("react/jsx-runtime").JSX.Element;
5
8
  parameters: {
6
9
  layout: string;
7
10
  };
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type StateCreator } from "zustand/vanilla";
2
3
  export type HisSliceProps = {};
3
4
  export interface HisSliceState extends HisSliceProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type StateCreator } from "zustand";
2
3
  export interface AppSliceProps {
3
4
  debug?: boolean;
@@ -29,7 +30,7 @@ export declare const gomtmContext: import("react").Context<(Omit<Omit<Omit<impor
29
30
  [k: string]: unknown;
30
31
  }>>) => void;
31
32
  clearStorage: () => void;
32
- rehydrate: () => Promise<void> | void;
33
+ rehydrate: () => void | Promise<void>;
33
34
  hasHydrated: () => boolean;
34
35
  onHydrate: (fn: (state: AppSliceState) => void) => () => void;
35
36
  onFinishHydration: (fn: (state: AppSliceState) => void) => () => void;
@@ -1,6 +1,7 @@
1
+ /// <reference types="react" />
1
2
  export declare const LzMtEditor: import("react").ComponentType<(import("./MtEditor").MtEditorProps & {
2
- onValueChange?: (content: any) => void;
3
- content?: import("@tiptap/core").JSONContent | null;
3
+ onValueChange?: ((content: any) => void) | undefined;
4
+ content?: import("@tiptap/core").JSONContent | null | undefined;
4
5
  }) | {
5
- content?: string;
6
+ content?: string | undefined;
6
7
  }>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { Editor, Range } from "@tiptap/core";
2
3
  interface EditorCommandItemProps {
3
4
  readonly onCommand: ({ editor, range, }: {
@@ -8,10 +9,10 @@ interface EditorCommandItemProps {
8
9
  export declare const EditorCommandItem: import("react").ForwardRefExoticComponent<EditorCommandItemProps & Omit<Omit<{
9
10
  children?: import("react").ReactNode;
10
11
  } & Omit<import("react").HTMLAttributes<HTMLDivElement>, "disabled" | "value" | "onSelect"> & {
11
- disabled?: boolean;
12
- onSelect?: (value: string) => void;
13
- value?: string;
14
- forceMount?: boolean;
12
+ disabled?: boolean | undefined;
13
+ onSelect?: ((value: string) => void) | undefined;
14
+ value?: string | undefined;
15
+ forceMount?: boolean | undefined;
15
16
  } & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
16
17
  export declare const EditorCommandEmpty: import("react").ForwardRefExoticComponent<Omit<{
17
18
  children?: import("react").ReactNode;
@@ -14,14 +14,14 @@ export declare const EditorCommandOut: FC<EditorCommandOutProps>;
14
14
  export declare const EditorCommand: import("react").ForwardRefExoticComponent<Omit<{
15
15
  children?: import("react").ReactNode;
16
16
  } & import("react").HTMLAttributes<HTMLDivElement> & {
17
- label?: string;
18
- shouldFilter?: boolean;
19
- filter?: (value: string, search: string) => number;
20
- defaultValue?: string;
21
- value?: string;
22
- onValueChange?: (value: string) => void;
23
- loop?: boolean;
24
- vimBindings?: boolean;
17
+ label?: string | undefined;
18
+ shouldFilter?: boolean | undefined;
19
+ filter?: ((value: string, search: string) => number) | undefined;
20
+ defaultValue?: string | undefined;
21
+ value?: string | undefined;
22
+ onValueChange?: ((value: string) => void) | undefined;
23
+ loop?: boolean | undefined;
24
+ vimBindings?: boolean | undefined;
25
25
  } & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
26
26
  export declare const EditorCommandList: import("react").ForwardRefExoticComponent<{
27
27
  children?: import("react").ReactNode;
@@ -15,7 +15,7 @@ export type EditorContentProps = Omit<EditorProviderProps, "content"> & {
15
15
  };
16
16
  export declare const EditorContent: import("react").ForwardRefExoticComponent<Omit<EditorProviderProps, "content"> & {
17
17
  readonly children?: ReactNode;
18
- readonly className?: string;
19
- readonly initialContent?: JSONContent;
18
+ readonly className?: string | undefined;
19
+ readonly initialContent?: JSONContent | undefined;
20
20
  } & import("react").RefAttributes<HTMLDivElement>>;
21
21
  export {};
@@ -16,8 +16,8 @@ import { Twitter } from "./twitter";
16
16
  import CustomKeymap from "./custom-keymap";
17
17
  import { ImageResizer } from "./image-resizer";
18
18
  import UpdatedImage from "./updated-image";
19
- declare const PlaceholderExtension: import("@tiptap/core").Extension<any, any>;
19
+ declare const PlaceholderExtension: import("@tiptap/core").Extension<import("@tiptap/extension-placeholder").PlaceholderOptions, any>;
20
20
  declare const Horizontal: import("@tiptap/core").Node<import("@tiptap/extension-horizontal-rule").HorizontalRuleOptions, any>;
21
- declare const MarkdownExtension: import("@tiptap/core").Extension<any, any>;
22
- declare const HighlightExtension: import("@tiptap/core").Mark<any, any>;
21
+ declare const MarkdownExtension: import("@tiptap/core").Extension<import("tiptap-markdown").MarkdownOptions, import("tiptap-markdown").MarkdownStorage>;
22
+ declare const HighlightExtension: import("@tiptap/core").Mark<import("@tiptap/extension-highlight").HighlightOptions, any>;
23
23
  export { CodeBlockLowlight, Horizontal as HorizontalRule, ImageResizer, InputRule, PlaceholderExtension as Placeholder, StarterKit, TaskItem, TaskList, TiptapImage, TiptapUnderline, MarkdownExtension, TextStyle, Color, HighlightExtension, CustomKeymap, TiptapLink, UpdatedImage, Youtube, Twitter, Mathematics, CharacterCount, GlobalDragHandle, };
@@ -1 +1 @@
1
- export declare const defaultExtensions: (import("@tiptap/core").Extension<any, any> | import("@tiptap/core").Node<any, any> | import("@tiptap/core").Mark<any, any>)[];
1
+ export declare const defaultExtensions: (import("@tiptap/core").Mark<import("@tiptap/extension-text-style").TextStyleOptions, any> | import("@tiptap/core").Extension<any, any> | import("@tiptap/core").Node<import("@tiptap/extension-horizontal-rule").HorizontalRuleOptions, any>)[];
@@ -5,5 +5,5 @@ export declare function isValidUrl(url: string): boolean;
5
5
  export declare function getUrlFromString(str: string): string | null | undefined;
6
6
  export declare const getPrevText: (editor: Editor, { chars, offset, }: {
7
7
  chars: number;
8
- offset?: number;
8
+ offset?: number | undefined;
9
9
  }) => any;
@@ -5,5 +5,5 @@ export declare function isValidUrl(url: string): boolean;
5
5
  export declare function getUrlFromString(str: string): string | null | undefined;
6
6
  export declare const getPrevText: (editor: Editor, { chars, offset, }: {
7
7
  chars: number;
8
- offset?: number;
8
+ offset?: number | undefined;
9
9
  }) => any;
@@ -1,20 +1,18 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { z } from "zod";
3
- import { BotCard } from "../../components/message";
4
3
  import { exec } from "mtxlib/exec";
4
+ import { BotCard } from "../../components/message";
5
5
  export const ollamaServiceTool = {
6
6
  ollamaService: {
7
7
  description: "启动或通知本地ollama服务",
8
8
  parameters: z.object({
9
- action: z
10
- .enum(["start", "stop"])
11
- .describe("动作类型,启动或停止"),
9
+ action: z.enum(["start", "stop"]).describe("动作类型,启动或停止"),
12
10
  }),
13
11
  generate: async function* (params) {
14
12
  yield _jsx(BotCard, { children: "loading" });
15
13
  try {
16
14
  const a = await exec("ollama ", { shell: true });
17
- return (_jsx(BotCard, { children: "\u5B8C\u6210" }));
15
+ return _jsx(BotCard, { children: "\u5B8C\u6210" });
18
16
  }
19
17
  catch (e) {
20
18
  return (_jsxs(BotCard, { children: [_jsx("h3", { children: "\u9519\u8BEF\u6458\u8981\uFF1A" }), _jsx("pre", { children: e.toString() }), _jsx("div", { children: "\u66F4\u5177\u4F53\u7684\u9519\u8BEF\u4FE1\u606F\uFF0C\u8BF7\u5230\u540E\u53F0\u67E5\u770B" })] }));
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { DialogProps } from "@radix-ui/react-dialog";
2
3
  export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
3
4
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
2
3
  declare const AspectRatio: import("react").ForwardRefExoticComponent<AspectRatioPrimitive.AspectRatioProps & import("react").RefAttributes<HTMLDivElement>>;
3
4
  export { AspectRatio };