@matreshka/bff 0.21.0 → 0.22.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 (44) hide show
  1. package/dist/components/board.d.ts +7 -0
  2. package/dist/components/board.js +7 -0
  3. package/dist/components/camera.d.ts +4 -0
  4. package/dist/components/camera.js +4 -0
  5. package/dist/components/component.d.ts +2 -1
  6. package/dist/components/dialog.d.ts +5 -0
  7. package/dist/components/dialog.js +8 -0
  8. package/dist/components/inputs/text-editor.d.ts +17 -0
  9. package/dist/components/inputs/text-editor.js +17 -0
  10. package/dist/components/map.d.ts +11 -0
  11. package/dist/components/map.js +7 -0
  12. package/dist/components/popover.d.ts +5 -0
  13. package/dist/components/popover.js +8 -0
  14. package/dist/components/stack.d.ts +4 -0
  15. package/dist/components/stack.js +4 -0
  16. package/dist/core/actions/close-entry.d.ts +15 -0
  17. package/dist/core/actions/close-entry.js +28 -0
  18. package/dist/core/actions/component-local-actions.d.ts +113 -0
  19. package/dist/core/actions/component-local-actions.js +274 -0
  20. package/dist/core/actions/dec-context-value.d.ts +21 -0
  21. package/dist/core/actions/dec-context-value.js +35 -0
  22. package/dist/core/actions/inc-context-value.d.ts +22 -0
  23. package/dist/core/actions/inc-context-value.js +35 -0
  24. package/dist/core/actions/local-action.d.ts +4 -0
  25. package/dist/core/actions/local-action.js +43 -0
  26. package/dist/core/actions/set-context.d.ts +20 -0
  27. package/dist/core/actions/set-context.js +33 -0
  28. package/dist/core/conditions/condition-operand.d.ts +5 -3
  29. package/dist/core/context/context-ref.d.ts +21 -0
  30. package/dist/core/context/context-ref.js +16 -0
  31. package/dist/core/context/context.d.ts +10 -0
  32. package/dist/core/context/context.js +11 -0
  33. package/dist/core/index.d.ts +3 -6
  34. package/dist/core/index.js +6 -6
  35. package/dist/core/local/index.d.ts +14 -0
  36. package/dist/core/local/index.js +18 -0
  37. package/dist/core/types/component-instance.d.ts +7 -0
  38. package/dist/core/types/component-instance.js +4 -0
  39. package/dist/core/types/context-value-ref.d.ts +2 -0
  40. package/package.json +2 -2
  41. package/dist/core/actions/set-context-value.d.ts +0 -21
  42. package/dist/core/actions/set-context-value.js +0 -34
  43. package/dist/core/actions/set-context-values.d.ts +0 -35
  44. package/dist/core/actions/set-context-values.js +0 -30
@@ -3,6 +3,7 @@ import type { BoardConfig, BoardPoint } from "@matreshka/shared/types/board-conf
3
3
  import { type FlexItemSpec } from "@matreshka/shared/types/flex-item";
4
4
  import type { NestedItemBase } from "@matreshka/shared/types/nested-item-base";
5
5
  import { Componentable, ComponentInstance, ComponentTreeNode, StandaloneComponent } from "../core";
6
+ import type { ActionConfig } from "../core/actions/action";
6
7
  import { Component, ComponentInitConfig, ComponentProperties, ServerComponentAction } from "./component";
7
8
  import type { ItemList } from "./item-list/item-list";
8
9
  import type { ItemListHost } from "./item-list/item-list-host";
