@combeenation/3d-viewer 7.1.2 → 7.1.3-alpha1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@combeenation/3d-viewer",
3
- "version": "7.1.2",
3
+ "version": "7.1.3-alpha1",
4
4
  "description": "Combeenation 3D Viewer",
5
5
  "homepage": "https://github.com/Combeenation/3d-viewer#readme",
6
6
  "bugs": {
@@ -11,6 +11,7 @@ import { debounce, loadJavascript, loadJson } from '../util/resourceHelper';
11
11
  import { getCustomCbnBabylonLoaderPlugin } from '../util/sceneLoaderHelper';
12
12
  import { replaceDots } from '../util/stringHelper';
13
13
  import { isMeshIncludedInExclusionList } from '../util/structureHelper';
14
+ import * as Index from './../../index';
14
15
  import { AnimationInterface } from './animationInterface';
15
16
  import { Event } from './event';
16
17
  import { EventBroadcaster } from './eventBroadcaster';
@@ -132,6 +133,19 @@ export class Viewer extends EventBroadcaster {
132
133
  return spec;
133
134
  }
134
135
 
136
+ /**
137
+ * Exports all modules which are exported by our index file.
138
+ * Needed by the Combeenation viewer control in situations where the viewer is injected from external code.
139
+ * See [Combeenation docs](https://docs.combeenation.com/) for more details.
140
+ */
141
+ // TODO Now: Naming + use a link to a dedicated page once it exists.
142
+ public static getViewerCtrlDependencies() {
143
+ // TODO Now, to discuss: Are there any downsides in importing * from `index` & simply export everything here?
144
+ // Pro: We don't have to adjust this if the viewer ctrl ever needs access to "more" (as long
145
+ // the newly required dep is exported from `index`)...
146
+ return Index;
147
+ }
148
+
135
149
  /**
136
150
  * Constructor
137
151
  */
@@ -159,8 +159,12 @@ type StructureJson = {
159
159
  };
160
160
  };
161
161
 
162
+ /**
163
+ * Extends the `StructureJson` by removing the optional flag from some properties which surely exist in the auto
164
+ * generated spec
165
+ */
162
166
  type AutoSpecStructureJson = StructureJson & {
163
- scene: SceneJson;
167
+ scene: AutoSpecSceneJson;
164
168
  setup: SetupJson;
165
169
  variants: { [id: string]: StructureJson };
166
170
  };
@@ -186,6 +190,17 @@ type SceneJson = {
186
190
  cloneMaterialsOnMutation?: boolean;
187
191
  };
188
192
 
193
+ /**
194
+ * Extends the `SceneJson` by removing the optional flag from some properties which surely exist in the auto generated
195
+ * spec
196
+ */
197
+ type AutoSpecSceneJson = SceneJson & {
198
+ engine: {
199
+ antialiasing: boolean;
200
+ options: EngineOptions;
201
+ };
202
+ };
203
+
189
204
  type SceneDefinition = {
190
205
  globals: SceneGlobals;
191
206
  cameras?: CameraDefinitions;