@spiffcommerce/preview 5.8.10 → 5.9.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/dist/index.d.mts CHANGED
@@ -165,7 +165,7 @@ type ThreeDPreviewService = {
165
165
  * Designed for use when utilizing the 3D preview in an editor format.
166
166
  * Given a list of material names, highlights the associated meshes in the scene.
167
167
  */
168
- setHighlights(materials: readonly MaterialHandle[], color?: readonly [number, number, number]): void;
168
+ setHighlights(materials: readonly MaterialHandle[]): void;
169
169
  /**
170
170
  * Sets the rendering pipeline configuration for the scene. Overwrites any existing configuration.
171
171
  * @param renderingPipelineConfiguration The configuration to apply. Empty values will be set to default.
@@ -224,6 +224,12 @@ type ThreeDPreviewService = {
224
224
  * Note this will not resolve any existing promises.
225
225
  */
226
226
  forceStopCameraAnimations(): void;
227
+ /**
228
+ * Takes a list of material names supported by the highlighter. This function
229
+ * must be notified of materials for highlighting to work.
230
+ * @param materials A list of material names to allow highlighting on.
231
+ */
232
+ setHighlightMaterials(materials: string[]): void;
227
233
  };
228
234
  /**
229
235
  * Represents a service capable of managing and returning contexts that
@@ -821,6 +827,10 @@ type ModelContainer = {
821
827
  * @returns A promise which resolves when the animation has completed. If the animation is looping, the promise will resolve after the first loop.
822
828
  */
823
829
  executeAnimation(animation: ModelAnimation): Promise<void>;
830
+ /**
831
+ * Returns the last animation that was executed on the model.
832
+ */
833
+ getLastRequestedAnimation(): ModelAnimation | undefined;
824
834
  /**
825
835
  * Disposes all resources associated with the model container.
826
836
  * Note: This will also remove the container from the preview service.
@@ -1090,12 +1100,12 @@ declare class SpiffCommerce3DPreviewService implements ThreeDPreviewService {
1090
1100
  * A collection of callbacks to be invoked when a model is loaded or unloaded.
1091
1101
  */
1092
1102
  private modelLoadEventCallbacks;
1093
- private glowLayerManager;
1094
1103
  /**
1095
- * When instantiated, contains a list of meshes that contribute to highlighting
1096
- * in the scene.
1104
+ * A list of valid material names supported by the highlighter.
1105
+ * All other materials will be ignored.
1097
1106
  */
1098
- private highlightLayer?;
1107
+ private validHighlightMaterials;
1108
+ private glowLayerManager;
1099
1109
  private renderingPipeline;
1100
1110
  private modelContainers;
1101
1111
  private plugins;
@@ -1131,7 +1141,7 @@ declare class SpiffCommerce3DPreviewService implements ThreeDPreviewService {
1131
1141
  renderSceneScreenshot(resolution: number, camAnim: CameraAnimation): Promise<string>;
1132
1142
  orbitEnabled(): boolean;
1133
1143
  fireResizeEvent(): void;
1134
- setHighlights(materials: readonly MaterialHandle[], color?: readonly [number, number, number]): void;
1144
+ setHighlights(materials: readonly MaterialHandle[]): void;
1135
1145
  setRenderingPipelineConfiguration(renderingPipelineConfiguration: RenderingPipelineConfiguration): void;
1136
1146
  loadModel(modelDetails: ModelDetails, options?: {
1137
1147
  refocusCamera?: boolean;
@@ -1154,6 +1164,7 @@ declare class SpiffCommerce3DPreviewService implements ThreeDPreviewService {
1154
1164
  scale: Vector;
1155
1165
  };
1156
1166
  updatePreviewOptions(options: PreviewOptions): void;
1167
+ setHighlightMaterials(materials: string[]): void;
1157
1168
  /**
1158
1169
  * Given a valid canvas element, will remove any existing input controls
1159
1170
  * and re-attach them to the given canvas. The pan mouse button can be set