@colijnit/configurator 259.1.5 → 260.1.1
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/README.md +28 -28
- package/bundles/colijnit-configurator.umd.js +112 -49
- package/bundles/colijnit-configurator.umd.js.map +1 -1
- package/colijnit-configurator-260.1.0.tgz +0 -0
- package/colijnit-configurator-260.1.1.tgz +0 -0
- package/configurator/index.html +14 -0
- package/configurator/main.js +3683 -0
- package/configurator/main.js.map +1 -0
- package/configurator/polyfills.js +5683 -0
- package/configurator/polyfills.js.map +1 -0
- package/configurator/runtime.js +149 -0
- package/configurator/runtime.js.map +1 -0
- package/configurator/styles.css +48 -0
- package/configurator/styles.css.map +1 -0
- package/configurator/vendor.js +209342 -0
- package/configurator/vendor.js.map +1 -0
- package/esm2015/app/builder.js +5 -9
- package/esm2015/app/components/answers/answer/answer.component.js +18 -18
- package/esm2015/app/components/shared/loader/loader.component.js +12 -12
- package/esm2015/app/components/shared/shared.module.js +1 -1
- package/esm2015/app/directives/visibility-observer-master.directive.js +1 -1
- package/esm2015/app/directives/visibility-observer.directive.js +1 -1
- package/esm2015/app/services/configurator.service.js +1 -1
- package/esm2015/app/services/image-cache.service.js +1 -1
- package/esm2015/helper/variation-helper.js +61 -35
- package/esm2015/model/material.js +1 -1
- package/esm2015/model/variation-settings.js +1 -1
- package/esm2015/model/variation.js +1 -1
- package/esm2015/utils/asset.utils.js +1 -1
- package/esm2015/utils/file.utils.js +1 -1
- package/esm2015/utils/image.utils.js +1 -1
- package/esm2015/utils/threed.utils.js +1 -1
- package/esm2015/utils/variation-utils.js +28 -1
- package/fesm2015/colijnit-configurator.js +119 -70
- package/fesm2015/colijnit-configurator.js.map +1 -1
- package/helper/variation-helper.d.ts +2 -1
- package/package.json +3 -3
- package/utils/variation-utils.d.ts +1 -0
package/README.md
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
# Catalog
|
|
2
|
-
|
|
3
|
-
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.1.2.
|
|
4
|
-
|
|
5
|
-
## Development server
|
|
6
|
-
|
|
7
|
-
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
|
|
8
|
-
|
|
9
|
-
## Code scaffolding
|
|
10
|
-
|
|
11
|
-
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|module`.
|
|
12
|
-
|
|
13
|
-
## Build
|
|
14
|
-
|
|
15
|
-
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
|
|
16
|
-
|
|
17
|
-
## Running unit tests
|
|
18
|
-
|
|
19
|
-
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
20
|
-
|
|
21
|
-
## Running end-to-end tests
|
|
22
|
-
|
|
23
|
-
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
|
|
24
|
-
Before running the tests make sure you are serving the app via `ng serve`.
|
|
25
|
-
|
|
26
|
-
## Further help
|
|
27
|
-
|
|
28
|
-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
|
1
|
+
# Catalog
|
|
2
|
+
|
|
3
|
+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.1.2.
|
|
4
|
+
|
|
5
|
+
## Development server
|
|
6
|
+
|
|
7
|
+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
|
|
8
|
+
|
|
9
|
+
## Code scaffolding
|
|
10
|
+
|
|
11
|
+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|module`.
|
|
12
|
+
|
|
13
|
+
## Build
|
|
14
|
+
|
|
15
|
+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
|
|
16
|
+
|
|
17
|
+
## Running unit tests
|
|
18
|
+
|
|
19
|
+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
20
|
+
|
|
21
|
+
## Running end-to-end tests
|
|
22
|
+
|
|
23
|
+
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
|
|
24
|
+
Before running the tests make sure you are serving the app via `ng serve`.
|
|
25
|
+
|
|
26
|
+
## Further help
|
|
27
|
+
|
|
28
|
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
|
@@ -1454,6 +1454,45 @@
|
|
|
1454
1454
|
});
|
|
1455
1455
|
});
|
|
1456
1456
|
};
|
|
1457
|
+
VariationUtils.LoadVariationByUrl = function (materialCode, url) {
|
|
1458
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1459
|
+
var file, settings, err_2;
|
|
1460
|
+
return __generator(this, function (_a) {
|
|
1461
|
+
switch (_a.label) {
|
|
1462
|
+
case 0:
|
|
1463
|
+
if (!url) {
|
|
1464
|
+
return [2 /*return*/, null];
|
|
1465
|
+
}
|
|
1466
|
+
if (!url.includes('ione3d')) {
|
|
1467
|
+
url = url.concat('.ione3d');
|
|
1468
|
+
}
|
|
1469
|
+
if (!window.hasOwnProperty('downloadVariation')) {
|
|
1470
|
+
console.error('downloadVariation not defined in window global');
|
|
1471
|
+
throw new Error('downloadVariation not defined in window global');
|
|
1472
|
+
}
|
|
1473
|
+
if (this.MaterialCache.has(materialCode)) {
|
|
1474
|
+
return [2 /*return*/, this.MaterialCache.get(materialCode)];
|
|
1475
|
+
}
|
|
1476
|
+
_a.label = 1;
|
|
1477
|
+
case 1:
|
|
1478
|
+
_a.trys.push([1, 4, , 5]);
|
|
1479
|
+
return [4 /*yield*/, window.downloadVariation(url)];
|
|
1480
|
+
case 2:
|
|
1481
|
+
file = _a.sent();
|
|
1482
|
+
return [4 /*yield*/, VariationUtils.GetVariationSettingsFromFile(materialCode, file)];
|
|
1483
|
+
case 3:
|
|
1484
|
+
settings = _a.sent();
|
|
1485
|
+
this.MaterialCache.set(materialCode, settings);
|
|
1486
|
+
return [2 /*return*/, settings];
|
|
1487
|
+
case 4:
|
|
1488
|
+
err_2 = _a.sent();
|
|
1489
|
+
console.error('Error loading variation:', err_2);
|
|
1490
|
+
throw err_2;
|
|
1491
|
+
case 5: return [2 /*return*/];
|
|
1492
|
+
}
|
|
1493
|
+
});
|
|
1494
|
+
});
|
|
1495
|
+
};
|
|
1457
1496
|
// public static GetMaterialFromName(variationFolder: string, material: any): Promise<MeshStandardMaterial> {
|
|
1458
1497
|
// return new Promise((resolve: Function) => {
|
|
1459
1498
|
// if (!material) {
|
|
@@ -1943,37 +1982,45 @@
|
|
|
1943
1982
|
return __generator(this, function (_b) {
|
|
1944
1983
|
switch (_b.label) {
|
|
1945
1984
|
case 0:
|
|
1946
|
-
_b.trys.push([0,
|
|
1985
|
+
_b.trys.push([0, 9, , 10]);
|
|
1947
1986
|
len = parts.length;
|
|
1948
1987
|
i = 0;
|
|
1949
1988
|
_b.label = 1;
|
|
1950
1989
|
case 1:
|
|
1951
|
-
if (!(i < len)) return [3 /*break*/,
|
|
1952
|
-
|
|
1953
|
-
|
|
1990
|
+
if (!(i < len)) return [3 /*break*/, 8];
|
|
1991
|
+
partSettings = void 0;
|
|
1992
|
+
if (!(parts[i].decoNode && parts[i].decoNode.materialUrl && parts[i].decoNode.type === decoNodeType_enum.DecoNodeType.Part)) return [3 /*break*/, 3];
|
|
1993
|
+
return [4 /*yield*/, VariationUtils.LoadVariationByUrl(parts[i].decoNode.materialCode, parts[i].decoNode.materialUrl)];
|
|
1954
1994
|
case 2:
|
|
1955
1995
|
partSettings = _b.sent();
|
|
1956
|
-
|
|
1996
|
+
_b.label = 3;
|
|
1997
|
+
case 3:
|
|
1998
|
+
if (!(parts[i].decoNode && parts[i].decoNode.gameObjectName && parts[i].decoNode.type === decoNodeType_enum.DecoNodeType.Part)) return [3 /*break*/, 5];
|
|
1999
|
+
return [4 /*yield*/, VariationUtils.LoadVariation(this.assetPath, parts[i].decoNode.gameObjectName || parts[i].decoId)];
|
|
2000
|
+
case 4:
|
|
2001
|
+
partSettings = _b.sent();
|
|
2002
|
+
_b.label = 5;
|
|
2003
|
+
case 5:
|
|
2004
|
+
if (!partSettings) return [3 /*break*/, 7];
|
|
1957
2005
|
partVariation = new Variation();
|
|
1958
2006
|
partVariation.decoId = parseFloat(parts[i].decoNode.id);
|
|
1959
2007
|
partVariation.brandId = parts[i].decoNode.brandId;
|
|
1960
2008
|
partVariation.gameObjectName = parts[i].decoNode.gameObjectName;
|
|
1961
2009
|
_a = partVariation;
|
|
1962
2010
|
return [4 /*yield*/, AssetUtils.CreateMaterialFromAsset(partSettings)];
|
|
1963
|
-
case
|
|
2011
|
+
case 6:
|
|
1964
2012
|
_a.material = _b.sent();
|
|
1965
|
-
// parts[i].variation = partVariation;
|
|
1966
2013
|
this._applyMaterialPart(obj, partVariation, parts[i].node, usePbr);
|
|
1967
|
-
_b.label =
|
|
1968
|
-
case
|
|
2014
|
+
_b.label = 7;
|
|
2015
|
+
case 7:
|
|
1969
2016
|
i++;
|
|
1970
2017
|
return [3 /*break*/, 1];
|
|
1971
|
-
case
|
|
1972
|
-
case
|
|
2018
|
+
case 8: return [3 /*break*/, 10];
|
|
2019
|
+
case 9:
|
|
1973
2020
|
e_1 = _b.sent();
|
|
1974
2021
|
console.error(e_1);
|
|
1975
|
-
return [3 /*break*/,
|
|
1976
|
-
case
|
|
2022
|
+
return [3 /*break*/, 10];
|
|
2023
|
+
case 10: return [2 /*return*/];
|
|
1977
2024
|
}
|
|
1978
2025
|
});
|
|
1979
2026
|
});
|
|
@@ -2006,8 +2053,14 @@
|
|
|
2006
2053
|
lastKnownVariations = [];
|
|
2007
2054
|
variationPromise = [];
|
|
2008
2055
|
_loop_2 = function (j) {
|
|
2009
|
-
|
|
2010
|
-
|
|
2056
|
+
var variationsName = '';
|
|
2057
|
+
if (variations[j].materialCode && variations[j].materialUrl) {
|
|
2058
|
+
variationsName = variations[j].materialCode;
|
|
2059
|
+
}
|
|
2060
|
+
else {
|
|
2061
|
+
variationsName = variations[j].gameObjectName || parts[i].decoId;
|
|
2062
|
+
}
|
|
2063
|
+
variationPromise.push(this_1.loadTheVariation(variationsName).then(function (variationSettings) {
|
|
2011
2064
|
var newVariation = new Variation();
|
|
2012
2065
|
newVariation.decoId = variations[j].constructor.name === 'Variation' ? variations[j].decoId : parseFloat(variations[j].id);
|
|
2013
2066
|
newVariation.node = variations[j].constructor.name === 'Variation' ? variations[j].node : variations[j].nodeId;
|
|
@@ -2073,33 +2126,47 @@
|
|
|
2073
2126
|
}
|
|
2074
2127
|
};
|
|
2075
2128
|
VariationHelper.prototype.preloadVariations = function (fileNames) {
|
|
2076
|
-
var
|
|
2077
|
-
|
|
2078
|
-
if (
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
.then(function (variationSettings) {
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
});
|
|
2129
|
+
var _this = this;
|
|
2130
|
+
fileNames.forEach(function (node) {
|
|
2131
|
+
if (node.materialUrl) {
|
|
2132
|
+
if (node.materialCode && !_this.get(node.materialCode)) {
|
|
2133
|
+
var settings_1 = new VariationSettings();
|
|
2134
|
+
settings_1.id = node.materialCode;
|
|
2135
|
+
settings_1.loading = true;
|
|
2136
|
+
_this._variations.push(settings_1);
|
|
2137
|
+
VariationUtils.LoadVariationByUrl(node.materialCode, node.materialUrl).then(function (variationSettings) {
|
|
2138
|
+
settings_1.loading = false;
|
|
2139
|
+
if (variationSettings) {
|
|
2140
|
+
settings_1.copyFrom(variationSettings);
|
|
2141
|
+
}
|
|
2142
|
+
settings_1.loaded.next(settings_1);
|
|
2143
|
+
}).catch(function (err) {
|
|
2144
|
+
console.error("Error loading variation " + node.materialCode + ":", err);
|
|
2145
|
+
settings_1.loading = false;
|
|
2146
|
+
settings_1.loaded.next(null);
|
|
2147
|
+
});
|
|
2148
|
+
}
|
|
2097
2149
|
}
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2150
|
+
else if (node.gameObjectName) {
|
|
2151
|
+
if (!_this.get(node.gameObjectName)) {
|
|
2152
|
+
var settings_2 = new VariationSettings();
|
|
2153
|
+
settings_2.id = node.gameObjectName;
|
|
2154
|
+
settings_2.loading = true;
|
|
2155
|
+
_this._variations.push(settings_2);
|
|
2156
|
+
VariationUtils.LoadVariation(_this.assetPath, node.gameObjectName).then(function (variationSettings) {
|
|
2157
|
+
settings_2.loading = false;
|
|
2158
|
+
if (variationSettings) {
|
|
2159
|
+
settings_2.copyFrom(variationSettings);
|
|
2160
|
+
}
|
|
2161
|
+
settings_2.loaded.next(settings_2);
|
|
2162
|
+
}).catch(function (err) {
|
|
2163
|
+
console.error("Error loading variation " + node.gameObjectName + ":", err);
|
|
2164
|
+
settings_2.loading = false;
|
|
2165
|
+
settings_2.loaded.next(null);
|
|
2166
|
+
});
|
|
2167
|
+
}
|
|
2168
|
+
}
|
|
2169
|
+
});
|
|
2103
2170
|
};
|
|
2104
2171
|
VariationHelper.prototype.loadTheVariation = function (fileName) {
|
|
2105
2172
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -2966,8 +3033,8 @@
|
|
|
2966
3033
|
Builder.prototype._preloadMaterials = function () {
|
|
2967
3034
|
if (this._decos && this._decos.length) {
|
|
2968
3035
|
var materials = __spreadArray([], __read(new Set(this._decos
|
|
2969
|
-
.filter(function (d) { return d.gameObjectName && d.type === decoNodeType_enum.DecoNodeType.Variation; })
|
|
2970
|
-
.map(function (d) { return d
|
|
3036
|
+
.filter(function (d) { return (d.gameObjectName || d.materialUrl) && d.type === decoNodeType_enum.DecoNodeType.Variation; })
|
|
3037
|
+
.map(function (d) { return d; }))));
|
|
2971
3038
|
this._variationHelper.preloadVariations(materials);
|
|
2972
3039
|
}
|
|
2973
3040
|
};
|
|
@@ -3177,18 +3244,14 @@
|
|
|
3177
3244
|
if (lastAdded) {
|
|
3178
3245
|
if (newPart) {
|
|
3179
3246
|
if (decoNode_1.materialId) {
|
|
3180
|
-
|
|
3181
|
-
lastAdded.variations.push(decoNode_1);
|
|
3182
|
-
}
|
|
3247
|
+
lastAdded.variations.push(decoNode_1);
|
|
3183
3248
|
}
|
|
3184
3249
|
else {
|
|
3185
3250
|
lastAdded.variations = [decoNode_1];
|
|
3186
3251
|
}
|
|
3187
3252
|
}
|
|
3188
3253
|
else {
|
|
3189
|
-
|
|
3190
|
-
lastAdded.variations.push(decoNode_1);
|
|
3191
|
-
}
|
|
3254
|
+
lastAdded.variations.push(decoNode_1);
|
|
3192
3255
|
}
|
|
3193
3256
|
newPart = false;
|
|
3194
3257
|
}
|