@myissue/vue-website-page-builder 3.2.92 → 3.2.93

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.
@@ -1368,7 +1368,7 @@ class uh {
1368
1368
  xt(this, "pageBuilderStateStore");
1369
1369
  xt(this, "getTextAreaVueModel");
1370
1370
  xt(this, "getLocalStorageItemName");
1371
- xt(this, "getCurrentImage");
1371
+ xt(this, "getApplyImageToSelection");
1372
1372
  xt(this, "getHyberlinkEnable");
1373
1373
  xt(this, "getComponents");
1374
1374
  xt(this, "getComponent");
@@ -1480,7 +1480,9 @@ class uh {
1480
1480
  });
1481
1481
  this.nextTick = Dt(), this.hasStartedEditing = !1, this.containsPagebuilder = document.querySelector("#contains-pagebuilder"), this.pageBuilderStateStore = t, this.getTextAreaVueModel = R(() => this.pageBuilderStateStore.getTextAreaVueModel), this.getLocalStorageItemName = R(
1482
1482
  () => this.pageBuilderStateStore.getLocalStorageItemName
1483
- ), this.getCurrentImage = R(() => this.pageBuilderStateStore.getCurrentImage), this.getHyberlinkEnable = R(() => this.pageBuilderStateStore.getHyberlinkEnable), this.getComponents = R(() => this.pageBuilderStateStore.getComponents), this.getComponent = R(() => this.pageBuilderStateStore.getComponent), this.getElement = R(() => this.pageBuilderStateStore.getElement), this.getNextSibling = R(() => this.pageBuilderStateStore.getNextSibling), this.getParentElement = R(() => this.pageBuilderStateStore.getParentElement), this.getRestoredElement = R(() => this.pageBuilderStateStore.getRestoredElement), this.getComponentArrayAddMethod = R(
1483
+ ), this.getApplyImageToSelection = R(
1484
+ () => this.pageBuilderStateStore.getApplyImageToSelection
1485
+ ), this.getHyberlinkEnable = R(() => this.pageBuilderStateStore.getHyberlinkEnable), this.getComponents = R(() => this.pageBuilderStateStore.getComponents), this.getComponent = R(() => this.pageBuilderStateStore.getComponent), this.getElement = R(() => this.pageBuilderStateStore.getElement), this.getNextSibling = R(() => this.pageBuilderStateStore.getNextSibling), this.getParentElement = R(() => this.pageBuilderStateStore.getParentElement), this.getRestoredElement = R(() => this.pageBuilderStateStore.getRestoredElement), this.getComponentArrayAddMethod = R(
1484
1486
  () => this.pageBuilderStateStore.getComponentArrayAddMethod
1485
1487
  ), this.NoneListernesTags = [
1486
1488
  "P",
@@ -1764,12 +1766,29 @@ class uh {
1764
1766
  }
1765
1767
  return !1;
1766
1768
  }
