@rebilly/instruments 9.54.0 → 9.54.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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
- ## [9.54.0](https://github.com/Rebilly/rebilly/compare/instruments/core-v9.53.2...instruments/core-v9.54.0) (2024-05-29)
1
+ ## [9.54.1](https://github.com/Rebilly/rebilly/compare/instruments/core-v9.54.0...instruments/core-v9.54.1) (2024-05-30)
2
2
 
3
3
 
4
- ### Features
4
+ ### Bug Fixes
5
5
 
6
- * **api-metadata, rebilly-js-sdk:** Update resources based on latest api definitions ([#5584](https://github.com/Rebilly/rebilly/issues/5584)) ([3f30308](https://github.com/Rebilly/rebilly/commit/3f303083e6d820b2c40971bf4711663e5a6a7c2c))
6
+ * **instruments:** Allow deactivate model not working within shadowdom ([#5618](https://github.com/Rebilly/rebilly/issues/5618)) ([34f37a9](https://github.com/Rebilly/rebilly/commit/34f37a9cbc5704325fd3e4c8d865d431cc5e0512))
package/dist/index.js CHANGED
@@ -2876,37 +2876,46 @@ function showConfirmationModalHandler(iframe) {
2876
2876
  }
2877
2877
  );
2878
2878
  }
2879
+ const modalTemplate$1 = ({ title: title2, message, cancelText, confirmText }) => `
2880
+ <div class="rebilly-instruments-modal-overlay is-visible">
2881
+ <div class="rebilly-instruments-modal-container rebilly-instruments-confirmation-modal-container is-visible">
2882
+ <div class="rebilly-instruments-modal-header rebilly-instruments-confirmation-modal-header">
2883
+ <strong
2884
+ class="rebilly-instruments-modal-title rebilly-instruments-confirmation-modal-title"
2885
+ >${title2}</strong>
2886
+ </div>
2887
+ <div class="rebilly-instruments-modal-content rebilly-instruments-confirmation-modal-content">
2888
+ <p
2889
+ class="rebilly-instruments-modal-message rebilly-instruments-confirmation-modal-message"
2890
+ >${message}</p>
2891
+ </div>
2892
+ <div class="rebilly-instruments-modal-actions rebilly-instruments-confirmation-modal-actions">
2893
+ <button
2894
+ class="rebilly-instruments-button rebilly-instruments-button-secondary rebilly-instruments-confirmation-modal-cancel"
2895
+ >${cancelText}</button>
2896
+ <button
2897
+ class="rebilly-instruments-button rebilly-instruments-confirmation-modal-confirm"
2898
+ >${confirmText}</button>
2899
+ </div>
2900
+ </div>
2901
+ </div>
2902
+ `;
2879
2903
  function showConfirmationModal({ title: title2, message, confirmText, cancelText }) {
2880
2904
  return new Promise((resolve2) => {
2881
- const modalElement = document.createElement("div");
2882
- modalElement.id = "confirmation-modal";
2883
- modalElement.classList.add(
2884
- "rebilly-instruments-modal-overlay",
2885
- "is-visible"
2905
+ state.form.insertAdjacentHTML(
2906
+ "beforeend",
2907
+ modalTemplate$1({ title: title2, message, confirmText, cancelText })
2908
+ );
2909
+ document.body.style.overflow = "hidden";
2910
+ const modalOverlay = state.form.querySelector(
2911
+ ".rebilly-instruments-modal-overlay"
2886
2912
  );
2887
- modalElement.innerHTML = `
2888
- <div class="rebilly-instruments-modal-container rebilly-instruments-confirmation-modal-container is-visible">
2889
- <div class="rebilly-instruments-modal-header rebilly-instruments-confirmation-modal-header">
2890
- <b class="rebilly-instruments-modal-title rebilly-instruments-confirmation-modal-title">${title2}</b>
2891
- </div>
2892
- <div class="rebilly-instruments-modal-content rebilly-instruments-confirmation-modal-content">
2893
- <p class="rebilly-instruments-modal-message rebilly-instruments-confirmation-modal-message">${message}</p>
2894
- </div>
2895
- <div class="rebilly-instruments-modal-actions rebilly-instruments-confirmation-modal-actions">
2896
- <button class="rebilly-instruments-button-transparent rebilly-instruments-confirmation-modal-cancel">${cancelText}</button>
2897
- <button class="rebilly-instruments-button rebilly-instruments-confirmation-modal-confirm">${confirmText}</button>
2898
- </div>
2899
- </div>
2900
- `;
2901
- document.body.appendChild(modalElement);
2902
- const modalOverlay = document.getElementById("confirmation-modal");
2903
- const confirmBtn = modalOverlay.querySelector(
2913
+ const confirmButton = state.form.querySelector(
2904
2914
  ".rebilly-instruments-confirmation-modal-confirm"
2905
2915
  );
2906
- const cancelBtn = modalOverlay.querySelector(
2916
+ const cancelButton = state.form.querySelector(
2907
2917
  ".rebilly-instruments-confirmation-modal-cancel"
2908
2918
  );
2909
- document.body.style.overflow = "hidden";
2910
2919
  const closeModal = () => {
2911
2920
  modalOverlay.classList.remove("is-visible");
2912
2921
  setTimeout(() => {
@@ -2914,11 +2923,17 @@ function showConfirmationModal({ title: title2, message, confirmText, cancelText
2914
2923
  modalOverlay.remove();
2915
2924
  }, 300);
2916
2925
  };
2917
- confirmBtn.addEventListener("click", () => {
2926
+ modalOverlay.addEventListener("click", (event) => {
2927
+ if (event.target === modalOverlay) {
2928
+ closeModal();
2929
+ resolve2({ confirmed: false });
2930
+ }
2931
+ });
2932
+ confirmButton.addEventListener("click", () => {
2918
2933
  closeModal();
2919
2934
  resolve2({ confirmed: true });
2920
2935
  });
2921
- cancelBtn.addEventListener("click", () => {
2936
+ cancelButton.addEventListener("click", () => {
2922
2937
  closeModal();
2923
2938
  resolve2({ confirmed: false });
2924
2939
  });
@@ -27908,6 +27923,7 @@ const vars = (theme2) => `
27908
27923
  align-items: center;
27909
27924
  font-weight: var(--rebilly-fontWeight600);
27910
27925
  line-height: var(--rebilly-fontLineHeightBase);
27926
+ margin-bottom: var(--rebilly-spacingM);
27911
27927
  }
27912
27928
 
27913
27929
  .rebilly-instruments-confirmation-modal-content {
@@ -27924,7 +27940,6 @@ const vars = (theme2) => `
27924
27940
  }
27925
27941
 
27926
27942
  .rebilly-instruments-confirmation-modal-actions .rebilly-instruments-confirmation-modal-confirm {
27927
- width: initial;
27928
27943
  margin-left: var(--rebilly-spacingS);
27929
27944
  }
27930
27945