@shapediver/viewer.settings
Advanced tools
Comparing version 0.1.39 to 0.2.0
@@ -18,2 +18,6 @@ import { IGlobalSettings } from "./interfaces/IGlobalSettings"; | ||
import { IAmbientLightProperties as IAmbientLightPropertiesV3_2, IDirectionalLightProperties as IDirectionalLightPropertiesV3_2, IHemisphereLightProperties as IHemisphereLightPropertiesV3_2, ILightSceneSettings as ILightSceneSettingsV3_2, IPointLightProperties as IPointLightPropertiesV3_2, ISpotLightProperties as ISpotLightPropertiesV3_2 } from "./versions/v3/ILightSceneSettings"; | ||
import { ISettings as ISettingsV3_3 } from "./versions/v3_3/ISettings"; | ||
import { Defaults as DefaultsV3_3 } from "./versions/v3_3/Defaults"; | ||
import { ICameraSettings as ICameraSettingsV3_3, IOrbitControlsSettings as IOrbitControlsSettingsV3_3, IOrthographicCameraSettings as IOrthographicCameraSettingsV3_3, IOrthographicControlsSettings as IOrthographicControlsSettingsV3_3, IPerspectiveCameraSettings as IPerspectiveCameraSettingsV3_3 } from "./versions/v3/ICameraSettings"; | ||
import { IAmbientLightProperties as IAmbientLightPropertiesV3_3, IDirectionalLightProperties as IDirectionalLightPropertiesV3_3, IHemisphereLightProperties as IHemisphereLightPropertiesV3_3, ILightSceneSettings as ILightSceneSettingsV3_3, IPointLightProperties as IPointLightPropertiesV3_3, ISpotLightProperties as ISpotLightPropertiesV3_3 } from "./versions/v3/ILightSceneSettings"; | ||
export { ISettingsV1, DefaultsV1 }; | ||
@@ -24,3 +28,4 @@ export { ISettingsV2, DefaultsV2 }; | ||
export { ISettingsV3_2, DefaultsV3_2, ICameraSettingsV3_2, IOrthographicCameraSettingsV3_2, IPerspectiveCameraSettingsV3_2, IOrbitControlsSettingsV3_2, IOrthographicControlsSettingsV3_2, ILightSceneSettingsV3_2, IAmbientLightPropertiesV3_2, IDirectionalLightPropertiesV3_2, IHemisphereLightPropertiesV3_2, IPointLightPropertiesV3_2, ISpotLightPropertiesV3_2 }; | ||
export declare type versions = '1.0' | '2.0' | '3.0' | '3.1' | '3.2'; | ||
export { ISettingsV3_3, DefaultsV3_3, ICameraSettingsV3_3, IOrthographicCameraSettingsV3_3, IPerspectiveCameraSettingsV3_3, IOrbitControlsSettingsV3_3, IOrthographicControlsSettingsV3_3, ILightSceneSettingsV3_3, IAmbientLightPropertiesV3_3, IDirectionalLightPropertiesV3_3, IHemisphereLightPropertiesV3_3, IPointLightPropertiesV3_3, ISpotLightPropertiesV3_3 }; | ||
export declare type versions = '1.0' | '2.0' | '3.0' | '3.1' | '3.2' | '3.3'; | ||
export declare const convert: (settings: any, targetVersion: versions) => IGlobalSettings; | ||
@@ -27,0 +32,0 @@ export declare const validate: (settings: any, targetVersion?: versions | undefined) => void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.evaluateSettingsVersion = exports.validate = exports.convert = exports.DefaultsV3_2 = exports.DefaultsV3_1 = exports.DefaultsV3 = exports.DefaultsV2 = exports.DefaultsV1 = void 0; | ||
exports.evaluateSettingsVersion = exports.validate = exports.convert = exports.DefaultsV3_3 = exports.DefaultsV3_2 = exports.DefaultsV3_1 = exports.DefaultsV3 = exports.DefaultsV2 = exports.DefaultsV1 = void 0; | ||
const Defaults_1 = require("./versions/v1/Defaults"); | ||
@@ -23,2 +23,6 @@ Object.defineProperty(exports, "DefaultsV1", { enumerable: true, get: function () { return Defaults_1.Defaults; } }); | ||
const Converter_4 = require("./versions/v3_2/Converter"); | ||
const Defaults_6 = require("./versions/v3_3/Defaults"); | ||
Object.defineProperty(exports, "DefaultsV3_3", { enumerable: true, get: function () { return Defaults_6.Defaults; } }); | ||
const Validator_6 = require("./versions/v3_3/Validator"); | ||
const Converter_5 = require("./versions/v3_3/Converter"); | ||
let settingsUtilities = []; | ||
@@ -60,2 +64,9 @@ settingsUtilities.push({ | ||
}); | ||
settingsUtilities.push({ | ||
version: '3.3', | ||
defaults: Defaults_6.Defaults, | ||
convertToPrevious: Converter_5.convertToPrevious, | ||
convertFromPrevious: Converter_5.convertFromPrevious, | ||
validate: Validator_6.validate | ||
}); | ||
const convert = (settings, targetVersion) => { | ||
@@ -115,3 +126,6 @@ const original_version = settings.settings_version || '1.0'; | ||
const upgradeVersions = viewerVersion.split('.'); | ||
if ((+upgradeVersions[1] === 2 && +upgradeVersions[2] >= 6) || +upgradeVersions[1] > 2) { | ||
if ((+upgradeVersions[1] === 2 && +upgradeVersions[2] >= 7) || +upgradeVersions[1] > 2) { | ||
return '3.3'; | ||
} | ||
else if ((+upgradeVersions[1] === 2 && +upgradeVersions[2] >= 6) || +upgradeVersions[1] > 2) { | ||
return '3.2'; | ||
@@ -118,0 +132,0 @@ } |
{ | ||
"name": "@shapediver/viewer.settings", | ||
"version": "0.1.39", | ||
"version": "0.2.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "license": "polyform-noncommercial-1.0.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
347149
110
3374