@rocketshow/designer 1.67.0 → 1.68.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.
@@ -11,7 +11,7 @@ import * as i1 from '@angular/common/http';
11
11
  import { HttpHeaders, HttpErrorResponse, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
12
12
  import * as i3$1 from 'ngx-toastr';
13
13
  import { ToastrModule } from 'ngx-toastr';
14
- import { of, forkJoin, Observable, Subject, timer } from 'rxjs';
14
+ import { Subject, of, forkJoin, Observable, timer } from 'rxjs';
15
15
  import * as i3 from '@angular/router';
16
16
  import { RouterModule } from '@angular/router';
17
17
  import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
@@ -814,6 +814,9 @@ class Project {
814
814
  this.fixtures = [];
815
815
  // the fixtures and pixel keys in order to be selectable
816
816
  this.presetFixtures = [];
817
+ // the universes (name + uuid) the project's fixtures are assigned to
818
+ // (used when the user manages universes freely, see freeUniverseEdit)
819
+ this.universes = [];
817
820
  this.scenes = [];
818
821
  this.presets = [];
819
822
  if (!data) {
@@ -855,6 +858,11 @@ class Project {
855
858
  this.presetFixtures.push(new PresetFixture(presetFixture));
856
859
  }
857
860
  }
861
+ if (data.universes) {
862
+ for (const universe of data.universes) {
863
+ this.universes.push({ uuid: universe.uuid, name: universe.name });
864
+ }
865
+ }
858
866
  if (data.scenes) {
859
867
  for (const scene of data.scenes) {
860
868
  this.scenes.push(new Scene(scene));
@@ -952,14 +960,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
952
960
  }]
953
961
  }], ctorParameters: () => [{ type: i1.HttpClient }] });
954
962
 
963
+ class ConfigService {
964
+ constructor() {
965
+ this.enableMediaLibrary = false;
966
+ this.loginAvailable = false;
967
+ this.shareAvailable = false;
968
+ this.menuHeightPx = 0;
969
+ this.languageSwitch = false;
970
+ this.livePreview = false;
971
+ this.localProfiles = false;
972
+ this.intro = false;
973
+ this.uniqueProjectNames = false;
974
+ this.dropzoneChunking = true;
975
+ // List of universes (with name and uuid) the user can choose from
976
+ // in the fixture pool. Typically supplied by the host application
977
+ // (e.g. fetched from a backend).
978
+ this.universes = [];
979
+ // When true, the user can freely add their own universes (only
980
+ // names) in the fixture pool, without depending on a list provided
981
+ // by the host application.
982
+ this.freeUniverseEdit = false;
983
+ this.menuHeightChanged = new Subject();
984
+ }
985
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
986
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ConfigService, providedIn: 'root' }); }
987
+ }
988
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ConfigService, decorators: [{
989
+ type: Injectable,
990
+ args: [{
991
+ providedIn: 'root',
992
+ }]
993
+ }], ctorParameters: () => [] });
994
+
955
995
  class ProjectService {
956
- constructor(http, userService, router, activatedRoute, translateService, toastrService) {
996
+ constructor(http, userService, router, activatedRoute, translateService, toastrService, configService) {
957
997
  this.http = http;
958
998
  this.userService = userService;
959
999
  this.router = router;
960
1000
  this.activatedRoute = activatedRoute;
961
1001
  this.translateService = translateService;
962
1002
  this.toastrService = toastrService;
1003
+ this.configService = configService;
963
1004
  // the project-file versions used in this version of the designer (older ones will be migrated, newer ones are not supported)
964
1005
  this.currentProjectVersion = 2;
965
1006
  }
@@ -985,6 +1026,10 @@ class ProjectService {
985
1026
  }
986
1027
  save(project) {
987
1028
  // tries to save the project and returns, whether it has been saved or not
1029
+ if (this.configService.freeUniverseEdit) {
1030
+ // persist the freely edited universes together with the project
1031
+ project.universes = this.configService.universes;
1032
+ }
988
1033
  this.saveApi(project).subscribe(() => {
989
1034
  const msg = 'designer.project.save-success';
990
1035
  const title = 'designer.project.save-success-title';
@@ -1021,7 +1066,7 @@ class ProjectService {
1021
1066
  return project;
1022
1067
  }));
1023
1068
  }
1024
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ProjectService, deps: [{ token: i1.HttpClient }, { token: UserService }, { token: i3.Router }, { token: i3.ActivatedRoute }, { token: i2.TranslateService }, { token: i3$1.ToastrService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1069
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ProjectService, deps: [{ token: i1.HttpClient }, { token: UserService }, { token: i3.Router }, { token: i3.ActivatedRoute }, { token: i2.TranslateService }, { token: i3$1.ToastrService }, { token: ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1025
1070
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ProjectService, providedIn: 'root' }); }
1026
1071
  }
1027
1072
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ProjectService, decorators: [{
@@ -1029,7 +1074,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
1029
1074
  args: [{
1030
1075
  providedIn: 'root',
1031
1076
  }]
1032
- }], ctorParameters: () => [{ type: i1.HttpClient }, { type: UserService }, { type: i3.Router }, { type: i3.ActivatedRoute }, { type: i2.TranslateService }, { type: i3$1.ToastrService }] });
1077
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: UserService }, { type: i3.Router }, { type: i3.ActivatedRoute }, { type: i2.TranslateService }, { type: i3$1.ToastrService }, { type: ConfigService }] });
1033
1078
 
