@matreshka/bff 0.17.0 → 0.19.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 (47) hide show
  1. package/dist/components/board.d.ts +0 -3
  2. package/dist/components/board.js +3 -11
  3. package/dist/components/camera.d.ts +0 -3
  4. package/dist/components/camera.js +4 -11
  5. package/dist/components/component.d.ts +17 -1
  6. package/dist/components/component.js +19 -2
  7. package/dist/components/container.js +8 -11
  8. package/dist/components/dialog.d.ts +0 -3
  9. package/dist/components/dialog.js +4 -11
  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/map.d.ts +0 -3
  14. package/dist/components/map.js +2 -12
  15. package/dist/components/page.d.ts +0 -1
  16. package/dist/components/page.js +4 -10
  17. package/dist/components/popover.d.ts +0 -3
  18. package/dist/components/popover.js +4 -11
  19. package/dist/components/stack.d.ts +1 -4
  20. package/dist/components/stack.js +4 -11
  21. package/dist/core/utils/serialize-component-tree.d.ts +3 -0
  22. package/dist/core/utils/serialize-component-tree.js +21 -0
  23. package/dist/platforms/browser-platform.d.ts +21 -37
  24. package/dist/platforms/browser-platform.js +61 -104
  25. package/dist/platforms/max-mini-app-platform.d.ts +2 -8
  26. package/dist/platforms/max-mini-app-platform.js +10 -21
  27. package/dist/platforms/mobile-platform.d.ts +32 -58
  28. package/dist/platforms/mobile-platform.js +139 -211
  29. package/dist/platforms/platform.d.ts +32 -49
  30. package/dist/platforms/platform.js +77 -87
  31. package/dist/platforms/telegram-mini-app-platform.d.ts +16 -34
  32. package/dist/platforms/telegram-mini-app-platform.js +41 -92
  33. package/dist/platforms/utils/client-back-platform-action.d.ts +9 -0
  34. package/dist/platforms/utils/client-back-platform-action.js +48 -0
  35. package/dist/platforms/utils/client-navigate-platform-action.d.ts +19 -0
  36. package/dist/platforms/utils/client-navigate-platform-action.js +60 -0
  37. package/dist/platforms/utils/client-reload-platform-action.d.ts +8 -0
  38. package/dist/platforms/utils/client-reload-platform-action.js +41 -0
  39. package/dist/platforms/utils/client-route-page-wait.d.ts +11 -0
  40. package/dist/platforms/utils/client-route-page-wait.js +33 -0
  41. package/dist/platforms/utils/match-navigate-path.d.ts +11 -0
  42. package/dist/platforms/utils/match-navigate-path.js +95 -0
  43. package/dist/platforms/utils/targeted-client-platform-action.d.ts +11 -0
  44. package/dist/platforms/utils/targeted-client-platform-action.js +80 -0
  45. package/dist/platforms/utils/targeted-client-platform-stream.d.ts +17 -0
  46. package/dist/platforms/utils/targeted-client-platform-stream.js +90 -0
  47. package/package.json +2 -2
