@matreshka/bff 0.17.0 → 0.20.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.
Files changed (53) hide show
  1. package/dist/components/board.d.ts +4 -7
  2. package/dist/components/board.js +7 -51
  3. package/dist/components/camera.d.ts +1 -4
  4. package/dist/components/camera.js +6 -26
  5. package/dist/components/component.d.ts +26 -5
  6. package/dist/components/component.js +35 -2
  7. package/dist/components/container.js +8 -11
  8. package/dist/components/dialog.d.ts +1 -4
  9. package/dist/components/dialog.js +5 -21
  10. package/dist/components/file-upload-area.js +8 -11
  11. package/dist/components/form.js +8 -11
  12. package/dist/components/grid.js +7 -11
  13. package/dist/components/inputs/text-editor.d.ts +14 -14
  14. package/dist/components/inputs/text-editor.js +14 -154
  15. package/dist/components/map.d.ts +4 -7
  16. package/dist/components/map.js +6 -52
  17. package/dist/components/page.d.ts +0 -1
  18. package/dist/components/page.js +4 -10
  19. package/dist/components/popover.d.ts +1 -4
  20. package/dist/components/popover.js +5 -21
  21. package/dist/components/stack.d.ts +2 -5
  22. package/dist/components/stack.js +6 -28
  23. package/dist/components/utils/targeted-client-component-action.d.ts +5 -0
  24. package/dist/components/utils/targeted-client-component-action.js +25 -0
  25. package/dist/core/utils/serialize-component-tree.d.ts +3 -0
  26. package/dist/core/utils/serialize-component-tree.js +21 -0
  27. package/dist/core/utils/targeted-client-action.d.ts +19 -0
  28. package/dist/core/utils/targeted-client-action.js +68 -0
  29. package/dist/platforms/browser-platform.d.ts +21 -37
  30. package/dist/platforms/browser-platform.js +61 -104
  31. package/dist/platforms/max-mini-app-platform.d.ts +2 -8
  32. package/dist/platforms/max-mini-app-platform.js +10 -21
  33. package/dist/platforms/mobile-platform.d.ts +32 -58
  34. package/dist/platforms/mobile-platform.js +139 -211
  35. package/dist/platforms/platform.d.ts +32 -49
  36. package/dist/platforms/platform.js +77 -87
  37. package/dist/platforms/telegram-mini-app-platform.d.ts +16 -34
  38. package/dist/platforms/telegram-mini-app-platform.js +41 -92
  39. package/dist/platforms/utils/client-back-platform-action.d.ts +9 -0
  40. package/dist/platforms/utils/client-back-platform-action.js +48 -0
  41. package/dist/platforms/utils/client-navigate-platform-action.d.ts +19 -0
  42. package/dist/platforms/utils/client-navigate-platform-action.js +60 -0
  43. package/dist/platforms/utils/client-reload-platform-action.d.ts +8 -0
  44. package/dist/platforms/utils/client-reload-platform-action.js +41 -0
  45. package/dist/platforms/utils/client-route-page-wait.d.ts +11 -0
  46. package/dist/platforms/utils/client-route-page-wait.js +33 -0
  47. package/dist/platforms/utils/match-navigate-path.d.ts +11 -0
  48. package/dist/platforms/utils/match-navigate-path.js +95 -0
  49. package/dist/platforms/utils/targeted-client-platform-action.d.ts +11 -0
  50. package/dist/platforms/utils/targeted-client-platform-action.js +25 -0
  51. package/dist/platforms/utils/targeted-client-platform-stream.d.ts +17 -0
  52. package/dist/platforms/utils/targeted-client-platform-stream.js +90 -0
  53. package/package.json +2 -2
@@ -32,60 +32,60 @@ export declare class TextEditor<RefType extends StringInputContextRef = StringIn
32
32
  *
33
33
  * @param value Строка HTML.
34
34
  */
35
- insertHTML(value: string, instances?: ComponentInstance[]): this;
35
+ insertHTML(value: string, instances?: ComponentInstance[]): import("rxjs").Observable<void>;
36
36
  /**
37
37
  * Переключает курсивное начертание текста.
38
38
  */
39
- toggleItalic(instances?: ComponentInstance[]): this;
39
+ toggleItalic(instances?: ComponentInstance[]): import("rxjs").Observable<void>;
40
40
  /**
41
41
  * Переключает полужирное начертание текста.
42
42
  */
