@lark-apaas/client-toolkit 1.0.10 → 1.0.11

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.
@@ -5,5 +5,6 @@ export interface UserDisplayProps {
5
5
  size?: 'small' | 'medium' | 'large';
6
6
  className?: string;
7
7
  style?: React.CSSProperties;
8
+ showLabel?: boolean;
8
9
  }
9
10
  export declare const UserDisplay: React.FC<UserDisplayProps>;
@@ -5,7 +5,7 @@ import { clsxWithTw } from "../../utils/utils.js";
5
5
  import { UserProfile } from "./UserProfile/index.js";
6
6
  import { UserWithAvatar } from "./UserWithAvatar.js";
7
7
  import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover.js";
8
- const UserDisplay = ({ users, size, className, style })=>{
8
+ const UserDisplay = ({ users, size, className, style, showLabel = true })=>{
9
9
  const normalizedUsers = useMemo(()=>Array.isArray(users) ? users : [
10
10
  users
11
11
  ].filter(Boolean), [
@@ -96,6 +96,7 @@ const UserDisplay = ({ users, size, className, style })=>{
96
96
  children: /*#__PURE__*/ jsx(UserWithAvatar, {
97
97
  data: user,
98
98
  size: size,
99
+ showLabel: showLabel,
99
100
  className: "cursor-pointer hover:bg-[rgba(31,35,41,0.15)] active:bg-[rgba(31,35,41,0.2)]"
100
101
  })
101
102
  })
@@ -1,3 +1,3 @@
1
1
  import * as React from 'react';
2
2
  import type { UserWithAvatarProps } from './type';
3
- export declare function UserWithAvatar({ data, size, mode, className, }: UserWithAvatarProps): React.JSX.Element;
3
+ export declare function UserWithAvatar({ data, size, mode, className, showLabel, }: UserWithAvatarProps): React.JSX.Element;
@@ -23,7 +23,7 @@ const textVariantMap = {
23
23
  medium: 'text-[14px] leading-[20px]',
24
24
  large: 'text-[16px] leading-[24px]'
25
25
  };
26
- function UserWithAvatar({ data, size = 'medium', mode = 'tag', className }) {
26
+ function UserWithAvatar({ data, size = 'medium', mode = 'tag', className, showLabel = true }) {
27
27
  const { avatar, name } = data;
28
28
  const displayName = name?.trim() || '无效人员';
29
29
  const formatSize = [
@@ -48,7 +48,7 @@ function UserWithAvatar({ data, size = 'medium', mode = 'tag', className }) {
48
48
  })
49
49
  ]
50
50
  }),
51
- /*#__PURE__*/ jsx(OverflowTooltipText, {
51
+ showLabel && /*#__PURE__*/ jsx(OverflowTooltipText, {
52
52
  text: displayName,
53
53
  className: clsxWithTw('text-card-foreground', textVariantMap[formatSize])
54
54
  })
@@ -10,4 +10,8 @@ export interface UserWithAvatarProps {
10
10
  */
11
11
  mode?: 'tag' | 'plain';
12
12
  className?: string;
13
+ /**
14
+ * @default true
15
+ */
16
+ showLabel?: boolean;
13
17
  }
@@ -13,7 +13,7 @@ class BatchLogger {
13
13
  userId,
14
14
  tenantId,
15
15
  appId,
16
- endpoint: '/dev/logs/collect-batch',
16
+ endpoint: (process.env.CLIENT_BASE_PATH || '') + '/dev/logs/collect-batch',
17
17
  sizeThreshold: 20,
18
18
  flushInterval: 1000,
19
19
  maxRetries: 3,
@@ -2,10 +2,11 @@ function getAppId(path) {
2
2
  if (window.MIAODA_APP_ID) return window.MIAODA_APP_ID;
3
3
  let prefix;
4
4
  prefix = path.includes('/ai/feida/runtime/') ? '/ai/feida/runtime/' : path.includes('/spark/r/') ? '/spark/r/' : '/ai/miaoda/';
5
- if (!path.startsWith(prefix)) return null;
5
+ const windowAppId = window.appId || null;
6
+ if (!path.startsWith(prefix)) return windowAppId;
6
7
  const remainder = path.substring(prefix.length);
7
8
  const nextSlashIndex = remainder.indexOf('/');
8
- if (-1 === nextSlashIndex) return remainder;
9
- return remainder.substring(0, nextSlashIndex);
9
+ if (-1 === nextSlashIndex) return remainder || windowAppId;
10
+ return remainder.substring(0, nextSlashIndex) || windowAppId;
10
11
  }
11
12
  export { getAppId };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/client-toolkit",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "types": "./lib/index.d.ts",
5
5
  "main": "./lib/index.js",
6
6
  "files": [