@@ -6,7 +6,6 @@ import { Componentable, ComponentInstance, ComponentTreeNode, StandaloneComponen
6
6
  import { Component, ComponentInitConfig, ComponentProperties, ServerComponentAction } from "./component";
7
7
  import type { ItemList } from "./item-list/item-list";
8
8
  import type { ItemListHost } from "./item-list/item-list-host";
9
- import { Overlay } from "./types/container-overlay";
10
9
  export declare const board: (config: BoardInitConfig<Board>) => Board;
11
10
  export type BoardItem = {
12
11
  position: BoardPoint;
@@ -19,12 +18,10 @@ export type BoardProperties = {
19
18
  minZoom: number;
20
19
  maxZoom: number;
21
20
  zoomStep: number;
22
- overlays?: Overlay[];
23
21
  flexItem?: FlexItemSpec;
24
22
  } & ComponentProperties;
25
23
  export type BoardInitConfig<ComponentType extends Componentable = Board, PropertiesType extends BoardProperties = BoardProperties> = {
26
24
  center?: BoardPoint;
27
- overlays?: Overlay[];
28
25
  zoom?: number;
29
26
  minZoom?: number;
30
27
  maxZoom?: number;
@@ -7,7 +7,6 @@ const board_set_zoom_message_1 = require("@matreshka/shared/messages/bff-to-clie
7
7
  const board_zoom_in_message_1 = require("@matreshka/shared/messages/bff-to-client/components/board/board-zoom-in-message");
8
8
  const board_zoom_out_message_1 = require("@matreshka/shared/messages/bff-to-client/components/board/board-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");
@@ -111,15 +110,11 @@ class Board extends component_1.Component {
111
110
  minZoom: initValues.minZoom ?? DEFAULT_MIN_ZOOM,
112
111
  maxZoom: initValues.maxZoom ?? DEFAULT_MAX_ZOOM,
113
112
  zoomStep: initValues.zoomStep ?? DEFAULT_ZOOM_STEP,
114
- overlays: initValues.overlays,
115
113
  flexItem: (0, flex_item_1.normalizeFlexItem)(initValues.flexItem),
116
114
  };
117
115
  }
118
116
  serializeRuleOverrides(overrides) {
119
- const out = { ...overrides };
120
- if (overrides.overlays !== undefined) {
121
- out.overlays = (0, core_1.serializeOverlays)(overrides.overlays);
122
- }
117
+ const out = super.serializeRuleOverrides(overrides);
123
118
  if (overrides.items !== undefined) {
124
119
  const instance = this.createInstance();
125
120
  out.items = (0, flatten_nested_items_1.flattenNestedItems)(overrides.items, instance);
@@ -134,16 +129,13 @@ class Board extends component_1.Component {
134
129
  instance = this.createInstance();
135
130
  }
136
131
  const result = super.serialize(instance);
137
- const p = this.properties;
138
132
  const items = (0, item_list_1.flattenNestedItemsForSerialize)(this.itemsSlot, instance);
139
133
  return {
140
134
  ...result,
141
135
  class: server_component_class_1.ServerComponentClass.Board,
142
- properties: {
143
- ...p,
144
- overlays: p.overlays ? (0, core_1.serializeOverlays)(p.overlays) : [],
136
+ properties: this.buildPropertiesForClient({
145
137
  items: items ?? [],
146
- },
138
+ }),
147
139
  };
148
140
  }
149
141
  }
@@ -5,11 +5,9 @@ import type { CameraConfig } from "@matreshka/shared/types/camera-config";
5
5
  import { Componentable, ComponentInstance, ComponentTreeNode, MixedWithCallbacksArray, StandaloneComponent } from "../core";
6
6
  import { VideoInputDevice } from "../platforms/platform";
7
7
  import { Component, ComponentInitConfig, ComponentProperties, ServerComponentAction } from "./component";
8
- import { Overlay } from "./types/container-overlay";
9
8
  export { VideoFacingMode } from "@matreshka/shared/enums/video-facing-mode";
10
9
  export type CameraProperties = {
11
10
  content: ComponentTreeNode[];
12
- overlays?: Overlay[];
13
11
  facingMode?: VideoFacingMode;
14
12
  } & ComponentProperties;
15
13
  /**
@@ -26,7 +24,6 @@ export type CameraInitConfig<ContentType extends ComponentTreeNode = ComponentTr
26
24
  * Полезно для кейсов вроде сканирования QR (обычно нужна задняя камера: `"environment"`).
27
25
  */
28
26
  facingMode?: VideoFacingMode;
29
- overlays?: Overlay[];
30
27
  content: MixedWithCallbacksArray<ContentType>;
31
28
  /**
32
29
  * Обработчики события распознавания QR-кода на клиенте.
@@ -65,7 +65,6 @@ class Camera extends component_1.Component {
65
65
  return {
66
66
  ...super.initProperties(initValues),
67
67
  content: (0, core_1.calculateComponents)(initValues.content),
68
- overlays: initValues.overlays,
69
68
  facingMode: initValues.facingMode,
70
69
  };
71
70
  }
@@ -90,26 +89,20 @@ class Camera extends component_1.Component {
90
89
  return this;
91
90
  }
92
91
  serializeRuleOverrides(overrides) {
93
- const out = { ...overrides };
92
+ const out = super.serializeRuleOverrides(overrides);
94
93
  if (overrides.content !== undefined) {
95
94
  out.content = (0, core_1.serializeComponentList)(overrides.content);
96
95
  }
97
- if (overrides.overlays !== undefined) {
98
- out.overlays = (0, core_1.serializeOverlays)(overrides.overlays);
99
- }
100
96
  return out;
101
97
  }
102
98
  serialize() {
103
99
  const result = super.serialize();
104
- const p = this.properties;
105
100
  return {
106
101
  ...result,
107
102
  class: server_component_class_1.ServerComponentClass.Camera,
108
- properties: {
109
- ...p,
110
- content: (0, core_1.serializeComponentList)(p.content),
111
- overlays: p.overlays ? (0, core_1.serializeOverlays)(p.overlays) : undefined,
112
- },
103
+ properties: this.buildPropertiesForClient({
104
+ content: (0, core_1.serializeComponentList)(this.properties.content),
105
+ }),
113
106
  };
114
107
  }
115
108
  }
@@ -4,6 +4,7 @@ import { TextAlign } from "@matreshka/shared/enums/text-align";
4
4
  import { TextDecoration } from "@matreshka/shared/enums/text-decoration";
5
5
  import { ComponentCommandMessage } from "@matreshka/shared/messages/bff-to-client/component-command-message";
6
6
  import { ColorToken } from "@matreshka/shared/types/color-token";
7
+ import type { Overlay as ClientOverlayShape } from "@matreshka/shared/types/container-overlay";
7
8
  import type { FontStackToken } from "@matreshka/shared/types/fonts";
8
9
  import type { GridItem } from "@matreshka/shared/types/grid-item";
9
10
  import type { ServerComponentConfig } from "@matreshka/shared/types/server-component-config";
@@ -12,6 +13,7 @@ import { Client, Componentable, ComponentInstance, LocalAction } from "../core";
12
13
  import { Condition } from "../core/conditions";
13
14
  import { ServerAction, ServerActionHandler } from "./actions/server-action";
14
15
  import type { EntryComponent } from "./entry-component";
16
+ import type { Overlay } from "./types/container-overlay";
15
17
  /**
16
18
  * @prop colors - Цветовые схемы для раскраски
17
19
  * @prop font - Stack token для сборки CSS-свойств шрифта
@@ -33,6 +35,14 @@ export type ComponentProperties = {
33
35
  link?: {
34
36
  value: string;
35
37
  };
38
+ /** Наложения поверх компонента (якоря + вложенный component). */
39
+ overlays?: Overlay[];
40
+ };
41
+ /** Оверлей в wire-конфиге (вложенный component уже сериализован). */
42
+ export type ClientSerializedOverlay = ClientOverlayShape<ServerComponentConfig>;
43
+ /** BFF-свойства компонента, подготовленные для клиента (overlays сериализованы). */
44
+ export type ClientSerializedProperties<P extends ComponentProperties> = Omit<P, "overlays"> & {
45
+ overlays?: ClientSerializedOverlay[];
36
46
  };
37
47
  /**
38
48
  * Переопределения в {@link ComponentInitConfig.rules}: те же поля, что у свойств
@@ -72,6 +82,8 @@ export type ComponentInitConfig<ComponentType extends Componentable, PropertiesT
72
82
  textDecoration?: TextDecoration;
73
83
  /** Настройки размещения элемента, когда он находится внутри grid. */
74
84
  gridItem?: GridItem;
85
+ /** Наложения поверх компонента. */
86
+ overlays?: Overlay[];
75
87
  conditions?: Condition[] | (() => Condition[]);
76
88
  rules?: {
77
89
  conditions: [Condition, ...Condition[]];
@@ -134,7 +146,11 @@ export declare abstract class Component<InitConfigType extends ComponentInitConf
134
146
  protected onInteraction<PayloadType>(type: string, callback: ServerComponentAction<Componentable, PayloadType>): this;
135
147
  protected usingByClient(client: Client): boolean;
136
148
  protected usingByEntry(entry: EntryComponent): boolean;
137
- protected serializeRuleOverrides(overrides: Record<string, unknown>): Record<string, unknown>;
149
+ protected serializeRuleOverrides(overrides: Partial<PropertiesType>): Record<string, unknown>;
150
+ /** Свойства для клиента: сериализует overlays и убирает сырые деревья component. */
151
+ protected serializePropertiesForClient(properties: PropertiesType): ClientSerializedProperties<PropertiesType>;
152
+ /** {@link serializePropertiesForClient} + поля, которые сериализуются только в override (content, markers, …). */
153
+ protected buildPropertiesForClient<T extends Record<string, unknown>>(extra?: T): ClientSerializedProperties<PropertiesType> & T;
138
154
  protected resolveRuleOverridesForClient(overrides: ComponentRuleOverrides<PropertiesType>): Partial<PropertiesType>;
139
155
  /** Проверяет, содержит ли компонент хотя бы один серверный обработчик. В этом случае нужно подписываться на входящие сообщения от клиента */
140
156
  private hasServerAction;
@@ -40,6 +40,7 @@ const crypto = __importStar(require("node:crypto"));
40
40
  const rxjs_1 = require("rxjs");
41
41
  const core_1 = require("../core");
42
42
  const incoming_message_observer_1 = require("../core/utils/incoming-message-observer");
43
+ const serialize_component_tree_1 = require("../core/utils/serialize-component-tree");
43
44
  const track_created_instances_1 = require("../core/utils/track-created-instances");
44
45
  const server_action_1 = require("./actions/server-action");
45
46
  /**
@@ -98,6 +99,7 @@ class Component {
98
99
  textDecoration: initValues.textDecoration,
99
100
  gridItem: initValues.gridItem,
100
101
  link: initValues.link,
102
+ overlays: initValues.overlays,
101
103
  colors,
102
104
  };
103
105
  }
@@ -181,7 +183,22 @@ class Component {
181
183
  this.instances.some((x) => x.entry?.component === entry));
182
184
  }
183
185
  serializeRuleOverrides(overrides) {
184
- return overrides;
186
+ const out = { ...overrides };
187
+ (0, serialize_component_tree_1.assignSerializedOverlays)(out, overrides.overlays);
188
+ return out;
189
+ }
190
+ /** Свойства для клиента: сериализует overlays и убирает сырые деревья component. */
191
+ serializePropertiesForClient(properties) {
192
+ const out = { ...properties };
193
+ (0, serialize_component_tree_1.assignSerializedOverlays)(out, properties.overlays);
194
+ return out;
195
+ }
196
+ /** {@link serializePropertiesForClient} + поля, которые сериализуются только в override (content, markers, …). */
197
+ buildPropertiesForClient(extra = {}) {
198
+ return {
199
+ ...this.serializePropertiesForClient(this.properties),
200
+ ...extra,
201
+ };
185
202
  }
186
203
  resolveRuleOverridesForClient(overrides) {
187
204
  if (overrides.colors === undefined) {
@@ -300,7 +317,7 @@ class Component {
300
317
  result.interactions = interactions;
301
318
  }
302
319
  if (hasProperties) {
303
- result.properties = properties;
320
+ result.properties = this.serializePropertiesForClient(properties);
304
321
  }
305
322
  if (hasRules) {
306
323
  result.rules = rules.map((rule) => ({
@@ -57,23 +57,20 @@ class Container extends component_1.Component {
57
57
  };
58
58
  }
59
59
  serializeRuleOverrides(overrides) {
60
- return {
61
- ...overrides,
62
- content: overrides.content
63
- ? (0, core_1.serializeComponentList)(overrides.content)
64
- : undefined,
65
- };
60
+ const out = super.serializeRuleOverrides(overrides);
61
+ if (overrides.content !== undefined) {
62
+ out.content = (0, core_1.serializeComponentList)(overrides.content);
63
+ }
64
+ return out;
66
65
  }
67
66
  serialize() {
68
67
  const result = super.serialize();
69
- const p = this.properties;
70
68
  return {
71
69
  ...result,
72
70
  class: server_component_class_1.ServerComponentClass.Container,
73
- properties: {
74
- ...p,
75
- content: (0, core_1.serializeComponentList)(p.content),
76
- },
71
+ properties: this.buildPropertiesForClient({
72
+ content: (0, core_1.serializeComponentList)(this.properties.content),
73
+ }),
77
74
  };
78
75
  }
79
76
  }
@@ -5,7 +5,6 @@ import type { DialogConfig } from "@matreshka/shared/types/dialog-config";
5
5
  import { Componentable, ComponentInstance, ComponentTreeNode, MixedWithCallbacksArray } from "../core";
6
6
  import type { AnimateComponent } from "../core/actions/animate-component";
7
7
  import { EntryComponent, EntryComponentInitConfig, EntryComponentProperties } from "./entry-component";
8
- import { Overlay } from "./types/container-overlay";
9
8
  /** Анимации подложки модального диалога при инициализации. */
10
9
  export type DialogBackdropInitConfig = {
11
10
  onEnter?: AnimateComponent | AnimateComponent[];
@@ -24,7 +23,6 @@ export type DialogProperties = {
24
23
  * См. {@link DialogInitConfig.modal}.
25
24
  */
26
25
  modal?: boolean;
27
- overlays?: Overlay[];
28
26
  /** Анимации нативной подложки (`::backdrop`) модального диалога. */
29
27
  backdrop?: DialogBackdropConfig;
30
28
  } & EntryComponentProperties;
@@ -44,7 +42,6 @@ export type DialogInitConfig<ComponentType extends Componentable = Dialog, Prope
44
42
  * `false` — немодальное (`show()`): остальная страница остаётся доступной
45
43
  */
46
44
  modal?: boolean;
47
- overlays?: Overlay[];
48
45
  /** Анимации нативной подложки (`::backdrop`) модального диалога. */
49
46
  backdrop?: DialogBackdropInitConfig;
50
47
  } & EntryComponentInitConfig<ComponentType, PropertiesType>;
@@ -71,7 +71,6 @@ class Dialog extends entry_component_1.EntryComponent {
71
71
  content: (0, core_1.calculateComponents)(initValues.content),
72
72
  anchors: initValues.anchors,
73
73
  modal: initValues.modal,
74
- overlays: initValues.overlays,
75
74
  backdrop: serializeDialogBackdrop(initValues.backdrop),
76
75
  };
77
76
  }
@@ -91,26 +90,20 @@ class Dialog extends entry_component_1.EntryComponent {
91
90
  }
92
91
  }
93
92
  serializeRuleOverrides(overrides) {
94
- const out = { ...overrides };
93
+ const out = super.serializeRuleOverrides(overrides);
95
94
  if (overrides.content !== undefined) {
96
95
  out.content = (0, core_1.serializeComponentList)(overrides.content);
97
96
  }
98
- if (overrides.overlays !== undefined) {
99
- out.overlays = (0, core_1.serializeOverlays)(overrides.overlays);
100
- }
101
97
  return out;
102
98
  }
103
99
  serializeEntry(instance) {
104
100
  const result = super.serializeEntry(instance);
105
- const p = this.properties;
106
101
  return {
107
102
  ...result,
108
103
  class: server_component_class_1.ServerComponentClass.Dialog,
109
- properties: {
110
- ...p,
111
- content: (0, core_1.serializeComponentList)(p.content),
112
- overlays: p.overlays ? (0, core_1.serializeOverlays)(p.overlays) : [],
113
- },
104
+ properties: this.buildPropertiesForClient({
105
+ content: (0, core_1.serializeComponentList)(this.properties.content),
106
+ }),
114
107
  };
115
108
  }
116
109
  serialize(instance) {
@@ -115,23 +115,20 @@ class FileUploadArea extends component_1.Component {
115
115
  };
116
116
  }
117
117
  serializeRuleOverrides(overrides) {
118
- return {
119
- ...overrides,
120
- content: overrides.content
121
- ? (0, core_1.serializeComponentList)(overrides.content)
122
- : undefined,
123
- };
118
+ const out = super.serializeRuleOverrides(overrides);
119
+ if (overrides.content !== undefined) {
120
+ out.content = (0, core_1.serializeComponentList)(overrides.content);
121
+ }
122
+ return out;
124
123
  }
125
124
  serialize() {
126
125
  const result = super.serialize();
127
- const p = this.properties;
128
126
  return {
129
127
  ...result,
130
128
  class: server_component_class_1.ServerComponentClass.FileUploadArea,
131
- properties: {
132
- ...p,
133
- content: (0, core_1.serializeComponentList)(p.content),
134
- },
129
+ properties: this.buildPropertiesForClient({
130
+ content: (0, core_1.serializeComponentList)(this.properties.content),
131
+ }),
135
132
  };
136
133
  }
137
134
  }
@@ -69,23 +69,20 @@ class Form extends component_1.Component {
69
69
  };
70
70
  }
71
71
  serializeRuleOverrides(overrides) {
72
- return {
73
- ...overrides,
74
- content: overrides.content
75
- ? (0, core_1.serializeComponentList)(overrides.content)
76
- : undefined,
77
- };
72
+ const out = super.serializeRuleOverrides(overrides);
73
+ if (overrides.content !== undefined) {
74
+ out.content = (0, core_1.serializeComponentList)(overrides.content);
75
+ }
76
+ return out;
78
77
  }
79
78
  serialize() {
80
79
  const result = super.serialize();
81
- const p = this.properties;
82
80
  return {
83
81
  ...result,
84
82
  class: server_component_class_1.ServerComponentClass.Form,
85
- properties: {
86
- ...p,
87
- content: (0, core_1.serializeComponentList)(p.content),
88
- },
83
+ properties: this.buildPropertiesForClient({
84
+ content: (0, core_1.serializeComponentList)(this.properties.content),
85
+ }),
89
86
  };
90
87
  }
91
88
  }
@@ -52,12 +52,10 @@ class Grid extends component_1.Component {
52
52
  };
53
53
  }
54
54
  serializeRuleOverrides(overrides) {
55
- const out = {
56
- ...overrides,
57
- content: overrides.content
58
- ? (0, core_1.serializeComponentList)(overrides.content)
59
- : undefined,
60
- };
55
+ const out = super.serializeRuleOverrides(overrides);
56
+ if (overrides.content !== undefined) {
57
+ out.content = (0, core_1.serializeComponentList)(overrides.content);
58
+ }
61
59
  if (overrides.flexItem !== undefined) {
62
60
  out.flexItem = (0, flex_item_1.normalizeFlexItem)(overrides.flexItem);
63
61
  }
@@ -65,14 +63,12 @@ class Grid extends component_1.Component {
65
63
  }
66
64
  serialize() {
67
65
  const result = super.serialize();
68
- const p = this.properties;
69
66
  return {
70
67
  ...result,
71
68
  class: server_component_class_1.ServerComponentClass.Grid,
72
- properties: {
73
- ...p,
74
- content: (0, core_1.serializeComponentList)(p.content),
75
- },
69
+ properties: this.buildPropertiesForClient({
70
+ content: (0, core_1.serializeComponentList)(this.properties.content),
71
+ }),
76
72
  };
77
73
  }
78
74
  }
@@ -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;
@@ -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");
@@ -105,15 +104,11 @@ class Map extends component_1.Component {
105
104
  apiKey: initValues.apiKey,
106
105
  center: initValues.center,
107
106
  zoom: initValues.zoom ?? 17,
108
- overlays: initValues.overlays,
109
107
  flexItem: (0, flex_item_1.normalizeFlexItem)(initValues.flexItem),
110
108
  };
111
109
  }
