@tramvai/tokens-render 1.36.0 → 1.39.1

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 CHANGED
@@ -1,11 +1,11 @@
1
1
  # Render tokens
2
2
 
3
- Модуль содержащий токены трамвая для интеграция и расширения модуля рендера
3
+ Tramvai tokens for integration and extending render module.
4
4
 
5
5
  ## Список токенов
6
6
 
7
7
  @inline src/index.ts
8
8
 
9
- ## Список доступных слотов для ассетов
9
+ ## Render slots
10
10
 
11
11
  @inline src/slots.ts
package/lib/index.d.ts CHANGED
@@ -3,18 +3,18 @@ import { StorageRecord } from '@tinkoff/htmlpagebuilder';
3
3
  import * as ResourceSlot from './slots';
4
4
  /**
5
5
  * @description
6
- * Позволяет добавлять ресурсы в определенные слоты при рендере приложения.
7
- * Используется только на сервере, эквивалентно использованию RESOURCES_REGISTRY.
6
+ * Token adding resources to specific render slots.
7
+ * Used only on server and it is equivalent to usage of RESOURCES_REGISTRY.
8
8
  *
9
- * [Пример использования](https://tramvai.dev/docs/how-to/render-add-resources)
9
+ * [Usage example](https://tramvai.dev/docs/how-to/render-add-resources)
10
10
  */
11
11
  export declare const RENDER_SLOTS: PageResource | PageResource[];
12
12
  /**
13
13
  * @description
14
- * Позволяет переопределять атрибуты для html, body и контейнера приложения. Имейте в виду, что:
15
- - это именно html атрибуты, а не реакт (т.е. должен быть не className, а class).
16
- - новые атрибуты затирают старые
17
- - поддерживаются только текстовые значения
14
+ * Token for defining additional attributes for html, body and app container. Keep in mind that:
15
+ * - only raw html attributes are allowed (not react or anything else, e.g. do not use className use class)
16
+ * - new attributes overrides old one
17
+ * - only text values are supported
18
18
  *
19
19
  * @example
20
20
  ```tsx
@@ -33,60 +33,61 @@ export declare const RENDER_SLOTS: PageResource | PageResource[];
33
33
  export declare const HTML_ATTRS: HtmlAttrs;
34
34
  /**
35
35
  * @description
36
- * Позволяет повесить Node-style колбэк на событие рендеринга в браузере.
37
- * Первым аргументом отправляет ошибку, если таковая имелась
36
+ * Add node-style callback on render event in browser.
37
+ * Passes error instance as first argument if there was an error
38
38
  */
39
39
  export declare const RENDERER_CALLBACK: ((e?: Error) => void)[];
40
40
  /**
41
41
  * @description
42
- * Позволяет задать функцию-обертку для рендера и переопределить параметры или результат рендера
42
+ * Used as async function which overrides app render. This function may define render parameters or override render result.
43
43
  */
44
44
  export declare const CUSTOM_RENDER: any;
45
45
  /**
46
46
  * @description
47
- * Регистр ресурсов - используется на сервере для регистрации дополнительных ресурсов (скриптов, стилей, верстки) которые должны быть вставлены в итоговую html-страницу
47
+ * Resources registry is used only on server for registering any additional assets for browser (scripts, styles, html) which should be added to response html page
48
48
  */
49
49
  export declare const RESOURCES_REGISTRY: ResourcesRegistry;
50
50
  /**
51
51
  * @description
52
- * Строка отвечающая за проверку требуется ли загрузить файл полифиллов в конкретном браузере.
53
- * Полифиллы грузятся всегда для браузеров без поддержки модулей, а в браузерах с поддержкой будет выполняться данная проверка
54
- * (по умолчанию проверяет на Promise.prototype.finally и реализацию URL, URLSearchParams)
52
+ * A string used for check of need to loading polyfills in the client browser.
53
+ * Polyfills are always loading for browsers without module support and if browser do support modules
54
+ * this check will called in order to find out the need of loading polyfills
55
+ * (by default checks for Promise.prototype.finally and implementations for URL and URLSearchParams)
55
56
  *
56
- * [Документация по полифилам](https://tramvai.dev/docs/how-to/how-to-enable-polyfills)
57
+ * [Polyfill documentation](https://tramvai.dev/docs/how-to/how-to-enable-polyfills)
57
58
  */
