@divkitframework/divkit 29.14.0 → 30.0.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/README.md +12 -2
- package/dist/browser/client-devtool.js +1 -1
- package/dist/browser/client-devtool.js.map +1 -1
- package/dist/browser/client-hydratable.js +1 -1
- package/dist/browser/client-hydratable.js.map +1 -1
- package/dist/browser/client.js +1 -1
- package/dist/browser/client.js.map +1 -1
- package/dist/client-devtool.js +1 -1
- package/dist/client-devtool.js.map +1 -1
- package/dist/client-hydratable.js +1 -1
- package/dist/client-hydratable.js.map +1 -1
- package/dist/client.css +1 -1
- package/dist/client.css.map +1 -1
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/esm/client-devtool.mjs +1 -1
- package/dist/esm/client-devtool.mjs.map +1 -1
- package/dist/esm/client-hydratable.mjs +1 -1
- package/dist/esm/client-hydratable.mjs.map +1 -1
- package/dist/esm/client.mjs +1 -1
- package/dist/esm/client.mjs.map +1 -1
- package/dist/esm/server.mjs +1 -1
- package/dist/esm/server.mjs.map +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
- package/typings/client-hydratable.d.ts +2 -0
- package/typings/client.d.ts +2 -0
- package/typings/common.d.ts +9 -0
- package/typings/server.d.ts +2 -0
- package/typings/store.d.ts +27 -0
package/package.json
CHANGED
|
@@ -12,6 +12,7 @@ import type {
|
|
|
12
12
|
FetchInit
|
|
13
13
|
} from './common';
|
|
14
14
|
import type { CustomComponentDescription } from './custom';
|
|
15
|
+
import type { Store } from './store';
|
|
15
16
|
import type { GlobalVariablesController } from './variables';
|
|
16
17
|
|
|
17
18
|
export function render(opts: {
|
|
@@ -34,6 +35,7 @@ export function render(opts: {
|
|
|
34
35
|
fetchInit?: FetchInit;
|
|
35
36
|
tooltipRoot?: HTMLElement;
|
|
36
37
|
customComponents?: Map<string, CustomComponentDescription> | undefined;
|
|
38
|
+
store?: Store;
|
|
37
39
|
}): DivkitInstance;
|
|
38
40
|
|
|
39
41
|
export { createVariable, createGlobalVariablesController } from './variables';
|
package/typings/client.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import type {
|
|
|
12
12
|
FetchInit
|
|
13
13
|
} from './common';
|
|
14
14
|
import type { CustomComponentDescription } from './custom';
|
|
15
|
+
import type { Store } from './store';
|
|
15
16
|
import type { GlobalVariablesController } from './variables';
|
|
16
17
|
|
|
17
18
|
export function render(opts: {
|
|
@@ -33,6 +34,7 @@ export function render(opts: {
|
|
|
33
34
|
fetchInit?: FetchInit;
|
|
34
35
|
tooltipRoot?: HTMLElement;
|
|
35
36
|
customComponents?: Map<string, CustomComponentDescription> | undefined;
|
|
37
|
+
store?: Store;
|
|
36
38
|
}): DivkitInstance;
|
|
37
39
|
|
|
38
40
|
export { createVariable, createGlobalVariablesController } from './variables';
|
package/typings/common.d.ts
CHANGED
|
@@ -199,7 +199,14 @@ export interface ActionBase {
|
|
|
199
199
|
is_enabled?: BooleanInt;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
+
export interface ActionMenuItem {
|
|
203
|
+
text: string;
|
|
204
|
+
action?: Action;
|
|
205
|
+
actions?: Action[];
|
|
206
|
+
}
|
|
207
|
+
|
|
202
208
|
export interface Action extends ActionBase {
|
|
209
|
+
menu_items?: ActionMenuItem[];
|
|
203
210
|
log_url?: string;
|
|
204
211
|
target?: string;
|
|
205
212
|
}
|
|
@@ -268,6 +275,8 @@ export interface Customization {
|
|
|
268
275
|
galleryRightClass?: string;
|
|
269
276
|
pagerLeftClass?: string;
|
|
270
277
|
pagerRightClass?: string;
|
|
278
|
+
menuPopupClass?: string;
|
|
279
|
+
menuItemClass?: string;
|
|
271
280
|
}
|
|
272
281
|
|
|
273
282
|
export interface DivExtensionContext {
|
package/typings/server.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
TypefaceProvider
|
|
7
7
|
} from './common';
|
|
8
8
|
import type { CustomComponentDescription } from './custom';
|
|
9
|
+
import type { Store } from './store';
|
|
9
10
|
|
|
10
11
|
export function render(opts: {
|
|
11
12
|
json: DivJson;
|
|
@@ -17,4 +18,5 @@ export function render(opts: {
|
|
|
17
18
|
onError?: ErrorCallback;
|
|
18
19
|
typefaceProvider?: TypefaceProvider;
|
|
19
20
|
customComponents?: Map<string, CustomComponentDescription> | undefined;
|
|
21
|
+
store?: Store;
|
|
20
22
|
}): string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type StoreTypes = 'string' | 'number' | 'boolean';
|
|
2
|
+
|
|
3
|
+
export interface Store {
|
|
4
|
+
/**
|
|
5
|
+
* Fetches primitive from the store
|
|
6
|
+
* @param name
|
|
7
|
+
* @param type Expected value tpye
|
|
8
|
+
*/
|
|
9
|
+
getValue(
|
|
10
|
+
name: string,
|
|
11
|
+
type: StoreTypes
|
|
12
|
+
): string | number | boolean | undefined;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Save primitive into the store
|
|
16
|
+
* @param name
|
|
17
|
+
* @param type Value type (for example, can be url)
|
|
18
|
+
* @param value
|
|
19
|
+
* @param lifetime Value lifetime in seconds
|
|
20
|
+
*/
|
|
21
|
+
setValue(
|
|
22
|
+
name: string,
|
|
23
|
+
type: StoreTypes,
|
|
24
|
+
value: string | number | boolean,
|
|
25
|
+
lifetime: number
|
|
26
|
+
): void;
|
|
27
|
+
}
|