lucid-extension-sdk 0.0.105 → 0.0.107
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/interop.d.ts +26 -0
- package/package.json +1 -1
- package/sdk/commandtypes.d.ts +9 -3
- package/sdk/ui/modal.d.ts +26 -4
- package/sdk/ui/modal.js +3 -0
package/interop.d.ts
CHANGED
|
@@ -33,3 +33,29 @@ interface Console {
|
|
|
33
33
|
trace(...data: any[]): void;
|
|
34
34
|
warn(...data: any[]): void;
|
|
35
35
|
}
|
|
36
|
+
|
|
37
|
+
declare class I18nSafeString {
|
|
38
|
+
public value: string;
|
|
39
|
+
constructor(str: string);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare interface I18nFormattedNumberParams {
|
|
43
|
+
useGrouping?: boolean;
|
|
44
|
+
minimumIntegerDigits?: number;
|
|
45
|
+
minimumFractionDigits?: number;
|
|
46
|
+
maximumFractionDigits?: number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
declare class I18nFormattedNumber {}
|
|
50
|
+
|
|
51
|
+
declare interface I18nReplacement {
|
|
52
|
+
[s: string]: number | string | I18nSafeString | I18nFormattedNumber;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare namespace i18n {
|
|
56
|
+
function setData(data: {[key: string]: string}, language: string): void;
|
|
57
|
+
function get(key: string, replacements?: I18nReplacement, wrappers?: string[], gender?: string): string;
|
|
58
|
+
function getLanguage(): string;
|
|
59
|
+
function getInLocale(locale: string, key: string, replacements?: I18nReplacement, wrappers?: string[]): string;
|
|
60
|
+
function formatNumber(value: number, params: I18nFormattedNumberParams): I18nFormattedNumber;
|
|
61
|
+
}
|
package/package.json
CHANGED
package/sdk/commandtypes.d.ts
CHANGED
|
@@ -1059,11 +1059,17 @@ export declare type ShowModalQuery = {
|
|
|
1059
1059
|
/** Name of the modal's action for receiving events; generated automatically by Modal base class */
|
|
1060
1060
|
'n': string;
|
|
1061
1061
|
/** Title to show on the modal */
|
|
1062
|
-
't'
|
|
1062
|
+
't'?: string | undefined;
|
|
1063
1063
|
/** Desired modal width */
|
|
1064
|
-
'w'
|
|
1064
|
+
'w'?: number | undefined;
|
|
1065
1065
|
/** Desired modal height */
|
|
1066
|
-
'h'
|
|
1066
|
+
'h'?: number | undefined;
|
|
1067
|
+
/** Chromeless (without a header and borders) or not */
|
|
1068
|
+
'cl'?: boolean | undefined;
|
|
1069
|
+
/** FullScreen or not */
|
|
1070
|
+
'fs'?: boolean | undefined;
|
|
1071
|
+
/** TransparentBackground or not */
|
|
1072
|
+
'tb'?: boolean | undefined;
|
|
1067
1073
|
/** Content to display in the modal; full HTML page preferred */
|
|
1068
1074
|
'c': string;
|
|
1069
1075
|
};
|
package/sdk/ui/modal.d.ts
CHANGED
|
@@ -3,16 +3,38 @@ import { IframeUI } from './iframeui';
|
|
|
3
3
|
/**
|
|
4
4
|
* Configuration required to display a [Modal](#classes_ui_modal-Modal).
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export declare type ModalConfig = {
|
|
7
|
+
/** Content to display in the modal's iframe. This is set as the srcdoc on a sandboxed iframe. */
|
|
8
|
+
content: string;
|
|
9
|
+
} & ({
|
|
7
10
|
/** Title to display in the header bar of the modal. */
|
|
8
11
|
title: string;
|
|
12
|
+
/** If true, the header bar won't display (and no title is needed). */
|
|
13
|
+
chromeless?: false | never;
|
|
14
|
+
} | {
|
|
15
|
+
/** Title to display in the header bar of the modal. */
|
|
16
|
+
title?: never;
|
|
17
|
+
/** If true, the header bar won't display (and no title is needed). */
|
|
18
|
+
chromeless: true;
|
|
19
|
+
}) & ({
|
|
9
20
|
/** Requested width of the modal, in pixels. Depending on window size, this may not be honored exactly. */
|
|
10
21
|
width: number;
|
|
11
22
|
/** Requested height of the modal, in pixels. Depending on window size, this may not be honored exactly. */
|
|
12
23
|
height: number;
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
|
|
24
|
+
/** If true, the modal will take up the entire window, and won't need a width and height */
|
|
25
|
+
fullScreen?: false | never;
|
|
26
|
+
/** If true, the background of modal will be transparent. */
|
|
27
|
+
transparentBackground?: false | never;
|
|
28
|
+
} | {
|
|
29
|
+
/** Requested width of the modal, in pixels. Depending on window size, this may not be honored exactly. */
|
|
30
|
+
width?: never;
|
|
31
|
+
/** Requested height of the modal, in pixels. Depending on window size, this may not be honored exactly. */
|
|
32
|
+
height?: never;
|
|
33
|
+
/** If true, the modal will take up the entire window, and won't need a width and height */
|
|
34
|
+
fullScreen: true;
|
|
35
|
+
/** If true, the background of modal will be transparent. */
|
|
36
|
+
transparentBackground?: boolean;
|
|
37
|
+
});
|
|
16
38
|
/**
|
|
17
39
|
* Extend this class to show a custom modal to the user, whose contents are displayed in a sandboxed
|
|
18
40
|
* iframe controlled by your extension.
|
package/sdk/ui/modal.js
CHANGED
|
@@ -29,6 +29,9 @@ class Modal extends iframeui_1.IframeUI {
|
|
|
29
29
|
't': this.config.title,
|
|
30
30
|
'w': this.config.width,
|
|
31
31
|
'h': this.config.height,
|
|
32
|
+
'cl': this.config.chromeless,
|
|
33
|
+
'fs': this.config.fullScreen,
|
|
34
|
+
'tb': this.config.transparentBackground,
|
|
32
35
|
'c': this.config.content,
|
|
33
36
|
});
|
|
34
37
|
this.visible = true;
|