1034
1079
  class UuidService {
1035
1080
  constructor() { }
@@ -2039,38 +2084,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
2039
2084
  }]
2040
2085
  }], ctorParameters: () => [] });
2041
2086
 
2042
- class ConfigService {
2043
- constructor() {
2044
- this.enableMediaLibrary = false;
2045
- this.loginAvailable = false;
2046
- this.shareAvailable = false;
2047
- this.menuHeightPx = 0;
2048
- this.languageSwitch = false;
2049
- this.livePreview = false;
2050
- this.localProfiles = false;
2051
- this.intro = false;
2052
- this.uniqueProjectNames = false;
2053
- this.dropzoneChunking = true;
2054
- // List of universes (with name and uuid) the user can choose from
2055
- // in the fixture pool. Typically supplied by the host application
2056
- // (e.g. fetched from a backend).
2057
- this.universes = [];
2058
- // When true, the user can freely add their own universes (only
2059
- // names) in the fixture pool, without depending on a list provided
2060
- // by the host application.
2061
- this.freeUniverseEdit = false;
2062
- this.menuHeightChanged = new Subject();
2063
- }
2064
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2065
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ConfigService, providedIn: 'root' }); }
2066
- }
2067
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ConfigService, decorators: [{
2068
- type: Injectable,
2069
- args: [{
2070
- providedIn: 'root',
2071
- }]
2072
- }], ctorParameters: () => [] });
2073
-
2074
2087
  class TimelineStateService {
2075
2088
  constructor() {
2076
2089
  this.playState = 'paused';
@@ -3557,12 +3570,14 @@ class PreviewService {
3557
3570
  }
3558
3571
  const fixture = this.fixtureService.getFixtureByUuid(projectFixture.fixtureUuid);
3559
3572
  const firstDmxChannelAndFixtureUuid = {
3573
+ dmxUniverseUuid: fixture.dmxUniverseUuid,
3560
3574
  firstDmxChannel: fixture.dmxFirstChannel,
3561
3575
  pixelKey: projectFixture.pixelKey,
3562
3576
  };
3563
- const exists = countedFirstDmxChannelPixelKey.some((item) => item.firstDmxChannel === firstDmxChannelAndFixtureUuid.firstDmxChannel &&
3577
+ const exists = countedFirstDmxChannelPixelKey.some((item) => item.dmxUniverseUuid === firstDmxChannelAndFixtureUuid.dmxUniverseUuid &&
3578
+ item.firstDmxChannel === firstDmxChannelAndFixtureUuid.firstDmxChannel &&
3564
3579
  ((!item.pixelKey && !firstDmxChannelAndFixtureUuid.pixelKey) || item.pixelKey === firstDmxChannelAndFixtureUuid.pixelKey));
3565
- // don't count fixtures on the same channel as already counted ones
3580
+ // don't count fixtures on the same universe and channel as already counted ones
3566
3581
  if (!exists) {
3567
3582
  index++;
3568
3583
  countedFirstDmxChannelPixelKey.push(firstDmxChannelAndFixtureUuid);
@@ -4681,7 +4696,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
4681
4696
  }], ctorParameters: () => [{ type: i1$1.BsModalService }, { type: i2.TranslateService }] });
4682
4697
 