43
- toggleBold(instances?: ComponentInstance[]): this;
43
+ toggleBold(instances?: ComponentInstance[]): import("rxjs").Observable<void>;
44
44
  /**
45
45
  * Переключает подчеркивание текста.
46
46
  */
47
- toggleUnderline(instances?: ComponentInstance[]): this;
47
+ toggleUnderline(instances?: ComponentInstance[]): import("rxjs").Observable<void>;
48
48
  /**
49
49
  * Выполняет операцию отмены последнего действия.
50
50
  */
51
- undo(instances?: ComponentInstance[]): this;
51
+ undo(instances?: ComponentInstance[]): import("rxjs").Observable<void>;
52
52
  /**
53
53
  * Выполняет операцию повтора последнего отмененного действия.
54
54
  */
55
- redo(instances?: ComponentInstance[]): this;
55
+ redo(instances?: ComponentInstance[]): import("rxjs").Observable<void>;
56
56
  /**
57
57
  * Применяет формат верхнего индекса к выделенному тексту.
58
58
  */
59
- superscript(instances?: ComponentInstance[]): this;
59
+ superscript(instances?: ComponentInstance[]): import("rxjs").Observable<void>;
60
60
  /**
61
61
  * Вставляет нумерованный список.
62
62
  */
63
- insertOrderedList(instances?: ComponentInstance[]): this;
63
+ insertOrderedList(instances?: ComponentInstance[]): import("rxjs").Observable<void>;
64
64
  /**
65
65
  * Вставляет маркированный список.
66
66
  */
67
- insertUnorderedList(instances?: ComponentInstance[]): this;
67
+ insertUnorderedList(instances?: ComponentInstance[]): import("rxjs").Observable<void>;
68
68
  /**
69
69
  * Выравнивает текст по левому краю.
70
70
  */
71
- justifyLeft(instances?: ComponentInstance[]): this;
71
+ justifyLeft(instances?: ComponentInstance[]): import("rxjs").Observable<void>;
72
72
  /**
73
73
  * Выравнивает текст по центру.
74
74
  */
75
- justifyCenter(instances?: ComponentInstance[]): this;
75
+ justifyCenter(instances?: ComponentInstance[]): import("rxjs").Observable<void>;
76
76
  /**
77
77
  * Выравнивает текст по правому краю.
78
78
  */
79
- justifyRight(instances?: ComponentInstance[]): this;
79
+ justifyRight(instances?: ComponentInstance[]): import("rxjs").Observable<void>;
80
80
  /**
81
81
  * Выравнивает текст по ширине.
82
82
  */
83
- justifyFull(instances?: ComponentInstance[]): this;
83
+ justifyFull(instances?: ComponentInstance[]): import("rxjs").Observable<void>;
84
84
  /**
85
85
  * Форматирует блок с указанным тегом.
86
86
  *
87
87
  * @param tag Тег HTML для форматирования блока.
88
88
  */
89
- formatBlock(tag: string, instances?: ComponentInstance[]): this;
89
+ formatBlock(tag: string, instances?: ComponentInstance[]): import("rxjs").Observable<void>;
90
90
  }
91
91
  export {};
