ngx-xtroedge-cms 1.4.3 → 1.4.4
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.d.mts +0 -5
- package/dist/index.d.ts +0 -5
- package/dist/index.global.js +1 -1
- package/dist/index.js +3 -40
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -40
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -397,12 +397,6 @@ body.lcms-editing [data-cms] {
|
|
|
397
397
|
-webkit-user-select: text !important;
|
|
398
398
|
cursor: text !important;
|
|
399
399
|
}
|
|
400
|
-
|
|
401
|
-
/* Ensure editable elements appear above other content */
|
|
402
|
-
body.lcms-editing [contenteditable="true"] {
|
|
403
|
-
position: relative !important;
|
|
404
|
-
z-index: 9999 !important;
|
|
405
|
-
}
|
|
406
400
|
`;
|
|
407
401
|
|
|
408
402
|
// src/xtroedge-cms.ts
|
|
@@ -654,26 +648,6 @@ var _XtroedgeCMS = class _XtroedgeCMS {
|
|
|
654
648
|
this.observer.observe(document.body, { childList: true, subtree: true });
|
|
655
649
|
window.addEventListener("popstate", this.boundPopState);
|
|
656
650
|
window.addEventListener("hashchange", this.boundHashChange);
|
|
657
|
-
document.addEventListener("click", (e) => {
|
|
658
|
-
if (!document.body.classList.contains("lcms-editing")) return;
|
|
659
|
-
const target = e.target;
|
|
660
|
-
const anchor = target.closest("a");
|
|
661
|
-
if (anchor) {
|
|
662
|
-
let editableEl = null;
|
|
663
|
-
if (target.getAttribute("contenteditable") === "true") {
|
|
664
|
-
editableEl = target;
|
|
665
|
-
} else {
|
|
666
|
-
editableEl = target.closest('[contenteditable="true"]') || anchor.querySelector('[contenteditable="true"]');
|
|
667
|
-
}
|
|
668
|
-
if (editableEl) {
|
|
669
|
-
e.preventDefault();
|
|
670
|
-
e.stopPropagation();
|
|
671
|
-
setTimeout(() => {
|
|
672
|
-
editableEl.focus();
|
|
673
|
-
}, 0);
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
}, true);
|
|
677
651
|
this.handleNavigation();
|
|
678
652
|
}
|
|
679
653
|
destroy() {
|
|
@@ -694,14 +668,6 @@ var _XtroedgeCMS = class _XtroedgeCMS {
|
|
|
694
668
|
if (this.toastTimer) clearTimeout(this.toastTimer);
|
|
695
669
|
this.db?.close();
|
|
696
670
|
}
|
|
697
|
-
/**
|
|
698
|
-
* Manually trigger a rescan of the DOM to detect new editable elements.
|
|
699
|
-
* Useful when elements are dynamically shown/hidden or added to the page.
|
|
700
|
-
*/
|
|
701
|
-
rescan() {
|
|
702
|
-
if (this.scanTimeout) clearTimeout(this.scanTimeout);
|
|
703
|
-
this.autoDetectAndScan();
|
|
704
|
-
}
|
|
705
671
|
// 24 hours
|
|
706
672
|
async validateLicense() {
|
|
707
673
|
const licenseKey = this.config.licenseKey || _XtroedgeCMS.secureGet("builder_token") || "";
|
|
@@ -1398,7 +1364,9 @@ var _XtroedgeCMS = class _XtroedgeCMS {
|
|
|
1398
1364
|
}
|
|
1399
1365
|
enableElementEdit(el, _key, blurH, keyH, inputH, clickH) {
|
|
1400
1366
|
const val = this.getPageText(_key);
|
|
1401
|
-
if (val
|
|
1367
|
+
if (val && document.activeElement !== el) {
|
|
1368
|
+
this.setElementContent(el, val);
|
|
1369
|
+
}
|
|
1402
1370
|
el.setAttribute("contenteditable", "true");
|
|
1403
1371
|
el.style.setProperty("outline", `2px dashed ${this.highlightColor}`, "important");
|
|
1404
1372
|
el.style.setProperty("outline-offset", "-2px", "important");
|
|
@@ -1629,11 +1597,6 @@ var _XtroedgeCMS = class _XtroedgeCMS {
|
|
|
1629
1597
|
}
|
|
1630
1598
|
}
|
|
1631
1599
|
this.observer?.observe(document.body, { childList: true, subtree: true });
|
|
1632
|
-
setTimeout(() => {
|
|
1633
|
-
if (this.editMode) {
|
|
1634
|
-
this.applyEditMode(true);
|
|
1635
|
-
}
|
|
1636
|
-
}, 200);
|
|
1637
1600
|
}
|
|
1638
1601
|
cleanupManagedElements() {
|
|
1639
1602
|
for (const [el] of this.managedElements) this.detachElement(el);
|