@lark-apaas/client-toolkit 1.1.16 → 1.1.17-safety-test.1

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.
@@ -2,15 +2,21 @@ import { Fragment, jsx } from "react/jsx-runtime";
2
2
  import { useEffect } from "react";
3
3
  import { snapdom } from "@zumer/snapdom";
4
4
  import { submitPostMessage } from "../../utils/postMessage.js";
5
+ import { clearNetworkIdle, networkIdleCallback } from "network-idle";
6
+ import { normalizeBasePath } from "../../utils/utils.js";
5
7
  function PageHoc(props) {
6
8
  const { children } = props;
7
9
  useEffect(()=>{
8
10
  if ('production' !== process.env.NODE_ENV) {
9
- const timer = setTimeout(()=>{
11
+ const basePath = normalizeBasePath(process.env.CLIENT_BASE_PATH);
12
+ const id = networkIdleCallback(()=>{
13
+ const width = document.body.scrollWidth;
14
+ const height = document.body.scrollHeight;
10
15
  snapdom(document.body, {
11
16
  format: 'png',
12
- width: document.body.scrollWidth,
13
- height: document.body.scrollHeight,
17
+ width,
18
+ height,
19
+ fallbackURL: ({ src })=>`${basePath}/dev/snapdom-proxy?url=${encodeURIComponent(src)}`,
14
20
  exclude: [
15
21
  '#lucide-react-svg'
16
22
  ],
@@ -22,8 +28,8 @@ function PageHoc(props) {
22
28
  data: imgEle.src
23
29
  });
24
30
  }).catch(()=>{});
25
- }, 1000);
26
- return ()=>clearTimeout(timer);
31
+ }, 2000);
32
+ return ()=>clearNetworkIdle(id);
27
33
  }
28
34
  }, []);
29
35
  return /*#__PURE__*/ jsx(Fragment, {
@@ -0,0 +1,4 @@
1
+ [data-custom-element="safety-close"]:hover, [data-custom-element="safety-more"]:hover {
2
+ background: var(--ud-info-border);
3
+ }
4
+
@@ -1,11 +1,11 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useRef, useState } from "react";
3
3
  import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover.js";
4
4
  import { getCsrfToken } from "../../utils/getCsrfToken.js";
5
5
  import { getAppId } from "../../utils/getAppId.js";
6
6
  import { useIsMobile } from "../../hooks/index.js";
7
7
  import { X } from "lucide-react";
8
- import { Button } from "../ui/button.js";
8
+ import { Sheet, SheetContent, SheetTrigger } from "../ui/drawer.js";
9
9
  const Component = ()=>{
10
10
  const HasClosedKey = `miaoda-creatByMiaoda-has-closed-${getAppId(window.location.pathname)}`;
11
11
  const [visible, setVisible] = useState(!window.localStorage?.getItem(HasClosedKey));
@@ -24,8 +24,126 @@ const Component = ()=>{
24
24
  setIsInternetVisible(data?.data?.is_internet_visible);
25
25
  });
26
26
  }, []);