@@ -55,209 +55,79 @@ class TextEditor extends input_component_1.InputComponent {
55
55
  */
56
56
  insertHTML(value, instances) {
57
57
  const payload = { value };
58
- if (instances) {
59
- instances
60
- .filter((instance) => instance.client)
61
- .forEach((instance) => {
62
- instance.client.outcomingMessage$.next(new text_editor_insert_html_message_1.TextEditorInsertHtmlMessage(instance.id, payload));
63
- });
64
- }
65
- else {
66
- this.broadcast(new text_editor_insert_html_message_1.TextEditorInsertHtmlMessage(this.id, payload));
67
- }
68
- return this;
58
+ return this.dispatchComponentCommand(instances, (target, actionScope) => new text_editor_insert_html_message_1.TextEditorInsertHtmlMessage(target, { ...payload, actionScope }));
69
59
  }
70
60
  /**
71
61
  * Переключает курсивное начертание текста.
72
62
  */
73
63
  toggleItalic(instances) {
74
- if (instances) {
75
- instances
76
- .filter((instance) => instance.client)
77
- .forEach((instance) => {
78
- instance.client.outcomingMessage$.next(new text_editor_toggle_italic_message_1.TextEditorToggleItalicMessage(instance.id));
79
- });
80
- }
81
- else {
82
- this.broadcast(new text_editor_toggle_italic_message_1.TextEditorToggleItalicMessage(this.id));
83
- }
84
- return this;
64
+ return this.dispatchComponentCommand(instances, (target, actionScope) => new text_editor_toggle_italic_message_1.TextEditorToggleItalicMessage(target, actionScope));
85
65
  }
86
66
  /**
87
67
  * Переключает полужирное начертание текста.
88
68
  */
89
69
  toggleBold(instances) {
90
- if (instances) {
91
- instances
92
- .filter((instance) => instance.client)
93
- .forEach((instance) => {
94
- instance.client.outcomingMessage$.next(new text_editor_toggle_bold_message_1.TextEditorToggleBoldMessage(instance.id));
95
- });
96
- }
97
- else {
98
- this.broadcast(new text_editor_toggle_bold_message_1.TextEditorToggleBoldMessage(this.id));
99
- }
100
- return this;
70
+ return this.dispatchComponentCommand(instances, (target, actionScope) => new text_editor_toggle_bold_message_1.TextEditorToggleBoldMessage(target, actionScope));
101
71
  }
102
72
  /**
103
73
  * Переключает подчеркивание текста.
104
74
  */
105
75
  toggleUnderline(instances) {
106
- if (instances) {
107
- instances
108
- .filter((instance) => instance.client)
109
- .forEach((instance) => {
110
- instance.client.outcomingMessage$.next(new text_editor_toggle_underline_message_1.TextEditorToggleUnderlineMessage(instance.id));
111
- });
112
- }
113
- else {
114
- this.broadcast(new text_editor_toggle_underline_message_1.TextEditorToggleUnderlineMessage(this.id));
115
- }
116
- return this;
76
+ return this.dispatchComponentCommand(instances, (target, actionScope) => new text_editor_toggle_underline_message_1.TextEditorToggleUnderlineMessage(target, actionScope));
117
77
  }
118
78
  /**
119
79
  * Выполняет операцию отмены последнего действия.
120
80
  */
121
81
  undo(instances) {
122
- if (instances) {
123
- instances
124
- .filter((instance) => instance.client)
125
- .forEach((instance) => {
126
- instance.client.outcomingMessage$.next(new text_editor_undo_message_1.TextEditorUndoMessage(instance.id));
127
- });
128
- }
129
- else {
130
- this.broadcast(new text_editor_undo_message_1.TextEditorUndoMessage(this.id));
131
- }
132
- return this;
82
+ return this.dispatchComponentCommand(instances, (target, actionScope) => new text_editor_undo_message_1.TextEditorUndoMessage(target, actionScope));
133
83
  }
134
84
  /**
135
85
  * Выполняет операцию повтора последнего отмененного действия.
136
86
  */
137
87
  redo(instances) {
138
- if (instances) {
139
- instances
140
- .filter((instance) => instance.client)
141
- .forEach((instance) => {
142
- instance.client.outcomingMessage$.next(new text_editor_redo_message_1.TextEditorRedoMessage(instance.id));
143
- });
144
- }
145
- else {
146
- this.broadcast(new text_editor_redo_message_1.TextEditorRedoMessage(this.id));
147
- }
148
- return this;
88
+ return this.dispatchComponentCommand(instances, (target, actionScope) => new text_editor_redo_message_1.TextEditorRedoMessage(target, actionScope));
149
89
  }
150
90
  /**
151
91
  * Применяет формат верхнего индекса к выделенному тексту.
152
92
  */
153
93
  superscript(instances) {
154
- if (instances) {
155
- instances
156
- .filter((instance) => instance.client)
157
- .forEach((instance) => {
158
- instance.client.outcomingMessage$.next(new text_editor_superscript_message_1.TextEditorSuperscriptMessage(instance.id));
159
- });
160
- }
161
- else {
162
- this.broadcast(new text_editor_superscript_message_1.TextEditorSuperscriptMessage(this.id));
163
- }
164
- return this;
94
+ return this.dispatchComponentCommand(instances, (target, actionScope) => new text_editor_superscript_message_1.TextEditorSuperscriptMessage(target, actionScope));
165
95
  }
166
96
  /**
167
97
  * Вставляет нумерованный список.
168
98
  */
169
99
  insertOrderedList(instances) {
170
- if (instances) {
171
- instances
172
- .filter((instance) => instance.client)
173
- .forEach((instance) => {
174
- instance.client.outcomingMessage$.next(new text_editor_insert_ordered_list_message_1.TextEditorInsertOrderedListMessage(instance.id));
175
- });
176
- }
177
- else {
178
- this.broadcast(new text_editor_insert_ordered_list_message_1.TextEditorInsertOrderedListMessage(this.id));
179
- }
180
- return this;
100
+ return this.dispatchComponentCommand(instances, (target, actionScope) => new text_editor_insert_ordered_list_message_1.TextEditorInsertOrderedListMessage(target, actionScope));
181
101
  }
182
102
  /**
183
103
  * Вставляет маркированный список.
184
104
  */
185
105
  insertUnorderedList(instances) {
186
- if (instances) {
187
- instances
188
- .filter((instance) => instance.client)
189
- .forEach((instance) => {
190
- instance.client.outcomingMessage$.next(new text_editor_insert_unordered_list_message_1.TextEditorInsertUnorderedListMessage(instance.id));
191
- });
192
- }
193
- else {
194
- this.broadcast(new text_editor_insert_unordered_list_message_1.TextEditorInsertUnorderedListMessage(this.id));
195
- }
196
- return this;
106
+ return this.dispatchComponentCommand(instances, (target, actionScope) => new text_editor_insert_unordered_list_message_1.TextEditorInsertUnorderedListMessage(target, actionScope));
197
107
  }
198
108
  /**
199
109
  * Выравнивает текст по левому краю.
200
110
  */
201
111
  justifyLeft(instances) {
202
- if (instances) {
203
- instances
204
- .filter((instance) => instance.client)
205
- .forEach((instance) => {
206
- instance.client.outcomingMessage$.next(new text_editor_justify_left_message_1.TextEditorJustifyLeftMessage(instance.id));
207
- });
208
- }
209
- else {
210
- this.broadcast(new text_editor_justify_left_message_1.TextEditorJustifyLeftMessage(this.id));
211
- }
212
- return this;
112
+ return this.dispatchComponentCommand(instances, (target, actionScope) => new text_editor_justify_left_message_1.TextEditorJustifyLeftMessage(target, actionScope));
213
113
  }
214
114
  /**
215
115
  * Выравнивает текст по центру.
216
116
  */
217
117
  justifyCenter(instances) {
218
- if (instances) {
219
- instances
220
- .filter((instance) => instance.client)
221
- .forEach((instance) => {
222
- instance.client.outcomingMessage$.next(new text_editor_justify_center_message_1.TextEditorJustifyCenterMessage(instance.id));
223
- });
224
- }
225
- else {
226
- this.broadcast(new text_editor_justify_center_message_1.TextEditorJustifyCenterMessage(this.id));
227
- }
228
- return this;
118
+ return this.dispatchComponentCommand(instances, (target, actionScope) => new text_editor_justify_center_message_1.TextEditorJustifyCenterMessage(target, actionScope));
229
119
  }
230
120
  /**
231
121
  * Выравнивает текст по правому краю.
232
122
  */
233
123
  justifyRight(instances) {
234
- if (instances) {
235
- instances
236
- .filter((instance) => instance.client)
237
- .forEach((instance) => {
238
- instance.client.outcomingMessage$.next(new text_editor_justify_right_message_1.TextEditorJustifyRightMessage(instance.id));
239
- });
240
- }
241
- else {
242
- this.broadcast(new text_editor_justify_right_message_1.TextEditorJustifyRightMessage(this.id));
243
- }
244
- return this;
124
+ return this.dispatchComponentCommand(instances, (target, actionScope) => new text_editor_justify_right_message_1.TextEditorJustifyRightMessage(target, actionScope));
245
125
  }
246
126
  /**
247
127
  * Выравнивает текст по ширине.
248
128
  */
249
129
  justifyFull(instances) {
250
- if (instances) {
251
- instances
252
- .filter((instance) => instance.client)
253
- .forEach((instance) => {
254
- instance.client.outcomingMessage$.next(new text_editor_justify_full_message_1.TextEditorJustifyFullMessage(instance.id));
255
- });
256
- }
257
- else {
258
- this.broadcast(new text_editor_justify_full_message_1.TextEditorJustifyFullMessage(this.id));
259
- }
260
- return this;
130
+ return this.dispatchComponentCommand(instances, (target, actionScope) => new text_editor_justify_full_message_1.TextEditorJustifyFullMessage(target, actionScope));
261
131
  }
262
132
  /**
263
133
  * Форматирует блок с указанным тегом.
@@ -266,17 +136,7 @@ class TextEditor extends input_component_1.InputComponent {
266
136
  */
267
137
  formatBlock(tag, instances) {
268
138
  const payload = { tag };
269
- if (instances) {
270
- instances
271
- .filter((instance) => instance.client)
272
- .forEach((instance) => {
273
- instance.client.outcomingMessage$.next(new text_editor_format_block_message_1.TextEditorFormatBlockMessage(instance.id, payload));
274
- });
275
- }
276
- else {
277
- this.broadcast(new text_editor_format_block_message_1.TextEditorFormatBlockMessage(this.id, payload));
278
- }
279
- return this;
139
+ return this.dispatchComponentCommand(instances, (target, actionScope) => new text_editor_format_block_message_1.TextEditorFormatBlockMessage(target, { ...payload, actionScope }));
280
140
  }
281
141
  }
