@edm-sdui/sdui 1.0.20 → 1.0.22

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Injectable, Optional, Inject, Injector, Component, Input, EventEmitter, Output, Directive, HostListener, ViewChild, inject, NgModule, ChangeDetectionStrategy } from '@angular/core';
2
+ import { InjectionToken, Injectable, Optional, Inject, Injector, Component, Input, EventEmitter, Output, createComponent, Directive, HostListener, ViewChild, inject, NgModule, ChangeDetectionStrategy } from '@angular/core';
3
3
  import * as i1$1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i1$3 from '@angular/router';
@@ -431,16 +431,11 @@ var UIActionType;
431
431
  })(UIActionType || (UIActionType = {}));
432
432
 
433
433
  class UIActionHandlersService {
434
- registerLogout(handler) {
435
- this.logoutHandler = handler;
434
+ registerInternalNavigation(fn) {
435
+ this.internalNavigationHandler = fn;
436
436
  }
437
- executeLogout() {
438
- if (this.logoutHandler) {
439
- this.logoutHandler();
440
- }
441
- else {
442
- console.warn('Nenhum handler de logout registrado.');
443
- }
437
+ handleInternalNavigation(url) {
438
+ this.internalNavigationHandler?.(url);
444
439
  }
445
440
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UIActionHandlersService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
446
441
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UIActionHandlersService, providedIn: 'root' }); }
@@ -477,14 +472,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
477
472
  }] } });
478
473
 
479
474
  class ModalService {
480
- constructor(injector, appRef, cfr) {
481
- this.injector = injector;
475
+ constructor(appRef, envInjector) {
482
476
  this.appRef = appRef;
483
- this.cfr = cfr;
477
+ this.envInjector = envInjector;
484
478
  }
485
479
  open(url, title = '') {
486
- const factory = this.cfr.resolveComponentFactory(ModalComponent);
487
- const componentRef = factory.create(this.injector);
480
+ const componentRef = createComponent(ModalComponent, {
481
+ environmentInjector: this.envInjector
482
+ });
488
483
  componentRef.instance.url = url;
489
484
  componentRef.instance.title = title;
490
485
  componentRef.instance.closed.subscribe(() => {
@@ -495,19 +490,19 @@ class ModalService {
495
490
  const domElem = componentRef.hostView.rootNodes[0];
496
491
  document.body.appendChild(domElem);
497
492
  }
498
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ModalService, deps: [{ token: i0.Injector }, { token: i0.ApplicationRef }, { token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Injectable }); }
493
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ModalService, deps: [{ token: i0.ApplicationRef }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
499
494
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ModalService, providedIn: 'root' }); }
500
495
  }
501
496
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ModalService, decorators: [{
502
497
  type: Injectable,
503
498
  args: [{ providedIn: 'root' }]
504
- }], ctorParameters: () => [{ type: i0.Injector }, { type: i0.ApplicationRef }, { type: i0.ComponentFactoryResolver }] });
499
+ }], ctorParameters: () => [{ type: i0.ApplicationRef }, { type: i0.EnvironmentInjector }] });
505
500
 
506
501
  class UIActionService {
507
- constructor(router, actionHandlers, modalService) {
502
+ constructor(router, modalService, actionHandlers) {
508
503
  this.router = router;
509
- this.actionHandlers = actionHandlers;
510
504
  this.modalService = modalService;
505
+ this.actionHandlers = actionHandlers;
511
506
  }
512
507
  execute(action) {
513
508
  if (!action || !action.type)
@@ -523,7 +518,8 @@ class UIActionService {
523
518
  });
524
519
  }
525
520
  else {
526
- this.handleCustomNavigation(action.url || '');
521
+ if (action.url)
522
+ this.actionHandlers.handleInternalNavigation(action.url);
527
523
  }
528
524
  break;
529
525
  case UIActionType.RELOAD_INTERNAL_URL:
@@ -554,80 +550,13 @@ class UIActionService {
554
550
  // Outros tipos de ação podem ser adicionados aqui
555
551
  }
556
552
  }
