@shapediver/viewer.shared.services
Advanced tools
Comparing version 2.5.1 to 2.6.0
@@ -1,10 +0,10 @@ | ||
import { ISettingsV3_1 } from '@shapediver/viewer.settings'; | ||
declare type IARSettings = ISettingsV3_1["ar"]; | ||
declare type ICameraSettings = ISettingsV3_1["camera"]; | ||
declare type IEnvironmentSettings = ISettingsV3_1["environment"]; | ||
declare type IEnvironmentGeometrySettings = ISettingsV3_1["environmentGeometry"]; | ||
declare type IGeneralSettings = ISettingsV3_1["general"]; | ||
declare type ILightSettings = ISettingsV3_1["light"]; | ||
declare type IRenderingSettings = ISettingsV3_1["rendering"]; | ||
declare type ISessionSettings = ISettingsV3_1["session"]; | ||
import { ISettingsV3_2 as ISettings } from '@shapediver/viewer.settings'; | ||
declare type IARSettings = ISettings["ar"]; | ||
declare type ICameraSettings = ISettings["camera"]; | ||
declare type IEnvironmentSettings = ISettings["environment"]; | ||
declare type IEnvironmentGeometrySettings = ISettings["environmentGeometry"]; | ||
declare type IGeneralSettings = ISettings["general"]; | ||
declare type ILightSettings = ISettings["light"]; | ||
declare type IRenderingSettings = ISettings["rendering"]; | ||
declare type ISessionSettings = ISettings["session"]; | ||
export declare class SettingsEngine { | ||
@@ -24,3 +24,3 @@ private readonly _eventEngine; | ||
set session(value: ISessionSettings); | ||
get settings(): ISettingsV3_1; | ||
get settings(): ISettings; | ||
convertToTargetVersion(): any; | ||
@@ -27,0 +27,0 @@ flatten(): { |
@@ -14,4 +14,4 @@ "use strict"; | ||
this._logger = tsyringe_1.container.resolve(Logger_1.Logger); | ||
this._settings = (0, viewer_settings_1.DefaultsV3_1)(); | ||
this._settings_version = '3.1'; | ||
this._settings = (0, viewer_settings_1.DefaultsV3_2)(); | ||
this._settings_version = '3.2'; | ||
// #endregion Private Methods (1) | ||
@@ -83,3 +83,3 @@ } | ||
this._settings_version = '1.0'; | ||
this._settings = (0, viewer_settings_1.convert)(json, '3.1'); | ||
this._settings = (0, viewer_settings_1.convert)(json, '3.2'); | ||
this.cleanSettings(this._settings); | ||
@@ -92,3 +92,3 @@ return; | ||
this._settings_version = '2.0'; | ||
this._settings = (0, viewer_settings_1.convert)(json, '3.1'); | ||
this._settings = (0, viewer_settings_1.convert)(json, '3.2'); | ||
this.cleanSettings(this._settings); | ||
@@ -101,3 +101,3 @@ return; | ||
this._settings_version = '3.0'; | ||
this._settings = (0, viewer_settings_1.convert)(json, '3.1'); | ||
this._settings = (0, viewer_settings_1.convert)(json, '3.2'); | ||
this.cleanSettings(this._settings); | ||
@@ -110,6 +110,14 @@ return; | ||
this._settings_version = '3.1'; | ||
this._settings = (0, viewer_settings_1.convert)(json, '3.1'); | ||
this._settings = (0, viewer_settings_1.convert)(json, '3.2'); | ||
this.cleanSettings(this._settings); | ||
return; | ||
} | ||
catch (e) { } | ||
try { | ||
(0, viewer_settings_1.validate)(json, '3.2'); | ||
this._settings_version = '3.2'; | ||
this._settings = (0, viewer_settings_1.convert)(json, '3.2'); | ||
this.cleanSettings(this._settings); | ||
return; | ||
} | ||
catch (e) { | ||
@@ -121,4 +129,4 @@ const error = new ShapeDiverViewerErrors_1.ShapeDiverViewerSettingsError('SettingsEngine.loadSettings: Settings could not be validated. ' + e.message, e); | ||
else { | ||
this._settings_version = '3.1'; | ||
this._settings = (0, viewer_settings_1.DefaultsV3_1)(); | ||
this._settings_version = '3.2'; | ||
this._settings = (0, viewer_settings_1.DefaultsV3_2)(); | ||
return; | ||
@@ -128,4 +136,4 @@ } | ||
reset() { | ||
this._settings_version = '3.1'; | ||
this._settings = (0, viewer_settings_1.DefaultsV3_1)(); | ||
this._settings_version = '3.2'; | ||
this._settings = (0, viewer_settings_1.DefaultsV3_2)(); | ||
} | ||
@@ -132,0 +140,0 @@ // #endregion Public Methods (4) |
{ | ||
"name": "@shapediver/viewer.shared.services", | ||
"version": "2.5.1", | ||
"version": "2.6.0", | ||
"description": "", | ||
@@ -45,5 +45,5 @@ "keywords": [], | ||
"@sentry/tracing": "^6.7.2", | ||
"@shapediver/sdk.geometry-api-sdk-v2": "^1.1.0", | ||
"@shapediver/viewer.settings": "0.1.36", | ||
"@shapediver/viewer.shared.build-data": "2.5.1", | ||
"@shapediver/sdk.geometry-api-sdk-v2": "1.2.3", | ||
"@shapediver/viewer.settings": "0.1.37", | ||
"@shapediver/viewer.shared.build-data": "2.6.0", | ||
"@types/dompurify": "^2.3.1", | ||
@@ -59,3 +59,3 @@ "@types/ua-parser-js": "^0.7.36", | ||
}, | ||
"gitHead": "81a327cb0e4e84f3b889d2f2f997e4db78dd8ba1" | ||
"gitHead": "a9946b0804ce334d7812a9121e19953b7d00f476" | ||
} |
@@ -1,2 +0,2 @@ | ||
import { convert, validate, DefaultsV3_1, ISettingsV3_1 } from '@shapediver/viewer.settings'; | ||
import { convert, validate, DefaultsV3_2 as Defaults, ISettingsV3_2 as ISettings } from '@shapediver/viewer.settings'; | ||
import { container, singleton } from 'tsyringe' | ||
@@ -8,10 +8,10 @@ | ||
type IARSettings = ISettingsV3_1["ar"]; | ||
type ICameraSettings = ISettingsV3_1["camera"]; | ||
type IEnvironmentSettings = ISettingsV3_1["environment"]; | ||
type IEnvironmentGeometrySettings = ISettingsV3_1["environmentGeometry"]; | ||
type IGeneralSettings = ISettingsV3_1["general"]; | ||
type ILightSettings = ISettingsV3_1["light"]; | ||
type IRenderingSettings = ISettingsV3_1["rendering"]; | ||
type ISessionSettings = ISettingsV3_1["session"]; | ||
type IARSettings = ISettings["ar"]; | ||
type ICameraSettings = ISettings["camera"]; | ||
type IEnvironmentSettings = ISettings["environment"]; | ||
type IEnvironmentGeometrySettings = ISettings["environmentGeometry"]; | ||
type IGeneralSettings = ISettings["general"]; | ||
type ILightSettings = ISettings["light"]; | ||
type IRenderingSettings = ISettings["rendering"]; | ||
type ISessionSettings = ISettings["session"]; | ||
@@ -23,4 +23,4 @@ export class SettingsEngine { | ||
private readonly _logger: Logger = <Logger>container.resolve(Logger); | ||
private readonly _settings: ISettingsV3_1 = DefaultsV3_1(); | ||
private _settings_version: '1.0' | '2.0' | '3.0' | '3.1' = '3.1'; | ||
private readonly _settings: ISettings = Defaults(); | ||
private _settings_version: '1.0' | '2.0' | '3.0' | '3.1' | '3.2' = '3.2'; | ||
@@ -67,3 +67,3 @@ // #endregion Properties (8) | ||
public get settings(): ISettingsV3_1 { | ||
public get settings(): ISettings { | ||
return this._settings; | ||
@@ -105,3 +105,3 @@ } | ||
this._settings_version = '1.0'; | ||
(<any>this._settings) = convert(json, '3.1'); | ||
(<any>this._settings) = convert(json, '3.2'); | ||
this.cleanSettings(this._settings); | ||
@@ -114,3 +114,3 @@ return; | ||
this._settings_version = '2.0'; | ||
(<any>this._settings) = convert(json, '3.1'); | ||
(<any>this._settings) = convert(json, '3.2'); | ||
this.cleanSettings(this._settings); | ||
@@ -123,3 +123,3 @@ return; | ||
this._settings_version = '3.0'; | ||
(<any>this._settings) = convert(json, '3.1'); | ||
(<any>this._settings) = convert(json, '3.2'); | ||
this.cleanSettings(this._settings); | ||
@@ -132,5 +132,13 @@ return; | ||
this._settings_version = '3.1'; | ||
(<any>this._settings) = convert(json, '3.1'); | ||
(<any>this._settings) = convert(json, '3.2'); | ||
this.cleanSettings(this._settings); | ||
return; | ||
} catch (e) {} | ||
try { | ||
validate(json, '3.2'); | ||
this._settings_version = '3.2'; | ||
(<any>this._settings) = convert(json, '3.2'); | ||
this.cleanSettings(this._settings); | ||
return; | ||
} catch (e) { | ||
@@ -141,4 +149,4 @@ const error = new ShapeDiverViewerSettingsError('SettingsEngine.loadSettings: Settings could not be validated. ' + (<Error>e).message, <Error>e); | ||
} else { | ||
this._settings_version = '3.1'; | ||
(<any>this._settings) = DefaultsV3_1(); | ||
this._settings_version = '3.2'; | ||
(<any>this._settings) = Defaults(); | ||
return; | ||
@@ -149,4 +157,4 @@ } | ||
public reset() { | ||
this._settings_version = '3.1'; | ||
(<any>this._settings) = DefaultsV3_1(); | ||
this._settings_version = '3.2'; | ||
(<any>this._settings) = Defaults(); | ||
} | ||
@@ -158,3 +166,3 @@ | ||
private cleanSettings(json: ISettingsV3_1) { | ||
private cleanSettings(json: ISettings) { | ||
for(let c in json.camera.cameras) { | ||
@@ -161,0 +169,0 @@ const camera = json.camera.cameras[c]; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
306310
4707
+ Added@shapediver/sdk.geometry-api-sdk-v2@1.2.3(transitive)
+ Added@shapediver/viewer.settings@0.1.37(transitive)
+ Added@shapediver/viewer.shared.build-data@2.6.0(transitive)
- Removed@shapediver/sdk.geometry-api-sdk-v2@1.13.0(transitive)
- Removed@shapediver/viewer.settings@0.1.36(transitive)
- Removed@shapediver/viewer.shared.build-data@2.5.1(transitive)