@3dsource/metabox-modular-configurator-api 3.0.17 → 3.0.19-dev.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.
@@ -2,6 +2,11 @@ import { Observable } from 'rxjs';
2
2
 
3
3
  type ApplicationDeviceTypes = 'deviceTypeAuto' | 'deviceTypeMobile' | 'deviceTypeDesktop';
4
4
 
5
+ /**
6
+ * @internal
7
+ * @hidden
8
+ * Represents main constants.
9
+ */
5
10
  declare const Metabox = "metabox_v3";
6
11
  declare const MetaboxHost = "metaboxHost_v3";
7
12
  declare const MetaboxData = "metaboxData_v3";
@@ -9,7 +14,7 @@ declare const AppLoaded = "appLoaded_v3";
9
14
  declare const MetaboxDomain = "metabox.3dsource.com";
10
15
  declare const BasicRouteUrl = "metabox-configurator/modular";
11
16
 
12
- declare const VERSION = "3.0.17";
17
+ declare const VERSION = "3.0.19-dev.0";
13
18
 
14
19
  type FromMetaboxApiAction = 'bridge' | typeof AppLoaded;
15
20
 
@@ -57,7 +62,6 @@ type ToMetaBoxActions = (typeof MetaboxModularConfiguratorActions)[keyof typeof
57
62
  * @hidden
58
63
  */
59
64
  type ToMetaboxMessagePayload = ToMetaboxMessagePayloads[keyof ToMetaboxMessagePayloads];
60
- type Test = Record<ToMetaBoxActions, object>;
61
65
  /**
62
66
  * Interface for messages sent from the application to the Metabox Modular Configurator.
63
67
  */
@@ -142,9 +146,14 @@ interface ToMetaBoxMessageEnvelope {
142
146
  action: ToMetaBoxActions;
143
147
  payload?: ToMetaboxMessagePayload | never;
144
148
  }
149
+ type ToMetaboxTarget = 'metabox' | 'child';
145
150
  interface ToMetaBoxMessage {
146
- host: typeof MetaboxHost;
147
- payload: ToMetaBoxMessageEnvelope;
151
+ envelope: ToMetaBoxMessageEnvelope;
152
+ /**
153
+ * @deprecated, use envelope instead of payload
154
+ */
155
+ payload?: ToMetaBoxMessageEnvelope;
156
+ target: ToMetaboxTarget;
148
157
  }
149
158
 
150
159
  /**
@@ -457,7 +466,7 @@ interface FromMetaboxMessagePayloads {
457
466
  */
458
467
  statusMessageChanged: string | null;
459
468
  /**
460
- * Dispatches every time when Unreal is sending ordered render with new GetScreenshot() command.
469
+ * Dispatches every time when Unreal is sending an ordered render with a new GetScreenshot() command.
461
470
  */
462
471
  screenshotReady: string | null;
463
472
  /**
@@ -465,9 +474,14 @@ interface FromMetaboxMessagePayloads {
465
474
  */
466
475
  videoResolutionChanged: VideoResolution;
467
476
  /**
468
- * Dispatches every time when the User sends get camera command.
477
+ * Dispatches every time when the User sends get camera command new GetCamera() command.
469
478
  */
470
479
  getCameraResult: CameraCommandPayload;
480
+ /**
481
+ * @deprecated
482
+ * Dispatches every time when the configurator connected/disconnected with Unreal Engine.
483
+ */
484
+ dataChannelConnected: boolean;
471
485
  }
472
486
  /**
473
487
  * @hidden
@@ -510,35 +524,14 @@ interface FromMetaBoxMessage {
510
524
  }
511
525
 
512
526
  /**
513
- * Base class for commands sent to the Metabox.
527
+ * Base class for commands sent to the Metabox API.
528
+ * @internal
529
+ * @hidden
514
530
  */
515
531
  declare class CommandBase {
516
532
  data: ToMetaBoxMessageEnvelope;
517
533
  }
518
534
 
519
- /**
520
- * Represents a command to ApplyZoom and change zoom camera on a scene.
521
- * @remarks
522
- * This class sends a command to the Metabox API to change zoom on a scene.
523
- *
524
- * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
525
- *
526
- * @example
527
- * import { ApplyZoom, Communicator } from '@3dsource/metabox-modular-configurator-api';
528
- * window.env3DSource.apiReady = (api: Communicator) => {
529
- * api.sendCommandToMetabox(new ApplyZoom(10));
530
- * api.sendCommandToMetabox(new ApplyZoom(-10));
531
- * };
532
- */
533
- declare class ApplyZoom extends CommandBase {
534
- /**
535
- * Creates an instance of ApplyZoom.
536
- *
537
- * @param {...number} zoom
538
- */
539
- constructor(zoom: number);
540
- }
541
-
542
535
  /**
543
536
  * Represents a callback listener for specific message types.
544
537
  * Used internally by EventDispatcher to store event listeners.
@@ -637,7 +630,7 @@ declare class Communicator extends EventDispatcher {
637
630
  */
638
631
  removeEventListener<T extends FromMetaBoxApiEvents>(messageType: T, callback: (data: FromMetaboxMessagePayloads[T]) => void): this;
