@matreshka/bff 0.20.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 (52) 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/for-each.d.ts +3 -3
  9. package/dist/components/for-each.js +18 -26
  10. package/dist/components/inputs/text-editor.d.ts +17 -0
  11. package/dist/components/inputs/text-editor.js +17 -0
  12. package/dist/components/item-list/item-list.js +11 -11
  13. package/dist/components/item-list/list-from-ref-context.d.ts +4 -1
  14. package/dist/components/item-list/list-from-ref-context.js +6 -4
  15. package/dist/components/item-list/types.d.ts +5 -5
  16. package/dist/components/item-list/types.js +1 -1
  17. package/dist/components/map.d.ts +11 -0
  18. package/dist/components/map.js +7 -0
  19. package/dist/components/popover.d.ts +5 -0
  20. package/dist/components/popover.js +8 -0
  21. package/dist/components/stack.d.ts +4 -0
  22. package/dist/components/stack.js +4 -0
  23. package/dist/core/actions/close-entry.d.ts +15 -0
  24. package/dist/core/actions/close-entry.js +28 -0
  25. package/dist/core/actions/component-local-actions.d.ts +113 -0
  26. package/dist/core/actions/component-local-actions.js +274 -0
  27. package/dist/core/actions/dec-context-value.d.ts +21 -0
  28. package/dist/core/actions/dec-context-value.js +35 -0
  29. package/dist/core/actions/inc-context-value.d.ts +22 -0
  30. package/dist/core/actions/inc-context-value.js +35 -0
  31. package/dist/core/actions/local-action.d.ts +4 -0
  32. package/dist/core/actions/local-action.js +43 -0
  33. package/dist/core/actions/set-context.d.ts +20 -0
  34. package/dist/core/actions/set-context.js +33 -0
  35. package/dist/core/conditions/condition-operand.d.ts +5 -3
  36. package/dist/core/context/context-ref.d.ts +26 -4
  37. package/dist/core/context/context-ref.js +25 -8
  38. package/dist/core/context/context.d.ts +52 -10
  39. package/dist/core/context/context.js +87 -13
  40. package/dist/core/index.d.ts +3 -6
  41. package/dist/core/index.js +6 -6
  42. package/dist/core/local/index.d.ts +14 -0
  43. package/dist/core/local/index.js +18 -0
  44. package/dist/core/types/component-instance.d.ts +7 -0
  45. package/dist/core/types/component-instance.js +4 -0
  46. package/dist/core/types/context-value-ref.d.ts +5 -3
  47. package/dist/core/utils/replace-context-keys.js +1 -2
  48. package/package.json +2 -2
  49. package/dist/core/actions/set-context-value.d.ts +0 -21
  50. package/dist/core/actions/set-context-value.js +0 -34
  51. package/dist/core/actions/set-context-values.d.ts +0 -35
  52. package/dist/core/actions/set-context-values.js +0 -30
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SetContextValue = void 0;
4
- exports.setContextValue = setContextValue;
5
- const local_action_1 = require("./local-action");
6
- /**
7
- * Запись одного значения в Context на клиенте (с sync на BFF через `context-values`).
8
- *
9
- * `R` — конкретный ref; `value` имеет тип значения по этому ref.
10
- */
11
- class SetContextValue extends local_action_1.LocalAction {
12
- constructor(ref, value, config = {}) {
13
- super(config.conditions);
14
- this.ref = ref;
15
- this.value = value;
16
- }
17
- class() {
18
- return "set-context-value";
19
- }
20
- payload() {
21
- return {
22
- ref: this.ref,
23
- value: this.value,
24
- };
25
- }
26
- }
27
- exports.SetContextValue = SetContextValue;
28
- /**
29
- * Функциональная форма {@link SetContextValue}.
30
- * Тип `value` должен совпадать с типом значения по `ref`.
31
- */
32
- function setContextValue(ref, value, config = {}) {
33
- return new SetContextValue(ref, value, config);
34
- }
@@ -1,35 +0,0 @@
1
- import { ContextRefValue } from "../context/context-ref";
2
- import { ContextValueRef } from "../types/context-value-ref";
3
- import { ActionConfig } from "./action";
4
- import { LocalAction } from "./local-action";
5
- /**
6
- * Пара ref + value для batch-записи в Context.
7
- * Тип `value` выводится из конкретного `ref`.
8
- */
9
- export type ContextValueAssignment<R extends ContextValueRef<unknown> = ContextValueRef<unknown>> = {
10
- ref: R;
11
- value: ContextRefValue<R>;
12
- };
13
- type AssertContextValueAssignments<T extends readonly unknown[]> = {
14
- [K in keyof T]: T[K] extends {
15
- ref: infer R extends ContextValueRef<unknown>;
16
- } ? ContextValueAssignment<R> : never;
17
- };
18
- /**
19
- * Batch-запись значений в Context на клиенте (с sync на BFF через `context-values`).
20
- */
21
- export declare class SetContextValues extends LocalAction {
22
- private readonly values;
23
- constructor(values: readonly ContextValueAssignment[], config?: ActionConfig);
24
- class(): string;
25
- payload(): object;
26
- }
27
- /**
28
- * Функциональная форма {@link SetContextValues}.
29
- * У каждого элемента массива тип `value` должен совпадать с типом значения по `ref`.
30
- */
31
- export declare function setContextValues<const T extends readonly [
32
- ContextValueAssignment,
33
- ...ContextValueAssignment[]
34
- ]>(values: AssertContextValueAssignments<T> & T, config?: ActionConfig): SetContextValues;
35
- export {};
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SetContextValues = void 0;
4
- exports.setContextValues = setContextValues;
5
- const local_action_1 = require("./local-action");
6
- /**
7
- * Batch-запись значений в Context на клиенте (с sync на BFF через `context-values`).
8
- */
9
- class SetContextValues extends local_action_1.LocalAction {
10
- constructor(values, config = {}) {
11
- super(config.conditions);
12
- this.values = values;
13
- }
14
- class() {
15
- return "set-context-values";
16
- }
17
- payload() {
18
- return {
19
- values: this.values.map(({ ref, value }) => ({ ref, value })),
20
- };
21
- }
22
- }
23
- exports.SetContextValues = SetContextValues;
24
- /**
25
- * Функциональная форма {@link SetContextValues}.
26
- * У каждого элемента массива тип `value` должен совпадать с типом значения по `ref`.
27
- */
28
- function setContextValues(values, config = {}) {
29
- return new SetContextValues(values, config);
30
- }