@divkitframework/divkit 28.6.0 → 28.7.0-canary-7d5bebc751b116e5d5df0cfdeaef19deee105012

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": "@divkitframework/divkit",
3
- "version": "28.6.0",
3
+ "version": "28.7.0-canary-7d5bebc751b116e5d5df0cfdeaef19deee105012",
4
4
  "description": "DivKit for the web",
5
5
  "keywords": [
6
6
  "server-driven-ui",
@@ -115,8 +115,8 @@
115
115
  "lottie-web": "5.11.0",
116
116
  "mini-css-extract-plugin": "2.7.5",
117
117
  "peggy": "3.0.2",
118
- "postcss": "8.4.23",
119
- "postcss-loader": "7.2.4",
118
+ "postcss": "8.4.31",
119
+ "postcss-loader": "7.3.3",
120
120
  "svelte": "4.2.0",
121
121
  "svelte-check": "3.5.0",
122
122
  "svelte-loader": "3.1.9",
@@ -14,6 +14,7 @@ import type {
14
14
  } from './common';
15
15
  import type { GlobalVariablesController, Variable } from './variables';
16
16
  import type { WrappedError } from './common';
17
+ import type { CustomComponentDescription } from './custom';
17
18
 
18
19
  export interface DivkitDebugInstance extends DivkitInstance {
19
20
  getDebugVariables(): Map<string, Variable>;
@@ -39,6 +40,7 @@ export function render(opts: {
39
40
  theme?: Theme;
40
41
  fetchInit?: FetchInit;
41
42
  tooltipRoot?: HTMLElement;
43
+ customComponents?: Map<string, CustomComponentDescription> | undefined;
42
44
  }): DivkitDebugInstance;
43
45
 
44
46
  export { createVariable, createGlobalVariablesController } from './variables';
@@ -11,6 +11,7 @@ import type {
11
11
  TypefaceProvider,
12
12
  FetchInit
13
13
  } from './common';
14
+ import type { CustomComponentDescription } from './custom';
14
15
  import type { GlobalVariablesController } from './variables';
15
16
 
16
17
  export function render(opts: {
@@ -32,6 +33,7 @@ export function render(opts: {
32
33
  theme?: Theme;
33
34
  fetchInit?: FetchInit;
34
35
  tooltipRoot?: HTMLElement;
36
+ customComponents?: Map<string, CustomComponentDescription> | undefined;
35
37
  }): DivkitInstance;
36
38
 
37
39
  export { createVariable, createGlobalVariablesController } from './variables';
@@ -11,6 +11,7 @@ import type {
11
11
  TypefaceProvider,
12
12
  FetchInit
13
13
  } from './common';
14
+ import type { CustomComponentDescription } from './custom';
14
15
  import type { GlobalVariablesController } from './variables';
15
16
 
16
17
  export function render(opts: {
@@ -31,6 +32,7 @@ export function render(opts: {
31
32
  theme?: Theme;
32
33
  fetchInit?: FetchInit;
33
34
  tooltipRoot?: HTMLElement;
35
+ customComponents?: Map<string, CustomComponentDescription> | undefined;
34
36
  }): DivkitInstance;
35
37
 
36
38
  export { createVariable, createGlobalVariablesController } from './variables';
@@ -98,6 +98,57 @@ export interface DownloadCallbacks {
98
98
  on_success_actions?: Action[];
99
99
  }
100
100
 
101
+ export interface StringValue {
102
+ type: 'string';
103
+ value: string;
104
+ }
105
+
106
+ export interface IntegerValue {
107
+ type: 'integer';
108
+ value: number;
109
+ }
110
+
111
+ export interface NumberValue {
112
+ type: 'number';
113
+ value: number;
114
+ }
115
+
116
+ export interface ColorValue {
117
+ type: 'color';
118
+ value: string;
119
+ }
120
+
121
+ export interface BooleanValue {
122
+ type: 'boolean';
123
+ value: boolean;
124
+ }
125
+
126
+ export interface UrlValue {
127
+ type: 'url';
128
+ value: string;
129
+ }
130
+
131
+ export interface DictValue {
132
+ type: 'dict';
133
+ value: Record<string, unknown>;
134
+ }
135
+
136
+ export interface ArrayValue {
137
+ type: 'array';
138
+ value: unknown[];
139
+ }
140
+
141
+ export type TypedValue = StringValue | IntegerValue | NumberValue | ColorValue |
142
+ BooleanValue | UrlValue | DictValue | ArrayValue;
143
+
144
+ export interface ActionSetVariable {
145
+ type: 'set_variable';
146
+ variable_name: string;
147
+ value: TypedValue;
148
+ }
149
+
150
+ export type TypedAction = ActionSetVariable;
151
+
101
152
  export interface Action {
102
153
  log_id: string;
103
154
  url?: string;
@@ -106,6 +157,7 @@ export interface Action {
106
157
  download_callbacks?: DownloadCallbacks;
107
158
  log_url?: string;
108
159
  target?: string;
160
+ typed?: TypedAction;
109
161
  }
110
162
 
111
163
  export interface VisibilityAction {
@@ -117,6 +169,7 @@ export interface VisibilityAction {
117
169
  visibility_percentage?: number;
118
170
  visibility_duration?: number;
119
171
  log_limit?: number;
172
+ typed?: TypedAction;
120
173
  }
121
174
 
122
175
  export interface DisappearAction {
@@ -128,6 +181,7 @@ export interface DisappearAction {
128
181
  visibility_percentage?: number;
129
182
  disappear_duration?: number;
130
183
  log_limit?: number;
184
+ typed?: TypedAction;
131
185
  }
132
186
 
133
187
  export type StatCallback = (details: {
@@ -0,0 +1,10 @@
1
+ export type CustomComponentTemplate = string | ((opts: {
2
+ props?: object;
3
+ variables: Map<string, string | number | boolean | unknown[] | object>;
4
+ }) => string);
5
+
6
+ export interface CustomComponentDescription {
7
+ element: string;
8
+ shadowRootMode?: 'open' | 'close';
9
+ template?: CustomComponentTemplate;
10
+ }
@@ -5,6 +5,7 @@ import type {
5
5
  Customization,
6
6
  TypefaceProvider
7
7
  } from './common';
8
+ import type { CustomComponentDescription } from './custom';
8
9
 
9
10
  export function render(opts: {
10
11
  json: DivJson;
@@ -15,4 +16,5 @@ export function render(opts: {
15
16
  builtinProtocols?: string[];
16
17
  onError?: ErrorCallback;
17
18
  typefaceProvider?: TypefaceProvider;
19
+ customComponents?: Map<string, CustomComponentDescription> | undefined;
18
20
  }): string;