4683
4698
  class ProjectLoadService {
4684
- constructor(projectService, previewService, fixtureService, presetService, sceneService, modalService, uuidService, timelineService, router, activatedRoute, warningDialogService, livePreviewService) {
4699
+ constructor(projectService, previewService, fixtureService, presetService, sceneService, modalService, uuidService, timelineService, router, activatedRoute, warningDialogService, livePreviewService, configService) {
4685
4700
  this.projectService = projectService;
4686
4701
  this.previewService = previewService;
4687
4702
  this.fixtureService = fixtureService;
@@ -4694,6 +4709,7 @@ class ProjectLoadService {
4694
4709
  this.activatedRoute = activatedRoute;
4695
4710
  this.warningDialogService = warningDialogService;
4696
4711
  this.livePreviewService = livePreviewService;
4712
+ this.configService = configService;
4697
4713
  }
4698
4714
  migrateToVersion2() {
4699
4715
  for (let fixture of this.projectService.project.fixtures) {
@@ -4741,8 +4757,32 @@ class ProjectLoadService {
4741
4757
  this.warningDialogService.show('designer.project.migrated').subscribe();
4742
4758
  }
4743
4759
  }
4760
+ setupUniverses() {
4761
+ if (this.configService.freeUniverseEdit) {
4762
+ // when the user manages universes freely, the project itself stores the
4763
+ // universes -> use them as the working list
4764
+ this.configService.universes = this.projectService.project.universes;
4765
+ // ensure a default universe exists
4766
+ if (this.configService.universes.length === 0) {
4767
+ this.configService.universes.push({ uuid: this.uuidService.getUuid(), name: 'Universe 1' });
4768
+ }
4769
+ }
4770
+ if (this.configService.universes.length === 0) {
4771
+ // no universe available to assign the fixtures to (e.g. the host
4772
+ // application did not provide any)
4773
+ return;
4774
+ }
4775
+ // assign all fixtures without a universe to the first (default) universe
4776
+ const defaultUniverseUuid = this.configService.universes[0].uuid;
4777
+ for (const fixture of this.projectService.project.fixtures) {
4778
+ if (!fixture.dmxUniverseUuid) {
4779
+ fixture.dmxUniverseUuid = defaultUniverseUuid;
4780
+ }
4781
+ }
4782
+ }
4744
4783
  afterLoad() {
4745
4784
  this.migrateFromOldProject();
4785
+ this.setupUniverses();
4746
4786
  this.fixtureService.updateCachedFixtures();
4747
4787
  this.presetService.removeDeletedFixtures();
4748
4788
  this.previewService.updateFixtureSetup();
@@ -4850,7 +4890,7 @@ class ProjectLoadService {
4850
4890
  this.selectScenesPresetComposition();
4851
4891
  this.afterLoad();
4852
4892
  }
4853
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ProjectLoadService, deps: [{ token: ProjectService }, { token: PreviewService }, { token: FixtureService }, { token: PresetService }, { token: SceneService }, { token: i1$1.BsModalService }, { token: UuidService }, { token: TimelineService }, { token: i3.Router }, { token: i3.ActivatedRoute }, { token: WarningDialogService }, { token: LivePreviewService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4893
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ProjectLoadService, deps: [{ token: ProjectService }, { token: PreviewService }, { token: FixtureService }, { token: PresetService }, { token: SceneService }, { token: i1$1.BsModalService }, { token: UuidService }, { token: TimelineService }, { token: i3.Router }, { token: i3.ActivatedRoute }, { token: WarningDialogService }, { token: LivePreviewService }, { token: ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4854
4894
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ProjectLoadService, providedIn: 'root' }); }
4855
4895
  }
4856
4896
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ProjectLoadService, decorators: [{
@@ -4858,7 +4898,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
4858
4898
  args: [{
4859
4899
  providedIn: 'root',
4860
4900
  }]
4861
- }], ctorParameters: () => [{ type: ProjectService }, { type: PreviewService }, { type: FixtureService }, { type: PresetService }, { type: SceneService }, { type: i1$1.BsModalService }, { type: UuidService }, { type: TimelineService }, { type: i3.Router }, { type: i3.ActivatedRoute }, { type: WarningDialogService }, { type: LivePreviewService }] });
4901
+ }], ctorParameters: () => [{ type: ProjectService }, { type: PreviewService }, { type: FixtureService }, { type: PresetService }, { type: SceneService }, { type: i1$1.BsModalService }, { type: UuidService }, { type: TimelineService }, { type: i3.Router }, { type: i3.ActivatedRoute }, { type: WarningDialogService }, { type: LivePreviewService }, { type: ConfigService }] });
4862
4902
 
4863
4903
  class ArraySortPipe {
4864
4904
  transform(array, field) {
@@ -7578,12 +7618,14 @@ class EffectCurveComponent {
7578
7618
  for (const presetFixture of this.presetService.selectedPreset.fixtures) {
7579
7619
  const fixture = this.fixtureService.getFixtureByUuid(presetFixture.fixtureUuid);
7580
7620
  const firstDmxChannelAndFixtureUuid = {
7621
+ dmxUniverseUuid: fixture.dmxUniverseUuid,
7581
7622
  firstDmxChannel: fixture.dmxFirstChannel,
7582
7623
  pixelKey: presetFixture.pixelKey,
7583
7624
  };
7584
- const exists = countedFirstDmxChannelPixelKey.some((item) => item.firstDmxChannel === firstDmxChannelAndFixtureUuid.firstDmxChannel &&
7625
+ const exists = countedFirstDmxChannelPixelKey.some((item) => item.dmxUniverseUuid === firstDmxChannelAndFixtureUuid.dmxUniverseUuid &&
7626
+ item.firstDmxChannel === firstDmxChannelAndFixtureUuid.firstDmxChannel &&
7585
7627
  ((!item.pixelKey && !firstDmxChannelAndFixtureUuid.pixelKey) || item.pixelKey === firstDmxChannelAndFixtureUuid.pixelKey));
7586
- // don't count it, if it has the same DMX address and pixel key (if available),
7628
+ // don't count it, if it has the same DMX universe, address and pixel key (if available),
7587
7629
  // as an already counted one
7588
7630
  if (!exists) {
7589
7631
  count++;