@giteeteam/apps-team-components 1.6.1 → 1.6.3

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
@@ -14,10 +14,22 @@ pnpm i
14
14
  pnpm storybook
15
15
  ```
16
16
 
17
+ ## 本地调试
18
+ 1. proxima 主库中将 package.json 中 @giteeteam/apps-team-components 改为本地路径,并执行 `pnpm install`
19
+ ```
20
+ - "@giteeteam/apps-team-components": "1.6.0",
21
+ + "@giteeteam/apps-team-components": "file:../giteeteam-components",
22
+ ```
23
+
24
+ > 注:[不要用 pnpm link](https://pnpm.io/zh/cli/link#whats-the-difference-between-pnpm-link-and-using-the-file-protocol),主库的依赖都引用自己的
25
+
26
+ 2. 在本代码库执行 `pnpm dev`
27
+
17
28
  # 版本对应
18
29
 
19
30
  | 组件库版本 | team版本 |
20
31
  | --| -- |
32
+ | 1.7.x | >=4.30.0 |
21
33
  | 1.6.x | >=4.29.0 |
22
34
  | 1.5.x | >=4.27.0 |
23
35
  | 1.4.x | >=4.24.0 |
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx } from '@emotion/react/jsx-runtime';
2
2
  import { useState, useEffect } from 'react';
3
3
  import { css } from '@emotion/react';
4
- import { useRecoilValue } from 'recoil';
4
+ import { useAtom } from 'jotai';
5
5
  import { dataQuoteState, currentDeleteState } from '../../../lib/store/dataQuoteStore.js';
6
6
  import EmptyField from '../../common/EmptyField.js';
7
7
  import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip.js';
@@ -10,8 +10,8 @@ import { dataQuoteInit } from './utils.js';
10
10
 
11
11
  const DataQuoteReadView = ({ value, userData }) => {
12
12
  const [dataList, setDataList] = useState(null);
13
- const dataQuoteList = useRecoilValue(dataQuoteState);
14
- const currentDeleteItem = useRecoilValue(currentDeleteState);
13
+ const [dataQuoteList] = useAtom(dataQuoteState);
14
+ const [currentDeleteItem] = useAtom(currentDeleteState);
15
15
  useEffect(() => {
16
16
  if (dataQuoteList) {
17
17
  setDataList(dataQuoteInit(dataQuoteList, value, userData === null || userData === void 0 ? void 0 : userData.display));
@@ -104,7 +104,7 @@ const TransitionPanel = ({ itemId, itemType, workspace, objectId, onTransitionSu
104
104
  message: i18n.t('pages.fields.view.checkInStatus'),
105
105
  };
106
106
  }
107
- const checkResult = checkFlowHandler(itemData, { userId: currentUser.id }, flowHandlerActive);
107
+ const checkResult = checkFlowHandler(itemData, { userId: currentUser === null || currentUser === void 0 ? void 0 : currentUser.id }, flowHandlerActive);
108
108
  if (checkResult && !checkResult.result) {
109
109
  return checkResult;
110
110
  }
@@ -115,7 +115,7 @@ const TransitionPanel = ({ itemId, itemType, workspace, objectId, onTransitionSu
115
115
  return conditionCheck;
116
116
  }
117
117
  return { result: true };
118
- }, [checkApproval, currentUser, flowHandlerActive, hideDisabledStatusTransition, validateCheckIn, itemData]);
118
+ }, [checkApproval, currentUser === null || currentUser === void 0 ? void 0 : currentUser.id, flowHandlerActive, hideDisabledStatusTransition, validateCheckIn, itemData]);
119
119
  const getTheTargetTransitions = useCallback(({ workflowData, statusId }) => {
120
120
  var _a;
121
121
  if (workflowData && statusId) {
@@ -195,15 +195,18 @@ const TransitionPanel = ({ itemId, itemType, workspace, objectId, onTransitionSu
195
195
  getWorkflowData,
196
196
  postCheckTransitions,
197
197
  getTheTargetTransitions,
198
+ currentUser === null || currentUser === void 0 ? void 0 : currentUser.id,
198
199
  ]);
199
200
  useEffect(() => {
200
- logger('refresh workflow');
201
- refresh();
202
- }, []);
201
+ logger('refresh workflow', currentUser);
202
+ if (currentUser === null || currentUser === void 0 ? void 0 : currentUser.id) {
203
+ refresh();
204
+ }
205
+ }, [currentUser === null || currentUser === void 0 ? void 0 : currentUser.id]);
203
206
  useEffect(() => {
204
207
  logger('updateWorkflowMessage', statusId);
205
208
  updateWorkflowMessage(workflowData, statusId, checkResultList);
206
- }, [statusId, workflowData, checkResultList, itemData]);
209
+ }, [statusId, workflowData, checkResultList, itemData, updateWorkflowMessage]);
207
210
  const refreshItem = useCallback((status) => {
208
211
  if (newItem.current !== itemId) {
209
212
  return;
@@ -1,13 +1,13 @@
1
1
  import { useMemo, useEffect } from 'react';
2
+ import { useAtom } from 'jotai';
2
3
  import { isEmpty, clone } from 'lodash-es';
3
- import { useRecoilState } from 'recoil';
4
4
  import { REG_EN_NUMBER } from '../regExp.js';
5
5
  import { dataQuoteState, currentDeleteState } from '../store/dataQuoteStore.js';
6
6
 
7
7
  const OBJECT_ID_LENGTH = 10;
8
8
  const useDataQuoteStore = (dataSources, getOptionsByValues) => {
9
- const [dataQuoteList, setDataQuoteList] = useRecoilState(dataQuoteState);
10
- const [currentDeleteItem, setCurrentDeleteItem] = useRecoilState(currentDeleteState);
9
+ const [dataQuoteList, setDataQuoteList] = useAtom(dataQuoteState);
10
+ const [currentDeleteItem, setCurrentDeleteItem] = useAtom(currentDeleteState);
11
11
  const dataSourcesDep = useMemo(() => {
12
12
  return (dataSources === null || dataSources === void 0 ? void 0 : dataSources.__hash) ? dataSources === null || dataSources === void 0 ? void 0 : dataSources.__hash : dataSources;
13
13
  }, [dataSources]);
@@ -1,2 +1,7 @@
1
- export declare const dataQuoteState: import("recoil").RecoilState<any[]>;
2
- export declare const currentDeleteState: import("recoil").RecoilState<string>;
1
+ import { type Item } from '../types/models';
2
+ export declare const dataQuoteState: import("jotai").PrimitiveAtom<Item[]> & {
3
+ init: Item[];
4
+ };
5
+ export declare const currentDeleteState: import("jotai").PrimitiveAtom<string> & {
6
+ init: string;
7
+ };
@@ -1,12 +1,6 @@
1
- import { atom } from 'recoil';
1
+ import { atom } from 'jotai';
2
2
 
3
- const dataQuoteState = atom({
4
- key: 'dataQuoteState',
5
- default: [],
6
- });
7
- const currentDeleteState = atom({
8
- key: 'currentDeleteState',
9
- default: '',
10
- });
3
+ const dataQuoteState = atom([]);
4
+ const currentDeleteState = atom('');
11
5
 
12
6
  export { currentDeleteState, dataQuoteState };
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@giteeteam/apps-team-components",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "description": "Gitee team components",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
7
7
  "scripts": {
8
8
  "prepare": "husky install && pnpm build",
9
+ "dev": "rollup -c -w",
9
10
  "build": "rimraf dist && rollup -c",
10
11
  "publish:alpha": "npm publish --tag alpha",
11
12
  "prepublishOnly": "pnpm build",
@@ -84,9 +85,9 @@
84
85
  "antd": "^5.7.3",
85
86
  "axios": "^1.7.3",
86
87
  "dayjs": "^1.11.10",
88
+ "jotai": "^2.0.0",
87
89
  "react": "^17.0.2 || ^18.2.0",
88
90
  "react-dom": "^17.0.2 || ^18.2.0",
89
- "recoil": "^0.7.7",
90
91
  "swr": "^1.1.0"
91
92
  },
92
93
  "dependencies": {
@@ -99,8 +100,7 @@
99
100
  "js-cookie": "^3.0.5",
100
101
  "lodash-es": "^4.17.21",
101
102
  "query-string": "7.1.3",
102
- "react-overlays": "^5.2.1",
103
- "react-window": "^1.8.10"
103
+ "react-overlays": "^5.2.1"
104
104
  },
105
105
  "msw": {
106
106
  "workerDirectory": [