@lark-apaas/client-toolkit 1.2.50 → 1.2.51-alpha.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,12 +2,29 @@ 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 { getAppId } from "../../utils/getAppId.js";
5
+ import { getEnv } from "../../utils/getParentOrigin.js";
5
6
  import { getCsrfToken } from "../../utils/getCsrfToken.js";
6
7
  import { isNewPathEnabled } from "../../utils/apiPath.js";
7
8
  import { useIsMobile } from "../../hooks/index.js";
8
9
  import { X } from "lucide-react";
9
10
  import { Sheet, SheetContent, SheetTrigger } from "../ui/drawer.js";
10
11
  import { t } from "../../locales/index.js";
12
+ const ICON_FEEDBACK_URL = 'https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miaoda-ui/icon_feedback_outlined.png';
13
+ const REPORT_DOMAIN = {
14
+ BOE: 'tns.feishu-boe.cn',
15
+ PRE: 'tns.feishu-pre.cn',
16
+ ONLINE: 'tns.feishu.cn'
17
+ };
18
+ const openReport = ()=>{
19
+ const params = JSON.stringify({
20
+ scene: 'miaoda_app_report',
21
+ entity_id: getAppId() ?? '',
22
+ entity_type: 'miaoda_app',
23
+ extra: ''
24
+ });
25
+ const url = `https://${REPORT_DOMAIN[getEnv()]}/cust/lark_report/?type=common&params=${encodeURIComponent(params)}&lang=zh-CN`;
26
+ window.open(url, '_blank', 'noopener,noreferrer');
27
+ };
11
28
  const Component = ()=>{
12
29
  const HasClosedKey = `miaoda-creatByMiaoda-has-closed-${getAppId()}`;
13
30
  const [visible, setVisible] = useState(!window.localStorage?.getItem(HasClosedKey));
@@ -129,6 +146,21 @@ const Component = ()=>{
129
146
  children: t('safety.ai.disclaimer')
130
147
  })
131
148
  ]
149
+ }),
150
+ /*#__PURE__*/ jsxs("div", {
151
+ className: "self-stretch shrink-0 flex items-center gap-x-[6px] cursor-pointer",
152
+ "data-custom-element": "safety-report",
153
+ onClick: openReport,
154
+ children: [
155
+ /*#__PURE__*/ jsx("img", {
156
+ src: ICON_FEEDBACK_URL,
157
+ className: "shrink-0 w-[14px] h-[14px]"
158
+ }),
159
+ /*#__PURE__*/ jsx("p", {
160
+ className: "shrink-0 m-0! text-[#646A73] text-sm underline",
161
+ children: t('safety.report')
162
+ })
163
+ ]
132
164
  })
133
165
  ]
134
166
  }),
@@ -248,6 +280,21 @@ const Component = ()=>{
248
280
  children: t('safety.ai.disclaimer')
249
281
  })
250
282
  ]
283
+ }),
284
+ /*#__PURE__*/ jsxs("div", {
285
+ className: "self-stretch shrink-0 flex items-center gap-x-[6px] cursor-pointer",
286
+ "data-custom-element": "safety-report",
287
+ onClick: openReport,
288
+ children: [
289
+ /*#__PURE__*/ jsx("img", {
290
+ src: ICON_FEEDBACK_URL,
291
+ className: "shrink-0 w-[12px] h-[12px]"
292
+ }),
293
+ /*#__PURE__*/ jsx("p", {
294
+ className: "shrink-0 m-0! text-[#a6a6a6] underline",
295
+ children: t('safety.report')
296
+ })
297
+ ]
251
298
  })
252
299
  ]
253
300
  }),
@@ -23,6 +23,10 @@ const messages_messages = {
23
23
  zh: '了解更多',
24
24
  en: 'Learn more'
25
25
  },
26
+ 'safety.report': {
27
+ zh: '投诉与举报',
28
+ en: 'Report'
29
+ },
26
30
  'safety.cover.pc': {
27
31
  zh: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodacover.png',
28
32
  en: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodacover-weben.png'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/client-toolkit",
3
- "version": "1.2.50",
3
+ "version": "1.2.51-alpha.1",
4
4
  "types": "./lib/index.d.ts",
5
5
  "main": "./lib/index.js",
6
6
  "files": [