282
142
  exports.TextEditor = TextEditor;
@@ -8,7 +8,6 @@ import { Componentable, ComponentInstance, ComponentTreeNode, StandaloneComponen
8
8
  import { Component, ComponentInitConfig, ComponentProperties, ServerComponentAction } from "./component";
9
9
  import type { ItemList } from "./item-list/item-list";
10
10
  import type { ItemListHost } from "./item-list/item-list-host";
11
- import { Overlay } from "./types/container-overlay";
12
11
  export declare const map: (config: MapInitConfig<Map>) => Map;
13
12
  export type MapMarker = {
14
13
  coordinates: {
@@ -31,7 +30,6 @@ export type MapProperties = {
31
30
  altitude?: number;
32
31
  };
33
32
  zoom: number;
34
- overlays?: Overlay[];
35
33
  flexItem?: FlexItemSpec;
36
34
  } & ComponentProperties;
37
35
  export type MapInitConfig<ComponentType extends Componentable = Map, PropertiesType extends MapProperties = MapProperties> = {
@@ -40,7 +38,6 @@ export type MapInitConfig<ComponentType extends Componentable = Map, PropertiesT
40
38
  longitude: number;
41
39
  altitude?: number;
42
40
  };
43
- overlays?: Overlay[];
44
41
  apiKey: string;
45
42
  zoom?: number;
46
43
  flexItem?: FlexItemSpec;
@@ -64,10 +61,10 @@ export declare class Map<InitConfigType extends MapInitConfig<any> = DefaultInit
64
61
  latitude: number;
65
62
  longitude: number;
66
63
  altitude?: number;
67
- }, instances?: ComponentInstance[]): void;
68
- setZoom(zoom: number, instances?: ComponentInstance[]): void;
69
- zoomIn(instances?: ComponentInstance[]): void;
70
- zoomOut(instances?: ComponentInstance[]): void;
64
+ }, instances?: ComponentInstance[]): import("rxjs").Observable<void>;
65
+ setZoom(zoom: number, instances?: ComponentInstance[]): import("rxjs").Observable<void>;
66
+ zoomIn(instances?: ComponentInstance[]): import("rxjs").Observable<void>;
67
+ zoomOut(instances?: ComponentInstance[]): import("rxjs").Observable<void>;
71
68
  constructor(config: InitConfigType);
