@colijnit/configurator 12.0.17 → 256.1.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.
package/app/builder.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import * as THREE from "three";
2
- import { Scene } from "three";
3
- import { Options } from "@colijnit/configuratorapi/build/model/options";
4
- import { DecoNode } from "@colijnit/configuratorapi/build/model/deco-node";
5
- import { Selection } from "@colijnit/configuratorapi/build/model/selection";
6
- import { Article } from "@colijnit/configuratorapi/build/model/article";
7
- import { Answer } from "@colijnit/configuratorapi/build/model/answer";
8
- import { BehaviorSubject } from "rxjs";
1
+ import * as THREE from 'three';
2
+ import { Scene } from 'three';
3
+ import { DecoNode } from '@colijnit/configuratorapi/build/model/deco-node';
4
+ import { Selection } from '@colijnit/configuratorapi/build/model/selection';
5
+ import { Article } from '@colijnit/configuratorapi/build/model/article';
6
+ import { Answer } from '@colijnit/configuratorapi/build/model/answer';
7
+ import { BehaviorSubject } from 'rxjs';
8
+ import { Options } from '@colijnit/ioneconnector/build/model/options';
9
9
  export declare class Builder {
10
10
  selectionsReceived: BehaviorSubject<Selection[]>;
11
11
  articleLoaded: BehaviorSubject<Article>;
@@ -1,8 +1,8 @@
1
1
  import { Selection } from '@colijnit/configuratorapi/build/model/selection';
2
2
  import { Answer } from '@colijnit/configuratorapi/build/model/answer';
3
- import { DataServiceResponseData } from '@colijnit/configuratorapi/build/model/data-service-response-data';
4
- import { Options } from "@colijnit/configuratorapi/build/model/options";
5
- import { QuestionAndAnswers } from "@colijnit/configuratorapi/build/model/question-and-answers";
3
+ import { QuestionAndAnswers } from '@colijnit/configuratorapi/build/model/question-and-answers';
4
+ import { Options } from '@colijnit/ioneconnector/build/model/options';
5
+ import { DataServiceResponseData } from '@colijnit/ioneconnector/build/model/data-service-response-data';
6
6
  export declare class ConfiguratorService {
7
7
  private _configuratorApi;
8
8
  initApi(options: Options): void;
@@ -14,6 +14,6 @@ export declare class ConfiguratorService {
14
14
  getDecos(showLoader?: boolean): Promise<DataServiceResponseData>;
15
15
  getQuestionAndAnswers(showLoader?: boolean, publicationCode?: number): Promise<QuestionAndAnswers>;
16
16
  getSingleImage(nodeId: number | string, publication: number, includeMimetype: boolean, thumb: boolean, showLoader: boolean): Promise<DataServiceResponseData>;
17
- selectSelection(selection: Selection, showLoader?: boolean): Promise<QuestionAndAnswers>;
18
- selectAnswer(answer: Answer, showLoader?: boolean): Promise<QuestionAndAnswers>;
17
+ selectSelection(selection: Selection, showLoader?: boolean): Promise<DataServiceResponseData>;
18
+ selectAnswer(answer: Answer, showLoader?: boolean): Promise<DataServiceResponseData>;
19
19
  }
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('three'), require('@colijnit/configuratorapi/build/model/deco-node'), require('@colijnit/configuratorapi/build/service/business-object-factory'), require('@colijnit/configuratorapi/build/model/selection'), require('@colijnit/configuratorapi/build/enum/deco-node-type.enum'), require('@colijnit/configuratorapi/build/enum/deco-node-kind.enum'), require('rxjs'), require('jszip'), require('@colijnit/configuratorapi/build/model/article'), require('@colijnit/configuratorapi/build/configurator'), require('@colijnit/configuratorapi/build/utils/function/not-nill.function'), require('@colijnit/configuratorapi/build/enum/node-type.enum'), require('@colijnit/configuratorapi/build/utils/function/is-nill.function'), require('@angular/core'), require('@angular/common'), require('@angular/animations')) :
3
- typeof define === 'function' && define.amd ? define('@colijnit/configurator', ['exports', 'three', '@colijnit/configuratorapi/build/model/deco-node', '@colijnit/configuratorapi/build/service/business-object-factory', '@colijnit/configuratorapi/build/model/selection', '@colijnit/configuratorapi/build/enum/deco-node-type.enum', '@colijnit/configuratorapi/build/enum/deco-node-kind.enum', 'rxjs', 'jszip', '@colijnit/configuratorapi/build/model/article', '@colijnit/configuratorapi/build/configurator', '@colijnit/configuratorapi/build/utils/function/not-nill.function', '@colijnit/configuratorapi/build/enum/node-type.enum', '@colijnit/configuratorapi/build/utils/function/is-nill.function', '@angular/core', '@angular/common', '@angular/animations'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.colijnit = global.colijnit || {}, global.colijnit.configurator = {}), global.THREE, global.decoNode, global.businessObjectFactory, global.selection, global.decoNodeType_enum, global.decoNodeKind_enum, global.rxjs, global.JSZip, global.article, global.configurator, global.notNill_function, global.nodeType_enum, global.isNill_function, global.ng.core, global.ng.common, global.ng.animations));
5
- })(this, (function (exports, THREE, decoNode, businessObjectFactory, selection, decoNodeType_enum, decoNodeKind_enum, rxjs, JSZip, article, configurator, notNill_function, nodeType_enum, isNill_function, i0, common, animations) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('three'), require('@colijnit/configuratorapi/build/model/deco-node'), require('@colijnit/configuratorapi/build/model/selection'), require('@colijnit/configuratorapi/build/enum/deco-node-type.enum'), require('@colijnit/configuratorapi/build/enum/deco-node-kind.enum'), require('rxjs'), require('jszip'), require('@colijnit/configuratorapi/build/model/article'), require('@colijnit/configuratorapi/build/configurator'), require('@colijnit/configuratorapi/build/utils/function/not-nill.function'), require('@colijnit/configuratorapi/build/enum/node-type.enum'), require('@colijnit/configuratorapi/build/utils/function/is-nill.function'), require('@angular/core'), require('@colijnit/ioneconnector/build/service/business-object-factory'), require('@angular/common'), require('@angular/animations')) :
3
+ typeof define === 'function' && define.amd ? define('@colijnit/configurator', ['exports', 'three', '@colijnit/configuratorapi/build/model/deco-node', '@colijnit/configuratorapi/build/model/selection', '@colijnit/configuratorapi/build/enum/deco-node-type.enum', '@colijnit/configuratorapi/build/enum/deco-node-kind.enum', 'rxjs', 'jszip', '@colijnit/configuratorapi/build/model/article', '@colijnit/configuratorapi/build/configurator', '@colijnit/configuratorapi/build/utils/function/not-nill.function', '@colijnit/configuratorapi/build/enum/node-type.enum', '@colijnit/configuratorapi/build/utils/function/is-nill.function', '@angular/core', '@colijnit/ioneconnector/build/service/business-object-factory', '@angular/common', '@angular/animations'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.colijnit = global.colijnit || {}, global.colijnit.configurator = {}), global.THREE, global.decoNode, global.selection, global.decoNodeType_enum, global.decoNodeKind_enum, global.rxjs, global.JSZip, global.article, global.configurator, global.notNill_function, global.nodeType_enum, global.isNill_function, global.ng.core, global.businessObjectFactory, global.ng.common, global.ng.animations));
5
+ })(this, (function (exports, THREE, decoNode, selection, decoNodeType_enum, decoNodeKind_enum, rxjs, JSZip, article, configurator, notNill_function, nodeType_enum, isNill_function, i0, businessObjectFactory, common, animations) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -793,7 +793,7 @@
793
793
 
794
794
  var Material = /** @class */ (function () {
795
795
  function Material() {
796
- this.specular = new THREE__namespace.Color(0.3, 0.3, 0.3);
796
+ this.specular = new THREE.Color(0.3, 0.3, 0.3);
797
797
  this.shininess = 0;
798
798
  this.repeatX = 4;
799
799
  this.repeatY = 4;
@@ -892,7 +892,7 @@
892
892
  return [4 /*yield*/, ImageUtils.CreateTextureFromBase64(asset.id + '_texture', asset.texture, material)];
893
893
  case 1:
894
894
  _a.texture = _o.sent();
895
- material.texture.encoding = THREE.sRGBEncoding;
895
+ material.texture.colorSpace = THREE.SRGBColorSpace;
896
896
  material.textureFilename = asset.textureFilename;
897
897
  _o.label = 2;
898
898
  case 2:
@@ -1016,7 +1016,7 @@
1016
1016
  }
1017
1017
  var level = parseFloat(settings['level']);
1018
1018
  if (!isNaN(level)) {
1019
- material.specular = new THREE__namespace.Color(level, level, level);
1019
+ material.specular = new THREE.Color(level, level, level);
1020
1020
  }
1021
1021
  var repeatObjectUsed = settings.hasOwnProperty('repeat');
1022
1022
  var repeatx = repeatObjectUsed ? parseFloat(settings['repeat']['repeatx']) : parseFloat(settings['repeatx']);
@@ -1291,20 +1291,20 @@
1291
1291
  variationSettings.settings.roughness = index.roughness;
1292
1292
  if (index.sheen && typeof index.sheen === 'object') {
1293
1293
  variationSettings.sheen = 1;
1294
- variationSettings.sheenColor = new THREE__namespace.Color(index.sheen.r, index.sheen.g, index.sheen.b);
1294
+ variationSettings.sheenColor = new THREE.Color(index.sheen.r, index.sheen.g, index.sheen.b).getHexString(THREE.SRGBColorSpace);
1295
1295
  }
1296
1296
  else {
1297
1297
  variationSettings.sheen = index.sheen;
1298
1298
  }
1299
1299
  if (index.sheenColor) {
1300
- variationSettings.sheenColor = new THREE__namespace.Color(index.sheenColor.r, index.sheenColor.g, index.sheenColor.b);
1300
+ variationSettings.sheenColor = new THREE.Color(index.sheenColor.r, index.sheenColor.g, index.sheenColor.b).getHexString(THREE.SRGBColorSpace);
1301
1301
  }
1302
1302
  variationSettings.sheenRoughness = index.sheenRoughness;
1303
1303
  variationSettings.envMapIntensity = index.envMapIntensity;
1304
1304
  variationSettings.transparent = index.transparent;
1305
1305
  variationSettings.opacity = index.opacity;
1306
1306
  if (index.emissiveValue) {
1307
- variationSettings.emissiveValue = new THREE__namespace.Color(index.emissiveValue.r, index.emissiveValue.g, index.emissiveValue.b);
1307
+ variationSettings.emissiveValue = new THREE.Color(index.emissiveValue.r, index.emissiveValue.g, index.emissiveValue.b).getHexString(THREE.SRGBColorSpace);
1308
1308
  }
1309
1309
  variationSettings.emissiveIntensity = index.emissiveIntensity;
1310
1310
  variationSettings.reflectivity = index.reflectivity;
@@ -1448,7 +1448,7 @@
1448
1448
  });
1449
1449
  };
1450
1450
  VariationUtils.LoadMaterialFromJson = function (material) {
1451
- var loader = new THREE__namespace.MaterialLoader();
1451
+ var loader = new THREE.MaterialLoader();
1452
1452
  if (material.textures) {
1453
1453
  var textures = {};
1454
1454
  for (var i = 0; i < material.textures.length; i++) {
@@ -1800,7 +1800,7 @@
1800
1800
  var child = children[i];
1801
1801
  if (child !== null && child !== undefined) {
1802
1802
  child.traverse(function (mesh) {
1803
- if (mesh instanceof THREE__namespace.Mesh && partMaterial) {
1803
+ if (mesh instanceof THREE.Mesh && partMaterial) {
1804
1804
  if (Array.isArray(mesh.material)) { // multimaterial support
1805
1805
  for (var j = 0, jlen = mesh.material.length; j < jlen; j++) {
1806
1806
  if (mesh.material[j].name.toLowerCase().indexOf('fixed_frame') !== -1) {
@@ -1827,7 +1827,7 @@
1827
1827
  var child = children[i];
1828
1828
  if (child !== null && child !== undefined) {
1829
1829
  child.traverse(function (mesh) {
1830
- if (mesh instanceof THREE__namespace.Mesh && part.variations && part.variations.length > 0 && mesh.name.toLowerCase().indexOf('c_')) {
1830
+ if (mesh instanceof THREE.Mesh && part.variations && part.variations.length > 0 && mesh.name.toLowerCase().indexOf('c_')) {
1831
1831
  for (var j = 0; j < part.variations.length; j++) {
1832
1832
  var variation = part.variations[j];
1833
1833
  if (variation.material) {
@@ -1835,7 +1835,7 @@
1835
1835
  if (Array.isArray(mesh.material)) { // multimaterial support
1836
1836
  for (var m = 0, mlen = mesh.material.length; m < mlen; m++) {
1837
1837
  if (mesh.material[m].name.toLowerCase().indexOf(materialToSearch) !== -1) {
1838
- if (variation.material instanceof THREE__namespace.Material) {
1838
+ if (variation.material instanceof THREE.Material) {
1839
1839
  mesh.material[m] = variation.material;
1840
1840
  if (mesh.material[m].name && (mesh.material[m].name === 'Fixed_Glass' || mesh.material[m].name === 'Default_Glass')) {
1841
1841
  mesh.castShadow = false;
@@ -1852,7 +1852,7 @@
1852
1852
  }
1853
1853
  else {
1854
1854
  if (mesh.material.name.toLowerCase().indexOf(materialToSearch) !== -1) {
1855
- if (variation.material instanceof THREE__namespace.Material) {
1855
+ if (variation.material instanceof THREE.Material) {
1856
1856
  mesh.material = variation.material;
1857
1857
  if (mesh.material.name && (mesh.material.name === 'Fixed_Glass' || mesh.material.name === 'Default_Glass')) {
1858
1858
  mesh.castShadow = false;
@@ -1878,10 +1878,10 @@
1878
1878
  var material = variation.material;
1879
1879
  if (material.texture) {
1880
1880
  material.texture.needsUpdate = true;
1881
- material.texture.mapping = THREE__namespace.EquirectangularReflectionMapping;
1881
+ material.texture.mapping = THREE.EquirectangularReflectionMapping;
1882
1882
  }
1883
1883
  if (!usePbr) {
1884
- var newMaterial = new THREE__namespace.MeshPhongMaterial({
1884
+ var newMaterial = new THREE.MeshPhongMaterial({
1885
1885
  shininess: material.shininess,
1886
1886
  specular: material.specular,
1887
1887
  map: material.texture,
@@ -1952,9 +1952,9 @@
1952
1952
  if (material.envMapIntensity != null || 0) {
1953
1953
  params.envMap = material.envMap;
1954
1954
  params.envMap.needsUpdate = true;
1955
- material.envMap.mapping = THREE__namespace.EquirectangularReflectionMapping;
1956
- material.envMap.minFilter = THREE__namespace.NearestFilter;
1957
- material.envMap.magFilter = THREE__namespace.NearestFilter;
1955
+ material.envMap.mapping = THREE.EquirectangularReflectionMapping;
1956
+ material.envMap.minFilter = THREE.NearestFilter;
1957
+ material.envMap.magFilter = THREE.NearestFilter;
1958
1958
  }
1959
1959
  }
1960
1960
  if (material.reflectivity !== undefined && material.reflectivity !== null) {
@@ -1963,7 +1963,7 @@
1963
1963
  if (material.side) {
1964
1964
  params.side = material.side;
1965
1965
  }
1966
- var newMaterial = new THREE__namespace.MeshPhysicalMaterial(params);
1966
+ var newMaterial = new THREE.MeshPhysicalMaterial(params);
1967
1967
  newMaterial.name = name;
1968
1968
  newMaterial.color.setRGB(1, 1, 1);
1969
1969
  if (material.sheen) {
@@ -2000,7 +2000,7 @@
2000
2000
  newMaterial.transmissionMap.needsUpdate = true;
2001
2001
  }
2002
2002
  if (newMaterial.name && (newMaterial.name === 'Fixed_Glass' || newMaterial.name === 'Default_Glass')) {
2003
- newMaterial.format = THREE__namespace.RGBAFormat;
2003
+ // newMaterial.format = RGBAFormat;
2004
2004
  }
2005
2005
  newMaterial.needsUpdate = true;
2006
2006
  return newMaterial;
@@ -2063,19 +2063,19 @@
2063
2063
  if (material.envMapIntensity != null || 0) {
2064
2064
  params.envMap = material.envMap;
2065
2065
  params.envMap.needsUpdate = true;
2066
- material.envMap.mapping = THREE__namespace.EquirectangularReflectionMapping;
2067
- material.envMap.minFilter = THREE__namespace.NearestFilter;
2068
- material.envMap.magFilter = THREE__namespace.NearestFilter;
2066
+ material.envMap.mapping = THREE.EquirectangularReflectionMapping;
2067
+ material.envMap.minFilter = THREE.NearestFilter;
2068
+ material.envMap.magFilter = THREE.NearestFilter;
2069
2069
  }
2070
2070
  }
2071
2071
  if (material.side) {
2072
2072
  params.side = material.side;
2073
2073
  }
2074
- var newMaterial = new THREE__namespace.MeshStandardMaterial(params);
2074
+ var newMaterial = new THREE.MeshStandardMaterial(params);
2075
2075
  newMaterial.name = name;
2076
2076
  newMaterial.color.setRGB(1, 1, 1);
2077
2077
  if (newMaterial.name && (newMaterial.name === 'Fixed_Glass' || newMaterial.name === 'Default_Glass')) {
2078
- newMaterial.format = THREE__namespace.RGBAFormat;
2078
+ // newMaterial.format = RGBAFormat;
2079
2079
  }
2080
2080
  newMaterial.needsUpdate = true;
2081
2081
  return newMaterial;
@@ -2418,14 +2418,14 @@
2418
2418
  };
2419
2419
  Builder.prototype.selectSelection = function (selection) {
2420
2420
  return __awaiter(this, void 0, void 0, function () {
2421
- var questionsAndAnswers;
2422
2421
  return __generator(this, function (_a) {
2423
2422
  switch (_a.label) {
2424
2423
  case 0: return [4 /*yield*/, this._configuratorService.selectSelection(selection, false)];
2425
2424
  case 1:
2426
- questionsAndAnswers = _a.sent();
2427
- this._answers = questionsAndAnswers.answers;
2428
- this.answersReceived.next(questionsAndAnswers.answers);
2425
+ _a.sent();
2426
+ return [4 /*yield*/, this.getQuestionAndAnswers()];
2427
+ case 2:
2428
+ _a.sent();
2429
2429
  return [2 /*return*/];
2430
2430
  }
2431
2431
  });
@@ -2448,15 +2448,15 @@
2448
2448
  };
2449
2449
  Builder.prototype.selectAnswer = function (answer) {
2450
2450
  return __awaiter(this, void 0, void 0, function () {
2451
- var questionsAndAnswers;
2452
2451
  return __generator(this, function (_a) {
2453
2452
  switch (_a.label) {
2454
2453
  case 0: return [4 /*yield*/, this._configuratorService.selectAnswer(answer, false)];
2455
2454
  case 1:
2456
- questionsAndAnswers = _a.sent();
2457
- this._answers = questionsAndAnswers.answers;
2458
- this.answersReceived.next(questionsAndAnswers.answers);
2459
- if (questionsAndAnswers.answers.length === 0) {
2455
+ _a.sent();
2456
+ return [4 /*yield*/, this.getQuestionAndAnswers()];
2457
+ case 2:
2458
+ _a.sent();
2459
+ if (this._answers.length === 0) {
2460
2460
  this._build();
2461
2461
  }
2462
2462
  return [2 /*return*/];