27
- if ('production' !== process.env.NODE_ENV) return null;
28
- if (isMobile || !visible || !userinfo) return null;
27
+ useEffect(()=>{
28
+ if (isMobile) {
29
+ const link = document.createElement('link');
30
+ link.rel = 'preload';
31
+ link.as = 'image';
32
+ link.href = 'https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodacover-mobile.png';
33
+ document.head.appendChild(link);
34
+ }
35
+ }, [
36
+ isMobile
37
+ ]);
38
+ if (!visible) return null;
39
+ if (isMobile) return /*#__PURE__*/ jsxs(Sheet, {
40
+ open: open,
41
+ onOpenChange: setOpen,
42
+ children: [
43
+ /*#__PURE__*/ jsx(SheetTrigger, {
44
+ asChild: true,
45
+ children: /*#__PURE__*/ jsxs("div", {
46
+ className: "fixed right-3 bottom-20 inline-flex items-center gap-x-1 border-solid border-[#ffffff1a] border px-2.5 py-1.5 bg-[#1f2329e5] backdrop-blur-[5px] shadow-[0px_6px_12px_0px_#41444a0a,0px_8px_24px_8px_#41444a0a] rounded-md text-[#ebebeb)] font-['PingFang_SC'] text-xs leading-[20px] tracking-[0px] z-[10000000]",
47
+ onClick: ()=>{
48
+ setOpen(true);
49
+ },
50
+ children: [
51
+ /*#__PURE__*/ jsx("img", {
52
+ src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodalogo.svg",
53
+ className: "shrink-0 w-[16px] h-[16px]"
54
+ }),
55
+ /*#__PURE__*/ jsx("p", {
56
+ className: "shrink-0 min-w-[28px] m-0! text-[#EBEBEB]",
57
+ children: "妙搭"
58
+ })
59
+ ]
60
+ })
61
+ }),
62
+ /*#__PURE__*/ jsx(SheetContent, {
63
+ side: "bottom",
64
+ className: "z-[10000001] border-none bg-transparent outline-0!",
65
+ children: /*#__PURE__*/ jsxs("div", {
66
+ className: "flex flex-col bg-white overflow-hidden rounded-t-2xl relative",
67
+ children: [
68
+ /*#__PURE__*/ jsx(X, {
69
+ className: "absolute top-2 left-4 size-6",
70
+ onClick: ()=>setOpen(false)
71
+ }),
72
+ /*#__PURE__*/ jsx("img", {
73
+ src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodacover-mobile.png",
74
+ alt: "",
75
+ className: "w-full h-full",
76
+ onClick: ()=>{
77
+ window.open('https://miaoda.feishu.cn/landing', '_blank');
78
+ }
79
+ }),
80
+ /*#__PURE__*/ jsxs("div", {
81
+ className: "flex flex-col w-full justify-center items-end gap-y-4 border-solid border-[#ffffff0d] border px-5 pt-4 pb-12 shadow-(--shadow-2xs,0px_2px_8px_2px_var(--shadow-2xs-1-color,#1f232905),0px_2px_8px_2px_var(--shadow-2xs-1-color,#1f232905),0px_2px_4px_0px_var(--shadow-2xs-1-color,#1f232905)) rounded-t-[12px] text-[#a6a6a6] font-['PingFang_SC'] text-[12px] leading-[20px] tracking-[0px]",
82
+ children: [
83
+ /*#__PURE__*/ jsxs("div", {
84
+ className: "self-stretch shrink-0 flex flex-col items-start gap-y-[4px]",
85
+ children: [
86
+ isInternetVisible && /*#__PURE__*/ jsxs("div", {
87
+ className: "self-stretch shrink-0 flex items-center gap-x-[6px]",
88
+ children: [
89
+ /*#__PURE__*/ jsx("img", {
90
+ src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/icon/icon_company_outlined.svg",
91
+ className: "shrink-0 w-3.5 h-3.5"
92
+ }),
93
+ /*#__PURE__*/ jsxs("p", {
94
+ className: "shrink-0 min-w-[96px] m-0! text-[#646A73] text-sm",
95
+ children: [
96
+ userinfo?.name,
97
+ "运营"
98
+ ]
99
+ })
100
+ ]
101
+ }),
102
+ /*#__PURE__*/ jsxs("div", {
103
+ className: "self-stretch shrink-0 flex items-center gap-x-[6px]",
104
+ children: [
105
+ /*#__PURE__*/ jsx("img", {
106
+ src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/icon/icon_efficiency-ai_outlined.svg",
107
+ className: "shrink-0 w-3.5 h-3.5"
108
+ }),
109
+ /*#__PURE__*/ jsx("p", {
110
+ className: "shrink-0 min-w-[163px] m-0! text-[#646A73] text-sm",
111
+ children: "包含 AI 生成内容,请注意甄别"
112
+ })
113
+ ]
114
+ })
115
+ ]
116
+ }),
117
+ /*#__PURE__*/ jsxs("div", {
118
+ className: "self-stretch shrink-0 flex items-start gap-x-4",
119
+ children: [
120
+ /*#__PURE__*/ jsx("div", {
121
+ className: "flex-1 flex rounded-[99px] items-center justify-center border-[0.5px] border-[#D0D3D6] bg-white text-[#1F2329] cursor-pointer text-lg py-3",
122
+ onClick: (e)=>{
123
+ e.stopPropagation();
124
+ e.preventDefault();
125
+ setOpen(false);
126
+ setTimeout(()=>setVisible(false), 200);
127
+ window.localStorage?.setItem(HasClosedKey, 'true');
128
+ },
129
+ children: "不再展示"
130
+ }),
131
+ /*#__PURE__*/ jsx("div", {
132
+ className: "flex-1 flex rounded-[99px] items-center justify-center border-[0.5px] border-black bg-black text-white cursor-pointer text-lg py-3",
133
+ onClick: ()=>{
134
+ window.open('https://miaoda.feishu.cn/landing', '_blank');
135
+ },
136
+ children: "了解更多"
137
+ })
138
+ ]
139
+ })
140
+ ]
141
+ })
142
+ ]
143
+ })
144
+ })
145
+ ]
146
+ });
29
147
  return /*#__PURE__*/ jsxs(Popover, {
30
148
  open: open,
31
149
  onOpenChange: setOpen,
@@ -33,7 +151,7 @@ const Component = ()=>{
33
151
  /*#__PURE__*/ jsx(PopoverTrigger, {
34
152
  asChild: true,
35
153
  children: /*#__PURE__*/ jsxs("div", {
36
- 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 z-[10000000]",
154
+ className: "fixed right-3 bottom-3 inline-flex items-center gap-x-1 border-solid border-[#ffffff1a] border px-2.5 py-1.5 bg-[#1f2329e5] backdrop-blur-[5px] shadow-[0px_6px_12px_0px_#41444a0a,0px_8px_24px_8px_#41444a0a] rounded-md text-[#ebebeb)] font-['PingFang_SC'] text-xs leading-[20px] tracking-[0px] z-[10000000] cursor-pointer",
37
155
  onMouseEnter: ()=>{
38
156
  clearTimeout(timeoutRef.current);
39
157
  setOpen(true);
@@ -44,31 +162,20 @@ const Component = ()=>{
44
162
  children: [
45
163
  /*#__PURE__*/ jsx("img", {
46
164
  src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodalogo.svg",
47
- className: "shrink-0 w-[18px] h-[18px]"
165
+ className: "shrink-0 w-[16px] h-[16px]"
48
166
  }),
49
167
  /*#__PURE__*/ jsx("p", {
50
- className: "shrink-0 min-w-[92px]",
51
- children: "由妙搭 AI 搭建"
52
- }),
53
- /*#__PURE__*/ jsx(Button, {
54
- size: "icon",
55
- variant: "ghost",
56
- className: "cursor-pointer rounded-full w-4 h-4 hover:bg-[#1f232914]",
57
- onClick: (e)=>{
58
- e.stopPropagation();
59
- e.preventDefault();
60
- setVisible(false);
61
- window.localStorage?.setItem(HasClosedKey, 'true');
62
- },
63
- children: /*#__PURE__*/ jsx(X, {
64
- className: "text-[#646A73] !w-[10px] !h-[10px]"
65
- })
168
+ className: "shrink-0 min-w-[60px] m-0! text-[#EBEBEB]",
169
+ children: "由妙搭搭建"
66
170
  })
67
171
  ]
68
172
  })
69
173
  }),
70
- /*#__PURE__*/ jsxs(PopoverContent, {
71
- className: "w-80 border-0 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-[#DEE0E3] inline-flex flex-col justify-center items-start overflow-hidden p-0",
174
+ /*#__PURE__*/ jsx(PopoverContent, {
175
+ className: "overflow-hidden p-0 m-0 border-0",
176
+ style: {
177
+ boxShadow: '0 6px 12px 0 rgba(65, 68, 74, 0.04), 0 8px 24px 0 rgba(65, 68, 74, 0.04)'
178
+ },
72
179
  side: "top",
73
180
  align: "end",
74
181
  sideOffset: 8,
@@ -79,87 +186,82 @@ const Component = ()=>{
79
186
  onMouseLeave: ()=>{
80
187
  timeoutRef.current = setTimeout(()=>setOpen(false), 100);
81
188
  },
82
- children: [
83
- /*#__PURE__*/ jsxs("div", {
84
- className: "self-stretch px-2 pt-2 pb-1 flex flex-col justify-start items-start gap-1",
85
- children: [
86
- isInternetVisible && /*#__PURE__*/ jsxs(Fragment, {
87
- children: [
88
- /*#__PURE__*/ jsx("div", {
89
- className: "self-stretch h-10 p-3 bg-token-bg-body rounded-lg flex flex-col justify-center items-start gap-2.5",
90
- children: /*#__PURE__*/ jsxs("div", {
91
- className: "self-stretch inline-flex justify-start items-center gap-2",
189
+ children: /*#__PURE__*/ jsxs("div", {
190
+ className: "flex flex-col bg-[#1F2021]",
191
+ children: [
192
+ /*#__PURE__*/ jsx("img", {
193
+ src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodacover.png",
194
+ alt: "",
195
+ className: "w-72 h-32 cursor-pointer",
196
+ onClick: ()=>{
197
+ window.open('https://miaoda.feishu.cn/landing', '_blank');
198
+ }
199
+ }),
200
+ /*#__PURE__*/ jsxs("div", {
201
+ className: "flex flex-col justify-center items-end gap-y-[12px] border-solid border-[#ffffff0d] border pl-[14px] pr-[15px] pt-[11px] pb-[15px] w-[286px] shadow-(--shadow-2xs,0px_2px_8px_2px_var(--shadow-2xs-1-color,#1f232905),0px_2px_8px_2px_var(--shadow-2xs-1-color,#1f232905),0px_2px_4px_0px_var(--shadow-2xs-1-color,#1f232905)) rounded-t-[12px] text-[#a6a6a6] font-['PingFang_SC'] text-[12px] leading-[20px] tracking-[0px]",
202
+ children: [
203
+ /*#__PURE__*/ jsxs("div", {
204
+ className: "self-stretch shrink-0 flex flex-col items-start gap-y-[4px]",
205
+ children: [
206
+ isInternetVisible && /*#__PURE__*/ jsxs("div", {
207
+ className: "self-stretch shrink-0 flex items-center gap-x-[6px]",
92
208
  children: [
93
- /*#__PURE__*/ jsxs("div", {
94
- className: "flex-1 flex justify-start items-center gap-1",
209
+ /*#__PURE__*/ jsx("img", {
210
+ src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/icon/icon_company_outlined.svg",
211
+ className: "shrink-0 w-[12px] h-[12px]"
212
+ }),
213
+ /*#__PURE__*/ jsxs("p", {
214
+ className: "shrink-0 min-w-[96px] m-0! text-[#a6a6a6]",
95
215
  children: [
96
- /*#__PURE__*/ jsx("img", {
97
- src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/icon_company_outlined.svg",
98
- className: "shrink-0 w-[14px] h-[14px]"
99
- }),
100
- /*#__PURE__*/ jsx("div", {
101
- className: "flex-1 justify-start text-[#2B2F36] text-sm font-normal font-['PingFang_SC'] leading-5",
102
- children: "运营方"
103
- })
216
+ userinfo?.name,
217
+ "运营"
104
218
  ]
219
+ })
220
+ ]
221
+ }),
222
+ /*#__PURE__*/ jsxs("div", {
223
+ className: "self-stretch shrink-0 flex items-center gap-x-[6px]",
224
+ children: [
225
+ /*#__PURE__*/ jsx("img", {
226
+ src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/icon/icon_efficiency-ai_outlined.svg",
227
+ className: "shrink-0 w-[12px] h-[12px]"
105
228
  }),
106
- /*#__PURE__*/ jsx("div", {
107
- className: "flex justify-start items-center gap-1 overflow-hidden",
108
- children: /*#__PURE__*/ jsx("div", {
109
- className: "justify-start text-[#646A73] text-sm font-normal font-['PingFang_SC'] leading-5",
110
- children: userinfo?.name
111
- })
229
+ /*#__PURE__*/ jsx("p", {
230
+ className: "shrink-0 min-w-[163px] m-0! text-[#a6a6a6]",
231
+ children: "包含 AI 生成内容,请注意甄别"
112
232
  })
113
233
  ]
114
234
  })
115
- }),
116
- /*#__PURE__*/ jsx("div", {
117
- className: "self-stretch px-2 flex flex-col justify-start items-start gap-2.5",
118
- children: /*#__PURE__*/ jsx("div", {
119
- className: "self-stretch h-0 outline outline-[0.50px] outline-offset-[-0.25px] outline-[rgba(31,35,41,0.15)]"
235
+ ]
236
+ }),
237
+ /*#__PURE__*/ jsxs("div", {
238
+ className: "self-stretch shrink-0 flex items-start gap-x-[8px]",
239
+ children: [
240
+ /*#__PURE__*/ jsx("div", {
241
+ className: "flex-1 flex rounded-lg h-[34px] items-center justify-center border-[0.5px] bg-transparent border-solid hover:bg-[#ffffff08] text-[#ebebeb99] hover:text-[#ebebebe6] cursor-pointer border-[#ffffff1c]",
242
+ "data-custom-element": "safety-close",
243
+ onClick: (e)=>{
244
+ e.stopPropagation();
245
+ e.preventDefault();
246
+ setVisible(false);
247
+ window.localStorage?.setItem(HasClosedKey, 'true');
248
+ },
249
+ children: "不再展示"
250
+ }),
251
+ /*#__PURE__*/ jsx("div", {
252
+ className: "flex-1 flex rounded-lg items-center justify-center h-[34px] border-[0.5px] border-solid border-[#ffffff1c] hover:border-[#ffffff33] bg-[#ffffff08] hover:bg-[#ffffff14] cursor-pointer text-[#ebebeb]",
253
+ "data-custom-element": "safety-more",
254
+ onClick: ()=>{
255
+ window.open('https://miaoda.feishu.cn/landing', '_blank');
256
+ },
257
+ children: "了解更多"
120
258
  })
121
- })
122
- ]
123
- }),
124
- /*#__PURE__*/ jsx("div", {
125
- 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",
126
- onClick: ()=>{
127
- window.open('https://miaoda.feishu.cn/', '_blank');
128
- },
129
- children: /*#__PURE__*/ jsx("div", {
130
- className: "self-stretch inline-flex justify-start items-center gap-2",
131
- children: /*#__PURE__*/ jsxs("div", {
132
- className: "flex-1 flex justify-start items-center gap-1",
133
- children: [
134
- /*#__PURE__*/ jsx("img", {
135
- src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/icon_efficiency_outlined.svg",
136
- className: "shrink-0 w-[14px] h-[14px]"
137
- }),
138
- /*#__PURE__*/ jsx("div", {
139
- className: "flex-1 justify-start text-[#2B2F36] text-sm font-normal font-['PingFang_SC'] leading-5",
140
- children: "了解妙搭"
141
- }),
142
- /*#__PURE__*/ jsx("img", {
143
- src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/icon_window-new_outlined.svg",
144
- className: "shrink-0 w-[12px] h-[12px]"
145
- })
146
- ]
147
- })
259
+ ]
148
260
  })
149
- })
150
- ]
151
- }),
152
- /*#__PURE__*/ jsx("div", {
153
- className: "self-stretch h-10 px-5 py-3 bg-[var(--token-bg-content-base,#F8F9FA)] inline-flex justify-start items-center gap-2",
154
- children: /*#__PURE__*/ jsx("div", {
155
- className: "flex-1 flex justify-start items-center gap-2",
156
- children: /*#__PURE__*/ jsx("div", {
157
- className: "justify-start text-[#8F959E] text-xs font-normal font-['PingFang_SC'] leading-5",
158
- children: "包含 AI 生成内容,请注意甄别"
159
- })
261
+ ]
160
262
  })
161
- })
162
- ]
263
+ ]
264
+ })
163
265
  })
164
266
  ]
165
267
  });
@@ -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" | "destructive" | "outline" | "secondary";
4
+ variant?: "default" | "secondary" | "destructive" | "outline";
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" | "destructive" | "outline" | "secondary" | "ghost";
4
+ variant?: "default" | "link" | "secondary" | "destructive" | "outline" | "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> & {
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ import * as SheetPrimitive from "@radix-ui/react-dialog";
3
+ declare function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>): React.JSX.Element;
4
+ declare function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>): React.JSX.Element;
5
+ declare function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>): React.JSX.Element;
6
+ declare function SheetContent({ className, children, side, ...props }: React.ComponentProps<typeof SheetPrimitive.Content> & {
7
+ side?: "top" | "right" | "bottom" | "left";
8
+ }): React.JSX.Element;
9
+ declare function SheetHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
10
+ declare function SheetFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
11
+ declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>): React.JSX.Element;
12
+ declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>): React.JSX.Element;
13
+ export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
@@ -0,0 +1,78 @@
1
+ "use client"
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import "react";
4
+ import { Close, Content, Description, Overlay, Portal, Root, Title, Trigger } from "@radix-ui/react-dialog";
5
+ import { clsxWithTw } from "../../utils/utils.js";
6
+ function Sheet({ ...props }) {
7
+ return /*#__PURE__*/ jsx(Root, {
8
+ "data-slot": "sheet",
9
+ ...props
10
+ });
11
+ }
12
+ function SheetTrigger({ ...props }) {
13
+ return /*#__PURE__*/ jsx(Trigger, {
14
+ "data-slot": "sheet-trigger",
15
+ ...props
16
+ });
17
+ }
18
+ function SheetClose({ ...props }) {
19
+ return /*#__PURE__*/ jsx(Close, {
20
+ "data-slot": "sheet-close",
21
+ ...props
22
+ });
23
+ }
24
+ function SheetPortal({ ...props }) {
25
+ return /*#__PURE__*/ jsx(Portal, {
26
+ "data-slot": "sheet-portal",
27
+ ...props
28
+ });
29
+ }
30
+ function SheetOverlay({ className, ...props }) {
31
+ return /*#__PURE__*/ jsx(Overlay, {
32
+ "data-slot": "sheet-overlay",
33
+ className: clsxWithTw("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className),
34
+ ...props
35
+ });
36
+ }
37
+ function SheetContent({ className, children, side = "right", ...props }) {
38
+ return /*#__PURE__*/ jsxs(SheetPortal, {
39
+ children: [
40
+ /*#__PURE__*/ jsx(SheetOverlay, {}),
41
+ /*#__PURE__*/ jsx(Content, {
42
+ "data-slot": "sheet-content",
43
+ className: clsxWithTw("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500", "right" === side && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm", "left" === side && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm", "top" === side && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b", "bottom" === side && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t", className),
44
+ ...props,
45
+ children: children
46
+ })
47
+ ]
48
+ });
49
+ }
50
+ function SheetHeader({ className, ...props }) {
51
+ return /*#__PURE__*/ jsx("div", {
52
+ "data-slot": "sheet-header",
53
+ className: clsxWithTw("flex flex-col gap-1.5 p-4", className),
54
+ ...props
55
+ });
56
+ }
57
+ function SheetFooter({ className, ...props }) {
58
+ return /*#__PURE__*/ jsx("div", {
59
+ "data-slot": "sheet-footer",
60
+ className: clsxWithTw("mt-auto flex flex-col gap-2 p-4", className),
61
+ ...props
62
+ });
63
+ }
64
+ function SheetTitle({ className, ...props }) {
65
+ return /*#__PURE__*/ jsx(Title, {
66
+ "data-slot": "sheet-title",
67
+ className: clsxWithTw("text-foreground font-semibold", className),
68
+ ...props
69
+ });
70
+ }
71
+ function SheetDescription({ className, ...props }) {
72
+ return /*#__PURE__*/ jsx(Description, {
73
+ "data-slot": "sheet-description",
74
+ className: clsxWithTw("text-muted-foreground text-sm", className),
75
+ ...props
76
+ });
77
+ }
78
+ export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };
@@ -61,6 +61,21 @@ function processDevServerLog(log) {
61
61
  });
62
62
  }
63
63
  }
64
+ function listenHmrApplyFailed() {
65
+ const hot = import.meta.webpackHot || module.hot;
66
+ if (hot) hot.addStatusHandler((status)=>{
67
+ if ('fail' === status || 'abort' === status) {
68
+ console.warn('hmr apply failed', status);
69
+ submitSlardarEvent({
70
+ name: 'sandbox-devServer',
71
+ categories: {
72
+ type: 'hmr-apply-failed',
73
+ status
74
+ }
75
+ });
76
+ }
77
+ });
78
+ }
64
79
  function interceptErrors() {
65
80
  window.addEventListener('error', (event)=>{
66
81
  logger.error(event.error);
@@ -68,6 +83,7 @@ function interceptErrors() {
68
83
  window.addEventListener('unhandledrejection', (event)=>{
69
84
  logger.error(event.reason);
70
85
  });
86
+ listenHmrApplyFailed();
71
87
  const PROXY_CONSOLE_METHOD = [
72
88
  'log',
73
89
  'info',
@@ -15,9 +15,22 @@ async function logResponse(ok, response) {
15
15
  'ms'
16
16
  ];
17
17
  const logTraceID = response.headers['x-log-trace-id'];
18
+ const queryParams = {};
19
+ const url = response.config.url || '';
20
+ const queryString = url.split('?')[1];
21
+ if (queryString) {
22
+ const urlParams = new URLSearchParams(queryString);
23
+ urlParams.forEach((value, key)=>{
24
+ queryParams[key] = value;
25
+ });
26
+ }
27
+ if (response.config.params) Object.assign(queryParams, response.config.params);
18
28
  const args = [
19
29
  {
20
30
  '请求参数:': response.config.data,
31
+ ...Object.keys(queryParams).length > 0 && {
32
+ '查询参数:': queryParams
33
+ },
21
34
  '返回数据:': response.data,
22
35
  '请求摘要:': {
23
36
  TraceID: logTraceID,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/client-toolkit",
3
- "version": "1.1.16",
3
+ "version": "1.1.17-safety-test.1",
4
4
  "types": "./lib/index.d.ts",
5
5
  "main": "./lib/index.js",
6
6
  "files": [
@@ -88,6 +88,7 @@
88
88
  "dayjs": "^1.11.13",
89
89
  "echarts": "^6.0.0",
90
90
  "lodash": "^4.17.21",
91
+ "network-idle": "^0.2.0",
91
92
  "penpal": "^6.2.2",
92
93
  "sockjs-client": "^1.6.1",
93
94
  "sonner": "~2.0.0",
@@ -102,6 +103,7 @@
102
103
  "devDependencies": {
103
104
  "@biomejs/biome": "2.0.6",
104
105
  "@changesets/cli": "^2.29.5",
106
+ "@radix-ui/react-dialog": "^1.1.15",
105
107
  "@rsbuild/core": "~1.4.13",
106
108
  "@rsbuild/plugin-react": "^1.3.4",
107
109
  "@rslib/core": "^0.15.0",
@@ -123,7 +125,7 @@
123
125
  "antd": "^5.26.6",
124
126
  "eslint": "^8.57.0",
125
127
  "jsdom": "^26.1.0",
126
- "lucide-react": "npm:@lark-apaas/lucide-react@1.0.2",
128
+ "lucide-react": "^0.554.0",
127
129
  "react": "^18.3.1",
128
130
  "react-dom": "^18.3.1",
129
131
  "react-router-dom": "^6.26.2",