58
59
  export declare const POLYFILL_CONDITION: string;
59
60
  /**
60
61
  * @description
61
- * Позволяет включить разные режимы работы React приложения - `strict`, `blocking`, `concurrent`, по умолчанию используется `legacy` - обычный режим работы
62
+ * Allows to specify different modes for React Render - `strict`, `blocking`, `concurrent`, by default value `legacy` is used
62
63
  *
63
- * [Подробнее в документации к module-render](https://tramvai.dev/docs/references/modules/render)
64
+ * [More details in doc for module-render](https://tramvai.dev/docs/references/modules/render)
64
65
  */
65
66
  export declare const RENDER_MODE: RenderMode;
66
67
  /**
67
68
  * @description
68
- * Позволяет сделать обертку для текущего провайдера.
69
- * Позволяет добавлять, например, свои React.Context.Provider для разного функционала
69
+ * A wrapper for app render.
70
+ * Through that token is possible to specify for example React.Context.Provider for the app
70
71
  */
71
72
  export declare const EXTEND_RENDER: ((current: ReactElement) => ReactElement)[];
72
73
  /**
73
74
  * @description
74
- * Токен инициализации лайаута по умолчанию для страниц
75
+ * Token for default layout for page
75
76
  */
76
77
  export declare const DEFAULT_LAYOUT_COMPONENT: any;
77
78
  /**
78
79
  * @description
79
- * Токен инициализации шапки по умолчанию для страниц
80
+ * Token for default header for page
80
81
  */
81
82
  export declare const DEFAULT_HEADER_COMPONENT: any;
82
83
  /**
83
84
  * @description
84
- * Токен инициализации футера по умолчанию для страниц
85
+ * Token for default footer for page
85
86
  */
86
87
  export declare const DEFAULT_FOOTER_COMPONENT: any;
87
88
  /**
88
89
  * @description
89
- * Токен для кастомизации дефолтного лейаута страниц
90
+ * Token for passing parameters for page layout
90
91
  */
91
92
  export declare const LAYOUT_OPTIONS: LayoutOptions[];
92
93
  declare type ReactComponent = ComponentType<any>;
@@ -118,9 +119,9 @@ declare type ResourceInlineOptions = {
118
119
  };
119
120
  /**
120
121
  * @description
121
- * Настройки инлайнинга ресурсов в HTML-страницу
122
- * * threshold Максимальное значение (в байтах) размера файла, до которого он инлайнится в HTML-страницу
123
- * * types Типы ресурсов, которые нужно инлайнить
122
+ * Settings for HTML resources inlining
123
+ * * threshold Maximum value (in bytes) of the file which are getting inlined in HTML page
124
+ * * types Types of resources which should be inlined
124
125
  */
125
126
  export declare const RESOURCE_INLINE_OPTIONS: ResourceInlineOptions;
126
127
  export { ResourceSlot };
