@acorex/core 18.14.1-next.4 → 18.14.1-next.5
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2022/platform/lib/platform.service.mjs +10 -10
- package/esm2022/translation/lib/translation.service.mjs +65 -8
- package/fesm2022/acorex-core-platform.mjs +9 -9
- package/fesm2022/acorex-core-platform.mjs.map +1 -1
- package/fesm2022/acorex-core-translation.mjs +64 -7
- package/fesm2022/acorex-core-translation.mjs.map +1 -1
- package/package.json +1 -1
- package/platform/lib/platform.service.d.ts +2 -1
@@ -117,17 +117,13 @@ export class AXPlatform {
|
|
117
117
|
switchLightMode() {
|
118
118
|
const _html = document.getElementsByTagName('html')[0];
|
119
119
|
_html.classList.remove('ax-dark');
|
120
|
-
|
121
|
-
this.themeMode$.next('light');
|
122
|
-
this.themeMode.set('light');
|
120
|
+
this.#setSystemTheme('light');
|
123
121
|
return 'light';
|
124
122
|
}
|
125
123
|
switchDarkMode() {
|
126
124
|
const _html = document.getElementsByTagName('html')[0];
|
127
125
|
_html.classList.add('ax-dark');
|
128
|
-
|
129
|
-
this.themeMode$.next('dark');
|
130
|
-
this.themeMode.set('dark');
|
126
|
+
this.#setSystemTheme('dark');
|
131
127
|
return 'dark';
|
132
128
|
}
|
133
129
|
switchSystemMode() {
|
@@ -135,15 +131,19 @@ export class AXPlatform {
|
|
135
131
|
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
136
132
|
const _html = document.getElementsByTagName('html')[0];
|
137
133
|
_html.classList.add('ax-dark');
|
134
|
+
this.#setSystemTheme('system-dark');
|
138
135
|
}
|
139
136
|
else {
|
140
137
|
const _html = document.getElementsByTagName('html')[0];
|
141
138
|
_html.classList.remove('ax-dark');
|
139
|
+
this.#setSystemTheme('system-light');
|
142
140
|
}
|
143
141
|
}
|
144
|
-
|
145
|
-
|
146
|
-
this.themeMode
|
142
|
+
}
|
143
|
+
#setSystemTheme(themeMode) {
|
144
|
+
this.themeMode$.next(themeMode);
|
145
|
+
localStorage.setItem('AX_THEME_MODE', themeMode);
|
146
|
+
this.themeMode.set(themeMode);
|
147
147
|
}
|
148
148
|
autoDetectThemeMode() {
|
149
149
|
const mode = localStorage.getItem('AX_THEME_MODE') || 'system';
|
@@ -260,4 +260,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
260
260
|
providedIn: 'root',
|
261
261
|
}]
|
262
262
|
}], ctorParameters: () => [] });
|
263
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGxhdGZvcm0uc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS9wbGF0Zm9ybS9zcmMvbGliL3BsYXRmb3JtLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDbkQsT0FBTyxFQUFFLGVBQWUsRUFBRSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBQzNELE9BQU8sRUFBRSxZQUFZLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQzs7QUFTcEUsTUFBTSxRQUFRLEdBQUcsQ0FBQyxHQUFXLEVBQVcsRUFBRSxDQUFDLGFBQWEsQ0FBQyxHQUFHLEVBQUUsU0FBUyxDQUFDLENBQUM7QUFFekUsTUFBTSxTQUFTLEdBQUcsQ0FBQyxHQUFXLEVBQVcsRUFBRSxDQUFDLGFBQWEsQ0FBQyxHQUFHLEVBQUUsVUFBVSxDQUFDLENBQUM7QUFFM0UsTUFBTSxNQUFNLEdBQUcsQ0FBQyxHQUFXLEVBQVcsRUFBRSxDQUFDLGFBQWEsQ0FBQyxHQUFHLEVBQUUsT0FBTyxDQUFDLENBQUM7QUFFckUsTUFBTSxRQUFRLEdB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UoJ2RpcicpO1xuICAgICAgICAgIHRoaXMuZGlyZWN0aW9uQ2hhbmdlLm5leHQoeyBzb3VyY2U6IHRoaXMsIG5hdGl2ZUV2ZW50OiBudWxsLCBkYXRhOiBkaXIgfSk7XG4gICAgICAgIH1cbiAgICAgIH0pO1xuICAgIH0pO1xuICAgIG9ic2VydmVyLm9ic2VydmUoZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50LCB7XG4gICAgICBhdHRyaWJ1dGVzOiB0cnVlLFxuICAgICAgY2hpbGRMaXN0OiBmYWxzZSxcbiAgICAgIGNoYXJhY3RlckRhdGE6IGZhbHNlLFxuICAgIH0pO1xuICB9XG59XG4iXX0=
|
@@ -190,28 +190,85 @@ export class AXTranslationService {
|
|
190
190
|
// Perform parameter replacement
|
191
191
|
return this.getTranslation((translation || key), lang, scope, options?.params);
|
192
192
|
}
|
193
|
+
// private findAXTranslateOptionsFromKey(
|
194
|
+
// inputString: string,
|
195
|
+
// ): (Omit<AXTranslateOptions, 'params'> & { key: string })[] {
|
196
|
+
// const regex = /<axt(?:\s+lang="([^"]*)")?(?:\s+scope="([^"]*)")?>(.*?)<\/axt>/g;
|
197
|
+
// const result: (Omit<AXTranslateOptions, 'params'> & { key: string })[] = [];
|
198
|
+
// let match;
|
199
|
+
// // Loop through all matches in the input string
|
200
|
+
// while ((match = regex.exec(inputString)) !== null) {
|
201
|
+
// result.push({
|
202
|
+
// lang: match[1] || undefined,
|
203
|
+
// scope: match[2] || undefined,
|
204
|
+
// key: match[3] || undefined,
|
205
|
+
// });
|
206
|
+
// }
|
207
|
+
// return result;
|
208
|
+
// }
|
193
209
|
findAXTranslateOptionsFromKey(inputString) {
|
194
|
-
const regex =
|
210
|
+
const regex = /t\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{\s*([^}]*)\s*\})?\s*\)/g;
|
195
211
|
const result = [];
|
196
212
|
let match;
|
197
213
|
// Loop through all matches in the input string
|
198
214
|
while ((match = regex.exec(inputString)) !== null) {
|
215
|
+
const key = match[1]; // Extract the key
|
216
|
+
const options = match[2]; // Extract the options object, if present
|
217
|
+
// Parse options into a key-value object
|
218
|
+
const parsedOptions = {};
|
219
|
+
if (options) {
|
220
|
+
options.split(',').forEach((option) => {
|
221
|
+
const [key, value] = option.split(':').map((s) => s.trim().replace(/^['"]|['"]$/g, ''));
|
222
|
+
parsedOptions[key] = value || undefined;
|
223
|
+
});
|
224
|
+
}
|
199
225
|
result.push({
|
200
|
-
|
201
|
-
|
202
|
-
|
226
|
+
key,
|
227
|
+
lang: parsedOptions['lang'],
|
228
|
+
scope: parsedOptions['scope'],
|
203
229
|
});
|
204
230
|
}
|
205
231
|
return result;
|
206
232
|
}
|
233
|
+
// private translateAsyncAXTranslate(key: string, options?: AXTranslateOptions): Observable<string> {
|
234
|
+
// const regex = /(<axt(?:\s+lang="[^"]*")?(?:\s+scope="[^"]*")?>.*?<\/axt>)/g;
|
235
|
+
// const splitParts = key.split(regex); // Split into <axt> parts and text parts
|
236
|
+
// const translationObservables: Observable<string>[] = [];
|
237
|
+
// for (const part of splitParts) {
|
238
|
+
// const optionsFromKey = this.findAXTranslateOptionsFromKey(part);
|
239
|
+
// if (optionsFromKey.length > 0) {
|
240
|
+
// // This is an <axt> part, translate it
|
241
|
+
// for (const parsed of optionsFromKey) {
|
242
|
+
// const parsedLang = parsed.lang || options?.lang || this.getActiveLang();
|
243
|
+
// const parsedScope = parsed.scope || options?.scope || this.config.defaultScope;
|
244
|
+
// const parsedKey = parsed.key;
|
245
|
+
// // Push the translation observable to the array
|
246
|
+
// translationObservables.push(
|
247
|
+
// this.load(parsedKey, {
|
248
|
+
// lang: parsedLang,
|
249
|
+
// scope: parsedScope,
|
250
|
+
// params: options?.params,
|
251
|
+
// }),
|
252
|
+
// );
|
253
|
+
// }
|
254
|
+
// } else {
|
255
|
+
// // This is plain text, so wrap it in an observable
|
256
|
+
// translationObservables.push(of(part));
|
257
|
+
// }
|
258
|
+
// }
|
259
|
+
// // Use forkJoin to wait for all observables to complete
|
260
|
+
// return forkJoin(translationObservables).pipe(
|
261
|
+
// map((translatedParts) => translatedParts.join('')), // Join all translated parts
|
262
|
+
// );
|
263
|
+
// }
|
207
264
|
translateAsyncAXTranslate(key, options) {
|
208
|
-
const regex = /(
|
209
|
-
const splitParts = key.split(regex); // Split into
|
265
|
+
const regex = /(t\(['"][^'"]+['"](?:,\s*\{[^}]*\})?\))/g; // Match t('key', { ... }) calls
|
266
|
+
const splitParts = key.split(regex); // Split into t() parts and text parts
|
210
267
|
const translationObservables = [];
|
211
268
|
for (const part of splitParts) {
|
212
269
|
const optionsFromKey = this.findAXTranslateOptionsFromKey(part);
|
213
270
|
if (optionsFromKey.length > 0) {
|
214
|
-
// This is
|
271
|
+
// This is a t() part, translate it
|
215
272
|
for (const parsed of optionsFromKey) {
|
216
273
|
const parsedLang = parsed.lang || options?.lang || this.getActiveLang();
|
217
274
|
const parsedScope = parsed.scope || options?.scope || this.config.defaultScope;
|
@@ -239,4 +296,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
239
296
|
type: Injectable,
|
240
297
|
args: [{ providedIn: 'root' }]
|
241
298
|
}], ctorParameters: () => [] });
|
242
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRpb24uc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS90cmFuc2xhdGlvbi9zcmMvbGliL3RyYW5zbGF0aW9uLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGNBQWMsRUFBRSxZQUFZLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUNuRSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUNuRCxPQUFPLEVBQU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
@@ -118,17 +118,13 @@ class AXPlatform {
|
|
118
118
|
switchLightMode() {
|
119
119
|
const _html = document.getElementsByTagName('html')[0];
|
120
120
|
_html.classList.remove('ax-dark');
|
121
|
-
|
122
|
-
this.themeMode$.next('light');
|
123
|
-
this.themeMode.set('light');
|
121
|
+
this.#setSystemTheme('light');
|
124
122
|
return 'light';
|
125
123
|
}
|
126
124
|
switchDarkMode() {
|
127
125
|
const _html = document.getElementsByTagName('html')[0];
|
128
126
|
_html.classList.add('ax-dark');
|
129
|
-
|
130
|
-
this.themeMode$.next('dark');
|
131
|
-
this.themeMode.set('dark');
|
127
|
+
this.#setSystemTheme('dark');
|
132
128
|
return 'dark';
|
133
129
|
}
|
134
130
|
switchSystemMode() {
|
@@ -136,15 +132,19 @@ class AXPlatform {
|
|
136
132
|
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
137
133
|
const _html = document.getElementsByTagName('html')[0];
|
138
134
|
_html.classList.add('ax-dark');
|
135
|
+
this.#setSystemTheme('system-dark');
|
139
136
|
}
|
140
137
|
else {
|
141
138
|
const _html = document.getElementsByTagName('html')[0];
|
142
139
|
_html.classList.remove('ax-dark');
|
140
|
+
this.#setSystemTheme('system-light');
|
143
141
|
}
|
144
142
|
}
|
145
|
-
|
146
|
-
|
147
|
-
this.themeMode
|
143
|
+
}
|
144
|
+
#setSystemTheme(themeMode) {
|
145
|
+
this.themeMode$.next(themeMode);
|
146
|
+
localStorage.setItem('AX_THEME_MODE', themeMode);
|
147
|
+
this.themeMode.set(themeMode);
|
148
148
|
}
|
149
149
|
autoDetectThemeMode() {
|
150
150
|
const mode = localStorage.getItem('AX_THEME_MODE') || 'system';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-core-platform.mjs","sources":["../../../../libs/core/platform/src/lib/platform.service.ts","../../../../libs/core/platform/src/acorex-core-platform.ts"],"sourcesContent":["import { Injectable, signal } from '@angular/core';\nimport { BehaviorSubject, Subject, fromEvent } from 'rxjs';\nimport { debounceTime, distinctUntilChanged } from 'rxjs/operators';\n\nexport type AXThemeMode = 'light' | 'dark' | 'system';\nexport type AXPlatforms = 'Android' | 'Desktop' | 'iOS' | 'Mobile';\nexport type AXBrowsers = 'Chrome' | 'Safari' | 'Edge' | 'Firefox' | 'Opera' | 'MSIE';\nexport type AXTechnologies = 'PWA' | 'Hybrid' | 'Electron';\n\nexport type AXScreenSizes = 'SM' | 'MD' | 'LG' | 'XL' | '2XL' | '3XL' | '4XL' | '5XL';\n\nconst isChrome = (win: Window): boolean => testUserAgent(win, /Chrome/i);\n\nconst isFirefox = (win: Window): boolean => testUserAgent(win, /Firefox/i);\n\nconst isEdge = (win: Window): boolean => testUserAgent(win, /Edge/i);\n\nconst isSafari = (win: Window): boolean => testUserAgent(win, /Safari/i);\n\nconst isOpera = (win: Window): boolean => testUserAgent(win, /Opera/i) || testUserAgent(win, /OPR/i);\n\nconst isMSIE = (win: Window): boolean => testUserAgent(win, /MSIE/i) || testUserAgent(win, /Trident/i);\n\nconst isMobileWeb = (win: Window): boolean => isMobile(win) && !isHybrid(win);\n\nconst isIpad = (win: Window) => {\n // iOS 12 and below\n if (testUserAgent(win, /iPad/i)) {\n return true;\n }\n\n // iOS 13+\n if (testUserAgent(win, /Macintosh/i) && isMobile(win)) {\n return true;\n }\n\n return false;\n};\n\nconst isIphone = (win: Window) => testUserAgent(win, /iPhone/i);\n\nconst isIOS = (win: Window) => testUserAgent(win, /iPhone|iPod/i) || isIpad(win);\n\nconst isAndroid = (win: Window) => testUserAgent(win, /android|sink/i);\n\nconst isAndroidTablet = (win: Window) => {\n return isAndroid(win) && !testUserAgent(win, /mobile/i);\n};\n\nconst isPhablet = (win: Window) => {\n const width = win.innerWidth;\n const height = win.innerHeight;\n const smallest = Math.min(width, height);\n const largest = Math.max(width, height);\n\n return smallest > 390 && smallest < 520 && largest > 620 && largest < 800;\n};\n\nconst isTablet = (win: Window) => {\n const width = win.innerWidth;\n const height = win.innerHeight;\n const smallest = Math.min(width, height);\n const largest = Math.max(width, height);\n\n return (\n isIpad(win) ||\n isAndroidTablet(win) ||\n (smallest > 460 && smallest < 820 && largest > 780 && largest < 1400)\n );\n};\n\nconst isMobile = (win: Window) => matchMedia(win, '(any-pointer:coarse)');\nconst isTouch = (win: Window) => matchMedia(win, '(any-pointer:coarse)');\n\nconst isDesktop = (win: Window) => !isMobile(win);\n\nconst isHybrid = (win: Window) => isCordova(win) || isCapacitorNative(win);\n\nconst isCordova = (win: any): boolean => !!(win['cordova'] || win['phonegap'] || win['PhoneGap']);\n\nconst isCapacitorNative = (win: any): boolean => {\n const capacitor = win['Capacitor'];\n return !!(capacitor && capacitor.isNative);\n};\n\nconst isElectron = (win: Window): boolean => testUserAgent(win, /electron/i);\n\nconst isPWA = (win: Window): boolean =>\n !!(win.matchMedia('(display-mode: standalone)').matches || (win.navigator as any).standalone);\n\nexport const testUserAgent = (win: Window, expr: RegExp) => expr.test(win.navigator.userAgent);\n\nexport const isBrowser = new Function('try {return this===window;}catch(e){ return false;}');\nexport const isServer = new Function('try {return this===global;}catch(e){return false;}');\n\nconst matchMedia = (win: Window, query: string): boolean => {\n return win.matchMedia(query).matches;\n};\n\nconst isSMScreen = (win: Window) => matchMedia(win, '(max-width: 578px)');\nconst isMDScreen = (win: Window) => matchMedia(win, '(max-width: 768px)');\nconst isLGScreen = (win: Window) => matchMedia(win, '(max-width: 992px)');\nconst isXLScreen = (win: Window) => matchMedia(win, '(max-width: 1200px)');\nconst is2XLScreen = (win: Window) => matchMedia(win, '(max-width: 1440px)');\nconst is3XLScreen = (win: Window) => matchMedia(win, '(max-width: 1920px)');\nconst is4XLScreen = (win: Window) => matchMedia(win, '(max-width: 2560px)');\n\nconst PLATFORMS_MAP: any = {\n Android: isAndroid,\n iOS: isIOS,\n Desktop: isDesktop,\n Mobile: isMobile,\n Touch: isTouch,\n Chrome: isChrome,\n Firefox: isFirefox,\n Safari: isSafari,\n Edge: isEdge,\n Opera: isOpera,\n Hybrid: isHybrid,\n PWA: isPWA,\n Electron: isElectron,\n SM: isSMScreen,\n MD: isMDScreen,\n LG: isLGScreen,\n XL: isXLScreen,\n '2XL': is2XLScreen,\n '3XL': is3XLScreen,\n '4XL': is4XLScreen,\n};\n\nexport class AXPlatformEvent<T extends Event = Event> {\n nativeEvent!: T;\n source!: AXPlatform;\n data?: any;\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXPlatform {\n resize: Subject<AXPlatformEvent> = new Subject<AXPlatformEvent>();\n directionChange: Subject<AXPlatformEvent> = new Subject<AXPlatformEvent>();\n click: Subject<AXPlatformEvent> = new Subject<AXPlatformEvent>();\n scroll: Subject<AXPlatformEvent> = new Subject<AXPlatformEvent>();\n themeMode$: BehaviorSubject<AXThemeMode> = new BehaviorSubject<AXThemeMode>('system');\n\n themeMode = signal<AXThemeMode>('system');\n\n isDark(): boolean {\n return document.documentElement.classList.contains('ax-dark');\n }\n\n isRtl(): boolean {\n return document.dir == 'rtl' || document.body.dir == 'rtl' || document.body.style.direction == 'rtl';\n }\n\n isLandscape(): boolean {\n return window.innerHeight < window.innerWidth;\n }\n\n isPortrate(): boolean {\n return !this.isLandscape();\n }\n\n is(name: AXPlatforms | AXBrowsers | AXTechnologies | AXScreenSizes): boolean {\n if (isBrowser()) {\n return PLATFORMS_MAP[name](window) || false;\n } else {\n return false;\n }\n }\n\n get screenSize(): AXScreenSizes {\n return (['SM', 'MD', 'LG', 'XL', '2XL', '3XL', '4XL'].find(\n (name) => PLATFORMS_MAP[name](window) == true,\n ) || '5XL') as AXScreenSizes;\n }\n\n switchLightMode() {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.remove('ax-dark');\n localStorage.setItem('AX_THEME_MODE', 'light');\n this.themeMode$.next('light');\n this.themeMode.set('light');\n return 'light';\n }\n\n switchDarkMode() {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.add('ax-dark');\n localStorage.setItem('AX_THEME_MODE', 'dark');\n this.themeMode$.next('dark');\n this.themeMode.set('dark');\n return 'dark';\n }\n\n switchSystemMode() {\n if (isBrowser()) {\n if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.add('ax-dark');\n } else {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.remove('ax-dark');\n }\n }\n localStorage.setItem('AX_THEME_MODE', 'system');\n this.themeMode$.next('system');\n this.themeMode.set('system');\n }\n\n autoDetectThemeMode() {\n const mode = localStorage.getItem('AX_THEME_MODE') || 'system';\n switch (mode) {\n case 'light':\n return this.switchLightMode();\n\n case 'dark':\n return this.switchDarkMode();\n\n case 'system':\n return this.switchSystemMode();\n }\n }\n\n private setFullHeightRatio() {\n if (isBrowser()) {\n try {\n document\n .querySelector<HTMLElement>(':root')\n ?.style.setProperty('--ax-vh', window.innerHeight / 100 + 'px');\n } catch (error) {\n console.error(error);\n }\n }\n }\n\n private autoSystemModeDetection(event) {\n if (this.themeMode() === 'system') {\n const themeMode = event.matches ? 'dark' : 'light';\n\n if (themeMode === 'dark') {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.add('ax-dark');\n } else {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.remove('ax-dark');\n }\n }\n }\n\n constructor() {\n if (isBrowser()) {\n this.detectDarkMode();\n this.detectOnResize();\n this.detectClickEvent();\n this.detectScrollEvent();\n this.setFullHeightRatio();\n this.detectDocumentDirectionChange();\n }\n }\n\n private detectDarkMode() {\n // fromEvent(UIEvent)(window,'')\n if (window?.matchMedia('(prefers-color-scheme: dark)').matches) {\n window?.matchMedia('(prefers-color-scheme: dark)')?.addEventListener('change', (event) => {\n // Detect System color mode\n this.autoSystemModeDetection(event);\n });\n }\n }\n\n private detectOnResize() {\n fromEvent<UIEvent>(window, 'resize')\n .pipe(debounceTime(100))\n .pipe(distinctUntilChanged())\n .subscribe((e) => {\n this.resize.next({\n nativeEvent: e,\n source: this,\n });\n //\n this.setFullHeightRatio();\n });\n }\n\n private detectClickEvent() {\n document.addEventListener(\n 'click',\n (e) => {\n this.click.next({\n nativeEvent: e,\n source: this,\n });\n },\n true,\n );\n }\n\n private detectScrollEvent() {\n document.addEventListener(\n 'scroll',\n (e) => {\n this.scroll.next({\n nativeEvent: e,\n source: this,\n });\n },\n true,\n );\n }\n\n private detectDocumentDirectionChange() {\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n // Detect Direction Change\n if (mutation.attributeName === 'dir') {\n const dir = document.documentElement.getAttribute('dir');\n this.directionChange.next({ source: this, nativeEvent: null, data: dir });\n }\n });\n });\n observer.observe(document.documentElement, {\n attributes: true,\n childList: false,\n characterData: false,\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAWA,MAAM,QAAQ,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC;AAExE,MAAM,SAAS,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,UAAU,CAAC;AAE1E,MAAM,MAAM,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC;AAEpE,MAAM,QAAQ,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC;AAExE,MAAM,OAAO,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC;AAEpG,MAAM,MAAM,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,aAAa,CAAC,GAAG,EAAE,UAAU,CAAC;AAEtG,MAAM,WAAW,GAAG,CAAC,GAAW,KAAc,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;AAE7E,MAAM,MAAM,GAAG,CAAC,GAAW,KAAI;;AAE7B,IAAA,IAAI,aAAa,CAAC,GAAG,EAAE,OAAO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AAM,EAAA,CAAA,CAAA;;2FAEP,UAAU,EAAA,UAAA,EAAA,CAAA;kBAHtB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;AC1ID;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"acorex-core-platform.mjs","sources":["../../../../libs/core/platform/src/lib/platform.service.ts","../../../../libs/core/platform/src/acorex-core-platform.ts"],"sourcesContent":["import { Injectable, signal } from '@angular/core';\nimport { BehaviorSubject, Subject, fromEvent } from 'rxjs';\nimport { debounceTime, distinctUntilChanged } from 'rxjs/operators';\n\nexport type AXThemeMode = 'light' | 'dark' | 'system' | 'system-dark' | 'system-light';\nexport type AXPlatforms = 'Android' | 'Desktop' | 'iOS' | 'Mobile';\nexport type AXBrowsers = 'Chrome' | 'Safari' | 'Edge' | 'Firefox' | 'Opera' | 'MSIE';\nexport type AXTechnologies = 'PWA' | 'Hybrid' | 'Electron';\n\nexport type AXScreenSizes = 'SM' | 'MD' | 'LG' | 'XL' | '2XL' | '3XL' | '4XL' | '5XL';\n\nconst isChrome = (win: Window): boolean => testUserAgent(win, /Chrome/i);\n\nconst isFirefox = (win: Window): boolean => testUserAgent(win, /Firefox/i);\n\nconst isEdge = (win: Window): boolean => testUserAgent(win, /Edge/i);\n\nconst isSafari = (win: Window): boolean => testUserAgent(win, /Safari/i);\n\nconst isOpera = (win: Window): boolean => testUserAgent(win, /Opera/i) || testUserAgent(win, /OPR/i);\n\nconst isMSIE = (win: Window): boolean => testUserAgent(win, /MSIE/i) || testUserAgent(win, /Trident/i);\n\nconst isMobileWeb = (win: Window): boolean => isMobile(win) && !isHybrid(win);\n\nconst isIpad = (win: Window) => {\n // iOS 12 and below\n if (testUserAgent(win, /iPad/i)) {\n return true;\n }\n\n // iOS 13+\n if (testUserAgent(win, /Macintosh/i) && isMobile(win)) {\n return true;\n }\n\n return false;\n};\n\nconst isIphone = (win: Window) => testUserAgent(win, /iPhone/i);\n\nconst isIOS = (win: Window) => testUserAgent(win, /iPhone|iPod/i) || isIpad(win);\n\nconst isAndroid = (win: Window) => testUserAgent(win, /android|sink/i);\n\nconst isAndroidTablet = (win: Window) => {\n return isAndroid(win) && !testUserAgent(win, /mobile/i);\n};\n\nconst isPhablet = (win: Window) => {\n const width = win.innerWidth;\n const height = win.innerHeight;\n const smallest = Math.min(width, height);\n const largest = Math.max(width, height);\n\n return smallest > 390 && smallest < 520 && largest > 620 && largest < 800;\n};\n\nconst isTablet = (win: Window) => {\n const width = win.innerWidth;\n const height = win.innerHeight;\n const smallest = Math.min(width, height);\n const largest = Math.max(width, height);\n\n return (\n isIpad(win) ||\n isAndroidTablet(win) ||\n (smallest > 460 && smallest < 820 && largest > 780 && largest < 1400)\n );\n};\n\nconst isMobile = (win: Window) => matchMedia(win, '(any-pointer:coarse)');\nconst isTouch = (win: Window) => matchMedia(win, '(any-pointer:coarse)');\n\nconst isDesktop = (win: Window) => !isMobile(win);\n\nconst isHybrid = (win: Window) => isCordova(win) || isCapacitorNative(win);\n\nconst isCordova = (win: any): boolean => !!(win['cordova'] || win['phonegap'] || win['PhoneGap']);\n\nconst isCapacitorNative = (win: any): boolean => {\n const capacitor = win['Capacitor'];\n return !!(capacitor && capacitor.isNative);\n};\n\nconst isElectron = (win: Window): boolean => testUserAgent(win, /electron/i);\n\nconst isPWA = (win: Window): boolean =>\n !!(win.matchMedia('(display-mode: standalone)').matches || (win.navigator as any).standalone);\n\nexport const testUserAgent = (win: Window, expr: RegExp) => expr.test(win.navigator.userAgent);\n\nexport const isBrowser = new Function('try {return this===window;}catch(e){ return false;}');\nexport const isServer = new Function('try {return this===global;}catch(e){return false;}');\n\nconst matchMedia = (win: Window, query: string): boolean => {\n return win.matchMedia(query).matches;\n};\n\nconst isSMScreen = (win: Window) => matchMedia(win, '(max-width: 578px)');\nconst isMDScreen = (win: Window) => matchMedia(win, '(max-width: 768px)');\nconst isLGScreen = (win: Window) => matchMedia(win, '(max-width: 992px)');\nconst isXLScreen = (win: Window) => matchMedia(win, '(max-width: 1200px)');\nconst is2XLScreen = (win: Window) => matchMedia(win, '(max-width: 1440px)');\nconst is3XLScreen = (win: Window) => matchMedia(win, '(max-width: 1920px)');\nconst is4XLScreen = (win: Window) => matchMedia(win, '(max-width: 2560px)');\n\nconst PLATFORMS_MAP: any = {\n Android: isAndroid,\n iOS: isIOS,\n Desktop: isDesktop,\n Mobile: isMobile,\n Touch: isTouch,\n Chrome: isChrome,\n Firefox: isFirefox,\n Safari: isSafari,\n Edge: isEdge,\n Opera: isOpera,\n Hybrid: isHybrid,\n PWA: isPWA,\n Electron: isElectron,\n SM: isSMScreen,\n MD: isMDScreen,\n LG: isLGScreen,\n XL: isXLScreen,\n '2XL': is2XLScreen,\n '3XL': is3XLScreen,\n '4XL': is4XLScreen,\n};\n\nexport class AXPlatformEvent<T extends Event = Event> {\n nativeEvent!: T;\n source!: AXPlatform;\n data?: any;\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXPlatform {\n resize: Subject<AXPlatformEvent> = new Subject<AXPlatformEvent>();\n directionChange: Subject<AXPlatformEvent> = new Subject<AXPlatformEvent>();\n click: Subject<AXPlatformEvent> = new Subject<AXPlatformEvent>();\n scroll: Subject<AXPlatformEvent> = new Subject<AXPlatformEvent>();\n themeMode$: BehaviorSubject<AXThemeMode> = new BehaviorSubject<AXThemeMode>('system');\n themeMode = signal<AXThemeMode>('system');\n\n isDark(): boolean {\n return document.documentElement.classList.contains('ax-dark');\n }\n\n isRtl(): boolean {\n return document.dir == 'rtl' || document.body.dir == 'rtl' || document.body.style.direction == 'rtl';\n }\n\n isLandscape(): boolean {\n return window.innerHeight < window.innerWidth;\n }\n\n isPortrate(): boolean {\n return !this.isLandscape();\n }\n\n is(name: AXPlatforms | AXBrowsers | AXTechnologies | AXScreenSizes): boolean {\n if (isBrowser()) {\n return PLATFORMS_MAP[name](window) || false;\n } else {\n return false;\n }\n }\n\n get screenSize(): AXScreenSizes {\n return (['SM', 'MD', 'LG', 'XL', '2XL', '3XL', '4XL'].find(\n (name) => PLATFORMS_MAP[name](window) == true,\n ) || '5XL') as AXScreenSizes;\n }\n\n switchLightMode() {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.remove('ax-dark');\n this.#setSystemTheme('light');\n return 'light';\n }\n\n switchDarkMode() {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.add('ax-dark');\n this.#setSystemTheme('dark');\n return 'dark';\n }\n\n switchSystemMode() {\n if (isBrowser()) {\n if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.add('ax-dark');\n this.#setSystemTheme('system-dark');\n } else {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.remove('ax-dark');\n this.#setSystemTheme('system-light');\n }\n }\n }\n\n #setSystemTheme(themeMode: AXThemeMode) {\n this.themeMode$.next(themeMode);\n localStorage.setItem('AX_THEME_MODE', themeMode);\n this.themeMode.set(themeMode);\n }\n\n autoDetectThemeMode() {\n const mode = localStorage.getItem('AX_THEME_MODE') || 'system';\n switch (mode) {\n case 'light':\n return this.switchLightMode();\n\n case 'dark':\n return this.switchDarkMode();\n\n case 'system':\n return this.switchSystemMode();\n }\n }\n\n private setFullHeightRatio() {\n if (isBrowser()) {\n try {\n document\n .querySelector<HTMLElement>(':root')\n ?.style.setProperty('--ax-vh', window.innerHeight / 100 + 'px');\n } catch (error) {\n console.error(error);\n }\n }\n }\n\n private autoSystemModeDetection(event) {\n if (this.themeMode() === 'system') {\n const themeMode = event.matches ? 'dark' : 'light';\n\n if (themeMode === 'dark') {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.add('ax-dark');\n } else {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.remove('ax-dark');\n }\n }\n }\n\n constructor() {\n if (isBrowser()) {\n this.detectDarkMode();\n this.detectOnResize();\n this.detectClickEvent();\n this.detectScrollEvent();\n this.setFullHeightRatio();\n this.detectDocumentDirectionChange();\n }\n }\n\n private detectDarkMode() {\n // fromEvent(UIEvent)(window,'')\n if (window?.matchMedia('(prefers-color-scheme: dark)').matches) {\n window?.matchMedia('(prefers-color-scheme: dark)')?.addEventListener('change', (event) => {\n // Detect System color mode\n this.autoSystemModeDetection(event);\n });\n }\n }\n\n private detectOnResize() {\n fromEvent<UIEvent>(window, 'resize')\n .pipe(debounceTime(100))\n .pipe(distinctUntilChanged())\n .subscribe((e) => {\n this.resize.next({\n nativeEvent: e,\n source: this,\n });\n //\n this.setFullHeightRatio();\n });\n }\n\n private detectClickEvent() {\n document.addEventListener(\n 'click',\n (e) => {\n this.click.next({\n nativeEvent: e,\n source: this,\n });\n },\n true,\n );\n }\n\n private detectScrollEvent() {\n document.addEventListener(\n 'scroll',\n (e) => {\n this.scroll.next({\n nativeEvent: e,\n source: this,\n });\n },\n true,\n );\n }\n\n private detectDocumentDirectionChange() {\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n // Detect Direction Change\n if (mutation.attributeName === 'dir') {\n const dir = document.documentElement.getAttribute('dir');\n this.directionChange.next({ source: this, nativeEvent: null, data: dir });\n }\n });\n });\n observer.observe(document.documentElement, {\n attributes: true,\n childList: false,\n characterData: false,\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAWA,MAAM,QAAQ,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC;AAExE,MAAM,SAAS,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,UAAU,CAAC;AAE1E,MAAM,MAAM,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC;AAEpE,MAAM,QAAQ,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC;AAExE,MAAM,OAAO,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,aA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,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAV,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAU,cAFT,MAAM,EAAA,CAAA,CAAA;;2FAEP,UAAU,EAAA,UAAA,EAAA,CAAA;kBAHtB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;AC1ID;;AAEG;;;;"}
|
@@ -220,28 +220,85 @@ class AXTranslationService {
|
|
220
220
|
// Perform parameter replacement
|
221
221
|
return this.getTranslation((translation || key), lang, scope, options?.params);
|
222
222
|
}
|
223
|
+
// private findAXTranslateOptionsFromKey(
|
224
|
+
// inputString: string,
|
225
|
+
// ): (Omit<AXTranslateOptions, 'params'> & { key: string })[] {
|
226
|
+
// const regex = /<axt(?:\s+lang="([^"]*)")?(?:\s+scope="([^"]*)")?>(.*?)<\/axt>/g;
|
227
|
+
// const result: (Omit<AXTranslateOptions, 'params'> & { key: string })[] = [];
|
228
|
+
// let match;
|
229
|
+
// // Loop through all matches in the input string
|
230
|
+
// while ((match = regex.exec(inputString)) !== null) {
|
231
|
+
// result.push({
|
232
|
+
// lang: match[1] || undefined,
|
233
|
+
// scope: match[2] || undefined,
|
234
|
+
// key: match[3] || undefined,
|
235
|
+
// });
|
236
|
+
// }
|
237
|
+
// return result;
|
238
|
+
// }
|
223
239
|
findAXTranslateOptionsFromKey(inputString) {
|
224
|
-
const regex =
|
240
|
+
const regex = /t\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{\s*([^}]*)\s*\})?\s*\)/g;
|
225
241
|
const result = [];
|
226
242
|
let match;
|
227
243
|
// Loop through all matches in the input string
|
228
244
|
while ((match = regex.exec(inputString)) !== null) {
|
245
|
+
const key = match[1]; // Extract the key
|
246
|
+
const options = match[2]; // Extract the options object, if present
|
247
|
+
// Parse options into a key-value object
|
248
|
+
const parsedOptions = {};
|
249
|
+
if (options) {
|
250
|
+
options.split(',').forEach((option) => {
|
251
|
+
const [key, value] = option.split(':').map((s) => s.trim().replace(/^['"]|['"]$/g, ''));
|
252
|
+
parsedOptions[key] = value || undefined;
|
253
|
+
});
|
254
|
+
}
|
229
255
|
result.push({
|
230
|
-
|
231
|
-
|
232
|
-
|
256
|
+
key,
|
257
|
+
lang: parsedOptions['lang'],
|
258
|
+
scope: parsedOptions['scope'],
|
233
259
|
});
|
234
260
|
}
|
235
261
|
return result;
|
236
262
|
}
|
263
|
+
// private translateAsyncAXTranslate(key: string, options?: AXTranslateOptions): Observable<string> {
|
264
|
+
// const regex = /(<axt(?:\s+lang="[^"]*")?(?:\s+scope="[^"]*")?>.*?<\/axt>)/g;
|
265
|
+
// const splitParts = key.split(regex); // Split into <axt> parts and text parts
|
266
|
+
// const translationObservables: Observable<string>[] = [];
|
267
|
+
// for (const part of splitParts) {
|
268
|
+
// const optionsFromKey = this.findAXTranslateOptionsFromKey(part);
|
269
|
+
// if (optionsFromKey.length > 0) {
|
270
|
+
// // This is an <axt> part, translate it
|
271
|
+
// for (const parsed of optionsFromKey) {
|
272
|
+
// const parsedLang = parsed.lang || options?.lang || this.getActiveLang();
|
273
|
+
// const parsedScope = parsed.scope || options?.scope || this.config.defaultScope;
|
274
|
+
// const parsedKey = parsed.key;
|
275
|
+
// // Push the translation observable to the array
|
276
|
+
// translationObservables.push(
|
277
|
+
// this.load(parsedKey, {
|
278
|
+
// lang: parsedLang,
|
279
|
+
// scope: parsedScope,
|
280
|
+
// params: options?.params,
|
281
|
+
// }),
|
282
|
+
// );
|
283
|
+
// }
|
284
|
+
// } else {
|
285
|
+
// // This is plain text, so wrap it in an observable
|
286
|
+
// translationObservables.push(of(part));
|
287
|
+
// }
|
288
|
+
// }
|
289
|
+
// // Use forkJoin to wait for all observables to complete
|
290
|
+
// return forkJoin(translationObservables).pipe(
|
291
|
+
// map((translatedParts) => translatedParts.join('')), // Join all translated parts
|
292
|
+
// );
|
293
|
+
// }
|
237
294
|
translateAsyncAXTranslate(key, options) {
|
238
|
-
const regex = /(
|
239
|
-
const splitParts = key.split(regex); // Split into
|
295
|
+
const regex = /(t\(['"][^'"]+['"](?:,\s*\{[^}]*\})?\))/g; // Match t('key', { ... }) calls
|
296
|
+
const splitParts = key.split(regex); // Split into t() parts and text parts
|
240
297
|
const translationObservables = [];
|
241
298
|
for (const part of splitParts) {
|
242
299
|
const optionsFromKey = this.findAXTranslateOptionsFromKey(part);
|
243
300
|
if (optionsFromKey.length > 0) {
|
244
|
-
// This is
|
301
|
+
// This is a t() part, translate it
|
245
302
|
for (const parsed of optionsFromKey) {
|
246
303
|
const parsedLang = parsed.lang || options?.lang || this.getActiveLang();
|
247
304
|
const parsedScope = parsed.scope || options?.scope || this.config.defaultScope;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-core-translation.mjs","sources":["../../../../libs/core/translation/src/lib/translation.config.ts","../../../../libs/core/translation/src/lib/translation.loader.ts","../../../../libs/core/translation/src/lib/translation.service.ts","../../../../libs/core/translation/src/lib/translation-scope.resolver.ts","../../../../libs/core/translation/src/lib/translator.directive.ts","../../../../libs/core/translation/src/lib/translator.pipe.ts","../../../../libs/core/translation/src/lib/translation.module.ts","../../../../libs/core/translation/src/acorex-core-translation.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { AXTranslateLang, AXTranslateScope } from './translation.types';\n\nexport interface AXTranslationConfig {\n defaultLang: AXTranslateLang;\n defaultScope: AXTranslateScope;\n preloadLangs?: AXTranslateLang[];\n preloadScopes?: AXTranslateLang[];\n availableLangs?: AXTranslateLang[];\n scopeResolverKey: string;\n}\n\nexport const AX_TRANSLATION_CONFIG = new InjectionToken<AXTranslationConfig>('AX_TRANSLATION_CONFIG', {\n providedIn: 'root',\n factory: () => {\n return AXTranslationDefaultConfig;\n },\n});\n\nexport const AXTranslationDefaultConfig: AXTranslationConfig = {\n defaultLang: 'en',\n defaultScope: 'common',\n scopeResolverKey: 'scope',\n};\n\nexport type AXPartialTranslationConfig = Partial<AXTranslationConfig>;\n\nexport function translationConfig(config: AXPartialTranslationConfig = {}): AXTranslationConfig {\n const result = {\n ...AXTranslationDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { InjectionToken } from '@angular/core';\nimport { Observable, of } from 'rxjs';\nimport { AXTranslateLang, AXTranslateScope, AXTranslation } from './translation.types';\n\nexport interface AXTranslationLoaderOptions {\n lang: AXTranslateLang;\n scope?: AXTranslateScope;\n}\n\nexport interface AXTranslationLoader {\n getTranslation(options: AXTranslationLoaderOptions): Observable<AXTranslation>;\n}\n\nexport class AXTranslationLoaderDefault implements AXTranslationLoader {\n getTranslation(options: AXTranslationLoaderOptions): Observable<AXTranslation> {\n return of({});\n }\n}\n\nexport const AX_TRANSLATION_LOADER = new InjectionToken<AXTranslationLoader>('AX_TRANSLATION_LOADER', {\n providedIn: 'root',\n factory: () => {\n return new AXTranslationLoaderDefault();\n },\n});\n","import { AXEventService, AXEventTypes } from '@acorex/core/events';\nimport { Injectable, inject } from '@angular/core';\nimport { get as lodashGet, set as lodashSet } from 'lodash-es';\nimport {\n BehaviorSubject,\n Observable,\n catchError,\n finalize,\n firstValueFrom,\n forkJoin,\n lastValueFrom,\n map,\n of,\n shareReplay,\n startWith,\n switchMap,\n take,\n tap,\n} from 'rxjs';\nimport { AX_TRANSLATION_CONFIG } from './translation.config';\nimport { AX_TRANSLATION_LOADER } from './translation.loader';\nimport {\n AXTranslateHashMap,\n AXTranslateLang,\n AXTranslateOptions,\n AXTranslateParams,\n} from './translation.types';\n\nlet service: AXTranslationService;\n\nexport function translateSync(key: string, options?: AXTranslateOptions): string {\n return service.translateSync(key, options);\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXTranslationService {\n private loader = inject(AX_TRANSLATION_LOADER);\n private config = inject(AX_TRANSLATION_CONFIG);\n\n private eventService = inject(AXEventService);\n\n private translationCache: AXTranslateHashMap<AXTranslateHashMap<string>> = {};\n private ongoingRequests: Map<string, Observable<any>> = new Map();\n\n private activeLang: BehaviorSubject<string> = new BehaviorSubject<string>(this.getDefaultLang());\n langChanges$: Observable<string> = this.activeLang.asObservable();\n\n private lastActiveLang: string | null = null;\n\n /**\n * @ignore\n */\n constructor() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n service = this;\n }\n\n public loadLanguagesAndScopes(languages: string[], scopes: string[]): Observable<unknown> {\n const requests = languages.flatMap((lang) =>\n scopes.map((scope) => {\n // Check if translations are already cached\n if (this.translationCache[lang]?.[scope]) {\n return of(this.translationCache[lang][scope]);\n }\n\n // Use the new method to handle ongoing requests and loading\n return this.getOrLoadTranslations(lang, scope);\n }),\n );\n\n return forkJoin(requests);\n }\n\n private getOrLoadTranslations(lang: string, scope: string): Observable<AXTranslateHashMap<string>> {\n const requestKey = `${lang}_${scope}`;\n\n // Return existing observable if the request is already in progress\n if (this.ongoingRequests.has(requestKey)) {\n return this.ongoingRequests.get(requestKey);\n }\n\n // Load translations if not in cache or ongoing requests\n const translationObservable = this.loader.getTranslation({ lang, scope }).pipe(\n tap((translations) => this.cacheTranslations(lang, scope, translations)),\n catchError((error) => {\n console.error(`Error loading translations for lang: ${lang}, scope: ${scope}`, error);\n return of(null);\n }),\n finalize(() => {\n this.eventService.emitEvent({\n type: AXEventTypes.AXLanguageLoaded,\n payload: lang,\n });\n this.ongoingRequests.delete(requestKey);\n }),\n shareReplay(1),\n );\n\n this.ongoingRequests.set(requestKey, translationObservable);\n return translationObservable;\n }\n\n private cacheTranslations(lang: string, scope: string, translations: AXTranslateHashMap<string>): void {\n lodashSet(this.translationCache, `${lang}.${scope}`, translations);\n }\n\n public getDefaultLang(): string {\n return this.config.defaultLang;\n }\n\n public getActiveLang(): string {\n return this.activeLang.getValue();\n }\n\n public setActiveLang(lang: string): void {\n if (lang != this.getActiveLang()) {\n this.lastActiveLang = this.getActiveLang(); // Update last active language\n this.activeLang.next(lang);\n this.eventService.emitEvent({\n type: AXEventTypes.AXLanguageChanged,\n payload: lang,\n });\n }\n }\n\n public isLangAvailable(lang: string, scope: string = null): boolean {\n return !this.translationCache[lang] && (!scope || !this.translationCache[lang][scope]);\n }\n\n public getLangAvailable(): AXTranslateLang[] | undefined {\n return this.config.availableLangs;\n }\n\n private load(key: string, options: AXTranslateOptions = {}): Observable<string> {\n const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options;\n\n // Function to fetch translation\n const fetchTranslation = (language: string): Observable<string> => {\n // Check if translations are available in the cache\n if (this.translationCache[language]?.[scope]) {\n return of(this.getTranslation(key, language, scope, options.params));\n }\n\n // Use the new method to handle ongoing requests and loading\n return this.getOrLoadTranslations(language, scope).pipe(\n map(() => {\n const translation = this.translationCache[language]?.[scope]?.[key] || key;\n return this.getTranslation(translation, language, scope, options.params);\n }),\n switchMap((translatedText) => {\n if (translatedText === key && language !== this.getDefaultLang()) {\n // If the translation is not found and the language is not default,\n // try fetching from the default language\n return fetchTranslation(this.getDefaultLang());\n }\n return of(translatedText);\n }),\n );\n };\n\n // First, try to fetch the translation for the requested language\n const translationForRequestedLang = fetchTranslation(lang);\n\n // If lastActiveLang is available and different from the requested language, use it as a fallback\n if (this.lastActiveLang && this.lastActiveLang !== lang) {\n const translationForLastActiveLang = this.getTranslation(\n key,\n this.lastActiveLang,\n scope,\n options.params,\n );\n return translationForRequestedLang.pipe(startWith(translationForLastActiveLang));\n }\n\n return translationForRequestedLang;\n }\n\n private getTranslation(key: string, lang: string, scope: string, params?: AXTranslateParams): string {\n let translation: string = (lodashGet(this.translationCache, `${lang}.${scope}.${key}`) || key) as string;\n\n // Replace params like {{ name }}\n if (params) {\n Object.keys(params).forEach((paramKey) => {\n const paramValue = params[paramKey] as string;\n if (typeof translation !== 'string') {\n console.error(`${key} is not string`, { key, lang, scope, params, translation });\n } else {\n translation = translation.replace(new RegExp(`{{\\\\s*${paramKey}\\\\s*}}`, 'g'), paramValue);\n }\n });\n }\n\n if (typeof translation !== 'string') {\n console.error(`${key} is not string`, { key, lang, scope, params, translation });\n } else {\n // Replace translations like {{ t('key') }}\n const translationPattern = /{{\\s*t\\('([^']+)'\\)\\s*}}/g;\n translation = translation.replace(translationPattern, (match, innerKey) => {\n return this.getTranslation(innerKey, lang, scope, params);\n });\n }\n\n return translation;\n }\n\n public translate(key: string, options?: AXTranslateOptions): Observable<string> {\n const result = this.findAXTranslateOptionsFromKey(key);\n if (result.length) {\n return this.langChanges$.pipe(\n startWith(this.getActiveLang()),\n switchMap((lang) => {\n return this.translateAsyncAXTranslate(key, options);\n }),\n );\n } else {\n if (options?.lang) {\n return this.load(key, options);\n }\n return this.langChanges$.pipe(\n startWith(this.getActiveLang()),\n switchMap((lang) => {\n return this.load(key, { ...options, lang: lang });\n }),\n );\n }\n }\n\n public async translateAsync(key: string, options?: AXTranslateOptions): Promise<string> {\n const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options || {};\n let translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);\n\n if (!translation) {\n // If the translation is not in the cache, load it\n await firstValueFrom(this.load(key, { lang, scope }).pipe(take(1)));\n translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);\n }\n\n // If still not available, try the last active language or default language\n if (!translation && this.lastActiveLang) {\n translation = lodashGet(this.translationCache, `${this.lastActiveLang}.${scope}.${key}`);\n }\n if (!translation) {\n translation = lodashGet(this.translationCache, `${this.getDefaultLang()}.${scope}.${key}`);\n }\n\n // Perform parameter replacement\n return this.getTranslation((translation || key) as any, lang, scope, options?.params);\n }\n\n public translateSync(key: string, options?: AXTranslateOptions): string {\n const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options || {};\n\n // Check if the translation for the active language is available\n let translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);\n\n //\n const loadLang = () => lastValueFrom(this.getOrLoadTranslations(lang, scope));\n // If not available, check lastActiveLang\n if (!translation && this.lastActiveLang) {\n loadLang();\n translation = lodashGet(this.translationCache, `${this.lastActiveLang}.${scope}.${key}`);\n }\n\n // If still not available, use the default language\n if (!translation) {\n loadLang();\n translation = lodashGet(this.translationCache, `${this.getDefaultLang()}.${scope}.${key}`);\n }\n\n // Perform parameter replacement\n return this.getTranslation((translation || key) as any, lang, scope, options?.params);\n }\n private findAXTranslateOptionsFromKey(\n inputString: string,\n ): (Omit<AXTranslateOptions, 'params'> & { key: string })[] {\n const regex = /<axt(?:\\s+lang=\"([^\"]*)\")?(?:\\s+scope=\"([^\"]*)\")?>(.*?)<\\/axt>/g;\n const result: (Omit<AXTranslateOptions, 'params'> & { key: string })[] = [];\n let match;\n\n // Loop through all matches in the input string\n while ((match = regex.exec(inputString)) !== null) {\n result.push({\n lang: match[1] || undefined,\n scope: match[2] || undefined,\n key: match[3] || undefined,\n });\n }\n return result;\n }\n\n private translateAsyncAXTranslate(key: string, options?: AXTranslateOptions): Observable<string> {\n const regex = /(<axt(?:\\s+lang=\"[^\"]*\")?(?:\\s+scope=\"[^\"]*\")?>.*?<\\/axt>)/g;\n const splitParts = key.split(regex); // Split into <axt> parts and text parts\n\n const translationObservables: Observable<string>[] = [];\n\n for (const part of splitParts) {\n const optionsFromKey = this.findAXTranslateOptionsFromKey(part);\n\n if (optionsFromKey.length > 0) {\n // This is an <axt> part, translate it\n for (const parsed of optionsFromKey) {\n const parsedLang = parsed.lang || options?.lang || this.getActiveLang();\n const parsedScope = parsed.scope || options?.scope || this.config.defaultScope;\n const parsedKey = parsed.key;\n\n // Push the translation observable to the array\n translationObservables.push(\n this.load(parsedKey, {\n lang: parsedLang,\n scope: parsedScope,\n params: options?.params,\n }),\n );\n }\n } else {\n // This is plain text, so wrap it in an observable\n translationObservables.push(of(part));\n }\n }\n\n // Use forkJoin to wait for all observables to complete\n return forkJoin(translationObservables).pipe(\n map((translatedParts) => translatedParts.join('')), // Join all translated parts\n );\n }\n}\n","import { inject } from '@angular/core';\nimport { ResolveFn } from '@angular/router';\nimport { AX_TRANSLATION_CONFIG } from './translation.config';\nimport { AXTranslationService } from './translation.service';\n\nexport const loadTranslationScope: ResolveFn<unknown> = (route, state) => {\n const translatorService = inject(AXTranslationService);\n const config = inject(AX_TRANSLATION_CONFIG);\n const scopeValue = route.data[config.scopeResolverKey];\n const scopes = Array.isArray(scopeValue) ? scopeValue : [scopeValue];\n return translatorService.loadLanguagesAndScopes([translatorService.getActiveLang()], scopes);\n};\n","import { Directive, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { AXTranslationService } from './translation.service';\nimport { AXTranslateOptions } from './translation.types';\n\n@Directive({\n selector: '[translate]',\n})\nexport class AXTranslatorDirective implements OnInit {\n constructor(\n private templateRef: TemplateRef<any>,\n private viewContainer: ViewContainerRef,\n private translationService: AXTranslationService,\n ) {}\n\n ngOnInit() {\n this.viewContainer.clear();\n this.viewContainer.createEmbeddedView(this.templateRef, {\n $implicit: (key: string, options?: AXTranslateOptions) => {\n return this.translationService.translate(key, options);\n },\n });\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Observable, of } from 'rxjs';\nimport { AXTranslationService } from './translation.service';\nimport { AXTranslateOptions } from './translation.types';\n\n@Pipe({ name: 'translate', pure: true }) // The pipe can now be pure\nexport class AXTranslatorPipe implements PipeTransform {\n constructor(private service: AXTranslationService) {}\n\n transform(key: string, options?: AXTranslateOptions): Observable<string> {\n if (!key) {\n return of(''); // Return an empty observable if the key is not provided\n }\n return this.service.translate(key, options);\n }\n}\n","import { APP_INITIALIZER, NgModule } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { AXTranslationConfig, AX_TRANSLATION_CONFIG } from './translation.config';\nimport { AXTranslationService } from './translation.service';\nimport { AXTranslatorDirective } from './translator.directive';\nimport { AXTranslatorPipe } from './translator.pipe';\n\nfunction initializeApp(translatorService: AXTranslationService, config: AXTranslationConfig) {\n return (): Observable<any> => {\n return translatorService.loadLanguagesAndScopes(\n config.preloadLangs ?? [config.defaultLang],\n config.preloadScopes ?? [config.defaultScope],\n );\n };\n}\n\n@NgModule({\n imports: [],\n exports: [AXTranslatorPipe, AXTranslatorDirective],\n declarations: [AXTranslatorPipe, AXTranslatorDirective],\n providers: [\n {\n provide: APP_INITIALIZER,\n useFactory: initializeApp,\n deps: [AXTranslationService, AX_TRANSLATION_CONFIG],\n multi: true,\n },\n ],\n})\nexport class AXTranslationModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["lodashSet","lodashGet","i1.AXTranslationService"],"mappings":";;;;;;MAYa,qBAAqB,GAAG,IAAI,cAAc,CAAsB,uBAAuB,EAAE;AACpG,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,MAAK;AACZ,QAAA,OAAO,0BAA0B;KAClC;AACF,CAAA;AAEY,MAAA,0BAA0B,GAAwB;AAC7D,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,YAAY,EAAE,QAAQ;AACtB,IAAA,gBAAgB,EAAE,OAAO;;AAKX,SAAA,iBAAiB,CAAC,MAAA,GAAqC,EAAE,EAAA;AACvE,IAAA,MAAM,MAAM,GAAG;AACb,QAAA,GAAG,0BAA0B;AAC7B,QAAA,GAAG,MAAM;KACV;AACD,IAAA,OAAO,MAAM;AACf;;MCpBa,0BAA0B,CAAA;AACrC,IAAA,cAAc,CAAC,OAAmC,EAAA;AAChD,QAAA,OAAO,EAAE,CAAC,EAAE,CAAC;;AAEhB;MAEY,qBAAqB,GAAG,IAAI,cAAc,CAAsB,uBAAuB,EAAE;AACpG,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,MAAK;QACZ,OAAO,IAAI,0BAA0B,EAAE;KACxC;AACF,CAAA;;ACID,IAAI,OAA6B;AAEjB,SAAA,aAAa,CAAC,GAAW,EAAE,OAA4B,EAAA;IACrE,OAAO,OAAO,CAAC,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC;AAC5C;MAGa,oBAAoB,CAAA;AAc/B;;AAEG;AACH,IAAA,WAAA,GAAA;AAhBQ,QAAA,IAAA,C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,aAAA;AACF,SAAA,EAAA,CAAA,CAAA;;2FAEU,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAb/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,OAAO,EAAE,CAAC,gBAAgB,EAAE,qBAAqB,CAAC;AAClD,oBAAA,YAAY,EAAE,CAAC,gBAAgB,EAAE,qBAAqB,CAAC;AACvD,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,eAAe;AACxB,4BAAA,UAAU,EAAE,aAAa;AACzB,4BAAA,IAAI,EAAE,CAAC,oBAAoB,EAAE,qBAAqB,CAAC;AACnD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA;AACF,iBAAA;;;AC5BD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"acorex-core-translation.mjs","sources":["../../../../libs/core/translation/src/lib/translation.config.ts","../../../../libs/core/translation/src/lib/translation.loader.ts","../../../../libs/core/translation/src/lib/translation.service.ts","../../../../libs/core/translation/src/lib/translation-scope.resolver.ts","../../../../libs/core/translation/src/lib/translator.directive.ts","../../../../libs/core/translation/src/lib/translator.pipe.ts","../../../../libs/core/translation/src/lib/translation.module.ts","../../../../libs/core/translation/src/acorex-core-translation.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { AXTranslateLang, AXTranslateScope } from './translation.types';\n\nexport interface AXTranslationConfig {\n defaultLang: AXTranslateLang;\n defaultScope: AXTranslateScope;\n preloadLangs?: AXTranslateLang[];\n preloadScopes?: AXTranslateLang[];\n availableLangs?: AXTranslateLang[];\n scopeResolverKey: string;\n}\n\nexport const AX_TRANSLATION_CONFIG = new InjectionToken<AXTranslationConfig>('AX_TRANSLATION_CONFIG', {\n providedIn: 'root',\n factory: () => {\n return AXTranslationDefaultConfig;\n },\n});\n\nexport const AXTranslationDefaultConfig: AXTranslationConfig = {\n defaultLang: 'en',\n defaultScope: 'common',\n scopeResolverKey: 'scope',\n};\n\nexport type AXPartialTranslationConfig = Partial<AXTranslationConfig>;\n\nexport function translationConfig(config: AXPartialTranslationConfig = {}): AXTranslationConfig {\n const result = {\n ...AXTranslationDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { InjectionToken } from '@angular/core';\nimport { Observable, of } from 'rxjs';\nimport { AXTranslateLang, AXTranslateScope, AXTranslation } from './translation.types';\n\nexport interface AXTranslationLoaderOptions {\n lang: AXTranslateLang;\n scope?: AXTranslateScope;\n}\n\nexport interface AXTranslationLoader {\n getTranslation(options: AXTranslationLoaderOptions): Observable<AXTranslation>;\n}\n\nexport class AXTranslationLoaderDefault implements AXTranslationLoader {\n getTranslation(options: AXTranslationLoaderOptions): Observable<AXTranslation> {\n return of({});\n }\n}\n\nexport const AX_TRANSLATION_LOADER = new InjectionToken<AXTranslationLoader>('AX_TRANSLATION_LOADER', {\n providedIn: 'root',\n factory: () => {\n return new AXTranslationLoaderDefault();\n },\n});\n","import { AXEventService, AXEventTypes } from '@acorex/core/events';\nimport { Injectable, inject } from '@angular/core';\nimport { get as lodashGet, set as lodashSet } from 'lodash-es';\nimport {\n BehaviorSubject,\n Observable,\n catchError,\n finalize,\n firstValueFrom,\n forkJoin,\n lastValueFrom,\n map,\n of,\n shareReplay,\n startWith,\n switchMap,\n take,\n tap,\n} from 'rxjs';\nimport { AX_TRANSLATION_CONFIG } from './translation.config';\nimport { AX_TRANSLATION_LOADER } from './translation.loader';\nimport {\n AXTranslateHashMap,\n AXTranslateLang,\n AXTranslateOptions,\n AXTranslateParams,\n} from './translation.types';\n\nlet service: AXTranslationService;\n\nexport function translateSync(key: string, options?: AXTranslateOptions): string {\n return service.translateSync(key, options);\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXTranslationService {\n private loader = inject(AX_TRANSLATION_LOADER);\n private config = inject(AX_TRANSLATION_CONFIG);\n\n private eventService = inject(AXEventService);\n\n private translationCache: AXTranslateHashMap<AXTranslateHashMap<string>> = {};\n private ongoingRequests: Map<string, Observable<any>> = new Map();\n\n private activeLang: BehaviorSubject<string> = new BehaviorSubject<string>(this.getDefaultLang());\n langChanges$: Observable<string> = this.activeLang.asObservable();\n\n private lastActiveLang: string | null = null;\n\n /**\n * @ignore\n */\n constructor() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n service = this;\n }\n\n public loadLanguagesAndScopes(languages: string[], scopes: string[]): Observable<unknown> {\n const requests = languages.flatMap((lang) =>\n scopes.map((scope) => {\n // Check if translations are already cached\n if (this.translationCache[lang]?.[scope]) {\n return of(this.translationCache[lang][scope]);\n }\n\n // Use the new method to handle ongoing requests and loading\n return this.getOrLoadTranslations(lang, scope);\n }),\n );\n\n return forkJoin(requests);\n }\n\n private getOrLoadTranslations(lang: string, scope: string): Observable<AXTranslateHashMap<string>> {\n const requestKey = `${lang}_${scope}`;\n\n // Return existing observable if the request is already in progress\n if (this.ongoingRequests.has(requestKey)) {\n return this.ongoingRequests.get(requestKey);\n }\n\n // Load translations if not in cache or ongoing requests\n const translationObservable = this.loader.getTranslation({ lang, scope }).pipe(\n tap((translations) => this.cacheTranslations(lang, scope, translations)),\n catchError((error) => {\n console.error(`Error loading translations for lang: ${lang}, scope: ${scope}`, error);\n return of(null);\n }),\n finalize(() => {\n this.eventService.emitEvent({\n type: AXEventTypes.AXLanguageLoaded,\n payload: lang,\n });\n this.ongoingRequests.delete(requestKey);\n }),\n shareReplay(1),\n );\n\n this.ongoingRequests.set(requestKey, translationObservable);\n return translationObservable;\n }\n\n private cacheTranslations(lang: string, scope: string, translations: AXTranslateHashMap<string>): void {\n lodashSet(this.translationCache, `${lang}.${scope}`, translations);\n }\n\n public getDefaultLang(): string {\n return this.config.defaultLang;\n }\n\n public getActiveLang(): string {\n return this.activeLang.getValue();\n }\n\n public setActiveLang(lang: string): void {\n if (lang != this.getActiveLang()) {\n this.lastActiveLang = this.getActiveLang(); // Update last active language\n this.activeLang.next(lang);\n this.eventService.emitEvent({\n type: AXEventTypes.AXLanguageChanged,\n payload: lang,\n });\n }\n }\n\n public isLangAvailable(lang: string, scope: string = null): boolean {\n return !this.translationCache[lang] && (!scope || !this.translationCache[lang][scope]);\n }\n\n public getLangAvailable(): AXTranslateLang[] | undefined {\n return this.config.availableLangs;\n }\n\n private load(key: string, options: AXTranslateOptions = {}): Observable<string> {\n const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options;\n\n // Function to fetch translation\n const fetchTranslation = (language: string): Observable<string> => {\n // Check if translations are available in the cache\n if (this.translationCache[language]?.[scope]) {\n return of(this.getTranslation(key, language, scope, options.params));\n }\n\n // Use the new method to handle ongoing requests and loading\n return this.getOrLoadTranslations(language, scope).pipe(\n map(() => {\n const translation = this.translationCache[language]?.[scope]?.[key] || key;\n return this.getTranslation(translation, language, scope, options.params);\n }),\n switchMap((translatedText) => {\n if (translatedText === key && language !== this.getDefaultLang()) {\n // If the translation is not found and the language is not default,\n // try fetching from the default language\n return fetchTranslation(this.getDefaultLang());\n }\n return of(translatedText);\n }),\n );\n };\n\n // First, try to fetch the translation for the requested language\n const translationForRequestedLang = fetchTranslation(lang);\n\n // If lastActiveLang is available and different from the requested language, use it as a fallback\n if (this.lastActiveLang && this.lastActiveLang !== lang) {\n const translationForLastActiveLang = this.getTranslation(\n key,\n this.lastActiveLang,\n scope,\n options.params,\n );\n return translationForRequestedLang.pipe(startWith(translationForLastActiveLang));\n }\n\n return translationForRequestedLang;\n }\n\n private getTranslation(key: string, lang: string, scope: string, params?: AXTranslateParams): string {\n let translation: string = (lodashGet(this.translationCache, `${lang}.${scope}.${key}`) || key) as string;\n\n // Replace params like {{ name }}\n if (params) {\n Object.keys(params).forEach((paramKey) => {\n const paramValue = params[paramKey] as string;\n if (typeof translation !== 'string') {\n console.error(`${key} is not string`, { key, lang, scope, params, translation });\n } else {\n translation = translation.replace(new RegExp(`{{\\\\s*${paramKey}\\\\s*}}`, 'g'), paramValue);\n }\n });\n }\n\n if (typeof translation !== 'string') {\n console.error(`${key} is not string`, { key, lang, scope, params, translation });\n } else {\n // Replace translations like {{ t('key') }}\n const translationPattern = /{{\\s*t\\('([^']+)'\\)\\s*}}/g;\n translation = translation.replace(translationPattern, (match, innerKey) => {\n return this.getTranslation(innerKey, lang, scope, params);\n });\n }\n\n return translation;\n }\n\n public translate(key: string, options?: AXTranslateOptions): Observable<string> {\n const result = this.findAXTranslateOptionsFromKey(key);\n if (result.length) {\n return this.langChanges$.pipe(\n startWith(this.getActiveLang()),\n switchMap((lang) => {\n return this.translateAsyncAXTranslate(key, options);\n }),\n );\n } else {\n if (options?.lang) {\n return this.load(key, options);\n }\n return this.langChanges$.pipe(\n startWith(this.getActiveLang()),\n switchMap((lang) => {\n return this.load(key, { ...options, lang: lang });\n }),\n );\n }\n }\n\n public async translateAsync(key: string, options?: AXTranslateOptions): Promise<string> {\n const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options || {};\n let translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);\n\n if (!translation) {\n // If the translation is not in the cache, load it\n await firstValueFrom(this.load(key, { lang, scope }).pipe(take(1)));\n translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);\n }\n\n // If still not available, try the last active language or default language\n if (!translation && this.lastActiveLang) {\n translation = lodashGet(this.translationCache, `${this.lastActiveLang}.${scope}.${key}`);\n }\n if (!translation) {\n translation = lodashGet(this.translationCache, `${this.getDefaultLang()}.${scope}.${key}`);\n }\n\n // Perform parameter replacement\n return this.getTranslation((translation || key) as any, lang, scope, options?.params);\n }\n\n public translateSync(key: string, options?: AXTranslateOptions): string {\n const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options || {};\n\n // Check if the translation for the active language is available\n let translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);\n\n //\n const loadLang = () => lastValueFrom(this.getOrLoadTranslations(lang, scope));\n // If not available, check lastActiveLang\n if (!translation && this.lastActiveLang) {\n loadLang();\n translation = lodashGet(this.translationCache, `${this.lastActiveLang}.${scope}.${key}`);\n }\n\n // If still not available, use the default language\n if (!translation) {\n loadLang();\n translation = lodashGet(this.translationCache, `${this.getDefaultLang()}.${scope}.${key}`);\n }\n\n // Perform parameter replacement\n return this.getTranslation((translation || key) as any, lang, scope, options?.params);\n }\n // private findAXTranslateOptionsFromKey(\n // inputString: string,\n // ): (Omit<AXTranslateOptions, 'params'> & { key: string })[] {\n // const regex = /<axt(?:\\s+lang=\"([^\"]*)\")?(?:\\s+scope=\"([^\"]*)\")?>(.*?)<\\/axt>/g;\n // const result: (Omit<AXTranslateOptions, 'params'> & { key: string })[] = [];\n // let match;\n\n // // Loop through all matches in the input string\n // while ((match = regex.exec(inputString)) !== null) {\n // result.push({\n // lang: match[1] || undefined,\n // scope: match[2] || undefined,\n // key: match[3] || undefined,\n // });\n // }\n // return result;\n // }\n private findAXTranslateOptionsFromKey(\n inputString: string,\n ): (Omit<AXTranslateOptions, 'params'> & { key: string })[] {\n const regex = /t\\(\\s*['\"]([^'\"]+)['\"]\\s*(?:,\\s*\\{\\s*([^}]*)\\s*\\})?\\s*\\)/g;\n const result: (Omit<AXTranslateOptions, 'params'> & { key: string })[] = [];\n let match;\n\n // Loop through all matches in the input string\n while ((match = regex.exec(inputString)) !== null) {\n const key = match[1]; // Extract the key\n const options = match[2]; // Extract the options object, if present\n\n // Parse options into a key-value object\n const parsedOptions: Record<string, string | undefined> = {};\n if (options) {\n options.split(',').forEach((option) => {\n const [key, value] = option.split(':').map((s) => s.trim().replace(/^['\"]|['\"]$/g, ''));\n parsedOptions[key] = value || undefined;\n });\n }\n\n result.push({\n key,\n lang: parsedOptions['lang'],\n scope: parsedOptions['scope'],\n });\n }\n\n return result;\n }\n\n // private translateAsyncAXTranslate(key: string, options?: AXTranslateOptions): Observable<string> {\n // const regex = /(<axt(?:\\s+lang=\"[^\"]*\")?(?:\\s+scope=\"[^\"]*\")?>.*?<\\/axt>)/g;\n // const splitParts = key.split(regex); // Split into <axt> parts and text parts\n\n // const translationObservables: Observable<string>[] = [];\n\n // for (const part of splitParts) {\n // const optionsFromKey = this.findAXTranslateOptionsFromKey(part);\n\n // if (optionsFromKey.length > 0) {\n // // This is an <axt> part, translate it\n // for (const parsed of optionsFromKey) {\n // const parsedLang = parsed.lang || options?.lang || this.getActiveLang();\n // const parsedScope = parsed.scope || options?.scope || this.config.defaultScope;\n // const parsedKey = parsed.key;\n\n // // Push the translation observable to the array\n // translationObservables.push(\n // this.load(parsedKey, {\n // lang: parsedLang,\n // scope: parsedScope,\n // params: options?.params,\n // }),\n // );\n // }\n // } else {\n // // This is plain text, so wrap it in an observable\n // translationObservables.push(of(part));\n // }\n // }\n\n // // Use forkJoin to wait for all observables to complete\n // return forkJoin(translationObservables).pipe(\n // map((translatedParts) => translatedParts.join('')), // Join all translated parts\n // );\n // }\n private translateAsyncAXTranslate(key: string, options?: AXTranslateOptions): Observable<string> {\n const regex = /(t\\(['\"][^'\"]+['\"](?:,\\s*\\{[^}]*\\})?\\))/g; // Match t('key', { ... }) calls\n const splitParts = key.split(regex); // Split into t() parts and text parts\n\n const translationObservables: Observable<string>[] = [];\n\n for (const part of splitParts) {\n const optionsFromKey = this.findAXTranslateOptionsFromKey(part);\n\n if (optionsFromKey.length > 0) {\n // This is a t() part, translate it\n for (const parsed of optionsFromKey) {\n const parsedLang = parsed.lang || options?.lang || this.getActiveLang();\n const parsedScope = parsed.scope || options?.scope || this.config.defaultScope;\n const parsedKey = parsed.key;\n\n // Push the translation observable to the array\n translationObservables.push(\n this.load(parsedKey, {\n lang: parsedLang,\n scope: parsedScope,\n params: options?.params,\n }),\n );\n }\n } else {\n // This is plain text, so wrap it in an observable\n translationObservables.push(of(part));\n }\n }\n\n // Use forkJoin to wait for all observables to complete\n return forkJoin(translationObservables).pipe(\n map((translatedParts) => translatedParts.join('')), // Join all translated parts\n );\n }\n}\n","import { inject } from '@angular/core';\nimport { ResolveFn } from '@angular/router';\nimport { AX_TRANSLATION_CONFIG } from './translation.config';\nimport { AXTranslationService } from './translation.service';\n\nexport const loadTranslationScope: ResolveFn<unknown> = (route, state) => {\n const translatorService = inject(AXTranslationService);\n const config = inject(AX_TRANSLATION_CONFIG);\n const scopeValue = route.data[config.scopeResolverKey];\n const scopes = Array.isArray(scopeValue) ? scopeValue : [scopeValue];\n return translatorService.loadLanguagesAndScopes([translatorService.getActiveLang()], scopes);\n};\n","import { Directive, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { AXTranslationService } from './translation.service';\nimport { AXTranslateOptions } from './translation.types';\n\n@Directive({\n selector: '[translate]',\n})\nexport class AXTranslatorDirective implements OnInit {\n constructor(\n private templateRef: TemplateRef<any>,\n private viewContainer: ViewContainerRef,\n private translationService: AXTranslationService,\n ) {}\n\n ngOnInit() {\n this.viewContainer.clear();\n this.viewContainer.createEmbeddedView(this.templateRef, {\n $implicit: (key: string, options?: AXTranslateOptions) => {\n return this.translationService.translate(key, options);\n },\n });\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Observable, of } from 'rxjs';\nimport { AXTranslationService } from './translation.service';\nimport { AXTranslateOptions } from './translation.types';\n\n@Pipe({ name: 'translate', pure: true }) // The pipe can now be pure\nexport class AXTranslatorPipe implements PipeTransform {\n constructor(private service: AXTranslationService) {}\n\n transform(key: string, options?: AXTranslateOptions): Observable<string> {\n if (!key) {\n return of(''); // Return an empty observable if the key is not provided\n }\n return this.service.translate(key, options);\n }\n}\n","import { APP_INITIALIZER, NgModule } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { AXTranslationConfig, AX_TRANSLATION_CONFIG } from './translation.config';\nimport { AXTranslationService } from './translation.service';\nimport { AXTranslatorDirective } from './translator.directive';\nimport { AXTranslatorPipe } from './translator.pipe';\n\nfunction initializeApp(translatorService: AXTranslationService, config: AXTranslationConfig) {\n return (): Observable<any> => {\n return translatorService.loadLanguagesAndScopes(\n config.preloadLangs ?? [config.defaultLang],\n config.preloadScopes ?? [config.defaultScope],\n );\n };\n}\n\n@NgModule({\n imports: [],\n exports: [AXTranslatorPipe, AXTranslatorDirective],\n declarations: [AXTranslatorPipe, AXTranslatorDirective],\n providers: [\n {\n provide: APP_INITIALIZER,\n useFactory: initializeApp,\n deps: [AXTranslationService, AX_TRANSLATION_CONFIG],\n multi: true,\n },\n ],\n})\nexport class AXTranslationModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["lodashSet","lodashGet","i1.AXTranslationService"],"mappings":";;;;;;MAYa,qBAAqB,GAAG,IAAI,cAAc,CAAsB,uBAAuB,EAAE;AACpG,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,MAAK;AACZ,QAAA,OAAO,0BAA0B;KAClC;AACF,CAAA;AAEY,MAAA,0BAA0B,GAAwB;AAC7D,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,YAAY,EAAE,QAAQ;AACtB,IAAA,gBAAgB,EAAE,OAAO;;AAKX,SAAA,iBAAiB,CAAC,MAAA,GAAqC,EAAE,EAAA;AACvE,IAAA,MAAM,MAAM,GAAG;AACb,QAAA,GAAG,0BAA0B;AAC7B,QAAA,GAAG,MAAM;KACV;AACD,IAAA,OAAO,MAAM;AACf;;MCpBa,0BAA0B,CAAA;AACrC,IAAA,cAAc,CAAC,OAAmC,EAAA;AAChD,QAAA,OAAO,EAAE,CAAC,EAAE,CAAC;;AAEhB;MAEY,qBAAqB,GAAG,IAAI,cAAc,CAAsB,uBAAuB,EAAE;AACpG,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,MAAK;QACZ,OAAO,IAAI,0BAA0B,EAAE;KACxC;AACF,CAAA;;ACID,IAAI,OAA6B;AAEjB,SAAA,aAAa,CAAC,GAAW,EAAE,OAA4B,EAAA;IACrE,OAAO,OAAO,CAAC,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC;AAC5C;MAGa,oBAAoB,CAAA;AAc/B;;AAEG;AACH,IAAA,WAAA,GAAA;AAhBQ,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACtC,QAAA,IAAA,CAAA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,gBAAgB,EAAE,qBAAqB,CAD5C,EAAA,OAAA,EAAA,CAAA,gBAAgB,EAAE,qBAAqB,CAAA,EAAA,CAAA,CAAA;AAWtC,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,EATnB,SAAA,EAAA;AACT,YAAA;AACE,gBAAA,OAAO,EAAE,eAAe;AACxB,gBAAA,UAAU,EAAE,aAAa;AACzB,gBAAA,IAAI,EAAE,CAAC,oBAAoB,EAAE,qBAAqB,CAAC;AACnD,gBAAA,KAAK,EAAE,IAAI;AACZ,aAAA;AACF,SAAA,EAAA,CAAA,CAAA;;2FAEU,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAb/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,OAAO,EAAE,CAAC,gBAAgB,EAAE,qBAAqB,CAAC;AAClD,oBAAA,YAAY,EAAE,CAAC,gBAAgB,EAAE,qBAAqB,CAAC;AACvD,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,eAAe;AACxB,4BAAA,UAAU,EAAE,aAAa;AACzB,4BAAA,IAAI,EAAE,CAAC,oBAAoB,EAAE,qBAAqB,CAAC;AACnD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA;AACF,iBAAA;;;AC5BD;;AAEG;;;;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { BehaviorSubject, Subject } from 'rxjs';
|
2
2
|
import * as i0 from "@angular/core";
|
3
|
-
export type AXThemeMode = 'light' | 'dark' | 'system';
|
3
|
+
export type AXThemeMode = 'light' | 'dark' | 'system' | 'system-dark' | 'system-light';
|
4
4
|
export type AXPlatforms = 'Android' | 'Desktop' | 'iOS' | 'Mobile';
|
5
5
|
export type AXBrowsers = 'Chrome' | 'Safari' | 'Edge' | 'Firefox' | 'Opera' | 'MSIE';
|
6
6
|
export type AXTechnologies = 'PWA' | 'Hybrid' | 'Electron';
|
@@ -14,6 +14,7 @@ export declare class AXPlatformEvent<T extends Event = Event> {
|
|
14
14
|
data?: any;
|
15
15
|
}
|
16
16
|
export declare class AXPlatform {
|
17
|
+
#private;
|
17
18
|
resize: Subject<AXPlatformEvent>;
|
18
19
|
directionChange: Subject<AXPlatformEvent>;
|
19
20
|
click: Subject<AXPlatformEvent>;
|