@lovalingo/lovalingo 0.5.28 → 0.6.0
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 +36 -0
- package/dist/chunk-2FZR2AKF.mjs +88 -0
- package/dist/chunk-7D5LBV45.mjs +46 -0
- package/dist/chunk-CJOSN7RA.mjs +90 -0
- package/dist/chunk-VAHA2TOX.mjs +3440 -0
- package/dist/chunk-ZMRCSUM7.mjs +26 -0
- package/dist/chunk-ZVYKEEUF.mjs +220 -0
- package/dist/core.d.mts +131 -0
- package/dist/core.d.ts +131 -0
- package/dist/core.js +3561 -0
- package/dist/core.mjs +19 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -25
- package/dist/index.js +3885 -28
- package/dist/index.mjs +33 -0
- package/dist/react-router.d.mts +101 -0
- package/dist/react-router.d.ts +101 -0
- package/dist/react-router.js +353 -0
- package/dist/react-router.mjs +14 -0
- package/dist/tanstack-router.d.mts +22 -0
- package/dist/tanstack-router.d.ts +22 -0
- package/dist/tanstack-router.js +162 -0
- package/dist/tanstack-router.mjs +8 -0
- package/package.json +34 -3
- package/dist/__tests__/languageFlags.test.d.ts +0 -1
- package/dist/__tests__/languageFlags.test.js +0 -42
- package/dist/__tests__/mergeEntitlements.test.d.ts +0 -1
- package/dist/__tests__/mergeEntitlements.test.js +0 -27
- package/dist/components/AixsterProvider.d.ts +0 -1
- package/dist/components/AixsterProvider.js +0 -1
- package/dist/components/LangLink.d.ts +0 -20
- package/dist/components/LangLink.js +0 -38
- package/dist/components/LangRouter.d.ts +0 -37
- package/dist/components/LangRouter.js +0 -191
- package/dist/components/LanguageSwitcher.d.ts +0 -17
- package/dist/components/LanguageSwitcher.js +0 -257
- package/dist/components/LovalingoProvider.d.ts +0 -10
- package/dist/components/LovalingoProvider.js +0 -413
- package/dist/components/NavigationOverlay.d.ts +0 -6
- package/dist/components/NavigationOverlay.js +0 -22
- package/dist/components/provider/__tests__/seoUtils.test.d.ts +0 -1
- package/dist/components/provider/__tests__/seoUtils.test.js +0 -13
- package/dist/components/provider/editModeUtils.d.ts +0 -6
- package/dist/components/provider/editModeUtils.js +0 -59
- package/dist/components/provider/localeUtils.d.ts +0 -8
- package/dist/components/provider/localeUtils.js +0 -46
- package/dist/components/provider/providerConstants.d.ts +0 -12
- package/dist/components/provider/providerConstants.js +0 -11
- package/dist/components/provider/seoUtils.d.ts +0 -8
- package/dist/components/provider/seoUtils.js +0 -118
- package/dist/components/provider/useEditModeOverlay.d.ts +0 -7
- package/dist/components/provider/useEditModeOverlay.js +0 -134
- package/dist/components/provider/useHistoryNavigationPatch.d.ts +0 -3
- package/dist/components/provider/useHistoryNavigationPatch.js +0 -47
- package/dist/components/provider/useProviderCache.d.ts +0 -12
- package/dist/components/provider/useProviderCache.js +0 -82
- package/dist/context/AixsterContext.d.ts +0 -3
- package/dist/context/AixsterContext.js +0 -2
- package/dist/context/LangContext.d.ts +0 -1
- package/dist/context/LangContext.js +0 -2
- package/dist/context/LangRoutingContext.d.ts +0 -8
- package/dist/context/LangRoutingContext.js +0 -7
- package/dist/context/LovalingoContext.d.ts +0 -1
- package/dist/context/LovalingoContext.js +0 -1
- package/dist/hooks/provider/useBundleLoading.d.ts +0 -33
- package/dist/hooks/provider/useBundleLoading.js +0 -380
- package/dist/hooks/provider/useDomRules.d.ts +0 -15
- package/dist/hooks/provider/useDomRules.js +0 -38
- package/dist/hooks/provider/useLinkAutoPrefix.d.ts +0 -12
- package/dist/hooks/provider/useLinkAutoPrefix.js +0 -146
- package/dist/hooks/provider/useNavigationPrefetch.d.ts +0 -12
- package/dist/hooks/provider/useNavigationPrefetch.js +0 -82
- package/dist/hooks/provider/usePageviewTracking.d.ts +0 -10
- package/dist/hooks/provider/usePageviewTracking.js +0 -44
- package/dist/hooks/provider/usePrehide.d.ts +0 -5
- package/dist/hooks/provider/usePrehide.js +0 -72
- package/dist/hooks/provider/useSitemapLinkTag.d.ts +0 -7
- package/dist/hooks/provider/useSitemapLinkTag.js +0 -28
- package/dist/hooks/provider/useStringMissReporting.d.ts +0 -14
- package/dist/hooks/provider/useStringMissReporting.js +0 -155
- package/dist/hooks/useAixster.d.ts +0 -6
- package/dist/hooks/useAixster.js +0 -14
- package/dist/hooks/useAixsterEdit.d.ts +0 -5
- package/dist/hooks/useAixsterEdit.js +0 -13
- package/dist/hooks/useAixsterTranslate.d.ts +0 -4
- package/dist/hooks/useAixsterTranslate.js +0 -12
- package/dist/hooks/useLang.d.ts +0 -16
- package/dist/hooks/useLang.js +0 -23
- package/dist/hooks/useLangNavigate.d.ts +0 -24
- package/dist/hooks/useLangNavigate.js +0 -40
- package/dist/hooks/useLovalingo.d.ts +0 -1
- package/dist/hooks/useLovalingo.js +0 -1
- package/dist/hooks/useLovalingoEdit.d.ts +0 -1
- package/dist/hooks/useLovalingoEdit.js +0 -1
- package/dist/hooks/useLovalingoTranslate.d.ts +0 -1
- package/dist/hooks/useLovalingoTranslate.js +0 -1
- package/dist/types.d.ts +0 -76
- package/dist/types.js +0 -1
- package/dist/utils/api.d.ts +0 -42
- package/dist/utils/api.js +0 -395
- package/dist/utils/apiTypes.d.ts +0 -78
- package/dist/utils/apiTypes.js +0 -1
- package/dist/utils/apiUtils.d.ts +0 -4
- package/dist/utils/apiUtils.js +0 -54
- package/dist/utils/domRules.d.ts +0 -2
- package/dist/utils/domRules.js +0 -150
- package/dist/utils/hash.d.ts +0 -9
- package/dist/utils/hash.js +0 -27
- package/dist/utils/languageFlags.d.ts +0 -7
- package/dist/utils/languageFlags.js +0 -90
- package/dist/utils/logger.d.ts +0 -3
- package/dist/utils/logger.js +0 -40
- package/dist/utils/markerEngine.d.ts +0 -12
- package/dist/utils/markerEngine.js +0 -109
- package/dist/utils/markerEngineApply.d.ts +0 -3
- package/dist/utils/markerEngineApply.js +0 -136
- package/dist/utils/markerEngineConstants.d.ts +0 -10
- package/dist/utils/markerEngineConstants.js +0 -12
- package/dist/utils/markerEngineCritical.d.ts +0 -2
- package/dist/utils/markerEngineCritical.js +0 -98
- package/dist/utils/markerEngineDomUtils.d.ts +0 -8
- package/dist/utils/markerEngineDomUtils.js +0 -74
- package/dist/utils/markerEngineFilters.d.ts +0 -2
- package/dist/utils/markerEngineFilters.js +0 -26
- package/dist/utils/markerEngineMisses.d.ts +0 -5
- package/dist/utils/markerEngineMisses.js +0 -81
- package/dist/utils/markerEngineOriginals.d.ts +0 -5
- package/dist/utils/markerEngineOriginals.js +0 -29
- package/dist/utils/markerEngineScan.d.ts +0 -5
- package/dist/utils/markerEngineScan.js +0 -162
- package/dist/utils/markerEngineState.d.ts +0 -4
- package/dist/utils/markerEngineState.js +0 -14
- package/dist/utils/markerEngineStats.d.ts +0 -3
- package/dist/utils/markerEngineStats.js +0 -28
- package/dist/utils/markerEngineTranslations.d.ts +0 -3
- package/dist/utils/markerEngineTranslations.js +0 -49
- package/dist/utils/markerEngineTypes.d.ts +0 -62
- package/dist/utils/markerEngineTypes.js +0 -1
- package/dist/utils/markerEngineViewport.d.ts +0 -2
- package/dist/utils/markerEngineViewport.js +0 -27
- package/dist/utils/mergeEntitlements.d.ts +0 -2
- package/dist/utils/mergeEntitlements.js +0 -7
- package/dist/utils/nonLocalizedPaths.d.ts +0 -12
- package/dist/utils/nonLocalizedPaths.js +0 -136
- package/dist/utils/pathNormalizer.d.ts +0 -49
- package/dist/utils/pathNormalizer.js +0 -115
- package/dist/version.d.ts +0 -1
- package/dist/version.js +0 -1
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect, useMemo, useRef } from 'react';
|
|
2
|
-
import { normalizeLocaleCode, resolveLocaleFlag } from '../utils/languageFlags';
|
|
3
|
-
export const LanguageSwitcher = ({ locales, currentLocale, onLocaleChange, position = 'bottom-right', offsetY = 20, theme = 'dark', branding, }) => {
|
|
4
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
5
|
-
const [isMobile, setIsMobile] = useState(false);
|
|
6
|
-
const containerRef = useRef(null);
|
|
7
|
-
const isRight = position.endsWith('right');
|
|
8
|
-
const isTop = position.startsWith('top');
|
|
9
|
-
const isBottom = position.startsWith('bottom');
|
|
10
|
-
const tokens = theme === 'light'
|
|
11
|
-
? {
|
|
12
|
-
surfaceBg: 'rgba(255, 255, 255, 0.93)',
|
|
13
|
-
surfaceHoverBg: 'rgba(245, 245, 245, 0.95)',
|
|
14
|
-
text: 'rgba(13, 13, 13, 0.96)',
|
|
15
|
-
textMuted: 'rgba(13, 13, 13, 0.74)',
|
|
16
|
-
divider: 'rgba(0, 0, 0, 0.10)',
|
|
17
|
-
insetHighlight: 'inset 0 0 1px rgba(0, 0, 0, 0.10)',
|
|
18
|
-
tabShadowRight: '-2px 0 8px rgba(0, 0, 0, 0.12), inset 0 0 1px rgba(0, 0, 0, 0.10)',
|
|
19
|
-
tabShadowLeft: '2px 0 8px rgba(0, 0, 0, 0.12), inset 0 0 1px rgba(0, 0, 0, 0.10)',
|
|
20
|
-
tabHoverShadowRight: '-4px 0 16px rgba(0, 0, 0, 0.16), inset 0 0 1px rgba(0, 0, 0, 0.12)',
|
|
21
|
-
tabHoverShadowLeft: '4px 0 16px rgba(0, 0, 0, 0.16), inset 0 0 1px rgba(0, 0, 0, 0.12)',
|
|
22
|
-
panelShadow: '0 8px 24px rgba(0, 0, 0, 0.14), inset 0 0 1px rgba(0, 0, 0, 0.10)',
|
|
23
|
-
}
|
|
24
|
-
: {
|
|
25
|
-
surfaceBg: 'rgba(26, 26, 26, 0.93)',
|
|
26
|
-
surfaceHoverBg: 'rgba(35, 35, 35, 0.95)',
|
|
27
|
-
text: 'rgba(255, 255, 255, 0.98)',
|
|
28
|
-
textMuted: 'rgba(255, 255, 255, 0.82)',
|
|
29
|
-
divider: 'rgba(255, 255, 255, 0.12)',
|
|
30
|
-
insetHighlight: 'inset 0 0 1px rgba(255, 255, 255, 0.10)',
|
|
31
|
-
tabShadowRight: '-2px 0 8px rgba(0, 0, 0, 0.2), inset 0 0 1px rgba(255, 255, 255, 0.10)',
|
|
32
|
-
tabShadowLeft: '2px 0 8px rgba(0, 0, 0, 0.2), inset 0 0 1px rgba(255, 255, 255, 0.10)',
|
|
33
|
-
tabHoverShadowRight: '-4px 0 16px rgba(0, 0, 0, 0.3), inset 0 0 1px rgba(255, 255, 255, 0.15)',
|
|
34
|
-
tabHoverShadowLeft: '4px 0 16px rgba(0, 0, 0, 0.3), inset 0 0 1px rgba(255, 255, 255, 0.15)',
|
|
35
|
-
panelShadow: '0 8px 24px rgba(0, 0, 0, 0.3), inset 0 0 1px rgba(255, 255, 255, 0.10)',
|
|
36
|
-
};
|
|
37
|
-
// Why: normalize locale codes for comparisons so variants like "tr_TR" and "tr-TR" are treated consistently.
|
|
38
|
-
const normalizedCurrentLocale = useMemo(() => normalizeLocaleCode(currentLocale), [currentLocale]);
|
|
39
|
-
// Why: keep active locale first while preserving caller order for the remaining locales.
|
|
40
|
-
const orderedLocales = useMemo(() => {
|
|
41
|
-
const seen = new Set();
|
|
42
|
-
const items = [];
|
|
43
|
-
const pushLocale = (value) => {
|
|
44
|
-
const raw = typeof value === 'string' ? value.trim() : '';
|
|
45
|
-
const normalized = normalizeLocaleCode(raw);
|
|
46
|
-
if (!raw || !normalized || seen.has(normalized))
|
|
47
|
-
return;
|
|
48
|
-
seen.add(normalized);
|
|
49
|
-
items.push({ raw, normalized });
|
|
50
|
-
};
|
|
51
|
-
if (normalizedCurrentLocale) {
|
|
52
|
-
pushLocale(currentLocale);
|
|
53
|
-
}
|
|
54
|
-
for (const locale of locales) {
|
|
55
|
-
const raw = typeof locale === 'string' ? locale.trim() : '';
|
|
56
|
-
const normalized = normalizeLocaleCode(raw);
|
|
57
|
-
if (!normalized || normalized === normalizedCurrentLocale)
|
|
58
|
-
continue;
|
|
59
|
-
pushLocale(raw);
|
|
60
|
-
}
|
|
61
|
-
if (items.length === 0) {
|
|
62
|
-
for (const locale of locales)
|
|
63
|
-
pushLocale(locale);
|
|
64
|
-
}
|
|
65
|
-
return items;
|
|
66
|
-
}, [currentLocale, locales, normalizedCurrentLocale]);
|
|
67
|
-
const tabFlag = useMemo(() => {
|
|
68
|
-
const fallbackLocale = orderedLocales[0]?.normalized || normalizedCurrentLocale;
|
|
69
|
-
return resolveLocaleFlag(fallbackLocale);
|
|
70
|
-
}, [orderedLocales, normalizedCurrentLocale]);
|
|
71
|
-
// Close on outside click
|
|
72
|
-
useEffect(() => {
|
|
73
|
-
const handleClickOutside = (event) => {
|
|
74
|
-
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
75
|
-
setIsOpen(false);
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
if (isOpen) {
|
|
79
|
-
document.addEventListener('mousedown', handleClickOutside);
|
|
80
|
-
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
81
|
-
}
|
|
82
|
-
}, [isOpen]);
|
|
83
|
-
useEffect(() => {
|
|
84
|
-
if (typeof window === 'undefined')
|
|
85
|
-
return;
|
|
86
|
-
const query = '(max-width: 640px)';
|
|
87
|
-
const media = window.matchMedia(query);
|
|
88
|
-
const update = () => setIsMobile(media.matches);
|
|
89
|
-
update();
|
|
90
|
-
if (typeof media.addEventListener === 'function') {
|
|
91
|
-
media.addEventListener('change', update);
|
|
92
|
-
return () => media.removeEventListener('change', update);
|
|
93
|
-
}
|
|
94
|
-
media.addListener(update);
|
|
95
|
-
return () => media.removeListener(update);
|
|
96
|
-
}, []);
|
|
97
|
-
// Handle keyboard navigation
|
|
98
|
-
useEffect(() => {
|
|
99
|
-
const handleKeyDown = (event) => {
|
|
100
|
-
if (event.key === 'Escape' && isOpen) {
|
|
101
|
-
setIsOpen(false);
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
if (isOpen) {
|
|
105
|
-
document.addEventListener('keydown', handleKeyDown);
|
|
106
|
-
return () => document.removeEventListener('keydown', handleKeyDown);
|
|
107
|
-
}
|
|
108
|
-
}, [isOpen]);
|
|
109
|
-
const containerStyles = {
|
|
110
|
-
position: 'fixed',
|
|
111
|
-
zIndex: 9999,
|
|
112
|
-
...(isTop && { top: `calc(env(safe-area-inset-top, 0px) + 24px + ${offsetY}px)` }),
|
|
113
|
-
...(isBottom && { bottom: `calc(env(safe-area-inset-bottom, 0px) + 24px + ${offsetY}px)` }),
|
|
114
|
-
...(isRight && { right: 0 }),
|
|
115
|
-
...(!isRight && { left: 0 }),
|
|
116
|
-
pointerEvents: 'none',
|
|
117
|
-
};
|
|
118
|
-
const rootStyles = {
|
|
119
|
-
position: 'relative',
|
|
120
|
-
display: 'flex',
|
|
121
|
-
alignItems: 'center',
|
|
122
|
-
pointerEvents: 'none',
|
|
123
|
-
};
|
|
124
|
-
const tabStyles = {
|
|
125
|
-
pointerEvents: 'auto',
|
|
126
|
-
display: 'flex',
|
|
127
|
-
alignItems: 'center',
|
|
128
|
-
justifyContent: 'center',
|
|
129
|
-
width: '44px',
|
|
130
|
-
height: '50px',
|
|
131
|
-
borderRadius: isRight ? '12px 0 0 12px' : '0 12px 12px 0',
|
|
132
|
-
background: tokens.surfaceBg,
|
|
133
|
-
boxShadow: isRight ? tokens.tabShadowRight : tokens.tabShadowLeft,
|
|
134
|
-
cursor: 'pointer',
|
|
135
|
-
fontSize: '20px',
|
|
136
|
-
transition: 'all 0.2s ease',
|
|
137
|
-
userSelect: 'none',
|
|
138
|
-
border: 'none',
|
|
139
|
-
color: tokens.text,
|
|
140
|
-
};
|
|
141
|
-
const panelStyles = {
|
|
142
|
-
position: 'absolute',
|
|
143
|
-
...(isRight && { right: '48px' }),
|
|
144
|
-
...(!isRight && { left: '48px' }),
|
|
145
|
-
top: '50%',
|
|
146
|
-
transform: isOpen
|
|
147
|
-
? 'translateY(-50%) translateX(0)'
|
|
148
|
-
: `translateY(-50%) translateX(${isRight ? '12px' : '-12px'})`,
|
|
149
|
-
opacity: isOpen ? 1 : 0,
|
|
150
|
-
pointerEvents: isOpen ? 'auto' : 'none',
|
|
151
|
-
background: tokens.surfaceBg,
|
|
152
|
-
borderRadius: '16px',
|
|
153
|
-
padding: '10px 12px',
|
|
154
|
-
display: 'flex',
|
|
155
|
-
flexDirection: 'column',
|
|
156
|
-
gap: '10px',
|
|
157
|
-
boxShadow: tokens.panelShadow,
|
|
158
|
-
transition: 'opacity 0.25s ease, transform 0.25s ease',
|
|
159
|
-
width: isMobile ? 'min(320px, calc(100vw - 88px))' : 'auto',
|
|
160
|
-
};
|
|
161
|
-
const localeRowStyles = {
|
|
162
|
-
display: isMobile ? 'grid' : 'flex',
|
|
163
|
-
gridTemplateColumns: isMobile ? 'repeat(5, minmax(0, 1fr))' : undefined,
|
|
164
|
-
justifyItems: isMobile ? 'center' : undefined,
|
|
165
|
-
gap: '10px',
|
|
166
|
-
padding: '0 2px',
|
|
167
|
-
};
|
|
168
|
-
const badgeRowStyles = {
|
|
169
|
-
display: 'flex',
|
|
170
|
-
alignItems: 'center',
|
|
171
|
-
gap: '8px',
|
|
172
|
-
paddingTop: '8px',
|
|
173
|
-
borderTop: `1px solid ${tokens.divider}`,
|
|
174
|
-
fontSize: '12px',
|
|
175
|
-
color: tokens.textMuted,
|
|
176
|
-
userSelect: 'none',
|
|
177
|
-
whiteSpace: 'nowrap',
|
|
178
|
-
};
|
|
179
|
-
const badgeLinkStyles = {
|
|
180
|
-
color: tokens.text,
|
|
181
|
-
textDecoration: 'none',
|
|
182
|
-
display: 'inline-flex',
|
|
183
|
-
alignItems: 'center',
|
|
184
|
-
gap: '6px',
|
|
185
|
-
};
|
|
186
|
-
const flagButtonStyles = (isActive) => ({
|
|
187
|
-
// Why: the panel stays mounted for the close animation, so buttons must be non-interactive while hidden.
|
|
188
|
-
pointerEvents: isOpen ? 'auto' : 'none',
|
|
189
|
-
width: '32px',
|
|
190
|
-
height: '32px',
|
|
191
|
-
borderRadius: '50%',
|
|
192
|
-
display: 'flex',
|
|
193
|
-
alignItems: 'center',
|
|
194
|
-
justifyContent: 'center',
|
|
195
|
-
fontSize: '20px',
|
|
196
|
-
background: isActive ? 'rgba(59, 130, 246, 0.2)' : 'transparent',
|
|
197
|
-
border: isActive ? '2px solid rgb(59, 130, 246)' : '2px solid transparent',
|
|
198
|
-
cursor: 'pointer',
|
|
199
|
-
transition: 'transform 0.15s ease, filter 0.15s ease, background 0.15s ease',
|
|
200
|
-
flexShrink: 0,
|
|
201
|
-
userSelect: 'none',
|
|
202
|
-
padding: 0,
|
|
203
|
-
});
|
|
204
|
-
return (React.createElement("div", { ref: containerRef, style: containerStyles, "data-Lovalingo-exclude": "true" },
|
|
205
|
-
React.createElement("div", { style: rootStyles },
|
|
206
|
-
React.createElement("button", { style: tabStyles, onClick: () => setIsOpen(!isOpen), onMouseEnter: (e) => {
|
|
207
|
-
e.currentTarget.style.background = tokens.surfaceHoverBg;
|
|
208
|
-
e.currentTarget.style.boxShadow = isRight ? tokens.tabHoverShadowRight : tokens.tabHoverShadowLeft;
|
|
209
|
-
}, onMouseLeave: (e) => {
|
|
210
|
-
e.currentTarget.style.background = tokens.surfaceBg;
|
|
211
|
-
e.currentTarget.style.boxShadow = isRight ? tokens.tabShadowRight : tokens.tabShadowLeft;
|
|
212
|
-
}, "aria-label": "Open language switcher", "aria-expanded": isOpen }, tabFlag),
|
|
213
|
-
React.createElement("div", { style: panelStyles, role: "toolbar", "aria-label": "Language options" },
|
|
214
|
-
React.createElement("div", { style: localeRowStyles }, orderedLocales.map((entry) => {
|
|
215
|
-
const isActive = entry.normalized === normalizedCurrentLocale;
|
|
216
|
-
return (React.createElement("button", { key: entry.normalized, style: flagButtonStyles(isActive), onClick: (e) => {
|
|
217
|
-
e.stopPropagation();
|
|
218
|
-
if (isActive) {
|
|
219
|
-
setIsOpen(false);
|
|
220
|
-
}
|
|
221
|
-
else {
|
|
222
|
-
onLocaleChange(entry.raw);
|
|
223
|
-
setIsOpen(false);
|
|
224
|
-
}
|
|
225
|
-
}, onMouseEnter: (e) => {
|
|
226
|
-
if (!isActive) {
|
|
227
|
-
e.currentTarget.style.filter = 'brightness(1.3)';
|
|
228
|
-
}
|
|
229
|
-
e.currentTarget.style.transform = 'scale(1.1)';
|
|
230
|
-
}, onMouseLeave: (e) => {
|
|
231
|
-
e.currentTarget.style.filter = 'brightness(1)';
|
|
232
|
-
e.currentTarget.style.transform = 'scale(1)';
|
|
233
|
-
}, "aria-label": `Switch to ${entry.normalized.toUpperCase()}`, title: entry.normalized.toUpperCase(), tabIndex: isOpen ? 0 : -1 }, resolveLocaleFlag(entry.normalized)));
|
|
234
|
-
})),
|
|
235
|
-
(branding?.required || branding?.enabled) && (React.createElement("div", { style: badgeRowStyles, "aria-label": "Lovalingo branding" },
|
|
236
|
-
React.createElement("a", { href: branding.href || 'https://lovalingo.com', target: "_blank", rel: "noreferrer", style: { ...badgeLinkStyles, pointerEvents: isOpen ? 'auto' : 'none' }, tabIndex: isOpen ? 0 : -1, "aria-label": "Localized by Lovalingo", title: "Localized by Lovalingo" },
|
|
237
|
-
React.createElement("span", { style: {
|
|
238
|
-
width: '16px',
|
|
239
|
-
height: '16px',
|
|
240
|
-
borderRadius: '999px',
|
|
241
|
-
overflow: 'hidden',
|
|
242
|
-
background: '#DA2576',
|
|
243
|
-
display: 'inline-flex',
|
|
244
|
-
alignItems: 'center',
|
|
245
|
-
justifyContent: 'center',
|
|
246
|
-
boxShadow: 'inset 0 0 0 1px rgba(0,0,0,0.25)',
|
|
247
|
-
flexShrink: 0,
|
|
248
|
-
} },
|
|
249
|
-
React.createElement("svg", { width: "16", height: "16", viewBox: "0 0 512 512", fill: "none", "aria-hidden": "true" },
|
|
250
|
-
React.createElement("path", { d: "M256 480C379.712 480 480 379.712 480 256C480 132.288 379.712 32 256 32C132.288 32 32 132.288 32 256C32 379.712 132.288 480 256 480Z", fill: "#DA2576" }),
|
|
251
|
-
React.createElement("path", { d: "M226.321 415.004C277.097 408.769 294.564 331.846 283.824 244.374C273.084 156.903 238.204 92.0061 187.427 98.2407C136.65 104.475 104.194 180.439 114.934 267.911C125.674 355.383 175.544 421.238 226.321 415.004Z", fill: "white", stroke: "white", strokeWidth: "10" }),
|
|
252
|
-
React.createElement("path", { d: "M182.564 395.999C201.42 431.462 270.873 431.411 337.69 395.883C404.508 360.356 443.388 302.806 424.531 267.342C405.675 231.879 336.223 231.931 269.405 267.458C202.588 302.986 163.708 370.535 182.564 395.999Z", fill: "white", stroke: "white", strokeWidth: "10" }))),
|
|
253
|
-
React.createElement("span", null,
|
|
254
|
-
branding.label || 'Localized by',
|
|
255
|
-
" ",
|
|
256
|
-
React.createElement("strong", { "data-no-translate": true, style: { color: tokens.text } }, "Lovalingo")))))))));
|
|
257
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { LovalingoConfig } from '../types';
|
|
3
|
-
interface LovalingoProviderProps extends LovalingoConfig {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
sitemap?: boolean;
|
|
6
|
-
seo?: boolean;
|
|
7
|
-
navigateRef?: React.MutableRefObject<((path: string) => void) | undefined>;
|
|
8
|
-
}
|
|
9
|
-
export declare const LovalingoProvider: React.FC<LovalingoProviderProps>;
|
|
10
|
-
export {};
|