@colijnit/homedecorator 262.1.4 → 262.1.5

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.
@@ -43,9 +43,7 @@ import { XRControllerModelFactory } from 'three/examples/jsm/webxr/XRControllerM
43
43
  import { RGBFormat, LinearToneMapping, AgXToneMapping, LinearFilter as LinearFilter$1, LinearSRGBColorSpace as LinearSRGBColorSpace$1, SrcAlphaSaturateFactor, FloatType as FloatType$1 } from 'three/src/constants.js';
44
44
  import md5 from 'md5';
45
45
  import { NodeType } from '@colijnit/configuratorapi/build/enum/node-type.enum';
46
- import { ConfiguratorStatisticsEnvironment } from '@colijnit/configuratorapi/build/model/configurator-statistics-environment';
47
46
  import { Options } from '@colijnit/ioneconnector/build/model/options';
48
- import { FrozenArticle } from '@colijnit/configuratorapi/build/model/frozen-article';
49
47
  import { SelectorWithOptions } from '@colijnit/configuratorapi/build/model/selector-with-options';
50
48
  import { ImageUtils } from '@colijnit/configuratorapi/build/utils/image-utils';
51
49
  import * as i1 from '@angular/common/http';
@@ -4003,6 +4001,18 @@ class HomedecoratorConnectorAdapterService {
4003
4001
  // public getJsonMatchTableArticles(): Promise<void> {
4004
4002
  // return this.connector.getJsonMatchTableArticles();
4005
4003
  // }
4004
+ async prepareArticleForCart(goodId, quantity = 1, shouldGetArticleTree = false, showLoader = true, instanceId = undefined) {
4005
+ const response = await this.articleApi.prepareArticleForCart('Homedecorator', 'Sales', 'Homedecorator', goodId, shouldGetArticleTree, quantity, instanceId, showLoader);
4006
+ if (response && response.validationResult && response.validationResult.success) {
4007
+ if (typeof response.resultObject !== 'string') {
4008
+ return this._boFactory.makeWithRawBackendData(ArticleFullObject, response.resultObject);
4009
+ }
4010
+ return response.resultObject;
4011
+ }
4012
+ else {
4013
+ return null;
4014
+ }
4015
+ }
4006
4016
  async setInstanceToConfigure(id) {
4007
4017
  try {
4008
4018
  if (id !== null) {
@@ -6869,8 +6879,8 @@ class HomedecoratorConnectorService {
6869
6879
  googleTranslateEnabled() {
6870
6880
  return this._connector.googleTranslateEnabled();
6871
6881
  }
6872
- getJsonConfiguredArticles(goodId, goodType, quantity, externalSource = false, showLoader = true, instanceId, configuratorStatistics) {
6873
- return this._connector.getJsonConfiguredArticles(goodId, goodType, quantity, externalSource, showLoader, instanceId, configuratorStatistics);
6882
+ prepareArticleForCart(goodId, quantity, externalSource = false, showLoader = true, instanceId) {
6883
+ return this._connector.prepareArticleForCart(goodId, quantity, !!externalSource, showLoader, instanceId);
6874
6884
  }
6875
6885
  // public getJsonMatchTableArticles(): Promise<any> {
6876
6886
  // return this._connector.getJsonMatchTableArticles();
@@ -6903,7 +6913,7 @@ class HomedecoratorConnectorService {
6903
6913
  });
6904
6914
  this.articleReceived.next(article);
6905
6915
  this._article = article;
6906
- this._articlePrice = article.price;
6916
+ this._articlePrice = article ? article.price : null;
6907
6917
  // Sometimes the sku is not returned in Article
6908
6918
  this._article.sku = sku;
6909
6919
  return article;
@@ -7189,23 +7199,21 @@ class HomedecoratorConnectorService {
7189
7199
  });
7190
7200
  }
7191
7201
  async addToCart(goodId, goodType, quantity, instanceId, externalSource) {
7192
- let json;
7193
- const statistics = new ConfiguratorStatisticsEnvironment();
7194
- statistics.userType = 'Homedecorator';
7195
- statistics.transactionType = 'Sales';
7196
- statistics.actionDomain = 'Homedecorator';
7197
- statistics.sessionId = this._settingsService.settings.session ? this._settingsService.settings.session.sessionId : 'unknown';
7198
- statistics.webHost = window.location.host;
7199
- statistics.bundleHost = window.location.host;
7200
- json = await this.getJsonConfiguredArticles(goodId, goodType, quantity, externalSource, true, instanceId, statistics);
7201
- const frozenArticle = JSON.parse(json);
7202
+ const response = await this.prepareArticleForCart(goodId, quantity, externalSource, true, instanceId);
7203
+ let article;
7204
+ if (typeof response === 'string') {
7205
+ article = JSON.parse(response);
7206
+ }
7207
+ else {
7208
+ article = response;
7209
+ }
7202
7210
  this._googleTagManager.sendEvent(GoogleTagManagerEvent.AddToCart, {
7203
- 'articleNr': frozenArticle.articleNr,
7204
- 'product': frozenArticle.articleName,
7205
- 'composition': frozenArticle instanceof FrozenArticle ? frozenArticle.compositions : frozenArticle.configurationText
7211
+ 'articleNr': article.selectorData ? article.selectorData.articleNr : article.articleNr,
7212
+ 'product': article.selectorData ? article.selectorData.articleName : article.name,
7213
+ 'composition': article.selectorData ? article.selectorData.configurationText : article.configuration
7206
7214
  });
7207
- this._messageService.emit(MessageType.ArticleCreated, json);
7208
- return json;
7215
+ this._messageService.emit(MessageType.ArticleCreated, article);
7216
+ return article;
7209
7217
  }
7210
7218
  handleAnswersReceived() {
7211
7219
  this._preloadCachedImages(this.activeAnswers);
@@ -17279,10 +17287,9 @@ class WallItem extends Item {
17279
17287
  // if elevation is higher than the wall, use maxY
17280
17288
  // vec3.y = Math.min(this._getMaxY(wall) / 2, this.halfSize.y + this.elevation);
17281
17289
  vec3.y = Math.min(maxY, this.halfSize.y + this.elevation);
17282
- }
17283
- else if (this.elevationAdjustable && this.onWall) {
17284
- // if the item is adjustable & is placed on the wall
17285
- vec3.y = Math.min(this._getMaxY(wall), this.halfSize.y + this.elevation);
17290
+ // } else if (this.elevationAdjustable && this.onWall) { /* no idea why this is done, but it causes problems for positioning items */
17291
+ // // if the item is adjustable & is placed on the wall
17292
+ // vec3.y = Math.min(this._getMaxY(wall), this.halfSize.y + this.elevation);
17286
17293
  }
17287
17294
  else {
17288
17295
  if (vec3.y < minY) {
@@ -28700,7 +28707,7 @@ class RenderService {
28700
28707
  this._appEventService = _appEventService;
28701
28708
  this._dictionaryService = _dictionaryService;
28702
28709
  this.renderImageChanged = new BehaviorSubject('');
28703
- this.renderImageError = new BehaviorSubject('');
28710
+ this.renderImageError = new Subject();
28704
28711
  this.blenderRenderStarted = new Subject();
28705
28712
  this.renderUpdateImageChanged = new BehaviorSubject(undefined);
28706
28713
  this.renderRoomImageChanged = new BehaviorSubject('');
@@ -43305,10 +43312,10 @@ class RoomPlannerComponent {
43305
43312
  if (object.metadata) {
43306
43313
  this.showContextMenu = false;
43307
43314
  await this._connectorAdapterService.initConnector(object.metadata.externalSettings ? object.metadata.externalSettings.settings : this.settingsService.settings, object.metadata.externalSettings ? object.metadata.externalSettings.name : undefined, false, object.metadata.externalSettings && object.metadata.externalSettings.externalSourceId ? object.metadata.externalSettings.externalSourceId : null);
43308
- const json = await this._connectorService.addToCart(+object.metadata.goodId, object.metadata.goodType, 1, object.metadata.itemId, !!(object.metadata.externalSettings && object.metadata.externalSettings.externalSourceId));
43315
+ const article = await this._connectorService.addToCart(+object.metadata.goodId, object.metadata.goodType, 1, object.metadata.itemId, !!(object.metadata.externalSettings && object.metadata.externalSettings.externalSourceId));
43309
43316
  if (object.metadata.externalSettings) {
43310
43317
  const externalSource = {
43311
- article: json,
43318
+ article: article,
43312
43319
  quantity: 1,
43313
43320
  catalogDefinition: object.metadata.externalSettings.catalogDefinition,
43314
43321
  externalSource: this._connectorAdapterService.getExternalSourceFromId(object.metadata.externalSettings.externalSourceId)
@@ -43316,7 +43323,7 @@ class RoomPlannerComponent {
43316
43323
  this._appEventService.addExternalSourceToCart.next(externalSource);
43317
43324
  }
43318
43325
  else {
43319
- this._appEventService.addToCart.next({ article: json, quantity: 1 });
43326
+ this._appEventService.addToCart.next({ article: article, quantity: 1 });
43320
43327
  }
43321
43328
  }
43322
43329
  }
@@ -49699,7 +49706,7 @@ class HomedecoratorComponent {
49699
49706
  return this._settings;
49700
49707
  }
49701
49708
  constructor(appService, // don't remove this, needs to be created on a high level
49702
- controllerService, appState, presetsService, screenAnalysis, _iconRegistry, _domSanitizer, _messageService, _homedecoratorService, _parentEventService, _ownEventService, _integrationService, _sceneService, _webWorkerService, _configurationPresetLoadService) {
49709
+ controllerService, appState, presetsService, screenAnalysis, _iconRegistry, _domSanitizer, _messageService, _homedecoratorService, _parentEventService, _ownEventService, _integrationService, _sceneService, _webWorkerService, _configurationPresetLoadService, _injector) {
49703
49710
  this.appService = appService;
49704
49711
  this.controllerService = controllerService;
49705
49712
  this.appState = appState;
@@ -49715,6 +49722,7 @@ class HomedecoratorComponent {
49715
49722
  this._sceneService = _sceneService;
49716
49723
  this._webWorkerService = _webWorkerService;
49717
49724
  this._configurationPresetLoadService = _configurationPresetLoadService;
49725
+ this._injector = _injector;
49718
49726
  this.generalFilterOrders = [
49719
49727
  { name: 'CATEGORY', order: 1 },
49720
49728
  { name: 'TURNOVER_GROUP', order: 2 },
@@ -49801,6 +49809,7 @@ class HomedecoratorComponent {
49801
49809
  // };
49802
49810
  this._subs = [];
49803
49811
  this._initCommunication = false;
49812
+ ServiceLocator.injector = this._injector;
49804
49813
  this._eventService = _parentEventService || _ownEventService;
49805
49814
  this._webWorkerService.initWorkers();
49806
49815
  }
@@ -49931,7 +49940,7 @@ class HomedecoratorComponent {
49931
49940
  _initConnection() {
49932
49941
  this._homedecoratorService.init(this._settings);
49933
49942
  }
49934
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: HomedecoratorComponent, deps: [{ token: HomedecoratorAppService }, { token: HomedecoratorConnectorService }, { token: AppStateService }, { token: PresetsService }, { token: ScreenSizeAnalysisService }, { token: i5.MatIconRegistry }, { token: i1$1.DomSanitizer }, { token: MessageBusService }, { token: HomedecoratorService }, { token: HomedecoratorAppEventService, optional: true, skipSelf: true }, { token: HomedecoratorAppEventService, optional: true, self: true }, { token: IntegrationService }, { token: SceneService }, { token: WebWorkerService }, { token: ConfigurationPresetLoadService }], target: i0.ɵɵFactoryTarget.Component }); }
49943
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: HomedecoratorComponent, deps: [{ token: HomedecoratorAppService }, { token: HomedecoratorConnectorService }, { token: AppStateService }, { token: PresetsService }, { token: ScreenSizeAnalysisService }, { token: i5.MatIconRegistry }, { token: i1$1.DomSanitizer }, { token: MessageBusService }, { token: HomedecoratorService }, { token: HomedecoratorAppEventService, optional: true, skipSelf: true }, { token: HomedecoratorAppEventService, optional: true, self: true }, { token: IntegrationService }, { token: SceneService }, { token: WebWorkerService }, { token: ConfigurationPresetLoadService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component }); }
49935
49944
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: HomedecoratorComponent, isStandalone: false, selector: "co-homedecorator", inputs: { generalFilterOrders: "generalFilterOrders", purchaseFilterOrders: "purchaseFilterOrders", logisticsFilterOrders: "logisticsFilterOrders", initCommunication: "initCommunication", projectToLoad: "projectToLoad", shareButton: "shareButton", loadWithConfigurationPreset: "loadWithConfigurationPreset", settings: "settings" }, host: { listeners: { "document:keyup": "keyup($event)" }, properties: { "class.co-homedecorator": "this.showClass" } }, providers: [
49936
49945
  APPLICATION_SERVICES_PROVIDERS
49937
49946
  ], ngImport: i0, template: `
@@ -50033,7 +50042,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
50033
50042
  type: Optional
50034
50043
  }, {
50035
50044
  type: Self
50036
- }] }, { type: IntegrationService }, { type: SceneService }, { type: WebWorkerService }, { type: ConfigurationPresetLoadService }], propDecorators: { generalFilterOrders: [{
50045
+ }] }, { type: IntegrationService }, { type: SceneService }, { type: WebWorkerService }, { type: ConfigurationPresetLoadService }, { type: i0.Injector }], propDecorators: { generalFilterOrders: [{
50037
50046
  type: Input
50038
50047
  }], purchaseFilterOrders: [{
50039
50048
  type: Input
@@ -52703,11 +52712,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
52703
52712
  }] });
52704
52713
 
52705
52714
  class HomedecoratorModule {
52706
- constructor(_injector) {
52707
- this._injector = _injector;
52708
- ServiceLocator.injector = this._injector;
52709
- }
52710
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: HomedecoratorModule, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.NgModule }); }
52715
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: HomedecoratorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
52711
52716
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.16", ngImport: i0, type: HomedecoratorModule, bootstrap: [HomedecoratorComponent], declarations: [HomedecoratorComponent], imports: [CommonModule,
52712
52717
  ProgressBarModule,
52713
52718
  LoadingOverlayModule,
@@ -52756,7 +52761,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
52756
52761
  ],
52757
52762
  bootstrap: [HomedecoratorComponent]
52758
52763
  }]
52759
- }], ctorParameters: () => [{ type: i0.Injector }] });
52764
+ }] });
52760
52765
 
52761
52766
  class MaterialBuilderComponent {
52762
52767
  set settings(value) {