639
632
  /**
640
- * Filters and dispatches incoming messages from to the Metabox.
633
+ * Filters and dispatches incoming messages from the Metabox.
641
634
  * @param messageType - Expected message type for filtering (MetaboxData).
642
635
  * @param event - The postMessage event received on a window.
643
636
  */
@@ -703,32 +696,61 @@ declare function integrateMetabox(configuratorId: string, containerId: string |
703
696
  */
704
697
  declare function saveImage(imageUrl: string, filename: string): void;
705
698
 
699
+ /**
700
+ *
701
+ * @remarks
702
+ * @internal
703
+ * @hidden
704
+ *
705
+ * @param {string} configuratorId - An string identifier for the configurator.
706
+ * @param {IntegrateMetaboxConfig} config - An object containing the configuration options.
707
+ */
706
708
  declare const prepareIframeSrc: (configuratorId: string, config?: IntegrateMetaboxConfig) => string;
707
709
 
708
710
  /**
709
711
  * Wrapper helper function to use it with rxJs the same as `fromEvent` to listen to events from the Communicator.
712
+ *
710
713
  * @param {Communicator} target
711
714
  * @param eventName
715
+ * @internal
712
716
  */
713
717
  declare function fromCommunicatorEvent<T extends FromMetaBoxApiEvents>(target: Communicator, eventName: T): Observable<FromMetaboxMessagePayloads[T]>;
714
718
 
715
719
  /**
716
- * Represents a command to get a Call To Action Information from Metabox Modular Configurator.
720
+ * Represents a command to send Metabox Config to Metabox Basic Configurator.
717
721
  * @remarks
718
- * This class sends a message to the Metabox API to generate Call To Action information based on the current configuration and sends it to the endpoint url from the cta information.
719
- * This action does not require any parameters.
722
+ * **Important**: No need to listen to any events to see changes.
720
723
  *
724
+ * @internal
725
+ * Automatically sent when the Communicator instance is ready.
726
+ */
727
+ declare class MetaboxConfig extends CommandBase {
728
+ /**
729
+ * Creates an instance of MetaboxConfig.
730
+ * @param {string} appId - The unique identifier for the Communicator Instance
731
+ * @param {MetaboxCommandConfig} config - optional initial config: standalone - if true - disable metabox custom template and all logic
732
+ */
733
+ constructor(appId: string, config: MetaboxCommandConfig);
734
+ }
735
+
736
+ /**
737
+ * Represents a command to get a PDF from Metabox Basic Configurator.
738
+ * @remarks
739
+ * This class sends a message to the Metabox API to generate a PDF based on the current configuration.
740
+ * **Important**: No need to listen to any events to see changes.
721
741
  * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
722
742
  *
723
743
  * @example
724
- * import { GetCallToActionInformation, Communicator } from '@3dsource/metabox-modular-configurator-api';
744
+ * import { GetPdf, Communicator } from '@3dsource/metabox-modular-configurator-api';
745
+ *
746
+ * @param {Communicator} api - communicator instance api
725
747
  * window.env3DSource.apiReady = (api: Communicator) => {
726
- * api.sendCommandToMetabox(new GetCallToActionInformation());
748
+ * api.sendCommandToMetabox(new GetPdf());
727
749
  * };
728
750
  */
729
- declare class GetCallToActionInformation extends CommandBase {
751
+ declare class GetPdf extends CommandBase {
730
752
  /**
731
- * Creates an instance of GetCallToActionInformation.
753
+ * Creates an instance of GetPdf.
732
754
  *
733
755
  * @remarks
734
756
  * This constructor does not require any parameters.
@@ -737,22 +759,36 @@ declare class GetCallToActionInformation extends CommandBase {
737
759
  }
738
760
 
739
761
  /**
740
- * Represents a command to get a PDF from Metabox.
762
+ * Represents a command to get a Call To Action Information from Metabox Basic Configurator.
741
763
  * @remarks
742
- * This class sends a message to the Metabox API to generate a PDF based on the current configuration.
743
- * This action does not require any parameters.
764
+ * This class sends a message to the Metabox API to generate Call To Action information based on the current configuration and sends it to the endpoint URL from the CTA information.
765
+ *
766
+ * To listen for changes after sending this command, listen to the 'ecomConfiguratorDataUpdated' event.
767
+ * //...Assume that the integration is already implemented (only once)
768
+ * @example
769
+ * import { Communicator } from '@3dsource/metabox-modular-configurator-api';
770
+ *
771
+ * @param {Communicator} api - communicator instance api
772
+ * window.env3DSource.apiReady = (api: Communicator) => {
773
+ * @param {EcomConfigurator} data - description for all ecom configurator params
774
+ * api.addEventListener('ecomConfiguratorDataUpdated', (data) => {
775
+ * console.log('Ecom configurator params:', data);
776
+ * });
777
+ * };
744
778
  *
745
779
  * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
746
780
  *
747
781
  * @example
748
- * import { GetPdf, Communicator } from '@3dsource/metabox-modular-configurator-api';
782
+ * import { GetCallToActionInformation, Communicator } from '@3dsource/metabox-modular-configurator-api';
783
+ *
784
+ * @param {Communicator} api - communicator instance api
749
785
  * window.env3DSource.apiReady = (api: Communicator) => {
750
- * api.sendCommandToMetabox(new GetPdf());
786
+ * api.sendCommandToMetabox(new GetCallToActionInformation());
751
787
  * };
752
788
  */
753
- declare class GetPdf extends CommandBase {
789
+ declare class GetCallToActionInformation extends CommandBase {
754
790
  /**
755
- * Creates an instance of GetPdf.
791
+ * Creates an instance of GetCallToActionInformation.
756
792
  *
757
793
  * @remarks
758
794
  * This constructor does not require any parameters.
@@ -761,15 +797,28 @@ declare class GetPdf extends CommandBase {
761
797
  }
762
798
 
763
799
  /**
764
- * Represents a command to send to unreal and get the camera from unreal to api.
800
+ * Represents a command to get the camera configuration from Unreal.
765
801
  * @remarks
766
802
  * This class sends a message to the Metabox API to get the camera from a scene.
767
- * This action does not require any parameters.
803
+ *
804
+ * To listen for changes after sending this command, listen to the 'getCameraResult' event.
805
+ * //...Assume that the integration is already implemented (only once)
806
+ * @example
807
+ * import { Communicator } from '@3dsource/metabox-modular-configurator-api';
808
+ *
809
+ * @param {Communicator} api - communicator instance api
810
+ * window.env3DSource.apiReady = (api: Communicator) => {
811
+ * @param {CameraCommandPayload} data - camera params
812
+ * api.addEventListener('getCameraResult', (data) => {
813
+ * console.log('Camera params after get camera command:', data);
814
+ * });
815
+ * };
768
816
  *
769
817
  * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
770
818
  *
771
819
  * @example
772
820
  * import { GetCamera, Communicator } from '@3dsource/metabox-modular-configurator-api';
821
+ * @param {Communicator} api - communicator instance api
773
822
  * window.env3DSource.apiReady = (api: Communicator) => {
774
823
  * api.sendCommandToMetabox(new GetCamera());
775
824
  * };
@@ -785,14 +834,15 @@ declare class GetCamera extends CommandBase {
785
834
  }
786
835
 
787
836
  /**
788
- * Represents a command to send to unreal and set camera to need.
837
+ * Represents a command to set the camera configuration.
789
838
  * @remarks
790
839
  * This class sends a message to the Metabox API to set the camera on a scene.
791
- *
840
+ * **Important**: No need to listen to any events to see changes.
792
841
  * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
793
842
  *
794
843
  * @example
795
- * import { ResetCamera, Communicator } from '@3dsource/metabox-modular-configurator-api';
844
+ * import { SetCamera, Communicator } from '@3dsource/metabox-modular-configurator-api';
845
+ * @param {Communicator} api - communicator instance api
796
846
  * window.env3DSource.apiReady = (api: Communicator) => {
797
847
  * api.sendCommandToMetabox(new SetCamera({
798
848
  * fov: 45,
@@ -816,22 +866,21 @@ declare class SetCamera extends CommandBase {
816
866
  /**
817
867
  * Creates an instance of SetCamera.
818
868
  *
819
- * @remarks
820
- * @param {CameraCommandPayload} camera - camera config
869
+ * @param {CameraCommandPayload} camera - The camera configuration.
821
870
  */
822
871
  constructor(camera: CameraCommandPayload);
823
872
  }
824
873
 
825
874
  /**
826
- * Represents a command to send to unreal and reset camera to initial.
875
+ * Represents a command to reset the camera to its initial position.
827
876
  * @remarks
828
877
  * This class sends a message to the Metabox API to reset the camera on a scene.
829
- * This action does not require any parameters.
830
- *
878
+ * **Important**: No need to listen to any events to see changes.
831
879
  * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
832
880
  *
833
881
  * @example
834
882
  * import { ResetCamera, Communicator } from '@3dsource/metabox-modular-configurator-api';
883
+ * @param {Communicator} api - communicator instance api
835
884
  * window.env3DSource.apiReady = (api: Communicator) => {
836
885
  * api.sendCommandToMetabox(new ResetCamera());
837
886
  * };
@@ -847,20 +896,70 @@ declare class ResetCamera extends CommandBase {
847
896
  }
848
897
 
849
898
  /**
850
- * Represents a command to Init Showcase for a product in a component on a scene and start a sequence for the product.
899
+ * Represents a command to apply zoom and change the camera zoom on a scene.
900
+ * @remarks
901
+ * This class sends a command to the Metabox API to change zoom on a scene.
902
+ * **Important**: No need to listen to any events to see changes.
903
+ * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
904
+ *
905
+ * @example
906
+ * import { ApplyZoom, Communicator } from '@3dsource/metabox-modular-configurator-api';
907
+ *
908
+ * @param {Communicator} api - communicator instance api
909
+ * window.env3DSource.apiReady = (api: Communicator) => {
910
+ * api.sendCommandToMetabox(new ApplyZoom(10));
911
+ * api.sendCommandToMetabox(new ApplyZoom(-10));
912
+ * };
913
+ */
914
+ declare class ApplyZoom extends CommandBase {
915
+ /**
916
+ * Creates an instance of ApplyZoom.
917
+ *
918
+ * @param {number} zoom - The zoom value to apply.
919
+ */
920
+ constructor(zoom: number);
921
+ }
922
+
923
+ /**
924
+ * Represents a command to initialize Showcase for a product scene and start a sequence for the product.
851
925
  * @remarks
852
- * This class sends a command to the Metabox API to init showcase if the product in a component has a sequence.
853
- * For check this needs to find a showcase property in the current product in a component
854
- * If this property exists, you can send init showcase command
855
- * You can send init showcase command only for root components; otherwise we will ignore this command
926
+ * This class sends a command to the Metabox API to initialize showcase if the product has a sequence.
927
+ * To check this, find the showcase property in the current product and listen to the 'configuratorDataUpdated' event.
928
+ * //...Assume that the integration is already implemented (only once)
929
+ * @example
930
+ * import { Communicator } from '@3dsource/metabox-modular-configurator-api';
931
+ *
932
+ * @param {Communicator} api - communicator instance api
933
+ * window.env3DSource.apiReady = (api: Communicator) => {
934
+ * @param {ConfiguratorEnvelope} data - configurator state after updated
935
+ * api.addEventListener('configuratorDataUpdated', (data) => {
936
+ * console.log('State updated after applied new environment:', data);
937
+ * });
938
+ * };
939
+ *
940
+ * If this property exists, you can send the init showcase command.
941
+ *
942
+ * To listen for changes after sending this command, listen to the 'showcaseStatusChanged' event.
943
+ * //...Assume that the integration is already implemented (only once)
944
+ * @example
945
+ * import { Communicator } from '@3dsource/metabox-modular-configurator-api';
946
+ *
947
+ * @param {Communicator} api - communicator instance api
948
+ * window.env3DSource.apiReady = (api: Communicator) => {
949
+ * @param {ShowCaseStatus} data - showcase status value
950
+ * api.addEventListener('showcaseStatusChanged', (data) => {
951
+ * console.log('Showcase status value after changed:', data);
952
+ * });
953
+ * };
856
954
  *
857
955
  * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
858
956
  *
859
957
  * @example
860
- * ```typescript
861
958
  * import { InitShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';
959
+ *
960
+ * @param {Communicator} api - communicator instance api
862
961
  * window.env3DSource.apiReady = (api: Communicator) => {
863
- * api.sendCommandToMetabox(new InitShowcase();
962
+ * api.sendCommandToMetabox(new InitShowcase());
864
963
  * };
865
964
  */
866
965
  declare class InitShowcase extends CommandBase {
@@ -874,23 +973,29 @@ declare class InitShowcase extends CommandBase {
874
973
  }
875
974
 
876
975
  /**
877
- * @internal
878
- * @hidden
879
- * Represents a command to send Unreal command.
880
- */
881
- declare class UnrealCommand extends CommandBase {
882
- constructor(payload: object);
883
- }
884
-
885
- /**
886
- * Represents a command to Play Showcase for a product when it already init, and you call pause, for example, before it.
976
+ * Represents a command to play Showcase for a product when it is already initialized and paused.
887
977
  * @remarks
888
- * This class sends a command to the Metabox API to play showcase for a product if it is already initialized and pause.
978
+ * This class sends a command to the Metabox API to play showcase for a product if it is already initialized and paused.
979
+ *
980
+ * To listen for changes after sending this command, listen to the 'showcaseStatusChanged' event.
981
+ * //...Assume that the integration is already implemented (only once)
982
+ * @example
983
+ * import { Communicator } from '@3dsource/metabox-modular-configurator-api';
984
+ *
985
+ * @param {Communicator} api - communicator instance api
986
+ * window.env3DSource.apiReady = (api: Communicator) => {
987
+ * @param {ShowCaseStatus} data - showcase status value
988
+ * api.addEventListener('showcaseStatusChanged', (data) => {
989
+ * console.log('Showcase status value after changed:', data);
990
+ * });
991
+ * };
889
992
  *
890
993
  * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
891
994
  *
892
995
  * @example
893
996
  * import { PlayShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';
997
+ *
998
+ * @param {Communicator} api - communicator instance api
894
999
  * window.env3DSource.apiReady = (api: Communicator) => {
895
1000
  * api.sendCommandToMetabox(new PlayShowcase());
896
1001
  * };
@@ -906,14 +1011,38 @@ declare class PlayShowcase extends CommandBase {
906
1011
  }
907
1012
 
908
1013
  /**
909
- * Represents a command to Pause Showcase for a product when it already init and play, and you call pause.
1014
+ * @internal
1015
+ * @hidden
1016
+ * Represents a command to send Unreal command.
1017
+ */
1018
+ declare class UnrealCommand extends CommandBase {
1019
+ constructor(payload: object);
1020
+ }
1021
+
1022
+ /**
1023
+ * Represents a command to pause Showcase for a product when it is already initialized and playing.
910
1024
  * @remarks
911
- * This class sends a command to the Metabox API to pause showcase for a product if it is already initialized and play.
1025
+ * This class sends a command to the Metabox API to pause showcase for a product if it is already initialized and playing.
1026
+ *
1027
+ * To listen for changes after sending this command, listen to the 'showcaseStatusChanged' event.
1028
+ * //...Assume that the integration is already implemented (only once)
1029
+ * @example
1030
+ * import { Communicator } from '@3dsource/metabox-modular-configurator-api';
1031
+ *
1032
+ * @param {Communicator} api - communicator instance api
1033
+ * window.env3DSource.apiReady = (api: Communicator) => {
1034
+ * @param {ShowCaseStatus} data - showcase status value
1035
+ * api.addEventListener('showcaseStatusChanged', (data) => {
1036
+ * console.log('Showcase status value after changed:', data);
1037
+ * });
1038
+ * };
912
1039
  *
913
1040
  * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
914
1041
  *
915
1042
  * @example
916
1043
  * import { PauseShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';
1044
+ *
1045
+ * @param {Communicator} api - communicator instance api
917
1046
  * window.env3DSource.apiReady = (api: Communicator) => {
918
1047
  * api.sendCommandToMetabox(new PauseShowcase());
919
1048
  * };
@@ -929,14 +1058,29 @@ declare class PauseShowcase extends CommandBase {
929
1058
  }
930
1059
 
931
1060
  /**
932
- * Represents a command to Stop Showcase for a product when it already init, and you want to destroy it.
1061
+ * Represents a command to stop Showcase for a product when it is already initialized, and you want to destroy it.
933
1062
  * @remarks
934
- * This class sends a command to the Metabox API to Stop showcase for a product if it is already initialized.
1063
+ * This class sends a command to the Metabox API to stop showcase for a product if it is already initialized.
1064
+ *
1065
+ * To listen for changes after sending this command, listen to the 'showcaseStatusChanged' event.
1066
+ * //...Assume that the integration is already implemented (only once)
1067
+ * @example
1068
+ * import { Communicator } from '@3dsource/metabox-modular-configurator-api';
1069
+ *
1070
+ * @param {Communicator} api - communicator instance api
1071
+ * window.env3DSource.apiReady = (api: Communicator) => {
1072
+ * @param {ShowCaseStatus} data - showcase status value
1073
+ * api.addEventListener('showcaseStatusChanged', (data) => {
1074
+ * console.log('Showcase status value after changed:', data);
1075
+ * });
1076
+ * };
935
1077
  *
936
1078
  * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
937
1079
  *
938
1080
  * @example
939
1081
  * import { StopShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';
1082
+ *
1083
+ * @param {Communicator} api - communicator instance api
940
1084
  * window.env3DSource.apiReady = (api: Communicator) => {
941
1085
  * api.sendCommandToMetabox(new StopShowcase());
942
1086
  * };
@@ -959,17 +1103,28 @@ declare class StopShowcase extends CommandBase {
959
1103
  type MimeType = 'image/png' | 'image/jpeg' | 'image/webp';
960
1104
  /**
961
1105
  * Represents a command to get a screenshot.
962
- *
963
1106
  * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
964
1107
  *
1108
+ * @remarks
1109
+ * To listen for changes after sending this command, listen to the 'screenshot' event.
1110
+ * //...Assume that the integration is already implemented (only once)
1111
+ * @example
1112
+ * import { Communicator } from '@3dsource/metabox-modular-configurator-api';
1113
+ *
1114
+ * @param {Communicator} api - communicator instance api
1115
+ * window.env3DSource.apiReady = (api: Communicator) => {
1116
+ * @param {string} data - base64 string image
1117
+ * api.addEventListener('screenshot', (data) => {
1118
+ * console.log('Get screenshot here:', data);
1119
+ * saveImage(data, 'Render.png');
1120
+ * });
1121
+ * };
1122
+ *
965
1123
  * @example
966
1124
  * import { GetScreenshot, Communicator, saveImage } from '@3dsource/metabox-modular-configurator-api';
1125
+ *
1126
+ * @param {Communicator} api - communicator instance api
967
1127
  * window.env3DSource.apiReady = (api: Communicator) => {
968
- * // Listen for events from to the Metabox API
969
- * api.addEventListener('screenshot', (data) => {
970
- * // Process the get screenshot response
971
- * saveImage(data, 'Render.png');
972
- * });
973
1128
  * api.sendCommandToMetabox(new GetScreenshot('image/png', { x: 1024, y: 1024 }));
974
1129
  * };
975
1130
  */
@@ -989,14 +1144,25 @@ declare class GetScreenshot extends CommandBase {
989
1144
  * Represents a command to set a component by its data (ID, typeId, isRoot).
990
1145
  *
991
1146
  * @remarks
992
- * This action sends a message to the Metabox API to set a component using the provided component ID and its component type data.
1147
+ * To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
1148
+ * //...Assume that the integration is already implemented (only once)
1149
+ * @example
1150
+ * import { Communicator } from '@3dsource/metabox-modular-configurator-api';
1151
+ *
1152
+ * @param {Communicator} api - communicator instance api
1153
+ * window.env3DSource.apiReady = (api: Communicator) => {
1154
+ * @param {ConfiguratorEnvelope} data - configurator state after updated
1155
+ * api.addEventListener('configuratorDataUpdated', (data) => {
1156
+ * console.log('State updated after applied new component:', data);
1157
+ * });
1158
+ * };
993
1159
  *
994
1160
  * @example
995
1161
  * import { SetComponent, Communicator } from '@3dsource/metabox-modular-configurator-api';
996
1162
  *
997
- * //...Assume that the integration is already implemented
1163
+ * @param {Communicator} api - communicator instance api
998
1164
  * window.env3DSource.apiReady = (api: Communicator) => {
999
- * api.setCommandToMetaBox(new SetComponent(
1165
+ * api.sendCommandToMetabox(new SetComponent(
1000
1166
  * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3', 'typeId', true
1001
1167
  * ));
1002
1168
  * };
@@ -1005,9 +1171,9 @@ declare class SetComponent extends CommandBase {
1005
1171
  /**
1006
1172
  * Creates an instance of SetComponent.
1007
1173
  *
1008
- * @param {string} id
1009
- * @param {string} typeId
1010
- * @param {boolean} isRoot
1174
+ * @param {string} id - The component ID.
1175
+ * @param {string} typeId - The component type ID.
1176
+ * @param {boolean} isRoot - Whether this is a root component.
1011
1177
  */
1012
1178
  constructor(id: string, typeId: string, isRoot: boolean);
1013
1179
  }
@@ -1015,10 +1181,24 @@ declare class SetComponent extends CommandBase {
1015
1181
  /**
1016
1182
  * Represents a command to set component material by its slot ID and Material ID.
1017
1183
  *
1184
+ * @remarks
1185
+ * To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
1186
+ * //...Assume that the integration is already implemented (only once)
1187
+ * @example
1188
+ * import { Communicator } from '@3dsource/metabox-modular-configurator-api';
1189
+ *
1190
+ * @param {Communicator} api - communicator instance api
1191
+ * window.env3DSource.apiReady = (api: Communicator) => {
1192
+ * @param {ConfiguratorEnvelope} data - configurator state after updated
1193
+ * api.addEventListener('configuratorDataUpdated', (data) => {
1194
+ * console.log('State updated after applied new product:', data);
1195
+ * });
1196
+ * };
1197
+ *
1018
1198
  * @example
1019
1199
  * import { SetComponentMaterial, Communicator } from '@3dsource/metabox-modular-configurator-api';
1020
1200
  *
1021
- * //...Assume that the integration is already implemented
1201
+ * @param {Communicator} api - communicator instance api
1022
1202
  * window.env3DSource.apiReady = (api: Communicator) => {
1023
1203
  * api.sendCommandToMetabox(new SetComponentMaterial(
1024
1204
  * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',
@@ -1041,12 +1221,25 @@ declare class SetComponentMaterial extends CommandBase {
1041
1221
  /**
1042
1222
  * Represents a command to set the environment by its ID.
1043
1223
  *
1224
+ * @remarks
1225
+ * To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
1226
+ * //...Assume that the integration is already implemented (only once)
1227
+ * @example
1228
+ * import { Communicator } from '@3dsource/metabox-modular-configurator-api';
1229
+ *
1230
+ * @param {Communicator} api - communicator instance api
1231
+ * window.env3DSource.apiReady = (api: Communicator) => {
1232
+ * @param {ConfiguratorEnvelope} data - configurator state after updated
1233
+ * api.addEventListener('configuratorDataUpdated', (data) => {
1234
+ * console.log('State updated after applied new environment:', data);
1235
+ * });
1236
+ * };
1237
+ *
1044
1238
  * @example
1045
1239
  * import { SetEnvironment, Communicator } from '@3dsource/metabox-modular-configurator-api';
1046
1240
  *
1047
- * //...Assume that the integration is already implemented
1241
+ * @param {Communicator} api - communicator instance api
1048
1242
  * window.env3DSource.apiReady = (api: Communicator) => {
1049
- * // Change the environment to '55555555-1234-1234-1234-01234567890'
1050
1243
  * api.sendCommandToMetabox(new SetEnvironment('55555555-1234-1234-1234-01234567890'));
1051
1244
  * };
1052
1245
  */
@@ -1062,10 +1255,24 @@ declare class SetEnvironment extends CommandBase {
1062
1255
  /**
1063
1256
  * Represents a command to set an environment material by its slot ID and Material ID.
1064
1257
  *
1258
+ * @remarks
1259
+ * To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
1260
+ * //...Assume that the integration is already implemented (only once)
1261
+ * @example
1262
+ * import { Communicator } from '@3dsource/metabox-modular-configurator-api';
1263
+ *
1264
+ * @param {Communicator} api - communicator instance api
1265
+ * window.env3DSource.apiReady = (api: Communicator) => {
1266
+ * @param {ConfiguratorEnvelope} data - configurator state after updated
1267
+ * api.addEventListener('configuratorDataUpdated', (data) => {
1268
+ * console.log('State updated after applied new environment material:', data);
1269
+ * });
1270
+ * };
1271
+ *
1065
1272
  * @example
1066
1273
  * import { SetEnvironmentMaterial, Communicator } from '@3dsource/metabox-modular-configurator-api';
1067
1274
  *
1068
- * //...Assume that the integration is already implemented
1275
+ * @param {Communicator} api - communicator instance api
1069
1276
  * window.env3DSource.apiReady = (api: Communicator) => {
1070
1277
  * api.sendCommandToMetabox(new SetEnvironmentMaterial(
1071
1278
  * 'carpaint',
@@ -1084,14 +1291,17 @@ declare class SetEnvironmentMaterial extends CommandBase {
1084
1291
  }
1085
1292
 
1086
1293
  /**
1087
- * Represents a command to toggle the Embedded to the Metabox Menu.
1294
+ * Represents a command to toggle the embedded Metabox menu.
1295
+ * @remarks
1296
+ * This command can only be used when using the metabox menu.
1297
+ * **Important**: No need to listen to any events to see changes.
1088
1298
  *
1089
1299
  * @example
1090
1300
  * import { ShowEmbeddedMenu, Communicator } from '@3dsource/metabox-modular-configurator-api';
1091
1301
  *
1092
- * //...Assume that the integration is already implemented
1302
+ * @param {Communicator} api - communicator instance api
1093
1303
  * window.env3DSource.apiReady = (api: Communicator) => {
1094
- * api.setCommandToMetaBox(new ShowEmbeddedMenu(true));
1304
+ * api.sendCommandToMetabox(new ShowEmbeddedMenu(true));
1095
1305
  * };
1096
1306
  */
1097
1307
  declare class ShowEmbeddedMenu extends CommandBase {
@@ -1108,11 +1318,12 @@ declare class ShowEmbeddedMenu extends CommandBase {
1108
1318
  *
1109
1319
  * @remarks
1110
1320
  * This action sends a message to the Metabox API to toggle the visibility of the Unreal overlay UI.
1321
+ * **Important**: No need to listen to any events to see changes.
1111
1322
  *
1112
1323
  * @example
1113
1324
  * import { ShowOverlayInterface, Communicator } from '@3dsource/metabox-modular-configurator-api';
1114
1325
  *
1115
- * //...Assume that the integration is already implemented
1326
+ * @param {Communicator} api - communicator instance api
1116
1327
  * window.env3DSource.apiReady = (api: Communicator) => {
1117
1328
  * api.setCommandToMetaBox(new ShowOverlayInterface(true));
1118
1329
  * };
@@ -1127,56 +1338,46 @@ declare class ShowOverlayInterface extends CommandBase {
1127
1338
  }
1128
1339
 
1129
1340
  /**
1130
- * Represents a command to force set the device type.
1131
- *
1341
+ * Represents a command to show measurement for a product when it is already loaded.
1132
1342
  * @remarks
1133
- * This class sends a message to the Metabox API to force to set the device type.
1343
+ * This class sends a command to the Metabox API to show measurement for a product if it is already initialized.
1344
+ * **Important**: No need to listen to any events to see changes.
1345
+ * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
1134
1346
  *
1135
1347
  * @example
1136
- * import { ForceSetDeviceType, Communicator } from '@3dsource/metabox-modular-configurator-api';
1348
+ * import { ShowMeasurement, Communicator } from '@3dsource/metabox-modular-configurator-api';
1137
1349
  *
1138
- * //...Assume that the integration is already implemented
1350
+ * @param {Communicator} api - communicator instance api
1139
1351
  * window.env3DSource.apiReady = (api: Communicator) => {
1140
- * api.sendCommandToMetabox(new ForceSetDeviceType('desktop'));
1352
+ * api.sendCommandToMetabox(new ShowMeasurement());
1141
1353
  * };
1142
1354
  */
1143
- declare class ForceSetDeviceType extends CommandBase {
1355
+ declare class ShowMeasurement extends CommandBase {
1144
1356
  /**
1145
- * Creates an instance of ForceSetDeviceType.
1357
+ * Creates an instance of ShowMeasurement.
1146
1358
  *
1147
- * @param {ApplicationDeviceTypes} deviceType - The device type to force set.
1148
- */
1149
- constructor(deviceType: ApplicationDeviceTypes);
1150
- }
1151
-
1152
- /**
1153
- * Represents a command to send Metabox Config to Metabox Modular Configurator.
1154
- * @remarks
1155
- * Automatically sent when the Communicator instance is ready.
1156
- */
1157
- declare class MetaboxConfig extends CommandBase {
1158
- /**
1159
- * Creates an instance of MetaboxConfig.
1160
- * @param {string} appId - The unique identifier for the Communicator Instance
1161
- * @param {MetaboxCommandConfig} config - optional initial config: standalone - if true - disable metabox custom template and all logic
1359
+ * @remarks
1360
+ * This constructor does not require any parameters.
1162
1361
  */
1163
- constructor(appId: string, config: MetaboxCommandConfig);
1362
+ constructor();
1164
1363
  }
1165
1364
 
1166
1365
  /**
1167
- * Represents a command to Show Measurement for a product when it already loaded.
1366
+ * Represents a command to hide measurement for a product when it is already loaded.
1168
1367
  * @remarks
1169
- * This class sends a command to the Metabox API to Show Measurement for a product if it is already initialized.
1170
- *
1368
+ * This class sends a command to the Metabox API to hide measurement for a product if it is already initialized.
1369
+ * **Important**: No need to listen to any events to see changes.
1171
1370
  * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
1172
1371
  *
1173
1372
  * @example
1174
- * import { ShowMeasurement, Communicator } from '@3dsource/metabox-modular-configurator-api';
1373
+ * import { HideMeasurement, Communicator } from '@3dsource/metabox-modular-configurator-api';
1374
+ *
1375
+ * @param {Communicator} api - communicator instance api
1175
1376
  * window.env3DSource.apiReady = (api: Communicator) => {
1176
- * api.sendCommandToMetabox(new ShowMeasurement());
1377
+ * api.sendCommandToMetabox(new HideMeasurement());
1177
1378
  * };
1178
1379
  */
1179
- declare class ShowMeasurement extends CommandBase {
1380
+ declare class HideMeasurement extends CommandBase {
1180
1381
  /**
1181
1382
  * Creates an instance of HideMeasurement.
1182
1383
  *
@@ -1187,27 +1388,29 @@ declare class ShowMeasurement extends CommandBase {
1187
1388
  }
1188
1389
 
1189
1390
  /**
1190
- * Represents a command to Hide Measurement for a product when it already loaded.
1191
- * @remarks
1192
- * This class sends a command to the Metabox API to Hide Measurement for a product if it is already initialized.
1391
+ * Represents a command to force set the device type.
1193
1392
  *
1194
- * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
1393
+ * @remarks
1394
+ * This class sends a message to the Metabox API to force set the device type.
1395
+ * **Important**: No need to listen to any events to see changes.
1396
+ * //...Assume that the integration is already implemented (only once)
1195
1397
  *
1196
1398
  * @example
1197
- * import { HideMeasurement, Communicator } from '@3dsource/metabox-modular-configurator-api';
1399
+ * import { ForceSetDeviceType, Communicator } from '@3dsource/metabox-modular-configurator-api';
1400
+ *
1401
+ * @param {Communicator} api - communicator instance api
1198
1402
  * window.env3DSource.apiReady = (api: Communicator) => {
1199
- * api.sendCommandToMetabox(new HideMeasurement());
1403
+ * api.sendCommandToMetabox(new ForceSetDeviceType('desktop'));
1200
1404
  * };
1201
1405
  */
1202
- declare class HideMeasurement extends CommandBase {
1406
+ declare class ForceSetDeviceType extends CommandBase {
1203
1407
  /**
1204
- * Creates an instance of HideMeasurement.
1408
+ * Creates an instance of ForceSetDeviceType.
1205
1409
  *
1206
- * @remarks
1207
- * This constructor does not require any parameters.
1410
+ * @param {ApplicationDeviceTypes} deviceType - The device type to force set.
1208
1411
  */
1209
- constructor();
1412
+ constructor(deviceType: ApplicationDeviceTypes);
1210
1413
  }
1211
1414
 
1212
1415
  export { AppLoaded, ApplyZoom, BasicRouteUrl, CommandBase, Communicator, EventDispatcher, ForceSetDeviceType, GetCallToActionInformation, GetCamera, GetPdf, GetScreenshot, HideMeasurement, InitShowcase, Metabox, MetaboxConfig, MetaboxData, MetaboxDomain, MetaboxHost, MetaboxModularConfiguratorActions, PauseShowcase, PlayShowcase, ResetCamera, SetCamera, SetComponent, SetComponentMaterial, SetEnvironment, SetEnvironmentMaterial, ShowEmbeddedMenu, ShowMeasurement, ShowOverlayInterface, StopShowcase, UnrealCommand, VERSION, fromCommunicatorEvent, integrateMetabox, prepareIframeSrc, saveImage };
1213
- export type { ApplicationDeviceTypes, CameraCommandPayload, ComponentWithParent, Cta, EcomConfigurator, Environment, FromMetaBoxAPIEnvelope, FromMetaBoxApiEvents, FromMetaBoxMessage, FromMetaboxApiAction, FromMetaboxMessagePayloads, InitialModularConfigurator, IntegrateMetaboxConfig, Listener, MCAppLoaded, Material, MetaBoxApiEnvelope, MetaProperty, MetaboxCommandConfig, MetaboxEnvironment, MimeType, ModularConfiguratorComponent, ModularConfiguratorComponentType, ModularConfiguratorConnector, ModularConfiguratorEnvelope, ModularConfiguratorEnvironment, ModularConfiguratorVirtualSocketToConnector, Product, SelectedIds, ShowCaseStatus, Showcase, Slot, Test, Thumbnail, Timecode, ToMetaBoxActions, ToMetaBoxMessage, ToMetaBoxMessageEnvelope, ToMetaboxMessagePayload, ToMetaboxMessagePayloads, VideoResolution };
1416
+ export type { ApplicationDeviceTypes, CameraCommandPayload, ComponentWithParent, Cta, EcomConfigurator, Environment, FromMetaBoxAPIEnvelope, FromMetaBoxApiEvents, FromMetaBoxMessage, FromMetaboxApiAction, FromMetaboxMessagePayloads, InitialModularConfigurator, IntegrateMetaboxConfig, Listener, MCAppLoaded, Material, MetaBoxApiEnvelope, MetaProperty, MetaboxCommandConfig, MetaboxEnvironment, MimeType, ModularConfiguratorComponent, ModularConfiguratorComponentType, ModularConfiguratorConnector, ModularConfiguratorEnvelope, ModularConfiguratorEnvironment, ModularConfiguratorVirtualSocketToConnector, Product, SelectedIds, ShowCaseStatus, Showcase, Slot, Thumbnail, Timecode, ToMetaBoxActions, ToMetaBoxMessage, ToMetaBoxMessageEnvelope, ToMetaboxMessagePayload, ToMetaboxMessagePayloads, ToMetaboxTarget, VideoResolution };