1767
- //
1768
- //
1769
- async updateBasePrimaryImage() {
1770
- this.getElement.value && this.getCurrentImage.value && this.getCurrentImage.value.src && (await this.nextTick, this.pageBuilderStateStore.setBasePrimaryImage(`${this.getCurrentImage.value.src}`), await this.handleAutoSave());
1769
+ /**
1770
+ * Sets the image selected from the media library as the "pending" image
1771
+ * to be applied to the currently selected element in the builder.
1772
+ * This does not update the DOM immediately—call `applyPendingImageToSelectedElement` to commit.
1773
+ * @param image - The image object to be staged for application
1774
+ */
1775
+ stageImageForSelectedElement(t) {
1776
+ this.pageBuilderStateStore.setApplyImageToSelection(t);
1771
1777
  }
1772
- setBasePrimaryImageFromCurrent() {
1778
+ /**
1779
+ * Applies the staged image (set by `stageImageForSelectedElement`) to the currently selected element.
1780
+ * This updates the builder state and triggers an auto-save.
1781
+ * If no element is selected or no image is staged, nothing happens.
1782
+ */
1783
+ async applyPendingImageToSelectedElement() {
1784
+ this.getElement.value && this.getApplyImageToSelection.value && this.getApplyImageToSelection.value.src && (await this.nextTick, this.pageBuilderStateStore.setBasePrimaryImage(`${this.getApplyImageToSelection.value.src}`), await this.handleAutoSave());
1785
+ }
1786
+ /**
1787
+ * Inspects the currently selected element and, if it contains exactly one <img> and no <div>,
1788
+ * sets that image's src as the base primary image in the builder state.
1789
+ * If the element does not meet these criteria, clears the base primary image.
1790
+ */
1791
+ setBasePrimaryImageFromSelectedElement() {
1773
1792
  if (!this.getElement.value) return;
1774
1793
  const t = document.createElement("div");
1775
1794
  t.innerHTML = this.getElement.value.outerHTML;
@@ -1835,7 +1854,7 @@ class uh {
1835
1854
  this.pageBuilderStateStore.setShowModalTipTap(t), t || await this.handleAutoSave();
1836
1855
  }
1837
1856
  async initializeElementStyles() {
1838
- this.pageBuilderStateStore.getPageBuilderConfig && (await new Promise((t) => requestAnimationFrame(t)), this.handleHyperlink(void 0, null, !1), this.handleOpacity(void 0), this.handleBackgroundOpacity(void 0), this.setBasePrimaryImageFromCurrent(), this.handleBorderStyle(void 0), this.handleBorderWidth(void 0), this.handleBorderColor(void 0), this.handleBorderRadiusGlobal(void 0), this.handleBorderRadiusTopLeft(void 0), this.handleBorderRadiusTopRight(void 0), this.handleBorderRadiusBottomleft(void 0), this.handleBorderRadiusBottomRight(void 0), this.handleFontSizeBase(void 0), this.handleFontSizeDesktop(void 0), this.handleFontSizeTablet(void 0), this.handleFontSizeMobile(void 0), this.handleFontWeight(void 0), this.handleFontFamily(void 0), this.handleFontStyle(void 0), this.handleVerticalPadding(void 0), this.handleHorizontalPadding(void 0), this.handleVerticalMargin(void 0), this.handleHorizontalMargin(void 0), this.handleBackgroundColor(void 0), this.handleTextColor(void 0), await Q(this, W, Ac).call(this));
1857
+ this.pageBuilderStateStore.getPageBuilderConfig && (await new Promise((t) => requestAnimationFrame(t)), this.handleHyperlink(void 0, null, !1), this.handleOpacity(void 0), this.handleBackgroundOpacity(void 0), this.setBasePrimaryImageFromSelectedElement(), this.handleBorderStyle(void 0), this.handleBorderWidth(void 0), this.handleBorderColor(void 0), this.handleBorderRadiusGlobal(void 0), this.handleBorderRadiusTopLeft(void 0), this.handleBorderRadiusTopRight(void 0), this.handleBorderRadiusBottomleft(void 0), this.handleBorderRadiusBottomRight(void 0), this.handleFontSizeBase(void 0), this.handleFontSizeDesktop(void 0), this.handleFontSizeTablet(void 0), this.handleFontSizeMobile(void 0), this.handleFontWeight(void 0), this.handleFontFamily(void 0), this.handleFontStyle(void 0), this.handleVerticalPadding(void 0), this.handleHorizontalPadding(void 0), this.handleVerticalMargin(void 0), this.handleHorizontalMargin(void 0), this.handleBackgroundColor(void 0), this.handleTextColor(void 0), await Q(this, W, Ac).call(this));
1839
1858
  }
1840
1859
  }
1841
1860
  W = new WeakSet(), Ec = function(t) {
@@ -3100,7 +3119,7 @@ const jh = /* @__PURE__ */ Hh("pageBuilderState", {
3100
3119
  basePrimaryImage: null,
3101
3120
  configPageBuilder: null,
3102
3121
  // Media Library State
3103
- currentImage: { src: "" },
3122
+ applyImageToSelection: { src: "" },
3104
3123
  currentPreviewImage: null,
3105
3124
  // User State
3106
3125
  builderStarted: !1,
@@ -3244,9 +3263,8 @@ const jh = /* @__PURE__ */ Hh("pageBuilderState", {
3244
3263
  getPageBuilderConfig(r) {
3245
3264
  return r.configPageBuilder;
3246
3265
  },
3247
- // Media Library Getters
3248
- getCurrentImage(r) {
3249
- return r.currentImage;
3266
+ getApplyImageToSelection(r) {
3267
+ return r.applyImageToSelection;
3250
3268
  },
3251
3269
  getCurrentPreviewImage(r) {
3252
3270
  return r.currentPreviewImage;
@@ -3415,9 +3433,8 @@ const jh = /* @__PURE__ */ Hh("pageBuilderState", {
3415
3433
  setPageBuilderConfig(r) {
3416
3434
  this.configPageBuilder = r;
3417
3435
  },
3418
- // Media Library Actions
3419
- setCurrentImage(r) {
3420
- this.currentImage = r;
3436
+ setApplyImageToSelection(r) {
3437
+ this.applyImageToSelection = r;
3421
3438
  },
3422
3439
  setCurrentPreviewImage(r) {
3423
3440
  this.currentPreviewImage = r;
@@ -23145,7 +23162,7 @@ const ck = ["src"], uk = {
23145
23162
  }, K3 = { class: "pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg" }, G3 = { class: "pbx-overflow-x-auto" }, J3 = { class: "pbx-w-max" }, Y3 = { class: "pbx-bg-white pbx-divide-y pbx-divide-gray-200" }, X3 = { class: "pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500" }, Q3 = { class: "pbx-min-w-[30rem] pbx-w-max" }, Z3 = { key: 0 }, t4 = { key: 1 }, e4 = { key: 0 }, r4 = { class: "pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500" }, o4 = { class: "pbx-min-w-[30rem] pbx-w-max" }, n4 = { class: "pbx-inline-flex pbx-items-center pbx-px-2.5 pbx-py-0.5 pbx-rounded-full pbx-text-xs pbx-font-medium" }, i4 = { class: "pbx-mt-4 pbx-mb-4 pbx-py-8 pbx-border-b pbx-border-myPrimbryLightGrayColor" }, a4 = { class: "pbx-mt-4 pbx-whitespace-pre-wrap pbx-text-white pbx-overflow-hidden pbx-bg-gray-900" }, s4 = { class: "pbx-px-4 pbx-pb-8 pbx-pt-4 pbx-text-white pbx-text-xs pbx-break-all" }, l4 = { class: "pbx-myPrimaryParagraph pbx-text-xs pbx-text-white" }, p4 = {
23146
23163
  __name: "PageBuilderSettings",
23147
23164
  setup(r) {
23148
- const t = "v3.2.92", e = Et, o = S(null), n = R(() => e.getPageBuilderConfig), i = R(() => e.getComponents), a = function(l, p) {
23165
+ const t = "v3.2.93", e = Et, o = S(null), n = R(() => e.getPageBuilderConfig), i = R(() => e.getComponents), a = function(l, p) {
23149
23166
  const d = document.createElement("a");
23150
23167
  d.setAttribute(
23151
23168
  "href",