@translifycc/angular 0.1.0 → 0.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@translifycc/angular",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Angular language selector component for Translify",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -8,6 +8,11 @@
8
8
  "@angular/common": ">=15.0.0",
9
9
  "@angular/core": ">=15.0.0"
10
10
  },
11
- "keywords": ["translify", "i18n", "translation", "angular"],
11
+ "keywords": [
12
+ "translify",
13
+ "i18n",
14
+ "translation",
15
+ "angular"
16
+ ],
12
17
  "license": "MIT"
13
18
  }
@@ -151,8 +151,17 @@ export class TranslifySelectorComponent implements OnInit, OnDestroy {
151
151
  @Input() apiKey!: string;
152
152
  @Input() apiBase = 'https://translify.cc';
153
153
  @Input() domain = window.location.hostname || 'localhost';
154
- @Input() classNames: Record<string, string> = {};
155
- @Input() labels: Record<string, string> = {};
154
+ @Input() classNames: {
155
+ trigger?: string; dropdown?: string; dropdownHeader?: string;
156
+ option?: string; optionActive?: string; optionNative?: string;
157
+ optionName?: string; optionRtl?: string; restore?: string;
158
+ overlay?: string; overlaySpinner?: string; overlayTitle?: string;
159
+ overlaySub?: string; toast?: string;
160
+ } = {};
161
+ @Input() labels: {
162
+ trigger?: string; dropdownHeader?: string; restore?: string;
163
+ overlayTitle?: string; overlaySub?: string;
164
+ } = {};
156
165
 
157
166
  languages: Language[] = [];
158
167
  activeLang: string | null = getSavedLang();
@@ -352,9 +361,10 @@ export class TranslifySelectorComponent implements OnInit, OnDestroy {
352
361
 
353
362
  private patchHistory() {
354
363
  const orig = history.pushState.bind(history);
355
- history.pushState = (...args: any[]) => {
356
- orig(...args);
357
- this.onRouteChange();
364
+ const self = this;
365
+ history.pushState = function(state: unknown, unused: string, url?: string | URL | null) {
366
+ orig(state, unused, url);
367
+ self.onRouteChange();
358
368
  };
359
369
  window.addEventListener('popstate', () => this.onRouteChange());
360
370
  }