@lark-apaas/client-toolkit 1.0.12 → 1.0.14
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/lib/components/AppContainer/index.js +9 -5
- package/lib/components/AppContainer/safety.d.ts +3 -0
- package/lib/components/AppContainer/safety.js +131 -0
- package/lib/components/Welcome/index.d.ts +1 -0
- package/lib/components/Welcome/index.js +2 -1
- package/lib/components/Welcome/welcome.css +12 -0
- package/package.json +2 -2
|
@@ -11,6 +11,7 @@ import { registerDayjsPlugins } from "./dayjsPlugins.js";
|
|
|
11
11
|
import "../../index.css";
|
|
12
12
|
import { initAxiosConfig } from "../../utils/axiosConfig.js";
|
|
13
13
|
import { useAppInfo } from "../../hooks/index.js";
|
|
14
|
+
import safety from "./safety.js";
|
|
14
15
|
registerDayjsPlugins();
|
|
15
16
|
initAxiosConfig();
|
|
16
17
|
const isMiaodaPreview = window.IS_MIAODA_PREVIEW;
|
|
@@ -57,12 +58,15 @@ const App = (props)=>{
|
|
|
57
58
|
};
|
|
58
59
|
const AppContainer = (props)=>{
|
|
59
60
|
const { children, ...rest } = props;
|
|
60
|
-
return /*#__PURE__*/
|
|
61
|
+
return /*#__PURE__*/ jsxs(ThemeProvider, {
|
|
61
62
|
...rest,
|
|
62
|
-
children:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
children: [
|
|
64
|
+
/*#__PURE__*/ jsx(safety, {}),
|
|
65
|
+
/*#__PURE__*/ jsx(App, {
|
|
66
|
+
themeMeta: props.themeMeta,
|
|
67
|
+
children: children
|
|
68
|
+
})
|
|
69
|
+
]
|
|
66
70
|
});
|
|
67
71
|
};
|
|
68
72
|
const components_AppContainer = AppContainer;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover.js";
|
|
4
|
+
import { getCsrfToken } from "../../utils/getCsrfToken.js";
|
|
5
|
+
const Component = ()=>{
|
|
6
|
+
const [open, setOpen] = useState(false);
|
|
7
|
+
const [userinfo, setUserinfo] = useState(null);
|
|
8
|
+
const [isInternetVisible, setIsInternetVisible] = useState(false);
|
|
9
|
+
useEffect(()=>{
|
|
10
|
+
fetch('/spark/b/app_4hqkwyq5s757z/tenant_info', {
|
|
11
|
+
headers: {
|
|
12
|
+
'X-Suda-Csrf-Token': getCsrfToken()
|
|
13
|
+
}
|
|
14
|
+
}).then((res)=>res.json()).then((data)=>{
|
|
15
|
+
setUserinfo(data?.data?.tenant_info);
|
|
16
|
+
setIsInternetVisible(data?.data?.is_internet_visible);
|
|
17
|
+
});
|
|
18
|
+
}, []);
|
|
19
|
+
if (!userinfo || !isInternetVisible) return null;
|
|
20
|
+
return /*#__PURE__*/ jsxs(Popover, {
|
|
21
|
+
open: open,
|
|
22
|
+
onOpenChange: setOpen,
|
|
23
|
+
children: [
|
|
24
|
+
/*#__PURE__*/ jsx(PopoverTrigger, {
|
|
25
|
+
asChild: true,
|
|
26
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
27
|
+
className: "fixed right-4 bottom-4 inline-flex items-center gap-x-[4px] px-[12px] py-[6px] bg-[#ffffffcc] shadow-[2px_4px_16px_0px_#00000024] rounded-[99px] text-[var(--token-text-title,#1f2329)] font-['PingFang_SC'] text-[14px] leading-[22px] tracking-[0px] cursor-pointer",
|
|
28
|
+
onMouseEnter: ()=>setOpen(true),
|
|
29
|
+
onMouseLeave: ()=>setOpen(false),
|
|
30
|
+
children: [
|
|
31
|
+
/*#__PURE__*/ jsx("img", {
|
|
32
|
+
src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodalogo.svg",
|
|
33
|
+
className: "shrink-0 w-[18px] h-[18px]"
|
|
34
|
+
}),
|
|
35
|
+
/*#__PURE__*/ jsx("p", {
|
|
36
|
+
className: "shrink-0 min-w-[92px]",
|
|
37
|
+
children: "由妙搭 AI 搭建"
|
|
38
|
+
})
|
|
39
|
+
]
|
|
40
|
+
})
|
|
41
|
+
}),
|
|
42
|
+
/*#__PURE__*/ jsxs(PopoverContent, {
|
|
43
|
+
className: "w-80 pt-2 bg-white rounded-xl shadow-[0px_10px_36px_10px_rgba(31,35,41,0.04)] shadow-[0px_8px_24px_0px_rgba(31,35,41,0.04)] shadow-[0px_6px_12px_-10px_rgba(31,35,41,0.06)] outline outline-[0.50px] outline-offset-[-0.50px] outline-token-line-border-card inline-flex flex-col justify-center items-start overflow-hidden p-0",
|
|
44
|
+
side: "top",
|
|
45
|
+
align: "end",
|
|
46
|
+
sideOffset: 8,
|
|
47
|
+
onMouseEnter: ()=>setOpen(true),
|
|
48
|
+
onMouseLeave: ()=>setOpen(false),
|
|
49
|
+
children: [
|
|
50
|
+
/*#__PURE__*/ jsxs("div", {
|
|
51
|
+
className: "self-stretch px-2 pt-2 pb-1 flex flex-col justify-start items-start gap-1",
|
|
52
|
+
children: [
|
|
53
|
+
/*#__PURE__*/ jsx("div", {
|
|
54
|
+
className: "self-stretch h-10 p-3 bg-token-bg-body rounded-lg flex flex-col justify-center items-start gap-2.5",
|
|
55
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
56
|
+
className: "self-stretch inline-flex justify-start items-center gap-2",
|
|
57
|
+
children: [
|
|
58
|
+
/*#__PURE__*/ jsxs("div", {
|
|
59
|
+
className: "flex-1 flex justify-start items-center gap-1",
|
|
60
|
+
children: [
|
|
61
|
+
/*#__PURE__*/ jsx("img", {
|
|
62
|
+
src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/icon_company_outlined.svg",
|
|
63
|
+
className: "shrink-0 w-[14px] h-[14px]"
|
|
64
|
+
}),
|
|
65
|
+
/*#__PURE__*/ jsx("div", {
|
|
66
|
+
className: "flex-1 justify-start text-token-icon-n1 text-sm font-normal font-['PingFang_SC'] leading-5",
|
|
67
|
+
children: "运营方"
|
|
68
|
+
})
|
|
69
|
+
]
|
|
70
|
+
}),
|
|
71
|
+
/*#__PURE__*/ jsx("div", {
|
|
72
|
+
className: "flex justify-start items-center gap-1 overflow-hidden",
|
|
73
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
74
|
+
className: "justify-start text-token-text-caption text-sm font-normal font-['PingFang_SC'] leading-5",
|
|
75
|
+
children: userinfo?.name
|
|
76
|
+
})
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
})
|
|
80
|
+
}),
|
|
81
|
+
/*#__PURE__*/ jsx("div", {
|
|
82
|
+
className: "self-stretch px-2 flex flex-col justify-start items-start gap-2.5",
|
|
83
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
84
|
+
className: "self-stretch h-0 outline outline-[0.50px] outline-offset-[-0.25px] outline-token-line-divider-default/20"
|
|
85
|
+
})
|
|
86
|
+
}),
|
|
87
|
+
/*#__PURE__*/ jsx("div", {
|
|
88
|
+
className: "self-stretch h-10 p-3 bg-token-bg-body rounded-lg flex flex-col justify-center items-start gap-2.5 hover:bg-[var(--token-fill-hover,rgba(31,35,41,0.08))] cursor-pointer transition-colors",
|
|
89
|
+
onClick: ()=>{
|
|
90
|
+
window.open('https://miaoda.feishu.cn/', '_blank');
|
|
91
|
+
},
|
|
92
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
93
|
+
className: "self-stretch inline-flex justify-start items-center gap-2",
|
|
94
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
95
|
+
className: "flex-1 flex justify-start items-center gap-1",
|
|
96
|
+
children: [
|
|
97
|
+
/*#__PURE__*/ jsx("img", {
|
|
98
|
+
src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/icon_efficiency_outlined.svg",
|
|
99
|
+
className: "shrink-0 w-[14px] h-[14px]"
|
|
100
|
+
}),
|
|
101
|
+
/*#__PURE__*/ jsx("div", {
|
|
102
|
+
className: "flex-1 justify-start text-token-icon-n1 text-sm font-normal font-['PingFang_SC'] leading-5",
|
|
103
|
+
children: "了解妙搭"
|
|
104
|
+
}),
|
|
105
|
+
/*#__PURE__*/ jsx("img", {
|
|
106
|
+
src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/icon_window-new_outlined.svg",
|
|
107
|
+
className: "shrink-0 w-[12px] h-[12px]"
|
|
108
|
+
})
|
|
109
|
+
]
|
|
110
|
+
})
|
|
111
|
+
})
|
|
112
|
+
})
|
|
113
|
+
]
|
|
114
|
+
}),
|
|
115
|
+
/*#__PURE__*/ jsx("div", {
|
|
116
|
+
className: "self-stretch h-10 px-5 py-3 bg-[var(--token-bg-content-base,#F8F9FA)] inline-flex justify-start items-center gap-2",
|
|
117
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
118
|
+
className: "flex-1 flex justify-start items-center gap-2",
|
|
119
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
120
|
+
className: "justify-start text-token-text-placeholder text-xs font-normal font-['PingFang_SC'] leading-5",
|
|
121
|
+
children: "包含 AI 生成内容,请注意甄别"
|
|
122
|
+
})
|
|
123
|
+
})
|
|
124
|
+
})
|
|
125
|
+
]
|
|
126
|
+
})
|
|
127
|
+
]
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
const safety = Component;
|
|
131
|
+
export { safety as default };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
+
import "./welcome.css";
|
|
3
4
|
const Welcome = ()=>/*#__PURE__*/ jsxs("div", {
|
|
4
|
-
className: "
|
|
5
|
+
className: "welcome-page flex flex-col items-center justify-center",
|
|
5
6
|
children: [
|
|
6
7
|
/*#__PURE__*/ jsx("div", {
|
|
7
8
|
className: "text-xl font-bold leading-8 mb-2",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/client-toolkit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"types": "./lib/index.d.ts",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@ant-design/colors": "^7.2.1",
|
|
77
77
|
"@ant-design/cssinjs": "^1.24.0",
|
|
78
|
-
"@data-loom/js": "0.3.
|
|
78
|
+
"@data-loom/js": "0.3.3",
|
|
79
79
|
"@lark-apaas/miaoda-inspector": "^1.0.0",
|
|
80
80
|
"@radix-ui/react-avatar": "^1.1.10",
|
|
81
81
|
"@radix-ui/react-popover": "^1.1.15",
|