112
110
  serializeRuleOverrides(overrides) {
113
- const out = { ...overrides };
114
- if (overrides.overlays !== undefined) {
115
- out.overlays = (0, core_1.serializeOverlays)(overrides.overlays);
116
- }
111
+ const out = super.serializeRuleOverrides(overrides);
117
112
  if (overrides.markers !== undefined) {
118
113
  const instance = this.createInstance();
119
114
  out.markers = (0, flatten_nested_items_1.flattenNestedItems)(overrides.markers, instance);
@@ -128,16 +123,11 @@ class Map extends component_1.Component {
128
123
  instance = this.createInstance();
129
124
  }
130
125
  const result = super.serialize(instance);
131
- const p = this.properties;
132
126
  const markers = (0, item_list_1.flattenNestedItemsForSerialize)(this.markersSlot, instance);
133
127
  return {
134
128
  ...result,
135
129
  class: server_component_class_1.ServerComponentClass.Map,
136
- properties: {
137
- ...p,
138
- overlays: p.overlays ? (0, core_1.serializeOverlays)(p.overlays) : [],
139
- markers,
140
- },
130
+ properties: this.buildPropertiesForClient({ markers }),
141
131
  };
142
132
  }
143
133
  }
@@ -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"];
@@ -63,30 +63,23 @@ class Popover extends entry_component_1.EntryComponent {
63
63
  content: (0, core_1.calculateComponents)(initValues.content),
64
64
  positionArea: initValues.positionArea,
65
65
  size: initValues.size,
66
- overlays: initValues.overlays,
67
66
  };
68
67
  }
69
68
  serializeRuleOverrides(overrides) {
70
- const out = { ...overrides };
69
+ const out = super.serializeRuleOverrides(overrides);
71
70
  if (overrides.content !== undefined) {
72
71
  out.content = (0, core_1.serializeComponentList)(overrides.content);
73
72
  }
74
- if (overrides.overlays !== undefined) {
75
- out.overlays = (0, core_1.serializeOverlays)(overrides.overlays);
76
- }
77
73
  return out;
78
74
  }
79
75
  serializeEntry(instance) {
80
76
  const result = super.serializeEntry(instance);
81
- const p = this.properties;
82
77
  return {
83
78
  ...result,
84
79
  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
- },
80
+ properties: this.buildPropertiesForClient({
81
+ content: (0, core_1.serializeComponentList)(this.properties.content),
82
+ }),
90
83
  };
91
84
  }
92
85
  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;