557
- handleCustomNavigation(url) {
558
- if (url.includes('timeline/')) {
559
- const broken = url.split('timeline/')[1];
560
- this.router.navigate(['comunidade', 'postagem', broken], { queryParams: { from: 'sdui' } });
561
- return true;
562
- }
563
- if (url.includes('live/')) {
564
- const broken = url.split('live/')[1];
565
- this.router.navigate(['comunidade', 'postagem', 'live', broken], { queryParams: { from: 'sdui' } });
566
- return true;
567
- }
568
- if (url.includes('lesson/')) {
569
- const lessonId = url.split('lesson/')[1];
570
- const productId = url.includes('product/') ? url.split('product/')[1].split('/')[0] : null;
571
- if (productId) {
572
- this.router.navigate(['produtos', productId, 'aula', lessonId], { queryParams: { from: 'sdui' } });
573
- return true;
574
- }
575
- }
576
- if (url.includes('product/')) {
577
- const productId = url.split('product/')[1];
578
- this.router.navigate(['produtos', productId], { queryParams: { from: 'sdui' } });
579
- return true;
580
- }
581
- if (url.includes('posts/')) {
582
- const postId = url.split('posts/')[1];
583
- this.router.navigate(['comunidade', 'postagem', postId], { queryParams: { from: 'sdui' } });
584
- return true;
585
- }
586
- if (url.includes('my-purchases')) {
587
- this.router.navigate(['perfil', 'compras'], { queryParams: { from: 'sdui' } });
588
- return true;
589
- }
590
- if (url.includes('my-annotations')) {
591
- this.router.navigate(['perfil', 'meu-caderno'], { queryParams: { from: 'sdui' } });
592
- return true;
593
- }
594
- if (url.includes('my-list')) {
595
- this.router.navigate(['perfil', 'minha-lista'], { queryParams: { from: 'sdui' } });
596
- return true;
597
- }
598
- if (url.includes('my-certificates')) {
599
- this.router.navigate(['perfil', 'certificados'], { queryParams: { from: 'sdui' } });
600
- return true;
601
- }
602
- if (url.includes('my-subscriptions')) {
603
- this.router.navigate(['perfil', 'assinaturas'], { queryParams: { from: 'sdui' } });
604
- return true;
605
- }
606
- if (url.includes('edit-profile')) {
607
- this.router.navigate(['perfil', 'editar'], { queryParams: { from: 'sdui' } });
608
- return true;
609
- }
610
- if (url.includes('ranking')) {
611
- this.router.navigate(['perfil', 'ranking'], { queryParams: { from: 'sdui' } });
612
- return true;
613
- }
614
- if (url.includes('ranking/rules')) {
615
- this.router.navigate(['perfil', 'ranking', 'regras'], { queryParams: { from: 'sdui' } });
616
- return true;
617
- }
618
- if (url.includes('logout')) {
619
- this.router.navigate(['logout'], { queryParams: { from: 'sdui' } });
620
- return true;
621
- }
622
- return false; // nenhum dos casos especiais foi tratado
623
- }
624
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UIActionService, deps: [{ token: i1$3.Router }, { token: UIActionHandlersService }, { token: ModalService }], target: i0.ɵɵFactoryTarget.Injectable }); }
553
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UIActionService, deps: [{ token: i1$3.Router }, { token: ModalService }, { token: UIActionHandlersService }], target: i0.ɵɵFactoryTarget.Injectable }); }
625
554
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UIActionService, providedIn: 'root' }); }
626
555
  }
627
556
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UIActionService, decorators: [{
628
557
  type: Injectable,
629
558
  args: [{ providedIn: 'root' }]
630
- }], ctorParameters: () => [{ type: i1$3.Router }, { type: UIActionHandlersService }, { type: ModalService }] });
559
+ }], ctorParameters: () => [{ type: i1$3.Router }, { type: ModalService }, { type: UIActionHandlersService }] });
631
560
 
632
561
  var UIAsset;
633
562
  (function (UIAsset) {
@@ -801,6 +730,7 @@ var UIAsset;
801
730
  UIAsset["IC_DOWNLOADS_LIST"] = "ic_downloads_list";
802
731
  UIAsset["IC_EMAIL"] = "ic_email";
803
732
  UIAsset["IC_EMPTY_CLASS"] = "ic_empty_class";
733
+ UIAsset["IC_EMPTY_MAIN"] = "ic_empty_main";
804
734
  UIAsset["IC_ERROR"] = "ic_error";
805
735
  UIAsset["IC_ERROR_CHALLENGE"] = "ic_error_challenge";
806
736
  UIAsset["IC_FILE"] = "ic_file";
@@ -995,6 +925,7 @@ var UIAsset;
995
925
  UIAsset["IC_RANKING_RANKING"] = "ic_ranking_ranking";
996
926
  UIAsset["BT_NEXT_PROFILE"] = "bt_next_profile";
997
927
  UIAsset["IC_SUPPORT_PROFILE"] = "ic_support_profile";
928
+ UIAsset["BT_BACK_SEC"] = "bt_back_sec";
998
929
  })(UIAsset || (UIAsset = {}));
999
930
 
1000
931
  const assetMapping = {
@@ -1167,6 +1098,7 @@ const assetMapping = {
1167
1098
  [UIAsset.IC_DOWNLOADS_LIST]: 'assets/images/ic-downloads-list.svg',
1168
1099
  [UIAsset.IC_EMAIL]: 'assets/images/ic-email.svg',
1169
1100
  [UIAsset.IC_EMPTY_CLASS]: 'assets/images/ic-empty-class.svg',
1101
+ [UIAsset.IC_EMPTY_MAIN]: 'assets/images/ic-empty-main.svg',
1170
1102
  [UIAsset.IC_ERROR]: 'assets/images/ic-error.svg',
1171
1103
  [UIAsset.IC_ERROR_CHALLENGE]: 'assets/images/ic-error-challenge.svg',
1172
1104
  [UIAsset.IC_FILE]: 'assets/images/ic-file.svg',
@@ -1362,6 +1294,7 @@ const assetMapping = {
1362
1294
  [UIAsset.IC_RANKING_RANKING]: 'assets/images/ic-ranking-ranking.svg',
1363
1295
  [UIAsset.BT_NEXT_PROFILE]: 'assets/images/bt-next-profile.svg',
1364
1296
  [UIAsset.IC_SUPPORT_PROFILE]: 'assets/images/ic-support-profile.svg',
1297
+ [UIAsset.BT_BACK_SEC]: 'assets/images/bt-back-sec.svg',
1365
1298
  };
1366
1299
 
1367
1300
  var UISpacingLevel;
@@ -2553,7 +2486,7 @@ class SduiComponent {
2553
2486
  this.route.queryParams.subscribe((params) => {
2554
2487
  const paramValue = params[SDUI_URL_PARAM];
2555
2488
  const hasValidParam = this.validateParam(paramValue);
2556
- if (hasValidParam && this.currentSduiUrl !== paramValue) {
2489
+ if (hasValidParam) {
2557
2490
  console.debug('[SduiComponent] carregando sdui do parâmetro...');
2558
2491
  this.viewModel.loadUIScreen(paramValue);
2559
2492
  }