@antscorp/antsomi-ui 1.3.5-beta.204 → 1.3.5-beta.206
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.
|
@@ -51,7 +51,7 @@ export const AccountSharing = props => {
|
|
|
51
51
|
const [serverTranslateData, setServerTranslateData] = useState({});
|
|
52
52
|
const [language, setLanguage] = useState(lang || 'en');
|
|
53
53
|
const debounceSearch = useDebounce(accountSearch, 500);
|
|
54
|
-
const [cookies, setCookie] = useCookies();
|
|
54
|
+
const [cookies, setCookie, removeCookie] = useCookies();
|
|
55
55
|
const domain = iamDomain.charAt(iamDomain.length - 1) === '/' ? iamDomain : `${iamDomain}/`;
|
|
56
56
|
const translateLang = useMemo(() => translate(translateData, serverTranslateData, language), [serverTranslateData, language, translateData]);
|
|
57
57
|
const getInfoAccount = () => {
|
|
@@ -223,6 +223,7 @@ export const AccountSharing = props => {
|
|
|
223
223
|
});
|
|
224
224
|
// const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
|
|
225
225
|
const onClickButtonLogout = () => {
|
|
226
|
+
removeCookie(`uogs_${networkId}`);
|
|
226
227
|
if (callbackLogout)
|
|
227
228
|
callbackLogout();
|
|
228
229
|
setTimeout(() => {
|
package/es/utils/styles.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function styleToCssString(rules: any): string;
|
|
1
|
+
export declare function styleToCssString(rules: any, important?: boolean): string;
|
|
2
2
|
export default styleToCssString;
|
package/es/utils/styles.js
CHANGED
|
@@ -143,16 +143,16 @@ const counter = 1;
|
|
|
143
143
|
// Follows syntax at https://developer.mozilla.org/en-US/docs/Web/CSS/content,
|
|
144
144
|
// including multiple space separated values.
|
|
145
145
|
const unquotedContentValueRegex = /^(normal|none|(\b(url\([^)]*\)|chapter_counter|attr\([^)]*\)|(no-)?(open|close)-quote|inherit)((\b\s*)|$|\s+))+)$/;
|
|
146
|
-
function buildRule(key, value) {
|
|
146
|
+
function buildRule(key, value, important = false) {
|
|
147
147
|
if (!isUnitlessNumber[key] && typeof value === 'number') {
|
|
148
148
|
value = `${value}px`;
|
|
149
149
|
}
|
|
150
150
|
else if (key === 'content' && !unquotedContentValueRegex.test(value)) {
|
|
151
151
|
value = `'${value.replace(/'/g, "\\'")}'`;
|
|
152
152
|
}
|
|
153
|
-
return `${hyphenateStyleName(key)}: ${value}; `;
|
|
153
|
+
return `${hyphenateStyleName(key)}: ${value} ${important ? '!important' : ''}; `;
|
|
154
154
|
}
|
|
155
|
-
export function styleToCssString(rules) {
|
|
155
|
+
export function styleToCssString(rules, important = false) {
|
|
156
156
|
let result = '';
|
|
157
157
|
if (!rules || keys(rules).length === 0) {
|
|
158
158
|
return result;
|
|
@@ -163,11 +163,11 @@ export function styleToCssString(rules) {
|
|
|
163
163
|
const value = rules[styleKey];
|
|
164
164
|
if (isArray(value)) {
|
|
165
165
|
for (let i = 0, len = value.length; i < len; i++) {
|
|
166
|
-
result += buildRule(styleKey, value[i]);
|
|
166
|
+
result += buildRule(styleKey, value[i], important);
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
else {
|
|
170
|
-
result += buildRule(styleKey, value);
|
|
170
|
+
result += buildRule(styleKey, value, important);
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
return result;
|