@babylonjs/viewer 5.0.0-rc.2 → 5.0.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/configuration/configuration.d.ts +13 -13
- package/configuration/configuration.js +1 -1
- package/configuration/configuration.js.map +1 -1
- package/configuration/configurationCompatibility.d.ts +1 -1
- package/configuration/configurationCompatibility.js +2 -2
- package/configuration/configurationCompatibility.js.map +1 -1
- package/configuration/configurationContainer.d.ts +3 -3
- package/configuration/configurationContainer.js +1 -1
- package/configuration/configurationContainer.js.map +1 -1
- package/configuration/globals.d.ts +1 -1
- package/configuration/globals.js.map +1 -1
- package/configuration/index.d.ts +2 -2
- package/configuration/index.js +3 -2
- package/configuration/index.js.map +1 -1
- package/configuration/interfaces/cameraConfiguration.js.map +1 -1
- package/configuration/interfaces/colorGradingConfiguration.js.map +1 -1
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +1 -1
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.js.map +1 -1
- package/configuration/interfaces/environmentMapConfiguration.js.map +1 -1
- package/configuration/interfaces/groundConfiguration.js.map +1 -1
- package/configuration/interfaces/imageProcessingConfiguration.js.map +1 -1
- package/configuration/interfaces/index.d.ts +15 -15
- package/configuration/interfaces/index.js +15 -15
- package/configuration/interfaces/index.js.map +1 -1
- package/configuration/interfaces/lightConfiguration.js.map +1 -1
- package/configuration/interfaces/modelAnimationConfiguration.js.map +1 -1
- package/configuration/interfaces/modelConfiguration.d.ts +1 -1
- package/configuration/interfaces/modelConfiguration.js.map +1 -1
- package/configuration/interfaces/observersConfiguration.js.map +1 -1
- package/configuration/interfaces/sceneConfiguration.d.ts +3 -3
- package/configuration/interfaces/sceneConfiguration.js.map +1 -1
- package/configuration/interfaces/sceneOptimizerConfiguration.js.map +1 -1
- package/configuration/interfaces/skyboxConfiguration.d.ts +1 -1
- package/configuration/interfaces/skyboxConfiguration.js.map +1 -1
- package/configuration/interfaces/templateConfiguration.js.map +1 -1
- package/configuration/interfaces/vrConfiguration.d.ts +1 -1
- package/configuration/interfaces/vrConfiguration.js.map +1 -1
- package/configuration/loader.js +3 -15
- package/configuration/loader.js.map +1 -1
- package/configuration/mappers.d.ts +3 -3
- package/configuration/mappers.js +13 -12
- package/configuration/mappers.js.map +1 -1
- package/configuration/renderOnlyLoader.d.ts +1 -1
- package/configuration/renderOnlyLoader.js +18 -15
- package/configuration/renderOnlyLoader.js.map +1 -1
- package/configuration/types/default.d.ts +2 -2
- package/configuration/types/default.js +37 -36
- package/configuration/types/default.js.map +1 -1
- package/configuration/types/environmentMap.d.ts +1 -1
- package/configuration/types/environmentMap.js +5 -5
- package/configuration/types/environmentMap.js.map +1 -1
- package/configuration/types/extended.d.ts +2 -2
- package/configuration/types/extended.js +49 -49
- package/configuration/types/extended.js.map +1 -1
- package/configuration/types/index.d.ts +4 -4
- package/configuration/types/index.js +14 -13
- package/configuration/types/index.js.map +1 -1
- package/configuration/types/minimal.d.ts +2 -2
- package/configuration/types/minimal.js +12 -12
- package/configuration/types/minimal.js.map +1 -1
- package/configuration/types/renderOnlyDefault.d.ts +1 -1
- package/configuration/types/renderOnlyDefault.js +8 -8
- package/configuration/types/renderOnlyDefault.js.map +1 -1
- package/configuration/types/shadowLight.d.ts +1 -1
- package/configuration/types/shadowLight.js +12 -12
- package/configuration/types/shadowLight.js.map +1 -1
- package/helper/index.d.ts +3 -3
- package/helper/index.js +14 -8
- package/helper/index.js.map +1 -1
- package/index.d.ts +20 -20
- package/index.js +22 -18
- package/index.js.map +1 -1
- package/initializer.js +8 -7
- package/initializer.js.map +1 -1
- package/interfaces.js.map +1 -1
- package/labs/environmentSerializer.d.ts +6 -6
- package/labs/environmentSerializer.js +18 -14
- package/labs/environmentSerializer.js.map +1 -1
- package/labs/texture.d.ts +7 -8
- package/labs/texture.js +30 -27
- package/labs/texture.js.map +1 -1
- package/labs/viewerLabs.d.ts +11 -11
- package/labs/viewerLabs.js +9 -7
- package/labs/viewerLabs.js.map +1 -1
- package/license.md +71 -0
- package/loader/modelLoader.d.ts +10 -7
- package/loader/modelLoader.js +26 -19
- package/loader/modelLoader.js.map +1 -1
- package/loader/plugins/applyMaterialConfig.d.ts +4 -4
- package/loader/plugins/applyMaterialConfig.js.map +1 -1
- package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +2 -2
- package/loader/plugins/extendedMaterialLoaderPlugin.js +1 -1
- package/loader/plugins/extendedMaterialLoaderPlugin.js.map +1 -1
- package/loader/plugins/index.d.ts +5 -4
- package/loader/plugins/index.js +9 -8
- package/loader/plugins/index.js.map +1 -1
- package/loader/plugins/loaderPlugin.d.ts +7 -7
- package/loader/plugins/loaderPlugin.js.map +1 -1
- package/loader/plugins/msftLodLoaderPlugin.d.ts +5 -5
- package/loader/plugins/msftLodLoaderPlugin.js +2 -1
- package/loader/plugins/msftLodLoaderPlugin.js.map +1 -1
- package/loader/plugins/telemetryLoaderPlugin.d.ts +4 -4
- package/loader/plugins/telemetryLoaderPlugin.js +4 -4
- package/loader/plugins/telemetryLoaderPlugin.js.map +1 -1
- package/managers/observablesManager.d.ts +6 -6
- package/managers/observablesManager.js +1 -1
- package/managers/observablesManager.js.map +1 -1
- package/managers/sceneManager.d.ts +28 -30
- package/managers/sceneManager.js +96 -95
- package/managers/sceneManager.js.map +1 -1
- package/managers/telemetryManager.d.ts +6 -6
- package/managers/telemetryManager.js +6 -6
- package/managers/telemetryManager.js.map +1 -1
- package/model/modelAnimation.d.ts +14 -14
- package/model/modelAnimation.js +3 -3
- package/model/modelAnimation.js.map +1 -1
- package/model/viewerModel.d.ts +23 -31
- package/model/viewerModel.js +51 -46
- package/model/viewerModel.js.map +1 -1
- package/optimizer/custom/extended.d.ts +3 -5
- package/optimizer/custom/extended.js +3 -5
- package/optimizer/custom/extended.js.map +1 -1
- package/optimizer/custom/index.d.ts +1 -1
- package/optimizer/custom/index.js +1 -1
- package/optimizer/custom/index.js.map +1 -1
- package/package.json +41 -215
- package/readme.md +12 -8
- package/renderOnlyIndex.d.ts +10 -10
- package/renderOnlyIndex.js +6 -4
- package/renderOnlyIndex.js.map +1 -1
- package/templating/eventManager.d.ts +1 -1
- package/templating/eventManager.js +4 -2
- package/templating/eventManager.js.map +1 -1
- package/templating/plugins/hdButtonPlugin.d.ts +2 -2
- package/templating/plugins/hdButtonPlugin.js +2 -15
- package/templating/plugins/hdButtonPlugin.js.map +1 -1
- package/templating/plugins/printButton.d.ts +2 -3
- package/templating/plugins/printButton.js +3 -16
- package/templating/plugins/printButton.js.map +1 -1
- package/templating/templateManager.d.ts +8 -7
- package/templating/templateManager.js +72 -62
- package/templating/templateManager.js.map +1 -1
- package/templating/viewerTemplatePlugin.d.ts +1 -1
- package/templating/viewerTemplatePlugin.js +4 -4
- package/templating/viewerTemplatePlugin.js.map +1 -1
- package/viewer/defaultViewer.d.ts +17 -11
- package/viewer/defaultViewer.js +116 -121
- package/viewer/defaultViewer.js.map +1 -1
- package/viewer/renderOnlyViewer.d.ts +2 -2
- package/viewer/renderOnlyViewer.js +17 -24
- package/viewer/renderOnlyViewer.js.map +1 -1
- package/viewer/viewer.d.ts +19 -18
- package/viewer/viewer.js +63 -49
- package/viewer/viewer.js.map +1 -1
- package/viewer/viewerManager.d.ts +5 -5
- package/viewer/viewerManager.js +4 -3
- package/viewer/viewerManager.js.map +1 -1
- package/viewer/viewerWithTemplate.js +2 -15
- package/viewer/viewerWithTemplate.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewerTemplatePlugin.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"viewerTemplatePlugin.js","sourceRoot":"","sources":["../../../../../tools/viewer/src/templating/viewerTemplatePlugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,YAAY,CAAC;AAWzC;IAQI,oCAAY,UAAkB,EAAE,WAAoB,EAAE,YAAqB;QAP3D,iBAAY,GAAW,QAAQ,CAAC;QAChC,mBAAc,GAAkB,CAAC,aAAa,CAA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QACvE,IAAI,SAAS,EAAE;YACX,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACf,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;aACzD;iBAAM;gBACH,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;aAClC;SACJ;IACL,CAAC;IAES,yDAAoB,GAA9B,UAA+B,QAAkB;QAC7C,IAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,aAAa,CAAC,MAAM,IAAI,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QACzJ,IAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,IAAI,EAAE,CAAC;QACnD,IAAM,OAAO,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,QAAoC,CAAC;QACzC,IAAI;YACA,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;SACvE;QAAC,OAAO,CAAC,EAAE;YACR,IAAM,MAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YACvD,MAAI,CAAC,SAAS,GAAG,OAAO,CAAC;YACzB,QAAQ,GAAG,MAAI,CAAC;SACnB;QACD,OAAO,QAAQ,CAAC;IACpB,CAAC;IACL,iCAAC;AAAD,CAAC,AA5ED,IA4EC","sourcesContent":["import type { EventCallback, Template } from \"./templateManager\";\r\nimport * as Handlebars from \"handlebars\";\r\n\r\nexport interface IViewerTemplatePlugin {\r\n readonly templateName: string;\r\n readonly eventsToAttach?: Array<string>;\r\n\r\n interactionPredicate(event: EventCallback): boolean;\r\n onEvent?(event: EventCallback): void;\r\n addHTMLTemplate?(template: Template): void;\r\n}\r\n\r\nexport abstract class AbstractViewerNavbarButton implements IViewerTemplatePlugin {\r\n public readonly templateName: string = \"navBar\";\r\n public readonly eventsToAttach: Array<string> = [\"pointerdown\"];\r\n protected _prepend: boolean = true;\r\n protected _buttonName: string;\r\n protected _buttonClass: string;\r\n protected _htmlTemplate: string;\r\n\r\n constructor(buttonName: string, buttonClass?: string, htmlTemplate?: string) {\r\n this._buttonName = buttonName;\r\n if (buttonClass) {\r\n this._buttonClass = buttonClass;\r\n } else {\r\n this._buttonClass = buttonName + \"-button\";\r\n }\r\n if (htmlTemplate) {\r\n this._htmlTemplate = htmlTemplate;\r\n } else {\r\n this._htmlTemplate = `\r\n<button class=\"${this._buttonClass}\">\r\n <span class=\"icon ${this._buttonName}-icon\"></span>\r\n</button>\r\n`;\r\n }\r\n }\r\n\r\n interactionPredicate(event: EventCallback): boolean {\r\n const pointerDown = <PointerEvent>event.event;\r\n if (pointerDown.button !== 0) {\r\n return false;\r\n }\r\n const element = <HTMLElement>event.event.target;\r\n\r\n if (!element) {\r\n return false;\r\n }\r\n\r\n const elementClasses = element.classList;\r\n\r\n for (let i = 0; i < elementClasses.length; ++i) {\r\n const className = elementClasses[i];\r\n if (className.indexOf(this._buttonClass) !== -1) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n abstract onEvent(event: EventCallback): void;\r\n\r\n public addHTMLTemplate(template: Template): void {\r\n const element = this._generateHTMLElement(template);\r\n const container = template.parent.querySelector(\"div.default-control\");\r\n if (container) {\r\n if (this._prepend) {\r\n container.insertBefore(element, container.firstChild);\r\n } else {\r\n container.appendChild(element);\r\n }\r\n }\r\n }\r\n\r\n protected _generateHTMLElement(template: Template): Element | DocumentFragment {\r\n const compiledTemplate = Handlebars.compile(this._htmlTemplate, { noEscape: template.configuration.params && !!template.configuration.params.noEscape });\r\n const config = template.configuration.params || {};\r\n const rawHtml = compiledTemplate(config);\r\n let fragment: Element | DocumentFragment;\r\n try {\r\n fragment = document.createRange().createContextualFragment(rawHtml);\r\n } catch (e) {\r\n const test = document.createElement(this._buttonClass);\r\n test.innerHTML = rawHtml;\r\n fragment = test;\r\n }\r\n return fragment;\r\n }\r\n}\r\n"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Template } from
|
|
2
|
-
import { TemplateManager } from
|
|
3
|
-
import { AbstractViewerWithTemplate } from
|
|
4
|
-
import { ViewerModel } from
|
|
5
|
-
import { IViewerTemplatePlugin } from
|
|
6
|
-
import { ViewerConfiguration } from
|
|
7
|
-
import { IModelConfiguration } from
|
|
1
|
+
import type { Template } from "../templating/templateManager";
|
|
2
|
+
import { TemplateManager } from "../templating/templateManager";
|
|
3
|
+
import { AbstractViewerWithTemplate } from "./viewerWithTemplate";
|
|
4
|
+
import type { ViewerModel } from "../model/viewerModel";
|
|
5
|
+
import type { IViewerTemplatePlugin } from "../templating/viewerTemplatePlugin";
|
|
6
|
+
import type { ViewerConfiguration } from "../configuration/configuration";
|
|
7
|
+
import type { IModelConfiguration } from "../configuration/interfaces/modelConfiguration";
|
|
8
|
+
import "@babylonjs/core/Lights/Shadows/shadowGeneratorSceneComponent.js";
|
|
8
9
|
/**
|
|
9
10
|
* The Default viewer is the default implementation of the AbstractViewer.
|
|
10
11
|
* It uses the templating system to render a new canvas and controls.
|
|
@@ -36,6 +37,7 @@ export declare class DefaultViewer extends AbstractViewerWithTemplate {
|
|
|
36
37
|
private _handlePointerClick;
|
|
37
38
|
/**
|
|
38
39
|
* Plays or Pauses animation
|
|
40
|
+
* @param noUiUpdate
|
|
39
41
|
*/
|
|
40
42
|
private _togglePlayPause;
|
|
41
43
|
private _oldIdleRotationValue;
|
|
@@ -45,10 +47,16 @@ export declare class DefaultViewer extends AbstractViewerWithTemplate {
|
|
|
45
47
|
private _updateProgressBar;
|
|
46
48
|
/**
|
|
47
49
|
* Update Current Animation Speed
|
|
50
|
+
* @param speed
|
|
51
|
+
* @param paramsObject
|
|
48
52
|
*/
|
|
49
53
|
private _updateAnimationSpeed;
|
|
50
54
|
/**
|
|
51
55
|
* Update Current Animation Type
|
|
56
|
+
* @param data
|
|
57
|
+
* @param data.label
|
|
58
|
+
* @param data.value
|
|
59
|
+
* @param paramsObject
|
|
52
60
|
*/
|
|
53
61
|
private _updateAnimationType;
|
|
54
62
|
protected _initVR(): void;
|
|
@@ -89,13 +97,13 @@ export declare class DefaultViewer extends AbstractViewerWithTemplate {
|
|
|
89
97
|
*
|
|
90
98
|
* @param visibilityFunction an optional function to execute in order to show the container
|
|
91
99
|
*/
|
|
92
|
-
show(visibilityFunction?: (
|
|
100
|
+
show(visibilityFunction?: (template: Template) => Promise<Template>): Promise<Template>;
|
|
93
101
|
/**
|
|
94
102
|
* hide the viewer (in case it is visible)
|
|
95
103
|
*
|
|
96
104
|
* @param visibilityFunction an optional function to execute in order to hide the container
|
|
97
105
|
*/
|
|
98
|
-
hide(visibilityFunction?: (
|
|
106
|
+
hide(visibilityFunction?: (template: Template) => Promise<Template>): Promise<Template>;
|
|
99
107
|
/**
|
|
100
108
|
* Show the loading screen.
|
|
101
109
|
* The loading screen can be configured using the configuration object
|
|
@@ -109,8 +117,6 @@ export declare class DefaultViewer extends AbstractViewerWithTemplate {
|
|
|
109
117
|
protected _onConfigurationLoaded(configuration: ViewerConfiguration): void;
|
|
110
118
|
/**
|
|
111
119
|
* An extension of the light configuration of the abstract viewer.
|
|
112
|
-
* @param lightsConfiguration the light configuration to use
|
|
113
|
-
* @param model the model that will be used to configure the lights (if the lights are model-dependant)
|
|
114
120
|
*/
|
|
115
121
|
private _configureLights;
|
|
116
122
|
}
|