@tramvai/module-router 1.49.1 → 1.50.3

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.
@@ -258,6 +258,13 @@ class PageService {
258
258
  const group = this.getComponentsGroupName();
259
259
  return this.componentRegistry.get(name, group);
260
260
  }
261
+ resolveComponentFromConfig(property) {
262
+ var _a;
263
+ const configName = `${property}Component`;
264
+ const defaultComponent = `${property}Default`;
265
+ const componentName = (_a = this.getConfig()[configName]) !== null && _a !== void 0 ? _a : defaultComponent;
266
+ return this.getComponent(componentName) || this.getComponent(defaultComponent);
267
+ }
261
268
  getComponentsGroupName() {
262
269
  const { bundle, pageComponent } = this.getConfig();
263
270
  const group = isFileSystemPageComponent(pageComponent) ? pageComponent : bundle;
package/lib/index.es.js CHANGED
@@ -260,6 +260,13 @@ class PageService {
260
260
  const group = this.getComponentsGroupName();
261
261
  return this.componentRegistry.get(name, group);
262
262
  }
263
+ resolveComponentFromConfig(property) {
264
+ var _a;
265
+ const configName = `${property}Component`;
266
+ const defaultComponent = `${property}Default`;
267
+ const componentName = (_a = this.getConfig()[configName]) !== null && _a !== void 0 ? _a : defaultComponent;
268
+ return this.getComponent(componentName) || this.getComponent(defaultComponent);
269
+ }
263
270
  getComponentsGroupName() {
264
271
  const { bundle, pageComponent } = this.getConfig();
265
272
  const group = isFileSystemPageComponent(pageComponent) ? pageComponent : bundle;
package/lib/index.js CHANGED
@@ -272,6 +272,13 @@ class PageService {
272
272
  const group = this.getComponentsGroupName();
273
273
  return this.componentRegistry.get(name, group);
274
274
  }
275
+ resolveComponentFromConfig(property) {
276
+ var _a;
277
+ const configName = `${property}Component`;
278
+ const defaultComponent = `${property}Default`;
279
+ const componentName = (_a = this.getConfig()[configName]) !== null && _a !== void 0 ? _a : defaultComponent;
280
+ return this.getComponent(componentName) || this.getComponent(defaultComponent);
281
+ }
275
282
  getComponentsGroupName() {
276
283
  const { bundle, pageComponent } = this.getConfig();
277
284
  const group = experiments.isFileSystemPageComponent(pageComponent) ? pageComponent : bundle;
@@ -21,6 +21,7 @@ export declare class PageService implements PageServiceInterface {
21
21
  go(to: number, options?: HistoryOptions): Promise<void>;
22
22
  addComponent(name: string, component: any): void;
23
23
  getComponent(name: string): any;
24
+ resolveComponentFromConfig(property: 'page' | 'layout' | 'header' | 'footer'): any;
24
25
  private getComponentsGroupName;
25
26
  }
26
27
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/module-router",
3
- "version": "1.49.1",
3
+ "version": "1.50.3",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "browser": {
@@ -23,24 +23,24 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@tinkoff/errors": "0.2.18",
26
- "@tinkoff/router": "0.1.66",
26
+ "@tinkoff/router": "0.1.67",
27
27
  "@tinkoff/url": "0.7.37",
28
- "@tramvai/tokens-render": "1.49.1",
29
- "@tramvai/tokens-router": "1.49.1",
30
- "@tramvai/tokens-server": "1.49.1",
31
- "@tramvai/experiments": "1.49.1"
28
+ "@tramvai/tokens-render": "1.50.3",
29
+ "@tramvai/tokens-router": "1.50.3",
30
+ "@tramvai/tokens-server": "1.50.3",
31
+ "@tramvai/experiments": "1.50.3"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "@tinkoff/utils": "^2.1.2",
35
- "@tramvai/cli": "1.49.1",
36
- "@tramvai/core": "1.49.1",
37
- "@tramvai/module-log": "1.49.1",
38
- "@tramvai/module-server": "1.49.1",
39
- "@tramvai/papi": "1.49.1",
40
- "@tramvai/state": "1.49.1",
41
- "@tramvai/test-helpers": "1.49.1",
42
- "@tramvai/test-mocks": "1.49.1",
43
- "@tramvai/tokens-common": "1.49.1",
35
+ "@tramvai/cli": "1.50.3",
36
+ "@tramvai/core": "1.50.3",
37
+ "@tramvai/module-log": "1.50.3",
38
+ "@tramvai/module-server": "1.50.3",
39
+ "@tramvai/papi": "1.50.3",
40
+ "@tramvai/state": "1.50.3",
41
+ "@tramvai/test-helpers": "1.50.3",
42
+ "@tramvai/test-mocks": "1.50.3",
43
+ "@tramvai/tokens-common": "1.50.3",
44
44
  "@tinkoff/dippy": "0.7.36",
45
45
  "react": "*",
46
46
  "tslib": "^2.0.3"