@clickview/player 0.0.16 → 0.0.17-dev.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/libs/analytics/src/clients/CollectionApiClient.d.ts +2 -0
- package/dist/libs/common/src/backbone/services/LanguageService.d.ts +10 -0
- package/dist/libs/common/src/react/utils/TextHelper.d.ts +18 -0
- package/dist/libs/shared/src/hooks/UseLazyLoad.d.ts +6 -0
- package/dist/libs/shared/src/interfaces/DateRange.d.ts +2 -0
- package/dist/player-app.js +2 -2
- package/dist/projects/player/src/plugins/points-of-interest-plugin/points-of-interest-plugin.d.ts +1 -0
- package/package.json +3 -3
|
@@ -13,6 +13,7 @@ interface CollectionApiClientOptions {
|
|
|
13
13
|
getUser: () => Promise<AnalyticsUser>;
|
|
14
14
|
shouldLog?: (event: IncomingEvent) => boolean;
|
|
15
15
|
formatData?: (event: IncomingEvent) => HashObject | HashObject[];
|
|
16
|
+
logError?: (error: Error) => void;
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
18
19
|
* A client for logging to CollectionApi.
|
|
@@ -41,5 +42,6 @@ export declare class CollectionApiClient {
|
|
|
41
42
|
private getEventMetadata;
|
|
42
43
|
private getRegionByName;
|
|
43
44
|
private normalizeYearGroup;
|
|
45
|
+
private logError;
|
|
44
46
|
}
|
|
45
47
|
export {};
|
|
@@ -15,6 +15,16 @@ declare class StaticLanguageService extends BaseService {
|
|
|
15
15
|
static get Instance(): StaticLanguageService;
|
|
16
16
|
get name(): string;
|
|
17
17
|
setConfig(config: LanguageConfig): void;
|
|
18
|
+
/**
|
|
19
|
+
* This function will escape any HTML in the values of `options` before interpolating the phrase.
|
|
20
|
+
* Any HTML from a .lang.json file will not be escaped.
|
|
21
|
+
*
|
|
22
|
+
* The reason that we escape `options` is that this is dynamic data that could come from user-input.
|
|
23
|
+
*
|
|
24
|
+
* If the output of this function is passed into `dangerouslySetInnerHTML` (e.g. in <Text /> or when using alerts),
|
|
25
|
+
* it should be passed through TextHelper.sanitize as an extra safeguard against XSS.
|
|
26
|
+
* TextHelper.sanitize will preserve any safe HTML, allowing custom HTML to be set in .lang.json files.
|
|
27
|
+
*/
|
|
18
28
|
getPhrase(namespace: string, phraseKey: string, options?: LanguageInterpolationOptions): string;
|
|
19
29
|
encloseNamespace(namespace: string): (phraseKey: string, options?: LanguageInterpolationOptions) => string;
|
|
20
30
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ObjectHash } from 'backbone';
|
|
2
|
+
export declare const TextHelper: {
|
|
3
|
+
escapeExpression(text: string): string;
|
|
4
|
+
escapeRegExp(str: string): string;
|
|
5
|
+
slugify(str: string): string;
|
|
6
|
+
linkifyText(text: string, options?: ObjectHash): string;
|
|
7
|
+
isEqual(str1: string | number, str2: string | number): boolean;
|
|
8
|
+
toTitleCase(str: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* DOMPurify.sanitize encodes '&' characters.
|
|
11
|
+
* At the moment, this appears to be the intended behaviour:
|
|
12
|
+
* https://github.com/cure53/DOMPurify/issues/379
|
|
13
|
+
*
|
|
14
|
+
* Note: DOMPurify.sanitize does not escape HTML. It will remove
|
|
15
|
+
* any XSS threats, leaving safe HTML.
|
|
16
|
+
*/
|
|
17
|
+
sanitize(text: string): string;
|
|
18
|
+
};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
interface LazyUtils {
|
|
2
2
|
ref: (node?: Element) => void | null;
|
|
3
3
|
inView: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Use this if you want to hide something on start
|
|
6
|
+
* and then show it as something else leaves the window
|
|
7
|
+
* e.g. The student feed floating jump to button
|
|
8
|
+
*/
|
|
9
|
+
initialized: boolean;
|
|
4
10
|
}
|
|
5
11
|
interface UseLazyLoadOptions {
|
|
6
12
|
prevent?: boolean;
|