ngx-xtroedge-cms 1.3.8 → 1.3.9

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.mjs CHANGED
@@ -223,6 +223,8 @@ var CMS_STYLES = `
223
223
  .lcms-btn-cancel { background: transparent; color: rgba(255,255,255,0.5); border: 1px solid rgba(var(--lcms-primary-rgb, 0,200,83),0.25) !important; }
224
224
  .lcms-btn-cancel:hover { color: white; border-color: rgba(var(--lcms-primary-rgb, 0,200,83),0.5) !important; background: rgba(var(--lcms-primary-rgb, 0,200,83),0.08); }
225
225
  .lcms-btn-cancel:disabled { opacity: 0.3; cursor: not-allowed; }
226
+ .lcms-btn-logout { background: rgba(244,67,54,0.12); color: rgba(244,67,54,0.85); border: 1px solid rgba(244,67,54,0.25) !important; margin-top: 4px; }
227
+ .lcms-btn-logout:hover { background: rgba(244,67,54,0.2); color: #f44336; border-color: rgba(244,67,54,0.5) !important; }
226
228
 
227
229
  .lcms-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: lcmsSpin 0.6s linear infinite; }
228
230
 
@@ -306,7 +308,8 @@ var ICON = {
306
308
  publish: '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="17 1 21 5 17 9"/><path d="M3 11V9a4 4 0 0 1 4-4h14"/></svg>',
307
309
  image: '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>',
308
310
  check: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5"/></svg>',
309
- error: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>'
311
+ error: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>',
312
+ logout: '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/></svg>'
310
313
  };
311
314
  var DB_NAME = "xtroedge_cms_history";
312
315
  var STORE_NAME = "history";
@@ -724,9 +727,17 @@ var XtroedgeCMS = class _XtroedgeCMS {
724
727
  e.stopPropagation();
725
728
  this.cancelEditing();
726
729
  });
730
+ const logoutBtn = document.createElement("button");
731
+ logoutBtn.className = "lcms-btn-logout";
732
+ logoutBtn.innerHTML = `${ICON.logout} Logout`;
733
+ logoutBtn.addEventListener("click", (e) => {
734
+ e.stopPropagation();
735
+ this.logout();
736
+ });
727
737
  this.actionsEl.appendChild(this.saveBtn);
728
738
  this.actionsEl.appendChild(this.publishBtn);
729
739
  this.actionsEl.appendChild(this.cancelBtn);
740
+ this.actionsEl.appendChild(logoutBtn);
730
741
  this.editModeContent.appendChild(this.actionsEl);
731
742
  this.panelEl.appendChild(this.editModeContent);
732
743
  this.brandingEl = this.createElement("div", "lcms-branding");
@@ -1272,6 +1283,16 @@ var XtroedgeCMS = class _XtroedgeCMS {
1272
1283
  this.applyPageImages();
1273
1284
  this.updateUI();
1274
1285
  }
1286
+ logout() {
1287
+ localStorage.removeItem("builder_token");
1288
+ sessionStorage.removeItem("builder_edit_mode");
1289
+ this.editMode = false;
1290
+ this.isEditAllowed = false;
1291
+ this.applyEditMode(false);
1292
+ this.isOpen = false;
1293
+ this.updateUI();
1294
+ this.showToast("Logged out", "success");
1295
+ }
1275
1296
  // ===============================================
1276
1297
  // API
1277
1298
  // ===============================================