72
69
  get hostInstances(): readonly ComponentInstance[];
73
70
  syncNestedItems(slot: string, items: NestedItemBase[]): void;
@@ -7,7 +7,6 @@ const map_set_zoom_message_1 = require("@matreshka/shared/messages/bff-to-client
7
7
  const map_zoom_in_message_1 = require("@matreshka/shared/messages/bff-to-client/components/map/map-zoom-in-message");
8
8
  const map_zoom_out_message_1 = require("@matreshka/shared/messages/bff-to-client/components/map/map-zoom-out-message");
9
9
  const flex_item_1 = require("@matreshka/shared/types/flex-item");
10
- const core_1 = require("../core");
11
10
  const component_1 = require("./component");
12
11
  const item_list_1 = require("./item-list");
13
12
  const flatten_nested_items_1 = require("./item-list/flatten-nested-items");
@@ -15,52 +14,16 @@ const map = (config) => new Map(config);
15
14
  exports.map = map;
16
15
  class Map extends component_1.Component {
17
16
  setCenter(center, instances) {
18
- if (instances) {
19
- instances
20
- .filter((instance) => instance.client)
21
- .forEach((instance) => {
22
- instance.client.outcomingMessage$.next(new map_set_center_message_1.MapSetCenterMessage(instance.id, center));
23
- });
24
- }
25
- else {
26
- this.broadcast(new map_set_center_message_1.MapSetCenterMessage(this.id, center));
27
- }
17
+ return this.dispatchComponentCommand(instances, (target, actionScope) => new map_set_center_message_1.MapSetCenterMessage(target, { ...center, actionScope }));
28
18
  }
29
19
  setZoom(zoom, instances) {
30
- if (instances) {
31
- instances
32
- .filter((instance) => instance.client)
33
- .forEach((instance) => {
34
- instance.client.outcomingMessage$.next(new map_set_zoom_message_1.MapSetZoomMessage(instance.id, zoom));
35
- });
36
- }
37
- else {
38
- this.broadcast(new map_set_zoom_message_1.MapSetZoomMessage(this.id, zoom));
39
- }
20
+ return this.dispatchComponentCommand(instances, (target, actionScope) => new map_set_zoom_message_1.MapSetZoomMessage(target, { zoom, actionScope }));
40
21
  }
41
22
  zoomIn(instances) {
42
- if (instances) {
43
- instances
44
- .filter((instance) => instance.client)
45
- .forEach((instance) => {
46
- instance.client.outcomingMessage$.next(new map_zoom_in_message_1.MapZoomInMessage(instance.id));
47
- });
48
- }
49
- else {
50
- this.broadcast(new map_zoom_in_message_1.MapZoomInMessage(this.id));
51
- }
23
+ return this.dispatchComponentCommand(instances, (target, actionScope) => new map_zoom_in_message_1.MapZoomInMessage(target, actionScope));
52
24
  }
53
25
  zoomOut(instances) {
54
- if (instances) {
55
- instances
56
- .filter((instance) => instance.client)
57
- .forEach((instance) => {
58
- instance.client.outcomingMessage$.next(new map_zoom_out_message_1.MapZoomOutMessage(instance.id));
59
- });
60
- }
61
- else {
62
- this.broadcast(new map_zoom_out_message_1.MapZoomOutMessage(this.id));
63
- }
26
+ return this.dispatchComponentCommand(instances, (target, actionScope) => new map_zoom_out_message_1.MapZoomOutMessage(target, actionScope));
64
27
  }
65
28
  constructor(config) {
66
29
  const markersSlot = (0, item_list_1.createNestedItemsSlotState)(config.markers);
@@ -105,15 +68,11 @@ class Map extends component_1.Component {
105
68
  apiKey: initValues.apiKey,
106
69
  center: initValues.center,
107
70
  zoom: initValues.zoom ?? 17,
108
- overlays: initValues.overlays,
109
71
  flexItem: (0, flex_item_1.normalizeFlexItem)(initValues.flexItem),
110
72
  };
111
73
  }
112
74
  serializeRuleOverrides(overrides) {
113
- const out = { ...overrides };
114
- if (overrides.overlays !== undefined) {
115
- out.overlays = (0, core_1.serializeOverlays)(overrides.overlays);
116
- }
75
+ const out = super.serializeRuleOverrides(overrides);
117
76
  if (overrides.markers !== undefined) {
118
77
  const instance = this.createInstance();
119
78
  out.markers = (0, flatten_nested_items_1.flattenNestedItems)(overrides.markers, instance);
@@ -128,16 +87,11 @@ class Map extends component_1.Component {
128
87
  instance = this.createInstance();
129
88
  }
130
89
  const result = super.serialize(instance);
131
- const p = this.properties;
132
90
  const markers = (0, item_list_1.flattenNestedItemsForSerialize)(this.markersSlot, instance);
133
91
  return {
134
92
  ...result,
135
93
  class: server_component_class_1.ServerComponentClass.Map,
136
- properties: {
137
- ...p,
138
- overlays: p.overlays ? (0, core_1.serializeOverlays)(p.overlays) : [],
139
- markers,
140
- },
94
+ properties: this.buildPropertiesForClient({ markers }),
141
95
  };
142
96
  }
143
97
  }
@@ -16,7 +16,6 @@ import { Overlay } from "./types/container-overlay";
16
16
  export type PageProperties = {
17
17
  content: ComponentTreeNode[];
18
18
  title: string;
19
- overlays?: Overlay[];
20
19
  statusCode: StatusCode;
21
20
  } & EntryComponentProperties;
22
21
  /**
@@ -98,26 +98,20 @@ class Page extends entry_component_1.EntryComponent {
98
98
  return server_component_class_1.ServerComponentClass.Page;
99
99
  }
100
100
  serializeRuleOverrides(overrides) {
101
- const out = { ...overrides };
101
+ const out = super.serializeRuleOverrides(overrides);
102
102
  if (overrides.content !== undefined) {
103
103
  out.content = (0, serialize_component_tree_1.serializeComponentList)(overrides.content);
104
104
  }
105
- if (overrides.overlays !== undefined) {
106
- out.overlays = (0, serialize_component_tree_1.serializeOverlays)(overrides.overlays);
107
- }
108
105
  return out;
109
106
  }
110
107
  serializeEntry(instance) {
111
108
  const result = super.serializeEntry(instance);
112
- const p = this.properties;
113
109
  return {
114
110
  ...result,
115
111
  class: server_component_class_1.ServerComponentClass.Page,
116
- properties: {
117
- ...p,
118
- content: (0, serialize_component_tree_1.serializeComponentList)(p.content),
119
- overlays: p.overlays ? (0, serialize_component_tree_1.serializeOverlays)(p.overlays) : [],
120
- },
112
+ properties: this.buildPropertiesForClient({
113
+ content: (0, serialize_component_tree_1.serializeComponentList)(this.properties.content),
114
+ }),
121
115
  };
122
116
  }
123
117
  serialize(instance) {
@@ -3,12 +3,10 @@ import type { PopoverConfig } from "@matreshka/shared/types/popover-config";
3
3
  import { Componentable, ComponentInstance, ComponentTreeNode, MixedWithCallbacksArray } from "../core";
4
4
  import { EntryComponent, EntryComponentInitConfig, EntryComponentProperties } from "./entry-component";
5
5
  import { PopoverPositionArea } from "./enum/popover-position-area";
6
- import { Overlay } from "./types/container-overlay";
7
6
  export type PopoverProperties = {
8
7
  content: ComponentTreeNode[];
9
8
  positionArea?: PopoverPositionArea;
10
9
  size?: number;
11
- overlays?: Overlay[];
12
10
  } & EntryComponentProperties;
13
11
  /**
14
12
  * Конфигурация инициализации для компонента Popover.
@@ -25,7 +23,6 @@ export type PopoverInitConfig<ComponentType extends Componentable = Popover, Pro
25
23
  * передается клиенту как отношение к ширине якоря.
26
24
  */
27
25
  size?: number;
28
- overlays?: Overlay[];
29
26
  } & EntryComponentInitConfig<ComponentType, PropertiesType>;
30
27
  type DefaultInitConfigType = PopoverInitConfig<Popover>;
31
28
  type PopoverContent = DefaultInitConfigType["content"];
@@ -48,7 +45,7 @@ export declare class Popover<InitConfigType extends PopoverInitConfig<any> = Def
48
45
  /**
49
46
  * Закрывает всплывающее окно, инициируя действие "close".
50
47
  */
51
- close(instances?: ComponentInstance[]): void;
48
+ close(instances?: ComponentInstance[]): import("rxjs").Observable<void>;
52
49
  /**
53
50
  * Инициализирует свойства компонента.
54
51
  *
@@ -40,16 +40,7 @@ class Popover extends entry_component_1.EntryComponent {
40
40
  * Закрывает всплывающее окно, инициируя действие "close".
41
41
  */
42
42
  close(instances) {
43
- if (instances) {
44
- instances
45
- .filter((instance) => instance.client)
46
- .forEach((instance) => {
47
- instance.client.outcomingMessage$.next(new popover_close_message_1.PopoverCloseMessage(instance.id));
48
- });
49
- }
50
- else {
51
- this.broadcast(new popover_close_message_1.PopoverCloseMessage(this.id));
52
- }
43
+ return this.dispatchComponentCommand(instances, (target, actionScope) => new popover_close_message_1.PopoverCloseMessage(target, actionScope));
53
44
  }
54
45
  /**
55
46
  * Инициализирует свойства компонента.
@@ -63,30 +54,23 @@ class Popover extends entry_component_1.EntryComponent {
63
54
  content: (0, core_1.calculateComponents)(initValues.content),
64
55
  positionArea: initValues.positionArea,
65
56
  size: initValues.size,
66
- overlays: initValues.overlays,
67
57
  };
68
58
  }
69
59
  serializeRuleOverrides(overrides) {
70
- const out = { ...overrides };
60
+ const out = super.serializeRuleOverrides(overrides);
71
61
  if (overrides.content !== undefined) {
72
62
  out.content = (0, core_1.serializeComponentList)(overrides.content);
73
63
  }
74
- if (overrides.overlays !== undefined) {
75
- out.overlays = (0, core_1.serializeOverlays)(overrides.overlays);
76
- }
77
64
  return out;
78
65
  }
79
66
  serializeEntry(instance) {
80
67
  const result = super.serializeEntry(instance);
81
- const p = this.properties;
82
68
  return {
83
69
  ...result,
84
70
  class: server_component_class_1.ServerComponentClass.Popover,
85
- properties: {
86
- ...p,
87
- content: (0, core_1.serializeComponentList)(p.content),
88
- overlays: p.overlays ? (0, core_1.serializeOverlays)(p.overlays) : [],
89
- },
71
+ properties: this.buildPropertiesForClient({
72
+ content: (0, core_1.serializeComponentList)(this.properties.content),
73
+ }),
90
74
  };
91
75
  }
92
76
  serialize(instance) {
@@ -10,11 +10,10 @@ import type { ComponentScrollPayload } from "@matreshka/shared/messages/client-t
10
10
  import { type FlexItemSpec } from "@matreshka/shared/types/flex-item";
11
11
  import type { PaddingPx } from "@matreshka/shared/types/padding-px";
12
12
  import type { RadiusPx } from "@matreshka/shared/types/radius-px";
13
- import type { StackScroll } from "@matreshka/shared/types/stack-scroll";
14
13
  import type { StackConfig } from "@matreshka/shared/types/stack-config";
14
+ import type { StackScroll } from "@matreshka/shared/types/stack-scroll";
15
15
  import { Componentable, ComponentInstance, ComponentTreeNode, MixedWithCallbacksArray, StandaloneComponent } from "../core";
16
16
  import { Component, ComponentInitConfig, ComponentProperties, ServerComponentAction } from "./component";
17
- import { Overlay } from "./types/container-overlay";
18
17
  export { DimensionalUnit } from "@matreshka/shared/enums/dimensional-unit";
19
18
  export { FlexWrap } from "@matreshka/shared/enums/flex-wrap";
20
19
  export { Overflow } from "@matreshka/shared/enums/overflow";
@@ -58,7 +57,6 @@ export type StackProperties = {
58
57
  */
59
58
  scroll?: StackScroll;
60
59
  safeArea?: SafeAreaSide[];
61
- overlays?: Overlay[];
62
60
  surface?: boolean;
63
61
  outline?: ComponentOutline[];
64
62
  focusWithinStyle?: boolean;
@@ -123,7 +121,6 @@ export type StackInitConfig<ComponentType extends Componentable = Stack, Propert
123
121
  padding?: PaddingPx;
124
122
  scroll?: StackScroll;
125
123
  safeArea?: SafeAreaSide[];
126
- overlays?: Overlay[];
127
124
  surface?: boolean;
128
125
  outline?: ComponentOutline[];
129
126
  focusWithinStyle?: boolean;
@@ -166,7 +163,7 @@ export declare class Stack<InitConfigType extends StackInitConfig<any> = Default
166
163
  * - {@link ScrollToPosition.End} — в конец;
167
164
  * - иное отрицательное `value` — отступ от конца (например `-16`).
168
165
  */
169
- scrollTo(value: number | ScrollToPosition, smooth?: boolean, instances?: ComponentInstance[]): this;
166
+ scrollTo(value: number | ScrollToPosition, smooth?: boolean, instances?: ComponentInstance[]): import("rxjs").Observable<void>;
170
167
  protected serializeRuleOverrides(overrides: Partial<PropertiesType>): Record<string, unknown>;
171
168
  serialize(instance?: ComponentInstance<this>): StackConfig;
172
169
  }