@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 +5 -0
- package/dist/components/common/utils.js +2 -1
- package/dist/components/fields/bind-workspace/hooks.js +2 -2
- package/dist/lib/contexts/index.js +2 -2
- package/dist/lib/contexts/teamConfig.d.ts +1 -0
- package/dist/lib/contexts/teamConfig.js +2 -1
- package/dist/lib/isInOne.d.ts +1 -1
- package/dist/lib/isInOne.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -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
|
-
|
|
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
|
};
|
package/dist/lib/isInOne.d.ts
CHANGED
|
@@ -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;
|
package/dist/lib/isInOne.js
CHANGED