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

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, {
@@ -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,115 @@ 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
+ if (!visible) return null;
28
+ if (isMobile) return /*#__PURE__*/ jsxs(Sheet, {
29
+ open: open,
30
+ onOpenChange: setOpen,
31
+ children: [
32
+ /*#__PURE__*/ jsx(SheetTrigger, {
33
+ asChild: true,
34
+ children: /*#__PURE__*/ jsxs("div", {
35
+ 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]",
36
+ onClick: ()=>{
37
+ setOpen(true);
38
+ },
39
+ children: [
40
+ /*#__PURE__*/ jsx("img", {
41
+ src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodalogo.svg",
42
+ className: "shrink-0 w-[16px] h-[16px]"
43
+ }),
44
+ /*#__PURE__*/ jsx("p", {
45
+ className: "shrink-0 min-w-[28px] m-0! text-[#EBEBEB]",
46
+ children: "妙搭"
47
+ })
48
+ ]
49
+ })
50
+ }),
51
+ /*#__PURE__*/ jsx(SheetContent, {
52
+ side: "bottom",
53
+ className: "z-[10000001] border-none bg-transparent",
54
+ children: /*#__PURE__*/ jsxs("div", {
55
+ className: "flex flex-col bg-white overflow-hidden rounded-t-2xl relative",
56
+ children: [
57
+ /*#__PURE__*/ jsx(X, {
58
+ className: "absolute top-2 left-4 size-6",
59
+ onClick: ()=>setOpen(false)
60
+ }),
61
+ /*#__PURE__*/ jsx("img", {
62
+ src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodacover-mobile.png",
63
+ alt: "",
64
+ className: "w-full h-full",
65
+ onClick: ()=>{
66
+ window.open('https://miaoda.feishu.cn/landing', '_blank');
67
+ }
68
+ }),
69
+ /*#__PURE__*/ jsxs("div", {
70
+ 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]",
71
+ children: [
72
+ /*#__PURE__*/ jsxs("div", {
73
+ className: "self-stretch shrink-0 flex flex-col items-start gap-y-[4px]",
74
+ children: [
75
+ isInternetVisible && /*#__PURE__*/ jsxs("div", {
76
+ className: "self-stretch shrink-0 flex items-center gap-x-[6px]",
77
+ children: [
78
+ /*#__PURE__*/ jsx("img", {
79
+ src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/icon/icon_company_outlined.svg",
80
+ className: "shrink-0 w-3.5 h-3.5"
81
+ }),
82
+ /*#__PURE__*/ jsxs("p", {
83
+ className: "shrink-0 min-w-[96px] m-0! text-[#a6a6a6] text-sm",
84
+ children: [
85
+ userinfo?.name,
86
+ "运营"
87
+ ]
88
+ })
89
+ ]
90
+ }),
91
+ /*#__PURE__*/ jsxs("div", {
92
+ className: "self-stretch shrink-0 flex items-center gap-x-[6px]",
93
+ children: [
94
+ /*#__PURE__*/ jsx("img", {
95
+ src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/icon/icon_efficiency-ai_outlined.svg",
96
+ className: "shrink-0 w-3.5 h-3.5"
97
+ }),
98
+ /*#__PURE__*/ jsx("p", {
99
+ className: "shrink-0 min-w-[163px] m-0! text-[#a6a6a6] text-sm",
100
+ children: "包含 AI 生成内容,请注意甄别"
101
+ })
102
+ ]
103
+ })
104
+ ]
105
+ }),
106
+ /*#__PURE__*/ jsxs("div", {
107
+ className: "self-stretch shrink-0 flex items-start gap-x-4",
108
+ children: [
109
+ /*#__PURE__*/ jsx("div", {
110
+ 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",
111
+ onClick: (e)=>{
112
+ e.stopPropagation();
113
+ e.preventDefault();
114
+ setOpen(false);
115
+ setTimeout(()=>setVisible(false), 200);
116
+ window.localStorage?.setItem(HasClosedKey, 'true');
117
+ },
118
+ children: "不再展示"
119
+ }),
120
+ /*#__PURE__*/ jsx("div", {
121
+ 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",
122
+ onClick: ()=>{
123
+ window.open('https://miaoda.feishu.cn/landing', '_blank');
124
+ },
125
+ children: "了解更多"
126
+ })
127
+ ]
128
+ })
129
+ ]
130
+ })
131
+ ]
132
+ })
133
+ })
134
+ ]
135
+ });
29
136
  return /*#__PURE__*/ jsxs(Popover, {
30
137
  open: open,
31
138
  onOpenChange: setOpen,
@@ -33,7 +140,7 @@ const Component = ()=>{
33
140
  /*#__PURE__*/ jsx(PopoverTrigger, {
34
141
  asChild: true,
35
142
  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]",
143
+ 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]",
37
144
  onMouseEnter: ()=>{
38
145
  clearTimeout(timeoutRef.current);
39
146
  setOpen(true);
@@ -44,31 +151,17 @@ const Component = ()=>{
44
151
  children: [
45
152
  /*#__PURE__*/ jsx("img", {
46
153
  src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodalogo.svg",
47
- className: "shrink-0 w-[18px] h-[18px]"
154
+ className: "shrink-0 w-[16px] h-[16px]"
48
155
  }),
49
156
  /*#__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
- })
157
+ className: "shrink-0 min-w-[60px] m-0! text-[#EBEBEB]",
158
+ children: "由妙搭搭建"
66
159
  })
67
160
  ]
68
161
  })
69
162
  }),
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",
163
+ /*#__PURE__*/ jsx(PopoverContent, {
164
+ className: "overflow-hidden p-0 m-0 border-0",
72
165
  side: "top",
73
166
  align: "end",
74
167
  sideOffset: 8,
@@ -79,87 +172,80 @@ const Component = ()=>{
79
172
  onMouseLeave: ()=>{
80
173
  timeoutRef.current = setTimeout(()=>setOpen(false), 100);
81
174
  },
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",
175
+ children: /*#__PURE__*/ jsxs("div", {
176
+ className: "flex flex-col bg-[#1F2021]",
177
+ children: [
178
+ /*#__PURE__*/ jsx("img", {
179
+ src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodacover.png",
180
+ alt: "",
181
+ className: "w-72 h-full",
182
+ onClick: ()=>{
183
+ window.open('https://miaoda.feishu.cn/landing', '_blank');
184
+ }
185
+ }),
186
+ /*#__PURE__*/ jsxs("div", {
187
+ 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]",
188
+ children: [
189
+ /*#__PURE__*/ jsxs("div", {
190
+ className: "self-stretch shrink-0 flex flex-col items-start gap-y-[4px]",
191
+ children: [
192
+ isInternetVisible && /*#__PURE__*/ jsxs("div", {
193
+ className: "self-stretch shrink-0 flex items-center gap-x-[6px]",
92
194
  children: [
93
- /*#__PURE__*/ jsxs("div", {
94
- className: "flex-1 flex justify-start items-center gap-1",
195
+ /*#__PURE__*/ jsx("img", {
196
+ src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/icon/icon_company_outlined.svg",
197
+ className: "shrink-0 w-[12px] h-[12px]"
198
+ }),
199
+ /*#__PURE__*/ jsxs("p", {
200
+ className: "shrink-0 min-w-[96px] m-0! text-[#a6a6a6]",
95
201
  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
- })
202
+ userinfo?.name,
203
+ "运营"
104
204
  ]
205
+ })
206
+ ]
207
+ }),
208
+ /*#__PURE__*/ jsxs("div", {
209
+ className: "self-stretch shrink-0 flex items-center gap-x-[6px]",
210
+ children: [
211
+ /*#__PURE__*/ jsx("img", {
212
+ src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/icon/icon_efficiency-ai_outlined.svg",
213
+ className: "shrink-0 w-[12px] h-[12px]"
105
214
  }),
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
- })
215
+ /*#__PURE__*/ jsx("p", {
216
+ className: "shrink-0 min-w-[163px] m-0! text-[#a6a6a6]",
217
+ children: "包含 AI 生成内容,请注意甄别"
112
218
  })
113
219
  ]
114
220
  })
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)]"
221
+ ]
222
+ }),
223
+ /*#__PURE__*/ jsxs("div", {
224
+ className: "self-stretch shrink-0 flex items-start gap-x-[8px]",
225
+ children: [
226
+ /*#__PURE__*/ jsx("div", {
227
+ className: "flex-1 flex rounded-lg h-[34px] items-center justify-center border-[0.5px] bg-none hover:bg-[rgba(255, 255, 255, 0.03)] hover-[#262728]! text-[rgba(235,235,235,0.6)] hover:text-[rgba(235,235,235,0.8)] cursor-pointer border-[rgba(255,255,255,0.11)]",
228
+ onClick: (e)=>{
229
+ e.stopPropagation();
230
+ e.preventDefault();
231
+ setVisible(false);
232
+ window.localStorage?.setItem(HasClosedKey, 'true');
233
+ },
234
+ children: "不再展示"
235
+ }),
236
+ /*#__PURE__*/ jsx("div", {
237
+ className: "flex-1 flex rounded-lg items-center justify-center h-[34px] border-[0.5px] border-[rgba(255, 255, 255, 0.11)] hover:border-[rgba(255, 255, 255, 0.20)] bg-[rgba(255, 255, 255, 0.03)] hover:bg-[rgba(255, 255, 255, 0.08)] cursor-pointer text-[#ebebeb]",
238
+ onClick: ()=>{
239
+ window.open('https://miaoda.feishu.cn/landing', '_blank');
240
+ },
241
+ children: "了解更多"
120
242
  })
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
- })
243
+ ]
148
244
  })
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
- })
245
+ ]
160
246
  })
161
- })
162
- ]
247
+ ]
248
+ })
163
249
  })
164
250
  ]
165
251
  });
@@ -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.0",
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",