@giteeteam/apps-team-components 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/README.md CHANGED
@@ -16,3 +16,8 @@ const Demo = ({children}) => {
16
16
  )
17
17
  }
18
18
  ```
19
+
20
+ ## TODO
21
+ - SimpleOverflowTooltip 统一为 BaseOverflowToolTip 导出
22
+ - 去除 BaseOverflowToolTip 的 maxline
23
+
@@ -4,7 +4,8 @@ export const getNameBadge = (name) => {
4
4
  var _a;
5
5
  if (!((_a = name === null || name === void 0 ? void 0 : name.trim) === null || _a === void 0 ? void 0 : _a.call(name)))
6
6
  return null;
7
- return name.slice(0, 1);
7
+ const str = name.trim();
8
+ return String.fromCodePoint(str.codePointAt(0));
8
9
  };
9
10
  const randomBackgroundColor = ['#5EA1FF', '#4BCC87', '#FFD15E', '#FF945E', '#A994FF'];
10
11
  export const getBackgroundColor = (s) => {
@@ -2,8 +2,8 @@ import useTeamConfig from '../../../lib/hooks/useTeamConfig';
2
2
  import useTenant from '../../../lib/hooks/useTenant';
3
3
  import isInOne from '../../../lib/isInOne';
4
4
  export const useToWorkspacePage = () => {
5
- const { teamBasePath, teamGateway } = useTeamConfig();
6
- const inOne = isInOne(teamGateway);
5
+ const { teamBasePath, teamGateway, isMicroApp } = useTeamConfig();
6
+ const inOne = isInOne(teamGateway, isMicroApp);
7
7
  const tenant = useTenant();
8
8
  return {
9
9
  toWorkspacePage: (workspaceKey) => {
@@ -11,7 +11,7 @@ import { ItemConfigProvider } from './itemConfig';
11
11
  import { TeamConfigProvider } from './teamConfig';
12
12
  import { TenantProvider } from './tenant';
13
13
  import { WorkflowConfigProvider } from './workflowConfig';
14
- export const LibraryProvider = ({ getPopupContainer, locale, tenant, datetimeFormat, teamBasePath, teamGateway, workspaceKey, workflow, item, currentUser, emotionCacheOptions, children, }) => {
14
+ export const LibraryProvider = ({ getPopupContainer, locale, tenant, datetimeFormat, teamBasePath, teamGateway, isMicroApp, workspaceKey, workflow, item, currentUser, emotionCacheOptions, children, }) => {
15
15
  const emotionCache = useMemo(() => {
16
16
  return createCache({
17
17
  key: 'apps',
@@ -21,5 +21,5 @@ export const LibraryProvider = ({ getPopupContainer, locale, tenant, datetimeFor
21
21
  useEffect(() => {
22
22
  i18n.setLocale(locale);
23
23
  }, [locale]);
24
- return (_jsx(CacheProvider, { value: emotionCache, children: _jsx(AntdConfigProvider, { getPopupContainer: getPopupContainer, children: _jsx(TeamConfigProvider, { teamBasePath: teamBasePath, teamGateway: teamGateway, children: _jsx(TenantProvider, { tenant: tenant, children: _jsx(CurrentWorkspaceProvider, { workspaceKey: workspaceKey, children: _jsx(DatetimeFormatProvider, { datetimeFormat: datetimeFormat, children: _jsx(CurrentUserProvider, { currentUser: currentUser, children: _jsx(WorkflowConfigProvider, { workflow: workflow, children: _jsx(ItemConfigProvider, { item: item, children: children }) }) }) }) }) }) }) }) }));
24
+ return (_jsx(CacheProvider, { value: emotionCache, children: _jsx(AntdConfigProvider, { getPopupContainer: getPopupContainer, children: _jsx(TeamConfigProvider, { teamBasePath: teamBasePath, teamGateway: teamGateway, isMicroApp: isMicroApp, children: _jsx(TenantProvider, { tenant: tenant, children: _jsx(CurrentWorkspaceProvider, { workspaceKey: workspaceKey, children: _jsx(DatetimeFormatProvider, { datetimeFormat: datetimeFormat, children: _jsx(CurrentUserProvider, { currentUser: currentUser, children: _jsx(WorkflowConfigProvider, { workflow: workflow, children: _jsx(ItemConfigProvider, { item: item, children: children }) }) }) }) }) }) }) }) }));
25
25
  };
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  export interface ITeamConfigContext {
3
3
  teamGateway?: string;
4
4
  teamBasePath?: string;
5
+ isMicroApp?: boolean;
5
6
  }
6
7
  export declare const TeamConfigContext: React.Context<ITeamConfigContext>;
7
8
  export interface TeamConfigProviderProps extends React.PropsWithChildren, ITeamConfigContext {
@@ -2,9 +2,10 @@ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
2
  import { createContext } from 'react';
3
3
  const defaultContext = {};
4
4
  export const TeamConfigContext = createContext(defaultContext);
5
- export const TeamConfigProvider = ({ teamGateway, teamBasePath, children }) => {
5
+ export const TeamConfigProvider = ({ teamGateway, teamBasePath, isMicroApp, children, }) => {
6
6
  return (_jsx(TeamConfigContext.Provider, { value: {
7
7
  teamGateway,
8
8
  teamBasePath,
9
+ isMicroApp,
9
10
  }, children: children }));
10
11
  };
@@ -1,2 +1,2 @@
1
- declare const isInOne: (gateway?: string) => boolean;
1
+ declare const isInOne: (gateway?: string, isMicroApp?: boolean) => boolean;
2
2
  export default isInOne;
@@ -1,4 +1,6 @@
1
- const isInOne = (gateway) => {
1
+ const isInOne = (gateway, isMicroApp) => {
2
+ if (isMicroApp != null)
3
+ return !!isMicroApp;
2
4
  if (!gateway)
3
5
  return false;
4
6
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giteeteam/apps-team-components",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "Gitee team components",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",