@bitrix24/b24jssdk 0.1.6 → 0.1.7

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.
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @version @bitrix24/b24jssdk v0.1.6
3
- * @copyright (c) 2024 Bitrix24
2
+ * @version @bitrix24/b24jssdk v0.1.7
3
+ * @copyright (c) 2025 Bitrix24
4
4
  * @licence MIT
5
5
  * @links https://github.com/bitrix24/b24jssdk - GitHub
6
6
  * @links https://bitrix24.github.io/b24jssdk/ - Documentation
@@ -1647,7 +1647,7 @@ class Http {
1647
1647
  result.logTag = this.#logTag;
1648
1648
  }
1649
1649
  result[this.#requestIdGenerator.getQueryStringParameterName()] = this.#requestIdGenerator.getRequestId();
1650
- result[this.#requestIdGenerator.getQueryStringSdkParameterName()] = "0.1.6";
1650
+ result[this.#requestIdGenerator.getQueryStringSdkParameterName()] = "0.1.7";
1651
1651
  if (!!result.data && !!result.data.start) {
1652
1652
  delete result.data.start;
1653
1653
  }
@@ -2801,6 +2801,8 @@ var MessageCommands = /* @__PURE__ */ ((MessageCommands2) => {
2801
2801
  MessageCommands2["selectAccess"] = "selectAccess";
2802
2802
  MessageCommands2["selectCRM"] = "selectCRM";
2803
2803
  MessageCommands2["showAppForm"] = "showAppForm";
2804
+ MessageCommands2["getInterface"] = "getInterface";
2805
+ MessageCommands2["placementBindEvent"] = "placementBindEvent";
2804
2806
  return MessageCommands2;
2805
2807
  })(MessageCommands || {});
2806
2808
 
@@ -3606,9 +3608,11 @@ class SliderManager {
3606
3608
  }
3607
3609
 
3608
3610
  class PlacementManager {
3611
+ #messageManager;
3609
3612
  #title = "";
3610
3613
  #options = {};
3611
- constructor() {
3614
+ constructor(messageManager) {
3615
+ this.#messageManager = messageManager;
3612
3616
  }
3613
3617
  /**
3614
3618
  * Initializes the data received from the parent window message.
@@ -3632,6 +3636,54 @@ class PlacementManager {
3632
3636
  get isSliderMode() {
3633
3637
  return this.options?.IFRAME === "Y";
3634
3638
  }
3639
+ /**
3640
+ * Get Information About the JS Interface of the Current Embedding Location
3641
+ *
3642
+ * @return {Promise<any>}
3643
+ *
3644
+ * @link https://apidocs.bitrix24.com/api-reference/widgets/ui-interaction/bx24-placement-get-interface.html
3645
+ */
3646
+ async getInterface() {
3647
+ return this.#messageManager.send(
3648
+ MessageCommands.getInterface,
3649
+ {
3650
+ isSafely: true
3651
+ }
3652
+ );
3653
+ }
3654
+ /**
3655
+ * Set Up the Interface Event Handler
3656
+ * @param {string} eventName
3657
+ * @return {Promise<any>}
3658
+ *
3659
+ * @link https://apidocs.bitrix24.com/api-reference/widgets/ui-interaction/bx24-placement-bind-event.html
3660
+ */
3661
+ async bindEvent(eventName) {
3662
+ return this.#messageManager.send(
3663
+ MessageCommands.getInterface,
3664
+ {
3665
+ event: eventName,
3666
+ isSafely: true
3667
+ }
3668
+ );
3669
+ }
3670
+ /**
3671
+ * Call the Registered Interface Command
3672
+ * @param {string} command
3673
+ * @param {Record<string, any>} parameters
3674
+ * @return {Promise<any>}
3675
+ *
3676
+ * @link https://apidocs.bitrix24.com/api-reference/widgets/ui-interaction/bx24-placement-call.html
3677
+ */
3678
+ async call(command, parameters = {}) {
3679
+ return this.#messageManager.send(
3680
+ command,
3681
+ {
3682
+ ...parameters,
3683
+ isSafely: true
3684
+ }
3685
+ );
3686
+ }
3635
3687
  }
3636
3688
 
3637
3689
  class B24Frame extends AbstractB24 {
@@ -3659,7 +3711,7 @@ class B24Frame extends AbstractB24 {
3659
3711
  this.#appFrame,
3660
3712
  this.#messageManager
3661
3713
  );
3662
- this.#placementManager = new PlacementManager();
3714
+ this.#placementManager = new PlacementManager(this.#messageManager);
3663
3715
  this._isInit = false;
3664
3716
  }
3665
3717
  setLogger(logger) {