@lark-apaas/client-toolkit 1.0.6 → 1.0.7
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect } from "react";
|
|
3
3
|
import { useLocation } from "react-router-dom";
|
|
4
|
-
import { Button } from "
|
|
4
|
+
import { Button } from "../ui/button.js";
|
|
5
5
|
import { postMessage } from "../../utils/postMessage.js";
|
|
6
6
|
import { copyToClipboard } from "../../utils/copyToClipboard.js";
|
|
7
7
|
const RenderError = (props)=>{
|
|
@@ -68,12 +68,12 @@ const RenderError = (props)=>{
|
|
|
68
68
|
className: "flex space-x-4",
|
|
69
69
|
children: [
|
|
70
70
|
/*#__PURE__*/ jsx(Button, {
|
|
71
|
-
className: "bg-white text-gray-600 font-[400] border rounded-[6px] shadow-xs hover:bg-gray-100 active:bg-gray-200 focus:outline-hidden h-[32px] border-[#D0D3D6]",
|
|
71
|
+
className: "bg-white cursor-pointer text-gray-600 font-[400] border rounded-[6px] shadow-xs hover:bg-gray-100 active:bg-gray-200 focus:outline-hidden h-[32px] border-[#D0D3D6]",
|
|
72
72
|
onClick: onClickCopy,
|
|
73
73
|
children: "复制错误信息"
|
|
74
74
|
}),
|
|
75
75
|
/*#__PURE__*/ jsx(Button, {
|
|
76
|
-
className: "h-[32px] text-sm font-medium text-white bg-blue-600 border border-transparent rounded-[6px] shadow-xs hover:bg-blue-600 active:bg-blue-700 focus:outline-hidden ",
|
|
76
|
+
className: "cursor-pointer h-[32px] text-sm font-medium text-white bg-blue-600 border border-transparent rounded-[6px] shadow-xs hover:bg-blue-600 active:bg-blue-700 focus:outline-hidden ",
|
|
77
77
|
onClick: onClickRepair,
|
|
78
78
|
children: "告诉妙搭修复"
|
|
79
79
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const badgeVariants: (props?: {
|
|
4
|
-
variant?: "default" | "
|
|
4
|
+
variant?: "default" | "destructive" | "outline" | "secondary";
|
|
5
5
|
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
6
6
|
declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
7
7
|
asChild?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const buttonVariants: (props?: {
|
|
4
|
-
variant?: "default" | "link" | "
|
|
4
|
+
variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost";
|
|
5
5
|
size?: "default" | "icon" | "sm" | "lg" | "icon-sm" | "icon-lg";
|
|
6
6
|
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
7
7
|
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
package/lib/hooks/useAppInfo.js
CHANGED
|
@@ -4,7 +4,18 @@ const useAppInfo = ()=>{
|
|
|
4
4
|
const [appInfo, setAppInfo] = useState({});
|
|
5
5
|
useEffect(()=>{
|
|
6
6
|
const handleMetaInfoChanged = async ()=>{
|
|
7
|
-
|
|
7
|
+
const info = await getAppInfo();
|
|
8
|
+
if (info.name) document.title = info.name;
|
|
9
|
+
if (info.avatar) {
|
|
10
|
+
let link = document.querySelector("link[rel~='icon']");
|
|
11
|
+
if (!link) {
|
|
12
|
+
link = document.createElement('link');
|
|
13
|
+
link.rel = 'icon';
|
|
14
|
+
document.head.appendChild(link);
|
|
15
|
+
}
|
|
16
|
+
link.href = info.avatar;
|
|
17
|
+
}
|
|
18
|
+
setAppInfo(info);
|
|
8
19
|
};
|
|
9
20
|
handleMetaInfoChanged();
|
|
10
21
|
window.addEventListener('MiaoDaMetaInfoChanged', handleMetaInfoChanged);
|
|
@@ -10,16 +10,6 @@ async function getAppInfo() {
|
|
|
10
10
|
};
|
|
11
11
|
if (appInfo.name) appInfo.name = appInfo.name.trim();
|
|
12
12
|
if ('undefined' != typeof window) window._appInfo = appInfo;
|
|
13
|
-
if ('undefined' != typeof document && document.head) {
|
|
14
|
-
if (appInfo.name) document.title = appInfo.name;
|
|
15
|
-
let link = document.querySelector("link[rel~='icon']");
|
|
16
|
-
if (!link) {
|
|
17
|
-
link = document.createElement('link');
|
|
18
|
-
link.rel = 'icon';
|
|
19
|
-
document.head.appendChild(link);
|
|
20
|
-
}
|
|
21
|
-
link.href = appInfo.avatar;
|
|
22
|
-
}
|
|
23
13
|
}
|
|
24
14
|
return appInfo ?? {};
|
|
25
15
|
}
|