@chlp-tech/rpa-ui 0.0.13 → 0.0.15-beta-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.
@@ -23,6 +23,7 @@ export interface ICoverModalV2Props {
23
23
  videoUrl: string;
24
24
  handleUpload: (file: File) => Promise<string>;
25
25
  onClose?: () => void;
26
+ zIndex?: number;
26
27
  onSubmit?: (key: 'selectCover' | 'uploadCover' | string, data: string | number) => void;
27
28
  }
28
29
  declare const CoverModal: FC<CoverModalProps>;
@@ -429,7 +429,8 @@ export var CoverModalV2 = function CoverModalV2(props) {
429
429
  footer: false,
430
430
  width: 640,
431
431
  onCancel: props.onClose,
432
- maskClosable: false
432
+ maskClosable: false,
433
+ zIndex: props.zIndex
433
434
  }, /*#__PURE__*/React.createElement(Segmented, {
434
435
  value: value,
435
436
  options: [{
@@ -27,6 +27,7 @@ interface AccountBlockProps {
27
27
  interface PublishAccountProps {
28
28
  accounts: SocialMediaAccounts;
29
29
  boxWidth?: number | string;
30
+ defaultSelectAccount?: Account;
30
31
  onAccountSelect: (account: Account) => void;
31
32
  onErrorClose?: (account: Account) => void;
32
33
  }
@@ -76,8 +76,9 @@ var PublishAccount = function PublishAccount(_ref2) {
76
76
  var accounts = _ref2.accounts,
77
77
  onAccountSelect = _ref2.onAccountSelect,
78
78
  onErrorClose = _ref2.onErrorClose,
79
- boxWidth = _ref2.boxWidth;
80
- var _useState = useState(null),
79
+ boxWidth = _ref2.boxWidth,
80
+ defaultSelectAccount = _ref2.defaultSelectAccount;
81
+ var _useState = useState(defaultSelectAccount),
81
82
  _useState2 = _slicedToArray(_useState, 2),
82
83
  selectedAccount = _useState2[0],
83
84
  setSelectedAccount = _useState2[1];
@@ -90,13 +91,34 @@ var PublishAccount = function PublishAccount(_ref2) {
90
91
  }
91
92
  return null;
92
93
  };
94
+
95
+ // 判断是否存在
96
+ var isExitInAccounts = function isExitInAccounts(account) {
97
+ if (!account) return false;
98
+ for (var _i2 = 0, _arr2 = ['fb', 'ins', 'tk', 'yt']; _i2 < _arr2.length; _i2++) {
99
+ var platform = _arr2[_i2];
100
+ if (accounts[platform] && accounts[platform].length > 0 && accounts[platform].some(function (item) {
101
+ return item.value === account.value;
102
+ })) {
103
+ return true;
104
+ }
105
+ }
106
+ return false;
107
+ };
93
108
  useEffect(function () {
94
- var firstAccount = getFirstAvailableAccount();
95
- if (firstAccount) {
96
- setSelectedAccount(firstAccount);
97
- onAccountSelect(firstAccount);
109
+ if (defaultSelectAccount) {
110
+ setSelectedAccount(defaultSelectAccount);
111
+ } else {
112
+ if (!selectedAccount && isExitInAccounts(selectedAccount)) {
113
+ return;
114
+ }
115
+ var firstAccount = getFirstAvailableAccount();
116
+ if (firstAccount) {
117
+ setSelectedAccount(firstAccount);
118
+ onAccountSelect(firstAccount);
119
+ }
98
120
  }
99
- }, [accounts]);
121
+ }, [accounts, defaultSelectAccount]);
100
122
  var renderAccounts = function renderAccounts(platform, icon) {
101
123
  var _accounts$platform;
102
124
  if (!accounts[platform] || accounts[platform].length === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chlp-tech/rpa-ui",
3
- "version": "0.0.13",
3
+ "version": "0.0.15-beta-1",
4
4
  "description": "rpa-ui",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",