@tolgee/core 4.9.2 → 4.9.3-rc.d287ae9.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/dist/tolgee.cjs.js +1127 -7028
- package/dist/tolgee.cjs.js.map +1 -1
- package/dist/tolgee.cjs.min.js +1 -1
- package/dist/tolgee.cjs.min.js.map +1 -1
- package/dist/tolgee.esm.min.mjs +1 -1
- package/dist/tolgee.esm.min.mjs.map +1 -1
- package/dist/tolgee.esm.mjs +1125 -7023
- package/dist/tolgee.esm.mjs.map +1 -1
- package/dist/tolgee.umd.js +1127 -7028
- package/dist/tolgee.umd.js.map +1 -1
- package/dist/tolgee.umd.min.js +1 -1
- package/dist/tolgee.umd.min.js.map +1 -1
- package/lib/Controller/Cache/Cache.d.ts +22 -0
- package/lib/Controller/Cache/helpers.d.ts +4 -0
- package/lib/Controller/Controller.d.ts +146 -0
- package/lib/Controller/Events/EventEmitter.d.ts +6 -0
- package/lib/Controller/Events/EventEmitterSelective.d.ts +15 -0
- package/lib/Controller/Events/Events.d.ts +50 -0
- package/lib/Controller/Plugins/Plugins.d.ts +36 -0
- package/lib/Controller/State/State.d.ts +39 -0
- package/lib/Controller/State/helpers.d.ts +6 -0
- package/lib/Controller/State/initObserverOptions.d.ts +13 -0
- package/lib/Controller/State/initState.d.ts +47 -0
- package/lib/Controller/ValueObserver.d.ts +5 -0
- package/lib/Tolgee.d.ts +2 -68
- package/lib/TranslateParams.d.ts +2 -0
- package/lib/{Constants/Global.d.ts → constants.d.ts} +1 -2
- package/lib/helpers.d.ts +3 -0
- package/lib/index.d.ts +3 -8
- package/lib/types.d.ts +244 -84
- package/package.json +20 -29
- package/src/Controller/Cache/Cache.ts +293 -0
- package/src/Controller/Cache/helpers.ts +37 -0
- package/src/Controller/Controller.ts +310 -0
- package/src/Controller/Events/EventEmitter.ts +27 -0
- package/src/Controller/Events/EventEmitterSelective.test.ts +125 -0
- package/src/Controller/Events/EventEmitterSelective.ts +179 -0
- package/src/Controller/Events/Events.ts +66 -0
- package/src/Controller/Plugins/Plugins.ts +315 -0
- package/src/Controller/State/State.ts +175 -0
- package/src/Controller/State/helpers.ts +41 -0
- package/src/Controller/State/initObserverOptions.ts +38 -0
- package/src/Controller/State/initState.ts +81 -0
- package/src/Controller/ValueObserver.ts +23 -0
- package/src/Tolgee.ts +79 -330
- package/src/TranslateParams.test.ts +41 -0
- package/src/TranslateParams.ts +51 -0
- package/src/__test/backend.test.ts +48 -0
- package/src/__test/cache.test.ts +148 -0
- package/src/__test/client.test.ts +48 -0
- package/src/__test/events.test.ts +33 -0
- package/src/__test/initialization.test.ts +85 -0
- package/src/__test/jest-setup.ts +2 -0
- package/src/__test/languageDetection.test.ts +129 -0
- package/src/__test/languageStorage.test.ts +145 -0
- package/src/__test/languages.test.ts +112 -0
- package/src/__test/loading.test.ts +39 -0
- package/src/__test/namespaces.test.ts +99 -0
- package/src/__test/namespacesFallback.test.ts +74 -0
- package/src/__test/plugins.test.ts +136 -0
- package/src/__test/testTools.ts +7 -0
- package/src/{Constants/Global.ts → constants.ts} +1 -3
- package/src/helpers.ts +17 -0
- package/src/index.ts +9 -8
- package/src/types.ts +338 -90
- package/README.md +0 -45
- package/dist/Constants/Global.d.ts +0 -6
- package/dist/Constants/ModifierKey.d.ts +0 -6
- package/dist/Errors/ApiHttpError.d.ts +0 -5
- package/dist/Observer.d.ts +0 -14
- package/dist/Observer.test.d.ts +0 -2
- package/dist/Properties.d.ts +0 -17
- package/dist/Properties.test.d.ts +0 -1
- package/dist/Tolgee.d.ts +0 -68
- package/dist/Tolgee.test.d.ts +0 -1
- package/dist/TolgeeConfig.d.ts +0 -69
- package/dist/TolgeeConfig.test.d.ts +0 -1
- package/dist/__integration/FormatterIcu.test.d.ts +0 -1
- package/dist/__integration/FormatterMissing.d.ts +0 -1
- package/dist/__integration/Tolgee.test.d.ts +0 -1
- package/dist/__integration/TolgeeInvisible.test.d.ts +0 -1
- package/dist/__integration/mockTranslations.d.ts +0 -7
- package/dist/__integration/testConfig.d.ts +0 -9
- package/dist/__testFixtures/classMock.d.ts +0 -3
- package/dist/__testFixtures/createElement.d.ts +0 -2
- package/dist/__testFixtures/createTestDom.d.ts +0 -9
- package/dist/__testFixtures/mocked.d.ts +0 -20
- package/dist/__testFixtures/setupAfterEnv.d.ts +0 -8
- package/dist/helpers/NodeHelper.d.ts +0 -14
- package/dist/helpers/TextHelper.d.ts +0 -5
- package/dist/helpers/TextHelper.test.d.ts +0 -1
- package/dist/helpers/commonTypes.d.ts +0 -2
- package/dist/helpers/encoderPolyfill.d.ts +0 -8
- package/dist/helpers/secret.d.ts +0 -6
- package/dist/helpers/secret.test.d.ts +0 -1
- package/dist/helpers/sleep.d.ts +0 -1
- package/dist/highlighter/HighlightFunctionsInitializer.d.ts +0 -10
- package/dist/highlighter/HighlightFunctionsInitializer.test.d.ts +0 -1
- package/dist/highlighter/MouseEventHandler.d.ts +0 -29
- package/dist/highlighter/MouseEventHandler.test.d.ts +0 -1
- package/dist/highlighter/TranslationHighlighter.d.ts +0 -14
- package/dist/highlighter/TranslationHighlighter.test.d.ts +0 -1
- package/dist/index.d.ts +0 -10
- package/dist/internal.d.ts +0 -2
- package/dist/modules/IcuFormatter.d.ts +0 -2
- package/dist/modules/IcuFormatter.test.d.ts +0 -1
- package/dist/modules/index.d.ts +0 -1
- package/dist/services/ApiHttpService.d.ts +0 -15
- package/dist/services/CoreService.d.ts +0 -18
- package/dist/services/CoreService.test.d.ts +0 -1
- package/dist/services/DependencyService.d.ts +0 -39
- package/dist/services/DependencyService.test.d.ts +0 -1
- package/dist/services/ElementRegistrar.d.ts +0 -19
- package/dist/services/ElementRegistrar.test.d.ts +0 -1
- package/dist/services/EventEmitter.d.ts +0 -13
- package/dist/services/EventService.d.ts +0 -9
- package/dist/services/ModuleService.d.ts +0 -5
- package/dist/services/ScreenshotService.d.ts +0 -15
- package/dist/services/Subscription.d.ts +0 -5
- package/dist/services/TextService.d.ts +0 -14
- package/dist/services/TextService.test.d.ts +0 -1
- package/dist/services/TranslationService.d.ts +0 -75
- package/dist/services/TranslationService.test.d.ts +0 -1
- package/dist/services/__mocks__/CoreService.d.ts +0 -2
- package/dist/toolsManager/Messages.d.ts +0 -8
- package/dist/toolsManager/Messages.test.d.ts +0 -1
- package/dist/toolsManager/PluginManager.d.ts +0 -21
- package/dist/toolsManager/PluginManager.test.d.ts +0 -1
- package/dist/types/DTOs.d.ts +0 -20
- package/dist/types/apiSchema.generated.d.ts +0 -6185
- package/dist/types.d.ts +0 -123
- package/dist/wrappers/AbstractWrapper.d.ts +0 -8
- package/dist/wrappers/NodeHandler.d.ts +0 -18
- package/dist/wrappers/WrappedHandler.d.ts +0 -8
- package/dist/wrappers/invisible/AttributeHandler.d.ts +0 -8
- package/dist/wrappers/invisible/Coder.d.ts +0 -7
- package/dist/wrappers/invisible/ContentHandler.d.ts +0 -6
- package/dist/wrappers/invisible/CoreHandler.d.ts +0 -10
- package/dist/wrappers/invisible/InvisibleWrapper.d.ts +0 -18
- package/dist/wrappers/invisible/ValueMemory.d.ts +0 -5
- package/dist/wrappers/invisible/ValueMemory.test.d.ts +0 -1
- package/dist/wrappers/text/AttributeHandler.d.ts +0 -8
- package/dist/wrappers/text/AttributeHandler.test.d.ts +0 -1
- package/dist/wrappers/text/Coder.d.ts +0 -15
- package/dist/wrappers/text/Coder.test.d.ts +0 -1
- package/dist/wrappers/text/ContentHandler.d.ts +0 -8
- package/dist/wrappers/text/ContentHandler.test.d.ts +0 -1
- package/dist/wrappers/text/CoreHandler.d.ts +0 -17
- package/dist/wrappers/text/CoreHandler.test.d.ts +0 -1
- package/dist/wrappers/text/TextWrapper.d.ts +0 -20
- package/index.js +0 -7
- package/lib/Constants/ModifierKey.d.ts +0 -6
- package/lib/Errors/ApiHttpError.d.ts +0 -5
- package/lib/Observer.d.ts +0 -14
- package/lib/Properties.d.ts +0 -17
- package/lib/TolgeeConfig.d.ts +0 -69
- package/lib/helpers/NodeHelper.d.ts +0 -14
- package/lib/helpers/TextHelper.d.ts +0 -5
- package/lib/helpers/commonTypes.d.ts +0 -2
- package/lib/helpers/encoderPolyfill.d.ts +0 -8
- package/lib/helpers/secret.d.ts +0 -6
- package/lib/helpers/sleep.d.ts +0 -1
- package/lib/highlighter/HighlightFunctionsInitializer.d.ts +0 -10
- package/lib/highlighter/MouseEventHandler.d.ts +0 -29
- package/lib/highlighter/TranslationHighlighter.d.ts +0 -14
- package/lib/modules/IcuFormatter.d.ts +0 -2
- package/lib/modules/index.d.ts +0 -1
- package/lib/services/ApiHttpService.d.ts +0 -15
- package/lib/services/CoreService.d.ts +0 -18
- package/lib/services/DependencyService.d.ts +0 -39
- package/lib/services/ElementRegistrar.d.ts +0 -19
- package/lib/services/EventEmitter.d.ts +0 -13
- package/lib/services/EventService.d.ts +0 -9
- package/lib/services/ModuleService.d.ts +0 -5
- package/lib/services/ScreenshotService.d.ts +0 -15
- package/lib/services/Subscription.d.ts +0 -5
- package/lib/services/TextService.d.ts +0 -14
- package/lib/services/TranslationService.d.ts +0 -75
- package/lib/toolsManager/Messages.d.ts +0 -8
- package/lib/toolsManager/PluginManager.d.ts +0 -21
- package/lib/types/DTOs.d.ts +0 -20
- package/lib/types/apiSchema.generated.d.ts +0 -6185
- package/lib/wrappers/AbstractWrapper.d.ts +0 -8
- package/lib/wrappers/NodeHandler.d.ts +0 -18
- package/lib/wrappers/WrappedHandler.d.ts +0 -8
- package/lib/wrappers/invisible/AttributeHandler.d.ts +0 -8
- package/lib/wrappers/invisible/Coder.d.ts +0 -7
- package/lib/wrappers/invisible/ContentHandler.d.ts +0 -6
- package/lib/wrappers/invisible/CoreHandler.d.ts +0 -10
- package/lib/wrappers/invisible/InvisibleWrapper.d.ts +0 -18
- package/lib/wrappers/invisible/ValueMemory.d.ts +0 -5
- package/lib/wrappers/text/AttributeHandler.d.ts +0 -8
- package/lib/wrappers/text/Coder.d.ts +0 -15
- package/lib/wrappers/text/ContentHandler.d.ts +0 -8
- package/lib/wrappers/text/CoreHandler.d.ts +0 -17
- package/lib/wrappers/text/TextWrapper.d.ts +0 -20
- package/src/Constants/ModifierKey.ts +0 -6
- package/src/Errors/ApiHttpError.ts +0 -8
- package/src/Observer.test.ts +0 -119
- package/src/Observer.ts +0 -68
- package/src/Properties.test.ts +0 -150
- package/src/Properties.ts +0 -112
- package/src/Tolgee.test.ts +0 -473
- package/src/TolgeeConfig.test.ts +0 -21
- package/src/TolgeeConfig.ts +0 -134
- package/src/__integration/FormatterIcu.test.ts +0 -80
- package/src/__integration/FormatterMissing.ts +0 -54
- package/src/__integration/Tolgee.test.ts +0 -90
- package/src/__integration/TolgeeInvisible.test.ts +0 -145
- package/src/__integration/mockTranslations.ts +0 -6
- package/src/__integration/testConfig.ts +0 -16
- package/src/__testFixtures/classMock.ts +0 -11
- package/src/__testFixtures/createElement.ts +0 -43
- package/src/__testFixtures/createTestDom.ts +0 -26
- package/src/__testFixtures/mocked.ts +0 -25
- package/src/__testFixtures/setupAfterEnv.ts +0 -34
- package/src/helpers/NodeHelper.ts +0 -90
- package/src/helpers/TextHelper.test.ts +0 -62
- package/src/helpers/TextHelper.ts +0 -58
- package/src/helpers/commonTypes.ts +0 -8
- package/src/helpers/encoderPolyfill.ts +0 -96
- package/src/helpers/secret.test.ts +0 -61
- package/src/helpers/secret.ts +0 -68
- package/src/helpers/sleep.ts +0 -2
- package/src/highlighter/HighlightFunctionsInitializer.test.ts +0 -40
- package/src/highlighter/HighlightFunctionsInitializer.ts +0 -61
- package/src/highlighter/MouseEventHandler.test.ts +0 -151
- package/src/highlighter/MouseEventHandler.ts +0 -191
- package/src/highlighter/TranslationHighlighter.test.ts +0 -177
- package/src/highlighter/TranslationHighlighter.ts +0 -113
- package/src/internal.ts +0 -2
- package/src/modules/IcuFormatter.test.ts +0 -21
- package/src/modules/IcuFormatter.ts +0 -39
- package/src/modules/index.ts +0 -1
- package/src/services/ApiHttpService.ts +0 -85
- package/src/services/CoreService.test.ts +0 -141
- package/src/services/CoreService.ts +0 -76
- package/src/services/DependencyService.test.ts +0 -51
- package/src/services/DependencyService.ts +0 -116
- package/src/services/ElementRegistrar.test.ts +0 -131
- package/src/services/ElementRegistrar.ts +0 -108
- package/src/services/EventEmitter.ts +0 -52
- package/src/services/EventService.ts +0 -14
- package/src/services/ModuleService.ts +0 -14
- package/src/services/ScreenshotService.ts +0 -31
- package/src/services/Subscription.ts +0 -7
- package/src/services/TextService.test.ts +0 -88
- package/src/services/TextService.ts +0 -82
- package/src/services/TranslationService.test.ts +0 -358
- package/src/services/TranslationService.ts +0 -417
- package/src/services/__mocks__/CoreService.ts +0 -17
- package/src/toolsManager/Messages.test.ts +0 -79
- package/src/toolsManager/Messages.ts +0 -60
- package/src/toolsManager/PluginManager.test.ts +0 -108
- package/src/toolsManager/PluginManager.ts +0 -129
- package/src/types/DTOs.ts +0 -25
- package/src/types/apiSchema.generated.ts +0 -6208
- package/src/wrappers/AbstractWrapper.ts +0 -14
- package/src/wrappers/NodeHandler.ts +0 -143
- package/src/wrappers/WrappedHandler.ts +0 -28
- package/src/wrappers/invisible/AttributeHandler.ts +0 -23
- package/src/wrappers/invisible/Coder.ts +0 -65
- package/src/wrappers/invisible/ContentHandler.ts +0 -15
- package/src/wrappers/invisible/CoreHandler.ts +0 -17
- package/src/wrappers/invisible/InvisibleWrapper.ts +0 -59
- package/src/wrappers/invisible/ValueMemory.test.ts +0 -25
- package/src/wrappers/invisible/ValueMemory.ts +0 -16
- package/src/wrappers/text/AttributeHandler.test.ts +0 -118
- package/src/wrappers/text/AttributeHandler.ts +0 -25
- package/src/wrappers/text/Coder.test.ts +0 -298
- package/src/wrappers/text/Coder.ts +0 -202
- package/src/wrappers/text/ContentHandler.test.ts +0 -185
- package/src/wrappers/text/ContentHandler.ts +0 -21
- package/src/wrappers/text/CoreHandler.test.ts +0 -106
- package/src/wrappers/text/CoreHandler.ts +0 -45
- package/src/wrappers/text/TextWrapper.ts +0 -69
package/dist/TolgeeConfig.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { TreeTranslationsData } from './types';
|
|
3
|
-
import { ModifierKey } from './Constants/ModifierKey';
|
|
4
|
-
import { Mode } from 'fs';
|
|
5
|
-
declare type UiConstructor = new (...args: any[]) => any;
|
|
6
|
-
interface UiLibInterface {
|
|
7
|
-
UI: UiConstructor;
|
|
8
|
-
}
|
|
9
|
-
declare type UiType = UiConstructor | UiLibInterface | Promise<UiConstructor> | Promise<UiLibInterface>;
|
|
10
|
-
export declare class TolgeeConfig {
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated This option won't have any effect,
|
|
13
|
-
* because mode is now automatically detected when apiKey + apiUrl are set
|
|
14
|
-
*/
|
|
15
|
-
mode?: Mode;
|
|
16
|
-
apiUrl?: string;
|
|
17
|
-
apiKey?: string;
|
|
18
|
-
inputPrefix?: string;
|
|
19
|
-
inputSuffix?: string;
|
|
20
|
-
/**
|
|
21
|
-
* Overrides all language settings
|
|
22
|
-
*/
|
|
23
|
-
forceLanguage?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Used when auto detection is not available or is turned off
|
|
26
|
-
*/
|
|
27
|
-
defaultLanguage?: string;
|
|
28
|
-
/**
|
|
29
|
-
* Languages which can be used for language detection
|
|
30
|
-
* and also limits which values can be stored
|
|
31
|
-
*/
|
|
32
|
-
availableLanguages?: string[];
|
|
33
|
-
/**
|
|
34
|
-
* Language which is used when no translation is available for current one
|
|
35
|
-
*/
|
|
36
|
-
fallbackLanguage?: string;
|
|
37
|
-
/**
|
|
38
|
-
* Store user language in localStorage (default: true)
|
|
39
|
-
*/
|
|
40
|
-
enableLanguageStore?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Use auto language detection by browser locale (default: true)
|
|
43
|
-
*/
|
|
44
|
-
enableLanguageDetection?: boolean;
|
|
45
|
-
filesUrlPrefix?: string;
|
|
46
|
-
watch?: boolean;
|
|
47
|
-
ui?: UiType;
|
|
48
|
-
targetElement?: Element;
|
|
49
|
-
tagAttributes?: {
|
|
50
|
-
[key: string]: string[];
|
|
51
|
-
};
|
|
52
|
-
highlightKeys?: ModifierKey[];
|
|
53
|
-
passToParent?: (keyof HTMLElementTagNameMap)[] | ((node: Element) => boolean);
|
|
54
|
-
restrictedElements?: string[];
|
|
55
|
-
highlightColor?: string;
|
|
56
|
-
highlightWidth?: number;
|
|
57
|
-
/** localization data to use in production mode */
|
|
58
|
-
staticData?: {
|
|
59
|
-
[key: string]: TreeTranslationsData | (() => Promise<TreeTranslationsData>);
|
|
60
|
-
};
|
|
61
|
-
wrapperMode?: 'text' | 'invisible';
|
|
62
|
-
/**
|
|
63
|
-
* When true, fallback language will be preloaded on Tolgee.run
|
|
64
|
-
*/
|
|
65
|
-
preloadFallback?: boolean;
|
|
66
|
-
private _targetElement?;
|
|
67
|
-
constructor(config?: TolgeeConfig);
|
|
68
|
-
}
|
|
69
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom/extend-expect';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom/extend-expect';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom/extend-expect';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom/extend-expect';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { TolgeeConfig } from '../TolgeeConfig';
|
|
2
|
-
import { Properties } from '../Properties';
|
|
3
|
-
import { CoreService } from '../services/CoreService';
|
|
4
|
-
import { Observer } from '../Observer';
|
|
5
|
-
import { TranslationService } from '../services/TranslationService';
|
|
6
|
-
import { TextService } from '../services/TextService';
|
|
7
|
-
import { EventService } from '../services/EventService';
|
|
8
|
-
import { EventEmitterImpl } from '../services/EventEmitter';
|
|
9
|
-
import { ContentHandler } from '../wrappers/text/ContentHandler';
|
|
10
|
-
export declare const configMock: import("jest-mock").MockedObject<typeof TolgeeConfig>;
|
|
11
|
-
export declare const propertiesMock: import("jest-mock").MockedObject<typeof Properties>;
|
|
12
|
-
export declare const coreServiceMock: import("jest-mock").MockedObject<typeof CoreService>;
|
|
13
|
-
export declare const observerMock: import("jest-mock").MockedObject<typeof Observer>;
|
|
14
|
-
export declare const translationServiceMock: import("jest-mock").MockedObject<typeof TranslationService>;
|
|
15
|
-
export declare const textServiceMock: import("jest-mock").MockedObject<typeof TextService>;
|
|
16
|
-
export declare const eventServiceMock: import("jest-mock").MockedObject<typeof EventService>;
|
|
17
|
-
export declare const eventEmitterMock: import("jest-mock").MockedObject<typeof EventEmitterImpl>;
|
|
18
|
-
export declare const tolgeeConfigMock: import("jest-mock").MockedObject<typeof TolgeeConfig>;
|
|
19
|
-
export declare const textHandlerMock: import("jest-mock").MockedObject<typeof ContentHandler>;
|
|
20
|
-
export declare const getMockedInstance: <T>(constructor: new (...args: any[]) => T) => T;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ArgumentTypes } from './commonTypes';
|
|
2
|
-
export declare class NodeHelper {
|
|
3
|
-
static evaluate<T extends Node>(...args: ArgumentTypes<typeof NodeHelper.evaluateGenerator>): T[];
|
|
4
|
-
static evaluateToSingle<T extends Node>(...args: ArgumentTypes<typeof NodeHelper.evaluateGenerator>): T;
|
|
5
|
-
static closestElement(node: Element | Text): Element;
|
|
6
|
-
static getParentElement(node: Node): Element | undefined;
|
|
7
|
-
static isElementTargetElement(element: Element): boolean;
|
|
8
|
-
static markElementAsTargetElement(element: Element): void;
|
|
9
|
-
static unmarkElementAsTargetElement(element: Element): void;
|
|
10
|
-
static nodeContains(descendant: Node, node: Node): boolean;
|
|
11
|
-
private static evaluateGenerator;
|
|
12
|
-
static getNodeText(node: Node): string;
|
|
13
|
-
static setNodeText(node: Node, text: string): void;
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/helpers/secret.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const INVISIBLE_CHARACTERS: string[];
|
|
2
|
-
export declare const INVISIBLE_REGEX: RegExp;
|
|
3
|
-
export declare const encodeMessage: (text: string) => string;
|
|
4
|
-
export declare const decodeFromText: (text: string) => string[];
|
|
5
|
-
export declare const removeSecrets: (text: string) => string;
|
|
6
|
-
export declare const stringToCodePoints: (text: string) => number[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/helpers/sleep.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const sleep: (ms: number) => Promise<unknown>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Properties } from '../Properties';
|
|
2
|
-
import { ElementWithMeta } from '../types';
|
|
3
|
-
export declare class HighlightFunctionsInitializer {
|
|
4
|
-
private properties;
|
|
5
|
-
constructor(properties: Properties);
|
|
6
|
-
initFunctions(element: ElementWithMeta): void;
|
|
7
|
-
borderElement: HTMLDivElement | null;
|
|
8
|
-
private initHighlightFunction;
|
|
9
|
-
private initUnhighlightFunction;
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { DependencyService } from '../services/DependencyService';
|
|
2
|
-
export declare class MouseEventHandler {
|
|
3
|
-
private dependencies;
|
|
4
|
-
private keysDown;
|
|
5
|
-
private highlighted;
|
|
6
|
-
private mouseOnChanged;
|
|
7
|
-
private keysChanged;
|
|
8
|
-
private cursorPosition;
|
|
9
|
-
constructor(dependencies: DependencyService);
|
|
10
|
-
run(): void;
|
|
11
|
-
stop(): void;
|
|
12
|
-
private readonly highlight;
|
|
13
|
-
private readonly unhighlight;
|
|
14
|
-
private updateHighlight;
|
|
15
|
-
private updateCursorPosition;
|
|
16
|
-
private blockEvents;
|
|
17
|
-
private onMouseMove;
|
|
18
|
-
private onBlur;
|
|
19
|
-
private onKeyDown;
|
|
20
|
-
private onKeyUp;
|
|
21
|
-
private onScroll;
|
|
22
|
-
private onClick;
|
|
23
|
-
private initEventListeners;
|
|
24
|
-
private removeEventListeners;
|
|
25
|
-
private isInUiDialog;
|
|
26
|
-
private getClosestTolgeeElement;
|
|
27
|
-
private findAncestor;
|
|
28
|
-
private areKeysDown;
|
|
29
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ElementWithMeta } from '../types';
|
|
2
|
-
import { PluginManager } from '../toolsManager/PluginManager';
|
|
3
|
-
import { DependencyService } from '../services/DependencyService';
|
|
4
|
-
export declare class TranslationHighlighter {
|
|
5
|
-
private dependencies;
|
|
6
|
-
pluginManager: PluginManager;
|
|
7
|
-
private _renderer;
|
|
8
|
-
constructor(dependencies: DependencyService);
|
|
9
|
-
private static getKeyOptions;
|
|
10
|
-
listen(element: ElementWithMeta & ElementCSSInlineStyle): void;
|
|
11
|
-
private getRenderer;
|
|
12
|
-
private getKeyAndDefault;
|
|
13
|
-
translationEdit: (e: MouseEvent, element: ElementWithMeta) => Promise<void>;
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { Tolgee } from './Tolgee';
|
|
2
|
-
export { TolgeeConfig } from './TolgeeConfig';
|
|
3
|
-
export { ModifierKey } from './Constants/ModifierKey';
|
|
4
|
-
export { TOLGEE_WRAPPED_ONLY_DATA_ATTRIBUTE } from './Constants/Global';
|
|
5
|
-
export * from './modules';
|
|
6
|
-
export * from './types/DTOs';
|
|
7
|
-
export * from './types';
|
|
8
|
-
export * from './Constants/Global';
|
|
9
|
-
export * from './helpers/NodeHelper';
|
|
10
|
-
export * from './helpers/TextHelper';
|
package/dist/internal.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/modules/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { IcuFormatter } from './IcuFormatter';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Properties } from '../Properties';
|
|
2
|
-
import { ArgumentTypes } from '../helpers/commonTypes';
|
|
3
|
-
declare type FetchArgumentTypes = ArgumentTypes<typeof fetch>;
|
|
4
|
-
declare type Tail<T extends any[]> = ((...args: T) => any) extends (_: infer First, ...rest: infer Rest) => any ? T extends any[] ? Rest : ReadonlyArray<Rest[number]> : [];
|
|
5
|
-
export declare class ApiHttpService {
|
|
6
|
-
private properties;
|
|
7
|
-
constructor(properties: Properties);
|
|
8
|
-
private static handleErrors;
|
|
9
|
-
fetch(...args: ArgumentTypes<typeof fetch>): Promise<Response>;
|
|
10
|
-
fetchJson(...args: ArgumentTypes<typeof fetch>): Promise<any>;
|
|
11
|
-
post(url: any, body: any, init?: FetchArgumentTypes[1], ...rest: Tail<Tail<FetchArgumentTypes>>): Promise<Response>;
|
|
12
|
-
postJson(url: any, body: any, init?: FetchArgumentTypes[1], ...rest: Tail<Tail<FetchArgumentTypes>>): Promise<any>;
|
|
13
|
-
private getUrl;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Properties } from '../Properties';
|
|
2
|
-
import { ApiHttpService } from './ApiHttpService';
|
|
3
|
-
import { Scope } from '../types';
|
|
4
|
-
import { LanguageModel } from '../types/DTOs';
|
|
5
|
-
import { components } from '../types/apiSchema.generated';
|
|
6
|
-
export declare type ApiKeyWithLanguagesModel = components['schemas']['ApiKeyWithLanguagesModel'];
|
|
7
|
-
export declare class CoreService {
|
|
8
|
-
private properties;
|
|
9
|
-
private apiHttpService;
|
|
10
|
-
private languagePromise;
|
|
11
|
-
constructor(properties: Properties, apiHttpService: ApiHttpService);
|
|
12
|
-
getLanguages(): Promise<Set<string>>;
|
|
13
|
-
getLanguagesFull(): Promise<LanguageModel[]>;
|
|
14
|
-
getApiKeyDetails(): Promise<ApiKeyWithLanguagesModel>;
|
|
15
|
-
isAuthorizedTo(scope: Scope): boolean;
|
|
16
|
-
checkScope(scope: Scope): void;
|
|
17
|
-
loadApiKeyDetails(): Promise<void>;
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom/extend-expect';
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Properties } from '../Properties';
|
|
2
|
-
import { EventService } from './EventService';
|
|
3
|
-
import { ApiHttpService } from './ApiHttpService';
|
|
4
|
-
import { TranslationService } from './TranslationService';
|
|
5
|
-
import { TextService } from './TextService';
|
|
6
|
-
import { MouseEventHandler } from '../highlighter/MouseEventHandler';
|
|
7
|
-
import { TranslationHighlighter } from '../highlighter/TranslationHighlighter';
|
|
8
|
-
import { ElementRegistrar } from './ElementRegistrar';
|
|
9
|
-
import { Observer } from '../Observer';
|
|
10
|
-
import { CoreService } from './CoreService';
|
|
11
|
-
import { TolgeeConfig } from '../TolgeeConfig';
|
|
12
|
-
import { PluginManager } from '../toolsManager/PluginManager';
|
|
13
|
-
import { Messages } from '../toolsManager/Messages';
|
|
14
|
-
import { HighlightFunctionsInitializer } from '../highlighter/HighlightFunctionsInitializer';
|
|
15
|
-
import { ScreenshotService } from './ScreenshotService';
|
|
16
|
-
import { ModuleService } from './ModuleService';
|
|
17
|
-
import { AbstractWrapper } from '../wrappers/AbstractWrapper';
|
|
18
|
-
export declare class DependencyService {
|
|
19
|
-
properties: Properties;
|
|
20
|
-
eventService: EventService;
|
|
21
|
-
apiHttpService: ApiHttpService;
|
|
22
|
-
mouseEventHandler: MouseEventHandler;
|
|
23
|
-
moduleService: ModuleService;
|
|
24
|
-
coreService: CoreService;
|
|
25
|
-
screenshotService: ScreenshotService;
|
|
26
|
-
translationService: TranslationService;
|
|
27
|
-
textService: TextService;
|
|
28
|
-
highlightFunctionInitializer: HighlightFunctionsInitializer;
|
|
29
|
-
translationHighlighter: TranslationHighlighter;
|
|
30
|
-
elementRegistrar: ElementRegistrar;
|
|
31
|
-
messages: Messages;
|
|
32
|
-
pluginManager: PluginManager;
|
|
33
|
-
constructor();
|
|
34
|
-
wrapper: AbstractWrapper;
|
|
35
|
-
observer: Observer;
|
|
36
|
-
init(config: TolgeeConfig): void;
|
|
37
|
-
run: () => void;
|
|
38
|
-
stop: () => void;
|
|
39
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ElementWithMeta } from '../types';
|
|
2
|
-
import { Properties } from '../Properties';
|
|
3
|
-
import { TranslationHighlighter } from '../highlighter/TranslationHighlighter';
|
|
4
|
-
import { EventService } from './EventService';
|
|
5
|
-
export declare class ElementRegistrar {
|
|
6
|
-
private properties;
|
|
7
|
-
private translationHighlighter;
|
|
8
|
-
private eventService;
|
|
9
|
-
private registeredElements;
|
|
10
|
-
constructor(properties: Properties, translationHighlighter: TranslationHighlighter, eventService: EventService);
|
|
11
|
-
register(element: ElementWithMeta): void;
|
|
12
|
-
refreshAll(): void;
|
|
13
|
-
cleanAll(): void;
|
|
14
|
-
findAllByKey(key: string): ElementWithMeta[];
|
|
15
|
-
private cleanElementInactiveNodes;
|
|
16
|
-
private cleanElement;
|
|
17
|
-
private getActiveNodes;
|
|
18
|
-
private isElementActive;
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom/extend-expect';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Subscription } from './Subscription';
|
|
2
|
-
export declare type CallbackType<T> = (data: T) => Promise<void> | void;
|
|
3
|
-
export interface EventEmitter<T> {
|
|
4
|
-
subscribe(callback: CallbackType<T>): Subscription;
|
|
5
|
-
}
|
|
6
|
-
export declare class EventEmitterImpl<T> {
|
|
7
|
-
private idCounter;
|
|
8
|
-
private _subscriptions;
|
|
9
|
-
private get subscriptions();
|
|
10
|
-
emit(data?: T): Promise<void> | void;
|
|
11
|
-
subscribe(callback: CallbackType<T>): Subscription;
|
|
12
|
-
private unsubscribe;
|
|
13
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from './EventEmitter';
|
|
2
|
-
import { TranslationData } from '../types/DTOs';
|
|
3
|
-
import { ElementWithMeta } from '../types';
|
|
4
|
-
export declare class EventService {
|
|
5
|
-
readonly TRANSLATION_CHANGED: EventEmitter<TranslationData>;
|
|
6
|
-
readonly LANGUAGE_CHANGED: EventEmitter<string>;
|
|
7
|
-
readonly LANGUAGE_LOADED: EventEmitter<string>;
|
|
8
|
-
readonly ELEMENT_REGISTERED: EventEmitter<ElementWithMeta>;
|
|
9
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ApiHttpService } from './ApiHttpService';
|
|
2
|
-
import { CoreService } from './CoreService';
|
|
3
|
-
export declare class ScreenshotService {
|
|
4
|
-
private coreService;
|
|
5
|
-
private apiHttpService;
|
|
6
|
-
constructor(coreService: CoreService, apiHttpService: ApiHttpService);
|
|
7
|
-
uploadImage(blob: Blob): Promise<{
|
|
8
|
-
id: number;
|
|
9
|
-
filename: string;
|
|
10
|
-
fileUrl: string;
|
|
11
|
-
requestFilename: string;
|
|
12
|
-
createdAt: string;
|
|
13
|
-
}>;
|
|
14
|
-
deleteImages(ids: number[]): Promise<Response>;
|
|
15
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { TranslationTags, TranslationParamsTags } from '../types';
|
|
2
|
-
import { TranslationService } from './TranslationService';
|
|
3
|
-
import { Properties } from '../Properties';
|
|
4
|
-
import { ModuleService } from './ModuleService';
|
|
5
|
-
export declare class TextService {
|
|
6
|
-
private properties;
|
|
7
|
-
private translationService;
|
|
8
|
-
private moduleService;
|
|
9
|
-
constructor(properties: Properties, translationService: TranslationService, moduleService: ModuleService);
|
|
10
|
-
translate(key: string, params: TranslationParamsTags<any>, lang?: string, orEmpty?: boolean, defaultValue?: string): Promise<TranslationTags<any>>;
|
|
11
|
-
instant(key: string, params: TranslationParamsTags<any>, lang?: string, orEmpty?: boolean, defaultValue?: string): TranslationTags<any>;
|
|
12
|
-
private formatTranslation;
|
|
13
|
-
private readonly format;
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { Translations } from '../types';
|
|
2
|
-
import { Properties } from '../Properties';
|
|
3
|
-
import { CoreService } from './CoreService';
|
|
4
|
-
import { ApiHttpService } from './ApiHttpService';
|
|
5
|
-
import { EventService } from './EventService';
|
|
6
|
-
import { ComplexEditKeyDto, CreateKeyDto, KeyWithDataModel, SetTranslationsResponseModel, SetTranslationsWithKeyDto, TranslationData } from '../types/DTOs';
|
|
7
|
-
interface TranslationInterface {
|
|
8
|
-
text?: string;
|
|
9
|
-
}
|
|
10
|
-
interface Key {
|
|
11
|
-
id?: number;
|
|
12
|
-
name: string;
|
|
13
|
-
translations: Record<string, TranslationInterface>;
|
|
14
|
-
}
|
|
15
|
-
export declare class TranslationService {
|
|
16
|
-
private properties;
|
|
17
|
-
private coreService;
|
|
18
|
-
private apiHttpService;
|
|
19
|
-
private eventService;
|
|
20
|
-
private translationsCache;
|
|
21
|
-
private fetchPromises;
|
|
22
|
-
private fetchedDev;
|
|
23
|
-
constructor(properties: Properties, coreService: CoreService, apiHttpService: ApiHttpService, eventService: EventService);
|
|
24
|
-
private static translationByValue;
|
|
25
|
-
initStatic(): void;
|
|
26
|
-
getCachedTranslations(): Map<string, Translations>;
|
|
27
|
-
updateTranslationInCache: (data: Key) => Promise<void>;
|
|
28
|
-
loadTranslations(lang?: string): Promise<Translations>;
|
|
29
|
-
getTranslation(key: string, lang?: string, defaultValue?: string): Promise<string>;
|
|
30
|
-
updateKeyComplex(id: number, data: ComplexEditKeyDto): Promise<KeyWithDataModel>;
|
|
31
|
-
createKey(data: CreateKeyDto): Promise<KeyWithDataModel>;
|
|
32
|
-
setTranslations(translationData: SetTranslationsWithKeyDto): Promise<SetTranslationsResponseModel>;
|
|
33
|
-
/**
|
|
34
|
-
* Change translations of some keys to some value temporarily.
|
|
35
|
-
* For screenshot taking with provided values, before actually saving
|
|
36
|
-
* the values
|
|
37
|
-
*
|
|
38
|
-
* @return Returns callback changing affected translations back
|
|
39
|
-
*/
|
|
40
|
-
changeTranslations({ key, translations, }: TranslationData): Promise<() => void>;
|
|
41
|
-
getFromCacheOrFallback(key: string, lang?: string, defaultValue?: string): string;
|
|
42
|
-
getTranslationsOfKey: (key: string, languages?: Set<string>) => Promise<readonly [{
|
|
43
|
-
keyId: number;
|
|
44
|
-
keyName: string;
|
|
45
|
-
keyTags: {
|
|
46
|
-
id: number;
|
|
47
|
-
name: string;
|
|
48
|
-
}[];
|
|
49
|
-
screenshotCount: number;
|
|
50
|
-
screenshots?: {
|
|
51
|
-
id: number;
|
|
52
|
-
filename: string;
|
|
53
|
-
fileUrl: string;
|
|
54
|
-
createdAt?: string;
|
|
55
|
-
}[];
|
|
56
|
-
translations: {
|
|
57
|
-
[key: string]: {
|
|
58
|
-
id: number;
|
|
59
|
-
text?: string;
|
|
60
|
-
state: "UNTRANSLATED" | "MACHINE_TRANSLATED" | "TRANSLATED" | "REVIEWED" | "NEEDS_REVIEW";
|
|
61
|
-
commentCount: number;
|
|
62
|
-
unresolvedCommentCount: number;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
}, string[]]>;
|
|
66
|
-
private isFetchNeeded;
|
|
67
|
-
private isLoaded;
|
|
68
|
-
private fetchTranslations;
|
|
69
|
-
private fetchTranslationsProduction;
|
|
70
|
-
private fetchTranslationsDevelopment;
|
|
71
|
-
private setEmptyLanguageData;
|
|
72
|
-
private setLanguageData;
|
|
73
|
-
private getFromCache;
|
|
74
|
-
}
|
|
75
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare class Messages {
|
|
2
|
-
private listeners;
|
|
3
|
-
private _stopListening;
|
|
4
|
-
readonly startListening: () => void;
|
|
5
|
-
stopListening(): void;
|
|
6
|
-
readonly listen: (type: string, callback: (data: any) => void) => () => void;
|
|
7
|
-
readonly send: (type: string, data?: any) => void;
|
|
8
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Properties } from '../Properties';
|
|
2
|
-
import { Messages } from './Messages';
|
|
3
|
-
import { EventService } from '../services/EventService';
|
|
4
|
-
import { ElementRegistrar } from '../services/ElementRegistrar';
|
|
5
|
-
import { TranslationService } from '../services/TranslationService';
|
|
6
|
-
import { TranslationData } from '../types/DTOs';
|
|
7
|
-
export declare class PluginManager {
|
|
8
|
-
private messages;
|
|
9
|
-
private properties;
|
|
10
|
-
private eventService;
|
|
11
|
-
private elementRegistrar;
|
|
12
|
-
private translationService;
|
|
13
|
-
handshakeSucceed: boolean;
|
|
14
|
-
constructor(messages: Messages, properties: Properties, eventService: EventService, elementRegistrar: ElementRegistrar, translationService: TranslationService);
|
|
15
|
-
run(): void;
|
|
16
|
-
stop(): void;
|
|
17
|
-
readonly takeScreenshot: (translationData: TranslationData) => Promise<string>;
|
|
18
|
-
private highlightAllByKey;
|
|
19
|
-
private unhighlightAllByKey;
|
|
20
|
-
private readonly handshake;
|
|
21
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/types/DTOs.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { components } from './apiSchema.generated';
|
|
2
|
-
export declare class TranslationData {
|
|
3
|
-
key: string;
|
|
4
|
-
translations: {
|
|
5
|
-
[key: string]: string;
|
|
6
|
-
};
|
|
7
|
-
id?: number;
|
|
8
|
-
constructor(key: string, translations: {
|
|
9
|
-
[key: string]: string;
|
|
10
|
-
}, id?: number);
|
|
11
|
-
}
|
|
12
|
-
export declare type ComplexEditKeyDto = components['schemas']['ComplexEditKeyDto'];
|
|
13
|
-
export declare type KeyWithDataModel = components['schemas']['KeyWithDataModel'];
|
|
14
|
-
export declare type CreateKeyDto = components['schemas']['CreateKeyDto'];
|
|
15
|
-
export declare type SetTranslationsWithKeyDto = components['schemas']['SetTranslationsWithKeyDto'];
|
|
16
|
-
export declare type SetTranslationsResponseModel = components['schemas']['SetTranslationsResponseModel'];
|
|
17
|
-
export declare type KeyWithTranslationsModel = components['schemas']['KeyWithTranslationsModel'];
|
|
18
|
-
export declare type UploadedImageModel = components['schemas']['UploadedImageModel'];
|
|
19
|
-
export declare type PagedModelLanguageModel = components['schemas']['PagedModelLanguageModel'];
|
|
20
|
-
export declare type LanguageModel = components['schemas']['LanguageModel'];
|