package/lib/index.es.js CHANGED
@@ -34,20 +34,20 @@ var slots = {
34
34
 
35
35
  /**
36
36
  * @description
37
- * Позволяет добавлять ресурсы в определенные слоты при рендере приложения.
38
- * Используется только на сервере, эквивалентно использованию RESOURCES_REGISTRY.
37
+ * Token adding resources to specific render slots.
38
+ * Used only on server and it is equivalent to usage of RESOURCES_REGISTRY.
39
39
  *
40
- * [Пример использования](https://tramvai.dev/docs/how-to/render-add-resources)
40
+ * [Usage example](https://tramvai.dev/docs/how-to/render-add-resources)
41
41
  */
42
42
  const RENDER_SLOTS = createToken('RENDER_SLOTS', {
43
43
  multi: true,
44
44
  });
45
45
  /**
46
46
  * @description
47
- * Позволяет переопределять атрибуты для html, body и контейнера приложения. Имейте в виду, что:
48
- - это именно html атрибуты, а не реакт (т.е. должен быть не className, а class).
49
- - новые атрибуты затирают старые
50
- - поддерживаются только текстовые значения
47
+ * Token for defining additional attributes for html, body and app container. Keep in mind that:
48
+ * - only raw html attributes are allowed (not react or anything else, e.g. do not use className use class)
49
+ * - new attributes overrides old one
50
+ * - only text values are supported
51
51
  *
52
52
  * @example
53
53
  ```tsx
@@ -66,71 +66,72 @@ const RENDER_SLOTS = createToken('RENDER_SLOTS', {
66
66
  const HTML_ATTRS = createToken('HTML_ATTRS', { multi: true });
67
67
  /**
68
68
  * @description
69
- * Позволяет повесить Node-style колбэк на событие рендеринга в браузере.
70
- * Первым аргументом отправляет ошибку, если таковая имелась
69
+ * Add node-style callback on render event in browser.
70
+ * Passes error instance as first argument if there was an error
71
71
  */
72
72
  const RENDERER_CALLBACK = createToken('RENDERER_CALLBACK', {
73
73
  multi: true,
74
74
  });
75
75
  /**
76
76
  * @description
77
- * Позволяет задать функцию-обертку для рендера и переопределить параметры или результат рендера
77
+ * Used as async function which overrides app render. This function may define render parameters or override render result.
78
78
  */
79
79
  const CUSTOM_RENDER = createToken('CUSTOM_RENDER');
80
80
  /**
81
81
  * @description
82
- * Регистр ресурсов - используется на сервере для регистрации дополнительных ресурсов (скриптов, стилей, верстки) которые должны быть вставлены в итоговую html-страницу
82
+ * Resources registry is used only on server for registering any additional assets for browser (scripts, styles, html) which should be added to response html page
83
83
  */
84
84
  const RESOURCES_REGISTRY = createToken('resourcesRegistry');
85
85
  /**
86
86
  * @description
87
- * Строка отвечающая за проверку требуется ли загрузить файл полифиллов в конкретном браузере.
88
- * Полифиллы грузятся всегда для браузеров без поддержки модулей, а в браузерах с поддержкой будет выполняться данная проверка
89
- * (по умолчанию проверяет на Promise.prototype.finally и реализацию URL, URLSearchParams)
87
+ * A string used for check of need to loading polyfills in the client browser.
88
+ * Polyfills are always loading for browsers without module support and if browser do support modules
89
+ * this check will called in order to find out the need of loading polyfills
90
+ * (by default checks for Promise.prototype.finally and implementations for URL and URLSearchParams)
90
91
  *
91
- * [Документация по полифилам](https://tramvai.dev/docs/how-to/how-to-enable-polyfills)
92
+ * [Polyfill documentation](https://tramvai.dev/docs/how-to/how-to-enable-polyfills)
92
93
  */
93
94
  const POLYFILL_CONDITION = createToken('POLYFILL_CONDITION');
94
95
  /**
95
96
  * @description
96
- * Позволяет включить разные режимы работы React приложения - `strict`, `blocking`, `concurrent`, по умолчанию используется `legacy` - обычный режим работы
97
+ * Allows to specify different modes for React Render - `strict`, `blocking`, `concurrent`, by default value `legacy` is used
97
98
  *
98
- * [Подробнее в документации к module-render](https://tramvai.dev/docs/references/modules/render)
99
+ * [More details in doc for module-render](https://tramvai.dev/docs/references/modules/render)
99
100
  */
100
101
  const RENDER_MODE = createToken('RENDER_MODE');
101
102
  /**
102
103
  * @description
103
- * Позволяет сделать обертку для текущего провайдера.
104
- * Позволяет добавлять, например, свои React.Context.Provider для разного функционала
104
+ * A wrapper for app render.
105
+ * Through that token is possible to specify for example React.Context.Provider for the app
105
106
  */
106
107
  const EXTEND_RENDER = createToken('EXTEND_RENDER', {
107
108
  multi: true,
108
109
  });
109
110
  /**
110
111
  * @description
111
- * Токен инициализации лайаута по умолчанию для страниц
112
+ * Token for default layout for page
112
113
  */
113
114
  const DEFAULT_LAYOUT_COMPONENT = createToken('defaultLayoutComponent');
114
115
  /**
115
116
  * @description
116
- * Токен инициализации шапки по умолчанию для страниц
117
+ * Token for default header for page
117
118
  */
118
119
  const DEFAULT_HEADER_COMPONENT = createToken('defaultHeaderComponent');
119
120
  /**
120
121
  * @description
121
- * Токен инициализации футера по умолчанию для страниц
122
+ * Token for default footer for page
122
123
  */
123
124
  const DEFAULT_FOOTER_COMPONENT = createToken('defaultFooterComponent');
124
125
  /**
125
126
  * @description
126
- * Токен для кастомизации дефолтного лейаута страниц
127
+ * Token for passing parameters for page layout
127
128
  */
128
129
  const LAYOUT_OPTIONS = createToken('layoutOptions', { multi: true });
129
130
  /**
130
131
  * @description
131
- * Настройки инлайнинга ресурсов в HTML-страницу
132
- * * threshold Максимальное значение (в байтах) размера файла, до которого он инлайнится в HTML-страницу
133
- * * types Типы ресурсов, которые нужно инлайнить
132
+ * Settings for HTML resources inlining
133
+ * * threshold Maximum value (in bytes) of the file which are getting inlined in HTML page
134
+ * * types Types of resources which should be inlined
134
135
  */
135
136
  const RESOURCE_INLINE_OPTIONS = createToken('resourceInlineThreshold');
136
137
 
package/lib/index.js CHANGED
@@ -38,20 +38,20 @@ var slots = {
38
38
 
39
39
  /**
40
40
  * @description
41
- * Позволяет добавлять ресурсы в определенные слоты при рендере приложения.
42
- * Используется только на сервере, эквивалентно использованию RESOURCES_REGISTRY.
41
+ * Token adding resources to specific render slots.
42
+ * Used only on server and it is equivalent to usage of RESOURCES_REGISTRY.
43
43
  *
44
- * [Пример использования](https://tramvai.dev/docs/how-to/render-add-resources)
44
+ * [Usage example](https://tramvai.dev/docs/how-to/render-add-resources)
45
45
  */
46
46
  const RENDER_SLOTS = dippy.createToken('RENDER_SLOTS', {
47
47
  multi: true,
48
48
  });
49
49
  /**
50
50
  * @description
51
- * Позволяет переопределять атрибуты для html, body и контейнера приложения. Имейте в виду, что:
52
- - это именно html атрибуты, а не реакт (т.е. должен быть не className, а class).
53
- - новые атрибуты затирают старые
54
- - поддерживаются только текстовые значения
51
+ * Token for defining additional attributes for html, body and app container. Keep in mind that:
52
+ * - only raw html attributes are allowed (not react or anything else, e.g. do not use className use class)
53
+ * - new attributes overrides old one
54
+ * - only text values are supported
55
55
  *
56
56
  * @example
57
57
  ```tsx
@@ -70,71 +70,72 @@ const RENDER_SLOTS = dippy.createToken('RENDER_SLOTS', {
70
70
  const HTML_ATTRS = dippy.createToken('HTML_ATTRS', { multi: true });
71
71
  /**
72
72
  * @description
73
- * Позволяет повесить Node-style колбэк на событие рендеринга в браузере.
74
- * Первым аргументом отправляет ошибку, если таковая имелась
73
+ * Add node-style callback on render event in browser.
74
+ * Passes error instance as first argument if there was an error
75
75
  */
76
76
  const RENDERER_CALLBACK = dippy.createToken('RENDERER_CALLBACK', {
77
77
  multi: true,
78
78
  });
79
79
  /**
80
80
  * @description
81
- * Позволяет задать функцию-обертку для рендера и переопределить параметры или результат рендера
81
+ * Used as async function which overrides app render. This function may define render parameters or override render result.
82
82
  */
83
83
  const CUSTOM_RENDER = dippy.createToken('CUSTOM_RENDER');
84
84
  /**
85
85
  * @description
86
- * Регистр ресурсов - используется на сервере для регистрации дополнительных ресурсов (скриптов, стилей, верстки) которые должны быть вставлены в итоговую html-страницу
86
+ * Resources registry is used only on server for registering any additional assets for browser (scripts, styles, html) which should be added to response html page
87
87
  */
88
88
  const RESOURCES_REGISTRY = dippy.createToken('resourcesRegistry');
89
89
  /**
90
90
  * @description
91
- * Строка отвечающая за проверку требуется ли загрузить файл полифиллов в конкретном браузере.
92
- * Полифиллы грузятся всегда для браузеров без поддержки модулей, а в браузерах с поддержкой будет выполняться данная проверка
93
- * (по умолчанию проверяет на Promise.prototype.finally и реализацию URL, URLSearchParams)
91
+ * A string used for check of need to loading polyfills in the client browser.
92
+ * Polyfills are always loading for browsers without module support and if browser do support modules
93
+ * this check will called in order to find out the need of loading polyfills
94
+ * (by default checks for Promise.prototype.finally and implementations for URL and URLSearchParams)
94
95
  *
95
- * [Документация по полифилам](https://tramvai.dev/docs/how-to/how-to-enable-polyfills)
96
+ * [Polyfill documentation](https://tramvai.dev/docs/how-to/how-to-enable-polyfills)
96
97
  */
97
98
  const POLYFILL_CONDITION = dippy.createToken('POLYFILL_CONDITION');
98
99
  /**
99
100
  * @description
100
- * Позволяет включить разные режимы работы React приложения - `strict`, `blocking`, `concurrent`, по умолчанию используется `legacy` - обычный режим работы
101
+ * Allows to specify different modes for React Render - `strict`, `blocking`, `concurrent`, by default value `legacy` is used
101
102
  *
102
- * [Подробнее в документации к module-render](https://tramvai.dev/docs/references/modules/render)
103
+ * [More details in doc for module-render](https://tramvai.dev/docs/references/modules/render)
103
104
  */
104
105
  const RENDER_MODE = dippy.createToken('RENDER_MODE');
105
106
  /**
106
107
  * @description
107
- * Позволяет сделать обертку для текущего провайдера.
108
- * Позволяет добавлять, например, свои React.Context.Provider для разного функционала
108
+ * A wrapper for app render.
109
+ * Through that token is possible to specify for example React.Context.Provider for the app
109
110
  */
110
111
  const EXTEND_RENDER = dippy.createToken('EXTEND_RENDER', {
111
112
  multi: true,
112
113
  });
113
114
  /**
114
115
  * @description
115
- * Токен инициализации лайаута по умолчанию для страниц
116
+ * Token for default layout for page
116
117
  */
117
118
  const DEFAULT_LAYOUT_COMPONENT = dippy.createToken('defaultLayoutComponent');
118
119
  /**
119
120
  * @description
120
- * Токен инициализации шапки по умолчанию для страниц
121
+ * Token for default header for page
121
122
  */
122
123
  const DEFAULT_HEADER_COMPONENT = dippy.createToken('defaultHeaderComponent');
123
124
  /**
124
125
  * @description
125
- * Токен инициализации футера по умолчанию для страниц
126
+ * Token for default footer for page
126
127
  */
127
128
  const DEFAULT_FOOTER_COMPONENT = dippy.createToken('defaultFooterComponent');
128
129
  /**
129
130
  * @description
130
- * Токен для кастомизации дефолтного лейаута страниц
131
+ * Token for passing parameters for page layout
131
132
  */
132
133
  const LAYOUT_OPTIONS = dippy.createToken('layoutOptions', { multi: true });
133
134
  /**
134
135
  * @description
135
- * Настройки инлайнинга ресурсов в HTML-страницу
136
- * * threshold Максимальное значение (в байтах) размера файла, до которого он инлайнится в HTML-страницу
137
- * * types Типы ресурсов, которые нужно инлайнить
136
+ * Settings for HTML resources inlining
137
+ * * threshold Maximum value (in bytes) of the file which are getting inlined in HTML page
138
+ * * types Types of resources which should be inlined
138
139
  */
139
140
  const RESOURCE_INLINE_OPTIONS = dippy.createToken('resourceInlineThreshold');
140
141
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/tokens-render",
3
- "version": "1.36.0",
3
+ "version": "1.39.1",
4
4
  "description": "Tramvai tokens for @tramvai/module-render",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.es.js",