@divkitframework/divkit 3.0.1 → 4.0.0-patched-9d2e220eb0410e222f2d803838c8e5c052f0e3b7
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/LICENSE +0 -6
- package/README.md +43 -3
- package/dist/browser/client-devtool.js.map +1 -1
- package/dist/browser/client-hydratable.js.map +1 -1
- package/dist/browser/client.js.map +1 -1
- package/dist/client-devtool.js.map +1 -1
- package/dist/client-hydratable.js.map +1 -1
- package/dist/client.css.map +1 -1
- package/dist/client.js.map +1 -1
- package/dist/esm/client-devtool.mjs.map +1 -1
- package/dist/esm/client-hydratable.mjs.map +1 -1
- package/dist/esm/client.mjs.map +1 -1
- package/dist/esm/server.mjs.map +1 -1
- package/dist/server.js.map +1 -1
- package/package.json +4 -2
- package/CHANGELOG.md +0 -124
package/LICENSE
CHANGED
|
@@ -136,8 +136,6 @@ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
|
|
136
136
|
|
|
137
137
|
com.google.android.material:material
|
|
138
138
|
|
|
139
|
-
Copyright (C) 2015 The Android Open Source Project
|
|
140
|
-
|
|
141
139
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
142
140
|
you may not use this file except in compliance with the License.
|
|
143
141
|
You may obtain a copy of the License at
|
|
@@ -290,8 +288,6 @@ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
|
|
290
288
|
|
|
291
289
|
com.squareup.moshi:moshi
|
|
292
290
|
|
|
293
|
-
Copyright (c) 2018 Square Inc.
|
|
294
|
-
|
|
295
291
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
296
292
|
you may not use this file except in compliance with the License.
|
|
297
293
|
You may obtain a copy of the License at
|
|
@@ -306,8 +302,6 @@ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
|
|
306
302
|
|
|
307
303
|
com.squareup:fest-android
|
|
308
304
|
|
|
309
|
-
Copyright (c) 2015 Square Inc.
|
|
310
|
-
|
|
311
305
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
312
306
|
you may not use this file except in compliance with the License.
|
|
313
307
|
You may obtain a copy of the License at
|
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
## DivKit for the Web
|
|
2
2
|
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
|
|
3
6
|
### Installation
|
|
4
7
|
|
|
5
8
|
```
|
|
@@ -137,6 +140,12 @@ ES modules can be used in the browser directly without any build:
|
|
|
137
140
|
</script>
|
|
138
141
|
```
|
|
139
142
|
|
|
143
|
+
### Usage with React
|
|
144
|
+
|
|
145
|
+
There is a separate package for that.
|
|
146
|
+
|
|
147
|
+
[React component package](../divkit-react)
|
|
148
|
+
|
|
140
149
|
### TypeScript and types
|
|
141
150
|
|
|
142
151
|
All modules have typescript definitions (client, client-hydratable and server), so typescript will load them at any use.
|
|
@@ -155,7 +164,7 @@ Node.js
|
|
|
155
164
|
Node.js >= 8
|
|
156
165
|
```
|
|
157
166
|
|
|
158
|
-
### API
|
|
167
|
+
### API: render
|
|
159
168
|
|
|
160
169
|
All 3 exported modules have an exported function `render`. This function works in a similar way on client and server.
|
|
161
170
|
|
|
@@ -163,8 +172,6 @@ All 3 exported modules have an exported function `render`. This function works i
|
|
|
163
172
|
|
|
164
173
|
Instead, `/server` module will return an HTML string.
|
|
165
174
|
|
|
166
|
-
### Options
|
|
167
|
-
|
|
168
175
|
#### id
|
|
169
176
|
|
|
170
177
|
String, required.
|
|
@@ -280,3 +287,36 @@ Divjson along with the `card` and `templates` can contain a `palette` property w
|
|
|
280
287
|
}
|
|
281
288
|
}
|
|
282
289
|
```
|
|
290
|
+
|
|
291
|
+
### API: other
|
|
292
|
+
|
|
293
|
+
#### Variables
|
|
294
|
+
|
|
295
|
+
```js
|
|
296
|
+
import {createVariable, createGlobalVariablesController, render} from '@divkit/divkit';
|
|
297
|
+
|
|
298
|
+
// Custom variable outside of DivJson
|
|
299
|
+
const variable = createVariable('name', 'string', 'val');
|
|
300
|
+
|
|
301
|
+
variable.subscribe(newVal => {
|
|
302
|
+
console.log(newVal);
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
// Custom scope for variables
|
|
306
|
+
const controller = createGlobalVariablesController();
|
|
307
|
+
|
|
308
|
+
controller.setVariable(variable);
|
|
309
|
+
|
|
310
|
+
render(({
|
|
311
|
+
id: 'smth',
|
|
312
|
+
target: document.querySelector('#root'),
|
|
313
|
+
json: {},
|
|
314
|
+
globalVariablesController: controller
|
|
315
|
+
});
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
[Documentation](https://divkit.tech/doc). [Medium tutorial](https://medium.com/p/cad519252f0f). [Habr tutorial](https://habr.com/ru/company/yandex/blog/683886/).
|
|
319
|
+
|
|
320
|
+
Telegram: [News](https://t.me/divkit_news) | [English-speaking chat](https://t.me/divkit_community_en) | [Чат на русском](https://t.me/divkit_community_ru).
|
|
321
|
+
|
|
322
|
+
[Twitter](https://twitter.com/DivKitFramework)
|