@rspress-theme-anatole/theme-default 0.7.17 → 0.7.18
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/dist/bundle.js +240 -50
- package/package.json +3 -3
package/dist/bundle.js
CHANGED
|
@@ -4380,6 +4380,10 @@ function NavScreen(props) {
|
|
|
4380
4380
|
hasSocialLinks && (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(SocialLinks, {
|
|
4381
4381
|
socialLinks: socialLinks
|
|
4382
4382
|
})
|
|
4383
|
+
(0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
4384
|
+
className: "ml-2",
|
|
4385
|
+
children: (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(UserAuth, {})
|
|
4386
|
+
})
|
|
4383
4387
|
]
|
|
4384
4388
|
})
|
|
4385
4389
|
]
|
|
@@ -4582,7 +4586,6 @@ function setCookie(name, value, days = 7) {
|
|
|
4582
4586
|
expires.setTime(expires.getTime() + (days * 24 * 60 * 60 * 1000));
|
|
4583
4587
|
document.cookie = `${name}=${encodeURIComponent(JSON.stringify(value))};expires=${expires.toUTCString()};path=/`;
|
|
4584
4588
|
}
|
|
4585
|
-
|
|
4586
4589
|
function getCookie(name) {
|
|
4587
4590
|
const nameEQ = name + "=";
|
|
4588
4591
|
const ca = document.cookie.split(';');
|
|
@@ -4591,40 +4594,194 @@ function getCookie(name) {
|
|
|
4591
4594
|
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
|
4592
4595
|
if (c.indexOf(nameEQ) === 0) {
|
|
4593
4596
|
try {
|
|
4594
|
-
|
|
4597
|
+
const value = c.substring(nameEQ.length, c.length);
|
|
4598
|
+
// Return raw value, decoding will be handled by parseKBGatewayUserContext
|
|
4599
|
+
return decodeURIComponent(value);
|
|
4595
4600
|
} catch (e) {
|
|
4596
|
-
return
|
|
4601
|
+
// If decodeURIComponent fails, return raw value
|
|
4602
|
+
return c.substring(nameEQ.length, c.length);
|
|
4597
4603
|
}
|
|
4598
4604
|
}
|
|
4599
4605
|
}
|
|
4600
4606
|
return null;
|
|
4601
4607
|
}
|
|
4602
|
-
|
|
4603
4608
|
function deleteCookie(name) {
|
|
4604
4609
|
document.cookie = `${name}=;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/`;
|
|
4605
4610
|
}
|
|
4611
|
+
// Decode Base64 string (supports Unicode)
|
|
4612
|
+
function decodeBase64(base64String) {
|
|
4613
|
+
try {
|
|
4614
|
+
// Handle URL-safe base64
|
|
4615
|
+
let base64 = base64String.replace(/-/g, '+').replace(/_/g, '/');
|
|
4616
|
+
|
|
4617
|
+
// Add padding if needed
|
|
4618
|
+
while (base64.length % 4) {
|
|
4619
|
+
base64 += '=';
|
|
4620
|
+
}
|
|
4621
|
+
|
|
4622
|
+
// Decode base64 to binary string
|
|
4623
|
+
const binaryString = atob(base64);
|
|
4624
|
+
|
|
4625
|
+
// Convert binary string to UTF-8
|
|
4626
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
4627
|
+
for (let i = 0; i < binaryString.length; i++) {
|
|
4628
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
4629
|
+
}
|
|
4630
|
+
|
|
4631
|
+
// Decode UTF-8 bytes to string
|
|
4632
|
+
const decoder = new TextDecoder('utf-8');
|
|
4633
|
+
return decoder.decode(bytes);
|
|
4634
|
+
} catch (e) {
|
|
4635
|
+
console.warn('Failed to decode base64:', e);
|
|
4636
|
+
return null;
|
|
4637
|
+
}
|
|
4638
|
+
}
|
|
4639
|
+
// Parse KBGateway-User-Context cookie (Base64 encoded)
|
|
4640
|
+
function parseKBGatewayUserContext(cookieValue) {
|
|
4641
|
+
if (!cookieValue) return null;
|
|
4642
|
+
|
|
4643
|
+
try {
|
|
4644
|
+
// First, decode Base64
|
|
4645
|
+
const decodedString = decodeBase64(cookieValue);
|
|
4646
|
+
|
|
4647
|
+
if (!decodedString) {
|
|
4648
|
+
console.warn('Failed to decode Base64 cookie value');
|
|
4649
|
+
return null;
|
|
4650
|
+
}
|
|
4651
|
+
|
|
4652
|
+
// Parse the decoded JSON string
|
|
4653
|
+
const parsed = JSON.parse(decodedString);
|
|
4606
4654
|
|
|
4655
|
+
let username = parsed.name || parsed.email || 'User';
|
|
4656
|
+
if (username.includes('@')) {
|
|
4657
|
+
username = username.split('@')[0];
|
|
4658
|
+
}
|
|
4659
|
+
username = username.charAt(0).toUpperCase() + username.slice(1);
|
|
4660
|
+
|
|
4661
|
+
return {
|
|
4662
|
+
username: username,
|
|
4663
|
+
email: parsed.email || null,
|
|
4664
|
+
avatar: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAYCAYAAAAPtVbGAAAAAXNSR0IArs4c6QAAAsJJREFUSEullU1IFHEYxp9ndpc+KHLzAyyDIIjO+TEzqWDtbFYXK/Bi0Cm61Ck6iEFsFEhFtyKiY2SBh0AIyZ1VQ2P/q3hMKIgOkUJahgRG6+4bo7kfzs7OSnPb+b/v8/s/78csscVHLP0T7dShUmkSNa5BoCMTvMexyZmNGG6FIRE9CnIElE7GUyMbuXLSPIKsvAegFeh9pa0anN9bg0SNHxCEQSwhrqoJiDgalpH1uOwAbXWhYohEmpvBwFReTEzaKSXRliaINu1VEdqKlUPWb1sYL7SVJifMFmiS+m+IWGYPIM9dQtQuomr/AJa+rHpAhmirroqciNtFTtMph0T04yBHi0H8iXBDDQcHM74QscxeQPo9p1DYx0Sy/98AvATQCOABbfW44hEWy3BKESgz6hnaKlhuFco6Ecu4A+CG7y4J7jKhej2b73UgjY0hhEMrPi420jOYW97J2dk/pfQ8nUjUvAWRm74ucoXnbcaTJeNLQny22JtrqwAB1/aXhkTMh6BcqdhF3s0jxpNXN+e5INLdHSixXI65Z9DQj2PJj3jXehTI9EFwznWR8IGgsxuF790Qy3gN4ExB0AraTu1iLOYqg7S27saOzHcAofx2YphxVZhf/BWWGDRMru1FHh6SPRxOLXtOYYdxEEF8LjgXtKkgY/neFDkRS58G2JRLELxiQp33641YxgcAhwvyZphQOZ0cRE631yKd/lYkGEjv45uZeX+I3gZwoiguFKrj8MSC8y4PsYwxAB1FgZKtYWLKqXnZRzrb65FJz20KektbremtQSTSUg1qiy4lTZo4ksr9V3v2JWpcguCp63x1ey3HxxfXIZaRBGC4gsgFxpN1vk4sw/mc5Ccsn6BoK5NytqMKv34veQoRXYyrIU8XEf0yyCee+duCeymWPgewvuxts+zhaPLF5hixzOuA3Pfp2PxfA8n5ENhQazEAAAAASUVORK5CYII="
|
|
4665
|
+
};
|
|
4666
|
+
} catch (e) {
|
|
4667
|
+
console.warn('Failed to parse KBGateway-User-Context:', e);
|
|
4668
|
+
|
|
4669
|
+
// Try parsing without Base64 decoding (in case it's not encoded)
|
|
4670
|
+
try {
|
|
4671
|
+
const parsed = JSON.parse(cookieValue);
|
|
4672
|
+
let username = parsed.name || parsed.email || 'User';
|
|
4673
|
+
if (username.includes('@')) {
|
|
4674
|
+
username = username.split('@')[0];
|
|
4675
|
+
}
|
|
4676
|
+
username = username.charAt(0).toUpperCase() + username.slice(1);
|
|
4677
|
+
|
|
4678
|
+
return {
|
|
4679
|
+
username: username,
|
|
4680
|
+
email: parsed.email || null,
|
|
4681
|
+
avatar: parsed.Avatar || parsed.avatar || null
|
|
4682
|
+
};
|
|
4683
|
+
} catch (e2) {
|
|
4684
|
+
console.warn('Failed to parse as JSON:', e2);
|
|
4685
|
+
return null;
|
|
4686
|
+
}
|
|
4687
|
+
}
|
|
4688
|
+
}
|
|
4689
|
+
// LocalStorage key for user data
|
|
4690
|
+
const USER_STORAGE_KEY = 'kb_user_data';
|
|
4691
|
+
// Get user data from localStorage
|
|
4692
|
+
function getUserFromStorage() {
|
|
4693
|
+
if (typeof localStorage === 'undefined') return null;
|
|
4694
|
+
|
|
4695
|
+
try {
|
|
4696
|
+
const storedData = localStorage.getItem(USER_STORAGE_KEY);
|
|
4697
|
+
if (storedData) {
|
|
4698
|
+
return JSON.parse(storedData);
|
|
4699
|
+
}
|
|
4700
|
+
} catch (e) {
|
|
4701
|
+
console.warn('Failed to get user from localStorage:', e);
|
|
4702
|
+
localStorage.removeItem(USER_STORAGE_KEY);
|
|
4703
|
+
}
|
|
4704
|
+
return null;
|
|
4705
|
+
}
|
|
4706
|
+
// Save user data to localStorage
|
|
4707
|
+
function saveUserToStorage(userData) {
|
|
4708
|
+
if (typeof localStorage === 'undefined') return;
|
|
4709
|
+
|
|
4710
|
+
try {
|
|
4711
|
+
if (userData) {
|
|
4712
|
+
localStorage.setItem(USER_STORAGE_KEY, JSON.stringify(userData));
|
|
4713
|
+
} else {
|
|
4714
|
+
localStorage.removeItem(USER_STORAGE_KEY);
|
|
4715
|
+
}
|
|
4716
|
+
} catch (e) {
|
|
4717
|
+
console.warn('Failed to save user to localStorage:', e);
|
|
4718
|
+
}
|
|
4719
|
+
}
|
|
4720
|
+
// Remove user data from localStorage
|
|
4721
|
+
function removeUserFromStorage() {
|
|
4722
|
+
if (typeof localStorage === 'undefined') return;
|
|
4723
|
+
localStorage.removeItem(USER_STORAGE_KEY);
|
|
4724
|
+
}
|
|
4725
|
+
// Sync cookie to localStorage and return user data
|
|
4726
|
+
function syncCookieToStorage(cookieName) {
|
|
4727
|
+
const cookieValue = getCookie(cookieName);
|
|
4728
|
+
const userData = parseKBGatewayUserContext(cookieValue);
|
|
4729
|
+
|
|
4730
|
+
if (userData) {
|
|
4731
|
+
saveUserToStorage(userData);
|
|
4732
|
+
} else {
|
|
4733
|
+
removeUserFromStorage();
|
|
4734
|
+
}
|
|
4735
|
+
|
|
4736
|
+
return userData;
|
|
4737
|
+
}
|
|
4607
4738
|
// User Authentication Component
|
|
4608
4739
|
function UserAuth() {
|
|
4609
4740
|
const { siteData } = (0, __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.usePageData)();
|
|
4610
|
-
const [user, setUser] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(null);
|
|
4611
|
-
const [showDropdown, setShowDropdown] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(false);
|
|
4612
4741
|
const dropdownRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
|
|
4613
|
-
|
|
4742
|
+
|
|
4614
4743
|
// Get sign in URL from site config
|
|
4615
|
-
const signInUrl = siteData?.
|
|
4744
|
+
const signInUrl = siteData?.auth?.signInUrl;
|
|
4745
|
+
|
|
4746
|
+
// Cookie name for KBGateway
|
|
4747
|
+
const KB_COOKIE_NAME = 'KBGateway-User-Context';
|
|
4748
|
+
|
|
4749
|
+
const [user, setUser] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(() => {
|
|
4750
|
+
if (typeof document === 'undefined') return null;
|
|
4751
|
+
|
|
4752
|
+
// 1. First try to get from localStorage (instant, no flicker)
|
|
4753
|
+
const storedUser = getUserFromStorage();
|
|
4754
|
+
if (storedUser) {
|
|
4755
|
+
return storedUser;
|
|
4756
|
+
}
|
|
4757
|
+
|
|
4758
|
+
// 2. If not in localStorage, check cookie and sync
|
|
4759
|
+
return syncCookieToStorage(KB_COOKIE_NAME);
|
|
4760
|
+
});
|
|
4761
|
+
|
|
4762
|
+
const [showDropdown, setShowDropdown] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(false);
|
|
4616
4763
|
|
|
4764
|
+
// Sync cookie to localStorage on mount and periodically check for changes
|
|
4617
4765
|
(0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(() => {
|
|
4618
|
-
//
|
|
4619
|
-
const userData =
|
|
4766
|
+
// Sync cookie to localStorage on mount
|
|
4767
|
+
const userData = syncCookieToStorage(KB_COOKIE_NAME);
|
|
4620
4768
|
if (userData) {
|
|
4621
4769
|
setUser(userData);
|
|
4622
4770
|
}
|
|
4623
4771
|
|
|
4624
4772
|
// Listen for storage events to sync across tabs
|
|
4625
|
-
const handleStorageChange = () => {
|
|
4626
|
-
|
|
4627
|
-
|
|
4773
|
+
const handleStorageChange = (e) => {
|
|
4774
|
+
if (e.key === USER_STORAGE_KEY) {
|
|
4775
|
+
if (e.newValue) {
|
|
4776
|
+
try {
|
|
4777
|
+
setUser(JSON.parse(e.newValue));
|
|
4778
|
+
} catch (err) {
|
|
4779
|
+
setUser(null);
|
|
4780
|
+
}
|
|
4781
|
+
} else {
|
|
4782
|
+
setUser(null);
|
|
4783
|
+
}
|
|
4784
|
+
}
|
|
4628
4785
|
};
|
|
4629
4786
|
|
|
4630
4787
|
window.addEventListener('storage', handleStorageChange);
|
|
@@ -4650,8 +4807,14 @@ function UserAuth() {
|
|
|
4650
4807
|
}
|
|
4651
4808
|
|
|
4652
4809
|
try {
|
|
4810
|
+
// Center the popup window
|
|
4811
|
+
const width = 600;
|
|
4812
|
+
const height = 600;
|
|
4813
|
+
const left = window.top.outerWidth / 2 + window.top.screenX - width / 2;
|
|
4814
|
+
const top = window.top.outerHeight / 2 + window.top.screenY - height / 2;
|
|
4815
|
+
|
|
4653
4816
|
// Open sign in URL in new window/tab
|
|
4654
|
-
const authWindow = window.open(signInUrl, '_blank',
|
|
4817
|
+
const authWindow = window.open(signInUrl, '_blank', `width=${width},height=${height},left=${left},top=${top}`);
|
|
4655
4818
|
|
|
4656
4819
|
// Listen for messages from auth window
|
|
4657
4820
|
const handleMessage = (event) => {
|
|
@@ -4660,10 +4823,12 @@ function UserAuth() {
|
|
|
4660
4823
|
if (event.data && event.data.type === 'AUTH_SUCCESS') {
|
|
4661
4824
|
const userData = {
|
|
4662
4825
|
username: event.data.username,
|
|
4826
|
+
email: event.data.email,
|
|
4663
4827
|
avatar: event.data.avatar
|
|
4664
4828
|
};
|
|
4665
4829
|
|
|
4666
|
-
|
|
4830
|
+
// Save to localStorage
|
|
4831
|
+
saveUserToStorage(userData);
|
|
4667
4832
|
setUser(userData);
|
|
4668
4833
|
authWindow.close();
|
|
4669
4834
|
|
|
@@ -4674,19 +4839,41 @@ function UserAuth() {
|
|
|
4674
4839
|
|
|
4675
4840
|
window.addEventListener('message', handleMessage);
|
|
4676
4841
|
|
|
4677
|
-
//
|
|
4842
|
+
// Poll for KBGateway-User-Context cookie
|
|
4678
4843
|
const pollInterval = setInterval(() => {
|
|
4679
|
-
|
|
4844
|
+
// Sync cookie to localStorage and get user data
|
|
4845
|
+
const userData = syncCookieToStorage(KB_COOKIE_NAME);
|
|
4846
|
+
|
|
4847
|
+
if (userData) {
|
|
4848
|
+
setUser(userData);
|
|
4680
4849
|
clearInterval(pollInterval);
|
|
4681
4850
|
window.removeEventListener('message', handleMessage);
|
|
4682
4851
|
|
|
4683
|
-
//
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
setUser(userData);
|
|
4852
|
+
// Close popup if still open
|
|
4853
|
+
if (authWindow && !authWindow.closed) {
|
|
4854
|
+
authWindow.close();
|
|
4687
4855
|
}
|
|
4688
4856
|
}
|
|
4689
|
-
|
|
4857
|
+
|
|
4858
|
+
// Also check if popup was closed manually
|
|
4859
|
+
if (authWindow && authWindow.closed) {
|
|
4860
|
+
clearInterval(pollInterval);
|
|
4861
|
+
window.removeEventListener('message', handleMessage);
|
|
4862
|
+
|
|
4863
|
+
// Final sync cookie to localStorage
|
|
4864
|
+
const finalUserData = syncCookieToStorage(KB_COOKIE_NAME);
|
|
4865
|
+
if (finalUserData) {
|
|
4866
|
+
setUser(finalUserData);
|
|
4867
|
+
}
|
|
4868
|
+
}
|
|
4869
|
+
}, 500); // Check every 500ms
|
|
4870
|
+
|
|
4871
|
+
// Timeout after 5 minutes
|
|
4872
|
+
setTimeout(() => {
|
|
4873
|
+
clearInterval(pollInterval);
|
|
4874
|
+
window.removeEventListener('message', handleMessage);
|
|
4875
|
+
}, 300000);
|
|
4876
|
+
|
|
4690
4877
|
|
|
4691
4878
|
} catch (error) {
|
|
4692
4879
|
console.error('Sign in error:', error);
|
|
@@ -4694,7 +4881,8 @@ function UserAuth() {
|
|
|
4694
4881
|
};
|
|
4695
4882
|
|
|
4696
4883
|
const handleSignOut = () => {
|
|
4697
|
-
deleteCookie(
|
|
4884
|
+
deleteCookie(KB_COOKIE_NAME);
|
|
4885
|
+
removeUserFromStorage();
|
|
4698
4886
|
setUser(null);
|
|
4699
4887
|
setShowDropdown(false);
|
|
4700
4888
|
};
|
|
@@ -4710,44 +4898,47 @@ function UserAuth() {
|
|
|
4710
4898
|
children: "Sign in"
|
|
4711
4899
|
});
|
|
4712
4900
|
}
|
|
4901
|
+
|
|
4902
|
+
const userAvatar = user.avatar ?? "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAYCAYAAAAPtVbGAAAAAXNSR0IArs4c6QAAAsJJREFUSEullU1IFHEYxp9ndpc+KHLzAyyDIIjO+TEzqWDtbFYXK/Bi0Cm61Ck6iEFsFEhFtyKiY2SBh0AIyZ1VQ2P/q3hMKIgOkUJahgRG6+4bo7kfzs7OSnPb+b/v8/s/78csscVHLP0T7dShUmkSNa5BoCMTvMexyZmNGG6FIRE9CnIElE7GUyMbuXLSPIKsvAegFeh9pa0anN9bg0SNHxCEQSwhrqoJiDgalpH1uOwAbXWhYohEmpvBwFReTEzaKSXRliaINu1VEdqKlUPWb1sYL7SVJifMFmiS+m+IWGYPIM9dQtQuomr/AJa+rHpAhmirroqciNtFTtMph0T04yBHi0H8iXBDDQcHM74QscxeQPo9p1DYx0Sy/98AvATQCOABbfW44hEWy3BKESgz6hnaKlhuFco6Ecu4A+CG7y4J7jKhej2b73UgjY0hhEMrPi420jOYW97J2dk/pfQ8nUjUvAWRm74ucoXnbcaTJeNLQny22JtrqwAB1/aXhkTMh6BcqdhF3s0jxpNXN+e5INLdHSixXI65Z9DQj2PJj3jXehTI9EFwznWR8IGgsxuF790Qy3gN4ExB0AraTu1iLOYqg7S27saOzHcAofx2YphxVZhf/BWWGDRMru1FHh6SPRxOLXtOYYdxEEF8LjgXtKkgY/neFDkRS58G2JRLELxiQp33641YxgcAhwvyZphQOZ0cRE631yKd/lYkGEjv45uZeX+I3gZwoiguFKrj8MSC8y4PsYwxAB1FgZKtYWLKqXnZRzrb65FJz20KektbremtQSTSUg1qiy4lTZo4ksr9V3v2JWpcguCp63x1ey3HxxfXIZaRBGC4gsgFxpN1vk4sw/mc5Ccsn6BoK5NytqMKv34veQoRXYyrIU8XEf0yyCee+duCeymWPgewvuxts+zhaPLF5hixzOuA3Pfp2PxfA8n5ENhQazEAAAAASUVORK5CYII=";
|
|
4713
4903
|
|
|
4714
4904
|
return (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
4715
4905
|
className: "relative",
|
|
4716
4906
|
ref: dropdownRef,
|
|
4717
4907
|
children: [
|
|
4718
|
-
(0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("
|
|
4908
|
+
(0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
4719
4909
|
onClick: () => setShowDropdown(!showDropdown),
|
|
4720
|
-
className:
|
|
4910
|
+
className: `flex items-center gap-2 rounded-md cursor-pointer hover:scale-110 transition-transform duration-200`,
|
|
4721
4911
|
children: [
|
|
4722
|
-
|
|
4723
|
-
src:
|
|
4912
|
+
userAvatar && (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("img", {
|
|
4913
|
+
src: userAvatar.startsWith('data:') ? userAvatar : `data:image/png;base64,${userAvatar}`,
|
|
4724
4914
|
alt: "User Avatar",
|
|
4725
|
-
className:
|
|
4726
|
-
|
|
4727
|
-
(0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
|
|
4728
|
-
children: user.username
|
|
4915
|
+
className: `w-full h-full rounded-full object-cover`,
|
|
4916
|
+
style: {border: showDropdown ? '2px solid rgb(239, 72, 61)' : '', width: '28px', height: '28px' }
|
|
4729
4917
|
}),
|
|
4730
|
-
(0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("svg", {
|
|
4731
|
-
className: `w-4 h-4 transition-transform ${showDropdown ? 'rotate-180' : ''}`,
|
|
4732
|
-
fill: "none",
|
|
4733
|
-
stroke: "currentColor",
|
|
4734
|
-
viewBox: "0 0 24 24",
|
|
4735
|
-
children: (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("path", {
|
|
4736
|
-
strokeLinecap: "round",
|
|
4737
|
-
strokeLinejoin: "round",
|
|
4738
|
-
strokeWidth: 2,
|
|
4739
|
-
d: "M19 9l-7 7-7-7"
|
|
4740
|
-
})
|
|
4741
|
-
})
|
|
4742
4918
|
]
|
|
4743
4919
|
}),
|
|
4744
4920
|
showDropdown && (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
4745
|
-
className: "absolute right-0 mt-2 w-
|
|
4746
|
-
children:
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4921
|
+
className: "absolute right-0 mt-2 w-60 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50 overflow-hidden",
|
|
4922
|
+
children: [
|
|
4923
|
+
(0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
|
|
4924
|
+
className: "px-4 py-3",
|
|
4925
|
+
style:{paddingBottom: '0.5rem'},
|
|
4926
|
+
children: [
|
|
4927
|
+
(0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("p", { className: "font-semibold text-gray-900 dark:text-gray-100", children: user.username }),
|
|
4928
|
+
(0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: user.email || '' })
|
|
4929
|
+
]
|
|
4930
|
+
}),
|
|
4931
|
+
|
|
4932
|
+
(0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
4933
|
+
className: "border-t border-gray-200 dark:border-gray-700"
|
|
4934
|
+
}),
|
|
4935
|
+
|
|
4936
|
+
(0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("button", {
|
|
4937
|
+
onClick: handleSignOut,
|
|
4938
|
+
className: "w-full text-left px-4 py-2 text-sm text-gray-900 font-bold bg-white hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-100 dark:hover:bg-gray-700",
|
|
4939
|
+
children: "Sign out"
|
|
4940
|
+
})
|
|
4941
|
+
]
|
|
4751
4942
|
})
|
|
4752
4943
|
]
|
|
4753
4944
|
});
|
|
@@ -5830,7 +6021,6 @@ function SearchPanel({ focused, setFocused }) {
|
|
|
5830
6021
|
const excludedPaths = ['index.html', 'index', 'what-is-coming-in-cloud', 'what-is-coming-in-cloud.html', 'solution-pages'];
|
|
5831
6022
|
|
|
5832
6023
|
if (productName && !excludedPaths.includes(productName)) {
|
|
5833
|
-
|
|
5834
6024
|
return {
|
|
5835
6025
|
scopeType: 'product',
|
|
5836
6026
|
productName: productName,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspress-theme-anatole/theme-default",
|
|
3
3
|
"author": "Anatole Tong",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.18",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.css",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"types": "./dist/bundle.d.ts",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@mdx-js/react": "2.3.0",
|
|
24
|
-
"@rspress-theme-anatole/rspress-plugin-mermaid": "0.7.
|
|
25
|
-
"@rspress-theme-anatole/shared": "0.7.
|
|
24
|
+
"@rspress-theme-anatole/rspress-plugin-mermaid": "0.7.18",
|
|
25
|
+
"@rspress-theme-anatole/shared": "0.7.18",
|
|
26
26
|
"@rspress/runtime": "1.43.8",
|
|
27
27
|
"body-scroll-lock": "4.0.0-beta.0",
|
|
28
28
|
"copy-to-clipboard": "^3.3.3",
|