@@ -36,6 +37,12 @@ type DefaultInitConfigType = BoardInitConfig<Board>;
36
37
  export declare class Board<InitConfigType extends BoardInitConfig<any> = DefaultInitConfigType, PropertiesType extends BoardProperties = BoardProperties> extends Component<InitConfigType, PropertiesType> implements StandaloneComponent, ItemListHost {
37
38
  private readonly itemsSlot;
38
39
  private readonly itemListHostAdapter;
40
+ readonly local: {
41
+ setCenter: (center: BoardPoint, config?: ActionConfig) => import("../core/actions/component-local-actions").BoardSetCenterLocalAction;
42
+ setZoom: (zoom: number, config?: ActionConfig) => import("../core/actions/component-local-actions").BoardSetZoomLocalAction;
43
+ zoomIn: (config?: ActionConfig) => import("../core/actions/component-local-actions").BoardZoomInLocalAction;
44
+ zoomOut: (config?: ActionConfig) => import("../core/actions/component-local-actions").BoardZoomOutLocalAction;
45
+ };
39
46
  setCenter(center: BoardPoint, instances?: ComponentInstance[]): import("rxjs").Observable<void>;
40
47
  setZoom(zoom: number, instances?: ComponentInstance[]): import("rxjs").Observable<void>;
41
48
  zoomIn(instances?: ComponentInstance[]): import("rxjs").Observable<void>;
@@ -7,6 +7,7 @@ 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 component_local_actions_1 = require("../core/actions/component-local-actions");
10
11
  const component_1 = require("./component");
11
12
  const item_list_1 = require("./item-list");
12
13
  const flatten_nested_items_1 = require("./item-list/flatten-nested-items");
@@ -38,6 +39,12 @@ class Board extends component_1.Component {
38
39
  source: [],
39
40
  itemLists: [],
40
41
  };
42
+ this.local = {
43
+ setCenter: (center, config) => (0, component_local_actions_1.boardSetCenterLocal)(this, center, config),
44
+ setZoom: (zoom, config) => (0, component_local_actions_1.boardSetZoomLocal)(this, zoom, config),
45
+ zoomIn: (config) => (0, component_local_actions_1.boardZoomInLocal)(this, config),
46
+ zoomOut: (config) => (0, component_local_actions_1.boardZoomOutLocal)(this, config),
47
+ };
41
48
  this.itemsSlot.source = itemsSlot.source;
42
49
  this.itemsSlot.itemLists = itemsSlot.itemLists;
43
50
  (0, item_list_1.attachItemListsToHost)(this, "items", this.itemsSlot);
@@ -3,6 +3,7 @@ import { VideoFacingMode } from "@matreshka/shared/enums/video-facing-mode";
3
3
  import { ErrorMessagePayload } from "@matreshka/shared/messages/client-to-bff/error-message";
4
4
  import type { CameraConfig } from "@matreshka/shared/types/camera-config";
5
5
  import { Componentable, ComponentInstance, ComponentTreeNode, MixedWithCallbacksArray, StandaloneComponent } from "../core";
6
+ import type { ActionConfig } from "../core/actions/action";
6
7
  import { VideoInputDevice } from "../platforms/platform";
7
8
  import { Component, ComponentInitConfig, ComponentProperties, ServerComponentAction } from "./component";
8
9
  export { VideoFacingMode } from "@matreshka/shared/enums/video-facing-mode";
@@ -53,6 +54,9 @@ export declare function camera<ContentType extends ComponentTreeNode = Component
53
54
  * Компонент камеры (контейнер), на клиенте отображает видео с веб-камеры устройства.
54
55
  */
55
56
  export declare class Camera<ContentType extends ComponentTreeNode = ComponentTreeNode, InitConfigType extends CameraInitConfig<ContentType, any> = DefaultInitConfigType<ContentType>, PropertiesType extends CameraProperties = CameraProperties> extends Component<InitConfigType, PropertiesType> implements StandaloneComponent {
57
+ readonly local: {
58
+ switchCamera: (device: VideoInputDevice, config?: ActionConfig) => import("../core/actions/component-local-actions").CameraSwitchLocalAction;
59
+ };
56
60
  constructor(config: InitConfigType);
57
61
  /**
58
62
  * Возвращает уникальный идентификатор класса компонента.
@@ -5,6 +5,7 @@ exports.camera = camera;
5
5
  const server_component_class_1 = require("@matreshka/shared/enums/server-component-class");
6
6
  const camera_switch_message_1 = require("@matreshka/shared/messages/bff-to-client/components/camera/camera-switch-message");
7
7
  const core_1 = require("../core");
8
+ const component_local_actions_1 = require("../core/actions/component-local-actions");
8
9
  const component_1 = require("./component");
9
10
  var video_facing_mode_1 = require("@matreshka/shared/enums/video-facing-mode");
10
11
  Object.defineProperty(exports, "VideoFacingMode", { enumerable: true, get: function () { return video_facing_mode_1.VideoFacingMode; } });
@@ -32,6 +33,9 @@ function camera(arg0, arg1) {
32
33
  class Camera extends component_1.Component {
33
34
  constructor(config) {
34
35
  super(config);
36
+ this.local = {
37
+ switchCamera: (device, config) => (0, component_local_actions_1.cameraSwitchLocal)(this, device, config),
38
+ };
35
39
  if (config.onQrCode) {
36
40
  // bindActions в базовом Component типизирован под payload=unknown.
37
41
  // Здесь payload всегда строка QR-кода, поэтому безопасно расширяем тип.
@@ -9,7 +9,8 @@ import type { FontStackToken } from "@matreshka/shared/types/fonts";
9
9
  import type { GridItem } from "@matreshka/shared/types/grid-item";
10
10
  import type { ServerComponentConfig } from "@matreshka/shared/types/server-component-config";
11
11
  import { Observable, Subscription } from "rxjs";
12
- import { Client, Componentable, ComponentInstance, LocalAction } from "../core";
12
+ import { Client, Componentable, ComponentInstance } from "../core";
13
+ import { LocalAction } from "../core/actions/local-action";
13
14
  import { Condition } from "../core/conditions";
14
15
  import { ServerAction, ServerActionHandler } from "./actions/server-action";
15
16
  import type { EntryComponent } from "./entry-component";
@@ -3,6 +3,7 @@ import { OverlayAnchor } from "@matreshka/shared/types/container-overlay";
3
3
  import type { DialogBackdropConfig } from "@matreshka/shared/types/dialog-backdrop-config";
4
4
  import type { DialogConfig } from "@matreshka/shared/types/dialog-config";
5
5
  import { Componentable, ComponentInstance, ComponentTreeNode, MixedWithCallbacksArray } from "../core";
6
+ import type { ActionConfig } from "../core/actions/action";
6
7
  import type { AnimateComponent } from "../core/actions/animate-component";
7
8
  import { EntryComponent, EntryComponentInitConfig, EntryComponentProperties } from "./entry-component";
8
9
  /** Анимации подложки модального диалога при инициализации. */
@@ -57,6 +58,10 @@ export declare function dialog(config: DefaultInitConfigType): Dialog;
57
58
  * @template InitConfigType Тип конфигурации инициализации.
58
59
  */
59
60
  export declare class Dialog<InitConfigType extends DialogInitConfig<any> = DefaultInitConfigType, PropertiesType extends DialogProperties = DialogProperties> extends EntryComponent<InitConfigType, PropertiesType> implements Componentable {
61
+ /** Локальные (client-only) действия entry-диалога. */
62
+ readonly local: {
63
+ close: (config?: ActionConfig) => import("../core/actions/close-entry").CloseEntry;
64
+ };
60
65
  /**
61
66
  * Возвращает уникальный идентификатор класса компонента.
62
67
  * @returns Строка "dialog".
@@ -5,6 +5,7 @@ exports.dialog = dialog;
5
5
  const server_component_class_1 = require("@matreshka/shared/enums/server-component-class");
6
6
  const dialog_close_message_1 = require("@matreshka/shared/messages/bff-to-client/components/dialog/dialog-close-message");
7
7
  const core_1 = require("../core");
8
+ const close_entry_1 = require("../core/actions/close-entry");
8
9
  const entry_component_1 = require("./entry-component");
9
10
  function serializeLocalActions(actions) {
10
11
  if (!actions) {
@@ -52,6 +53,13 @@ function dialog(arg0, arg1) {
52
53
  * @template InitConfigType Тип конфигурации инициализации.
53
54
  */
54
55
  class Dialog extends entry_component_1.EntryComponent {
56
+ constructor() {
57
+ super(...arguments);
58
+ /** Локальные (client-only) действия entry-диалога. */
59
+ this.local = {
60
+ close: (config) => (0, close_entry_1.closeEntry)(this, config),
61
+ };
62
+ }
55
63
  /**
56
64
  * Возвращает уникальный идентификатор класса компонента.
57
65
  * @returns Строка "dialog".
@@ -1,5 +1,6 @@
1
1
  import { ServerComponentClass } from "@matreshka/shared/enums/server-component-class";
2
2
  import { Componentable, ComponentInstance } from "../../core";
3
+ import type { ActionConfig } from "../../core/actions/action";
3
4
  import { ServerComponentAction } from "../component";
4
5
  import { InputComponent, InputInitConfig, InputProperties, StringInputContextRef } from "./input-component";
5
6
  /**
@@ -25,6 +26,22 @@ export declare function textEditor<RefType extends StringInputContextRef = Strin
25
26
  * Поддерживает панель инструментов, вложенные компоненты и команды форматирования.
26
27
  */
27
28
  export declare class TextEditor<RefType extends StringInputContextRef = StringInputContextRef, InitConfigType extends TextEditorInitConfig<any, RefType> = DefaultInitConfigType<RefType>, PropertiesType extends TextEditorProperties = TextEditorProperties> extends InputComponent<InitConfigType, PropertiesType> {
29
+ readonly local: {
30
+ insertHTML: (value: string, config?: ActionConfig) => import("../../core/actions/component-local-actions").TextEditorInsertHtmlLocalAction;
31
+ toggleItalic: (config?: ActionConfig) => import("../../core/actions/local-action").LocalAction;
32
+ toggleBold: (config?: ActionConfig) => import("../../core/actions/local-action").LocalAction;
33
+ toggleUnderline: (config?: ActionConfig) => import("../../core/actions/local-action").LocalAction;
34
+ undo: (config?: ActionConfig) => import("../../core/actions/local-action").LocalAction;
35
+ redo: (config?: ActionConfig) => import("../../core/actions/local-action").LocalAction;
36
+ superscript: (config?: ActionConfig) => import("../../core/actions/local-action").LocalAction;
37
+ insertOrderedList: (config?: ActionConfig) => import("../../core/actions/local-action").LocalAction;
38
+ insertUnorderedList: (config?: ActionConfig) => import("../../core/actions/local-action").LocalAction;
39
+ justifyLeft: (config?: ActionConfig) => import("../../core/actions/local-action").LocalAction;
40
+ justifyCenter: (config?: ActionConfig) => import("../../core/actions/local-action").LocalAction;
41
+ justifyRight: (config?: ActionConfig) => import("../../core/actions/local-action").LocalAction;
42
+ justifyFull: (config?: ActionConfig) => import("../../core/actions/local-action").LocalAction;
43
+ formatBlock: (tag: string, config?: ActionConfig) => import("../../core/actions/component-local-actions").TextEditorFormatBlockLocalAction;
44
+ };
28
45
  constructor(config: TextEditorInitConfig<any, RefType>);
29
46
  protected class(): ServerComponentClass;
30
47
  /**
@@ -18,6 +18,7 @@ const text_editor_toggle_italic_message_1 = require("@matreshka/shared/messages/
18
18
  const text_editor_toggle_underline_message_1 = require("@matreshka/shared/messages/bff-to-client/components/text-editor/text-editor-toggle-underline-message");
19
19
  const text_editor_undo_message_1 = require("@matreshka/shared/messages/bff-to-client/components/text-editor/text-editor-undo-message");
20
20
  const core_1 = require("../../core");
21
+ const component_local_actions_1 = require("../../core/actions/component-local-actions");
21
22
  const input_component_1 = require("./input-component");
22
23
  function textEditor(arg0, arg1) {
23
24
  if (arg1 !== undefined) {
@@ -40,6 +41,22 @@ function textEditor(arg0, arg1) {
40
41
  class TextEditor extends input_component_1.InputComponent {
41
42
  constructor(config) {
42
43
  super(config);
44
+ this.local = {
45
+ insertHTML: (value, config) => (0, component_local_actions_1.textEditorInsertHtmlLocal)(this, value, config),
46
+ toggleItalic: (config) => (0, component_local_actions_1.textEditorToggleItalicLocal)(this, config),
47
+ toggleBold: (config) => (0, component_local_actions_1.textEditorToggleBoldLocal)(this, config),
48
+ toggleUnderline: (config) => (0, component_local_actions_1.textEditorToggleUnderlineLocal)(this, config),
49
+ undo: (config) => (0, component_local_actions_1.textEditorUndoLocal)(this, config),
50
+ redo: (config) => (0, component_local_actions_1.textEditorRedoLocal)(this, config),
51
+ superscript: (config) => (0, component_local_actions_1.textEditorSuperscriptLocal)(this, config),
52
+ insertOrderedList: (config) => (0, component_local_actions_1.textEditorInsertOrderedListLocal)(this, config),
53
+ insertUnorderedList: (config) => (0, component_local_actions_1.textEditorInsertUnorderedListLocal)(this, config),
54
+ justifyLeft: (config) => (0, component_local_actions_1.textEditorJustifyLeftLocal)(this, config),
55
+ justifyCenter: (config) => (0, component_local_actions_1.textEditorJustifyCenterLocal)(this, config),
56
+ justifyRight: (config) => (0, component_local_actions_1.textEditorJustifyRightLocal)(this, config),
57
+ justifyFull: (config) => (0, component_local_actions_1.textEditorJustifyFullLocal)(this, config),
58
+ formatBlock: (tag, config) => (0, component_local_actions_1.textEditorFormatBlockLocal)(this, tag, config),
59
+ };
43
60
  if (config.onSelectionChange) {
44
61
  const actions = config.onSelectionChange;
45
62
  this.bindActions("selection-change", actions);
@@ -5,6 +5,7 @@ import { type FlexItemSpec } from "@matreshka/shared/types/flex-item";
5
5
  import type { MapConfig } from "@matreshka/shared/types/map-config";
6
6
  import type { NestedItemBase } from "@matreshka/shared/types/nested-item-base";
7
7
  import { Componentable, ComponentInstance, ComponentTreeNode, StandaloneComponent } from "../core";
8
+ import type { ActionConfig } from "../core/actions/action";
8
9
  import { Component, ComponentInitConfig, ComponentProperties, ServerComponentAction } from "./component";
9
10
  import type { ItemList } from "./item-list/item-list";
10
11
  import type { ItemListHost } from "./item-list/item-list-host";
@@ -57,6 +58,16 @@ type DefaultInitConfigType = MapInitConfig<Map>;
57
58
  export declare class Map<InitConfigType extends MapInitConfig<any> = DefaultInitConfigType, PropertiesType extends MapProperties = MapProperties> extends Component<InitConfigType, PropertiesType> implements StandaloneComponent, ItemListHost {
58
59
  private readonly markersSlot;
59
60
  private readonly itemListHostAdapter;
61
+ readonly local: {
62
+ setCenter: (center: {
63
+ latitude: number;
64
+ longitude: number;
65
+ altitude?: number;
66
+ }, config?: ActionConfig) => import("../core/actions/component-local-actions").MapSetCenterLocalAction;
67
+ setZoom: (zoom: number, config?: ActionConfig) => import("../core/actions/component-local-actions").MapSetZoomLocalAction;
68
+ zoomIn: (config?: ActionConfig) => import("../core/actions/component-local-actions").MapZoomInLocalAction;
69
+ zoomOut: (config?: ActionConfig) => import("../core/actions/component-local-actions").MapZoomOutLocalAction;
70
+ };
60
71
  setCenter(center: {
61
72
  latitude: number;
62
73
  longitude: number;
@@ -7,6 +7,7 @@ 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 component_local_actions_1 = require("../core/actions/component-local-actions");
10
11
  const component_1 = require("./component");
11
12
  const item_list_1 = require("./item-list");
12
13
  const flatten_nested_items_1 = require("./item-list/flatten-nested-items");
@@ -34,6 +35,12 @@ class Map extends component_1.Component {
34
35
  source: [],
35
36
  itemLists: [],
36
37
  };
38
+ this.local = {
39
+ setCenter: (center, config) => (0, component_local_actions_1.mapSetCenterLocal)(this, center, config),
40
+ setZoom: (zoom, config) => (0, component_local_actions_1.mapSetZoomLocal)(this, zoom, config),
41
+ zoomIn: (config) => (0, component_local_actions_1.mapZoomInLocal)(this, config),
42
+ zoomOut: (config) => (0, component_local_actions_1.mapZoomOutLocal)(this, config),
43
+ };
37
44
  this.markersSlot.source = markersSlot.source;
38
45
  this.markersSlot.itemLists = markersSlot.itemLists;
39
46
  (0, item_list_1.attachItemListsToHost)(this, "markers", this.markersSlot);
@@ -1,6 +1,7 @@
1
1
  import { ServerComponentClass } from "@matreshka/shared/enums/server-component-class";
2
2
  import type { PopoverConfig } from "@matreshka/shared/types/popover-config";
3
3
  import { Componentable, ComponentInstance, ComponentTreeNode, MixedWithCallbacksArray } from "../core";
4
+ import type { ActionConfig } from "../core/actions/action";
4
5
  import { EntryComponent, EntryComponentInitConfig, EntryComponentProperties } from "./entry-component";
5
6
  import { PopoverPositionArea } from "./enum/popover-position-area";
6
7
  export type PopoverProperties = {
@@ -36,6 +37,10 @@ export declare function popover(config: DefaultInitConfigType): Popover;
36
37
  * На клиенте рендерится через [Popover API](https://doka.guide/html/popover/) (`popover="auto"`).
37
38
  */
38
39
  export declare class Popover<InitConfigType extends PopoverInitConfig<any> = DefaultInitConfigType, PropertiesType extends PopoverProperties = PopoverProperties> extends EntryComponent<InitConfigType, PropertiesType> {
40
+ /** Локальные (client-only) действия entry-popover. */
41
+ readonly local: {
42
+ close: (config?: ActionConfig) => import("../core/actions/close-entry").CloseEntry;
43
+ };
39
44
  /**
40
45
  * Возвращает уникальный идентификатор класса компонента.
41
46
  *
@@ -5,6 +5,7 @@ exports.popover = popover;
5
5
  const server_component_class_1 = require("@matreshka/shared/enums/server-component-class");
6
6
  const popover_close_message_1 = require("@matreshka/shared/messages/bff-to-client/components/popover/popover-close-message");
7
7
  const core_1 = require("../core");
8
+ const close_entry_1 = require("../core/actions/close-entry");
8
9
  const entry_component_1 = require("./entry-component");
9
10
  function popover(arg0, arg1) {
10
11
  if (arg1 !== undefined) {
@@ -28,6 +29,13 @@ function popover(arg0, arg1) {
28
29
  * На клиенте рендерится через [Popover API](https://doka.guide/html/popover/) (`popover="auto"`).
29
30
  */
30
31
  class Popover extends entry_component_1.EntryComponent {
32
+ constructor() {
33
+ super(...arguments);
34
+ /** Локальные (client-only) действия entry-popover. */
35
+ this.local = {
36
+ close: (config) => (0, close_entry_1.closeEntry)(this, config),
37
+ };
38
+ }
31
39
  /**
32
40
  * Возвращает уникальный идентификатор класса компонента.
33
41
  *
@@ -13,6 +13,7 @@ import type { RadiusPx } from "@matreshka/shared/types/radius-px";
13
13
  import type { StackConfig } from "@matreshka/shared/types/stack-config";
14
14
  import type { StackScroll } from "@matreshka/shared/types/stack-scroll";
15
15
  import { Componentable, ComponentInstance, ComponentTreeNode, MixedWithCallbacksArray, StandaloneComponent } from "../core";
16
+ import type { ActionConfig } from "../core/actions/action";
16
17
  import { Component, ComponentInitConfig, ComponentProperties, ServerComponentAction } from "./component";
17
18
  export { DimensionalUnit } from "@matreshka/shared/enums/dimensional-unit";
18
19
  export { FlexWrap } from "@matreshka/shared/enums/flex-wrap";
@@ -136,6 +137,9 @@ export declare function stack(config: DefaultInitConfigType): Stack;
136
137
  * Компонент Stack, отображающий вложенные элементы в колонку или строку (`direction`) с возможностью настройки выравнивания, отступов и прокрутки.
137
138
  */
138
139
  export declare class Stack<InitConfigType extends StackInitConfig<any> = DefaultInitConfigType, PropertiesType extends StackProperties = StackProperties> extends Component<InitConfigType, PropertiesType> implements StandaloneComponent {
140
+ readonly local: {
141
+ scrollTo: (value: number | ScrollToPosition, smooth?: boolean, config?: ActionConfig) => import("../core/actions/component-local-actions").ScrollToLocalAction;
142
+ };
139
143
  constructor(config: InitConfigType);
140
144
  /**
141
145
  * Возвращает флаг, указывающий, что компонент является самостоятельным.
@@ -6,6 +6,7 @@ const server_component_class_1 = require("@matreshka/shared/enums/server-compone
6
6
  const component_scroll_to_message_1 = require("@matreshka/shared/messages/bff-to-client/components/component-scroll-to-message");
7
7
  const flex_item_1 = require("@matreshka/shared/types/flex-item");
8
8
  const core_1 = require("../core");
9
+ const component_local_actions_1 = require("../core/actions/component-local-actions");
9
10
  const component_1 = require("./component");
10
11
  var dimensional_unit_1 = require("@matreshka/shared/enums/dimensional-unit");
11
12
  Object.defineProperty(exports, "DimensionalUnit", { enumerable: true, get: function () { return dimensional_unit_1.DimensionalUnit; } });
@@ -44,6 +45,9 @@ function stack(arg0, arg1) {
44
45
  class Stack extends component_1.Component {
45
46
  constructor(config) {
46
47
  super(config);
48
+ this.local = {
49
+ scrollTo: (value, smooth = false, config) => (0, component_local_actions_1.scrollToLocal)(this, value, smooth, config),
50
+ };
47
51
  if (config.onClick) {
48
52
  this.bindActions("click", config.onClick);
49
53
  }
@@ -0,0 +1,15 @@
1
+ import type { Componentable } from "../types/componentable";
2
+ import { ActionConfig } from "./action";
3
+ import { LocalAction } from "./local-action";
4
+ /**
5
+ * Локальное закрытие entry (dialog / popover) на клиенте без round-trip на BFF.
6
+ * {@link target} в payload — явный instance id или базовый id компонента.
7
+ */
8
+ export declare class CloseEntry extends LocalAction {
9
+ private readonly entry;
10
+ private readonly target;
11
+ constructor(entry: Componentable, config?: ActionConfig, target?: string);
12
+ class(): string;
13
+ payload(): object;
14
+ }
15
+ export declare function closeEntry(entry: Componentable, config?: ActionConfig, target?: string): CloseEntry;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CloseEntry = void 0;
4
+ exports.closeEntry = closeEntry;
5
+ const local_action_1 = require("./local-action");
6
+ /**
7
+ * Локальное закрытие entry (dialog / popover) на клиенте без round-trip на BFF.
8
+ * {@link target} в payload — явный instance id или базовый id компонента.
9
+ */
10
+ class CloseEntry extends local_action_1.LocalAction {
11
+ constructor(entry, config = {}, target = entry.id) {
12
+ super(config.conditions);
13
+ this.entry = entry;
14
+ this.target = target;
15
+ }
16
+ class() {
17
+ return "close-entry";
18
+ }
19
+ payload() {
20
+ return {
21
+ target: this.target,
22
+ };
23
+ }
24
+ }
25
+ exports.CloseEntry = CloseEntry;
26
+ function closeEntry(entry, config = {}, target = entry.id) {
27
+ return new CloseEntry(entry, config, target);
28
+ }
@@ -0,0 +1,113 @@
1
+ import { ScrollToPosition } from "@matreshka/shared/enums/scroll-to-position";
2
+ import type { BoardPoint } from "@matreshka/shared/types/board-config";
3
+ import type { VideoInputDevice } from "../../platforms/platform";
4
+ import type { Componentable } from "../types/componentable";
5
+ import type { ActionConfig } from "./action";
6
+ import { LocalAction } from "./local-action";
7
+ declare abstract class ComponentLocalAction extends LocalAction {
8
+ protected readonly component: Componentable;
9
+ constructor(component: Componentable, config?: ActionConfig);
10
+ protected targetPayload(): {
11
+ target: string;
12
+ };
13
+ }
14
+ export declare class MapSetCenterLocalAction extends ComponentLocalAction {
15
+ private readonly center;
16
+ constructor(component: Componentable, center: {
17
+ latitude: number;
18
+ longitude: number;
19
+ altitude?: number;
20
+ }, config?: ActionConfig);
21
+ class(): string;
22
+ payload(): object;
23
+ }
24
+ export declare function mapSetCenterLocal(component: Componentable, center: {
25
+ latitude: number;
26
+ longitude: number;
27
+ altitude?: number;
28
+ }, config?: ActionConfig): MapSetCenterLocalAction;
29
+ export declare class MapSetZoomLocalAction extends ComponentLocalAction {
30
+ private readonly zoom;
31
+ constructor(component: Componentable, zoom: number, config?: ActionConfig);
32
+ class(): string;
33
+ payload(): object;
34
+ }
35
+ export declare function mapSetZoomLocal(component: Componentable, zoom: number, config?: ActionConfig): MapSetZoomLocalAction;
36
+ export declare class MapZoomInLocalAction extends ComponentLocalAction {
37
+ class(): string;
38
+ payload(): object;
39
+ }
40
+ export declare function mapZoomInLocal(component: Componentable, config?: ActionConfig): MapZoomInLocalAction;
41
+ export declare class MapZoomOutLocalAction extends ComponentLocalAction {
42
+ class(): string;
43
+ payload(): object;
44
+ }
45
+ export declare function mapZoomOutLocal(component: Componentable, config?: ActionConfig): MapZoomOutLocalAction;
46
+ export declare class BoardSetCenterLocalAction extends ComponentLocalAction {
47
+ private readonly center;
48
+ constructor(component: Componentable, center: BoardPoint, config?: ActionConfig);
49
+ class(): string;
50
+ payload(): object;
51
+ }
52
+ export declare function boardSetCenterLocal(component: Componentable, center: BoardPoint, config?: ActionConfig): BoardSetCenterLocalAction;
53
+ export declare class BoardSetZoomLocalAction extends ComponentLocalAction {
54
+ private readonly zoom;
55
+ constructor(component: Componentable, zoom: number, config?: ActionConfig);
56
+ class(): string;
57
+ payload(): object;
58
+ }
59
+ export declare function boardSetZoomLocal(component: Componentable, zoom: number, config?: ActionConfig): BoardSetZoomLocalAction;
60
+ export declare class BoardZoomInLocalAction extends ComponentLocalAction {
61
+ class(): string;
62
+ payload(): object;
63
+ }
64
+ export declare function boardZoomInLocal(component: Componentable, config?: ActionConfig): BoardZoomInLocalAction;
65
+ export declare class BoardZoomOutLocalAction extends ComponentLocalAction {
66
+ class(): string;
67
+ payload(): object;
68
+ }
69
+ export declare function boardZoomOutLocal(component: Componentable, config?: ActionConfig): BoardZoomOutLocalAction;
70
+ export declare class ScrollToLocalAction extends ComponentLocalAction {
71
+ private readonly value;
72
+ private readonly smooth;
73
+ constructor(component: Componentable, value: number | ScrollToPosition, smooth: boolean, config?: ActionConfig);
74
+ class(): string;
75
+ payload(): object;
76
+ }
77
+ export declare function scrollToLocal(component: Componentable, value: number | ScrollToPosition, smooth?: boolean, config?: ActionConfig): ScrollToLocalAction;
78
+ export declare class CameraSwitchLocalAction extends ComponentLocalAction {
79
+ private readonly device;
80
+ constructor(component: Componentable, device: VideoInputDevice, config?: ActionConfig);
81
+ class(): string;
82
+ payload(): object;
83
+ }
84
+ export declare function cameraSwitchLocal(component: Componentable, device: VideoInputDevice, config?: ActionConfig): CameraSwitchLocalAction;
85
+ declare abstract class TextEditorLocalAction extends ComponentLocalAction {
86
+ }
87
+ export declare class TextEditorInsertHtmlLocalAction extends TextEditorLocalAction {
88
+ private readonly value;
89
+ constructor(component: Componentable, value: string, config?: ActionConfig);
90
+ class(): string;
91
+ payload(): object;
92
+ }
93
+ export declare function textEditorInsertHtmlLocal(component: Componentable, value: string, config?: ActionConfig): TextEditorInsertHtmlLocalAction;
94
+ export declare class TextEditorFormatBlockLocalAction extends TextEditorLocalAction {
95
+ private readonly tag;
96
+ constructor(component: Componentable, tag: string, config?: ActionConfig);
97
+ class(): string;
98
+ payload(): object;
99
+ }
100
+ export declare function textEditorFormatBlockLocal(component: Componentable, tag: string, config?: ActionConfig): TextEditorFormatBlockLocalAction;
101
+ export declare function textEditorToggleItalicLocal(component: Componentable, config?: ActionConfig): LocalAction;
102
+ export declare function textEditorToggleBoldLocal(component: Componentable, config?: ActionConfig): LocalAction;
103
+ export declare function textEditorToggleUnderlineLocal(component: Componentable, config?: ActionConfig): LocalAction;
104
+ export declare function textEditorUndoLocal(component: Componentable, config?: ActionConfig): LocalAction;
105
+ export declare function textEditorRedoLocal(component: Componentable, config?: ActionConfig): LocalAction;
106
+ export declare function textEditorSuperscriptLocal(component: Componentable, config?: ActionConfig): LocalAction;
107
+ export declare function textEditorInsertOrderedListLocal(component: Componentable, config?: ActionConfig): LocalAction;
108
+ export declare function textEditorInsertUnorderedListLocal(component: Componentable, config?: ActionConfig): LocalAction;
109
+ export declare function textEditorJustifyLeftLocal(component: Componentable, config?: ActionConfig): LocalAction;
110
+ export declare function textEditorJustifyCenterLocal(component: Componentable, config?: ActionConfig): LocalAction;
111
+ export declare function textEditorJustifyRightLocal(component: Componentable, config?: ActionConfig): LocalAction;
112
+ export declare function textEditorJustifyFullLocal(component: Componentable, config?: ActionConfig): LocalAction;
113
+ export {};