@cocreate/elements
Advanced tools
Comparing version 1.36.1 to 1.36.2
{ | ||
"name": "@cocreate/elements", | ||
"version": "1.36.1", | ||
"version": "1.36.2", | ||
"description": "Fetch content into any html element by using html5 attributes to query data stored in CoCreate headless CMS. If data is changed it will instantly reflect in html tags as changes are broadcasted in realtime", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -22,3 +22,3 @@ import observer from '@cocreate/observer'; | ||
if (!src || /{{\s*([\w\W]+)\s*}}/g.test(src)) | ||
return; | ||
continue; | ||
@@ -25,0 +25,0 @@ let initialize = initializing.get(element) |
@@ -100,14 +100,22 @@ /******************************************************************************** | ||
if (['INPUT', 'TEXTAREA', 'SELECT'].includes(el.tagName) | ||
|| (el.hasAttribute('contenteditable') && el.getAttribute('contenteditable') !== 'false') | ||
|| el.contenteditable) { | ||
el.addEventListener('input', function (e) { | ||
const { object, key, isRealtime, isCrdt } = getAttributes(el); | ||
if (!isRealtime || isRealtime === "false" || key === "_id") return; | ||
if (isCrdt == "true" && object && object !== 'pending') return | ||
if (e.detail && e.detail.skip == true) return; | ||
if (data.type !== 'object' && data[data.type] === 'pending') return | ||
if (el.tagName === "EDITOR") | ||
console.log('editor event added') | ||
if (!el.elementsInputEvent) { | ||
el.elementsInputEvent = true; | ||
save(el); | ||
}); | ||
if (['INPUT', 'TEXTAREA', 'SELECT'].includes(el.tagName) | ||
|| (el.hasAttribute('contenteditable') && el.getAttribute('contenteditable') !== 'false') | ||
|| el.contenteditable) { | ||
el.addEventListener('input', function (e) { | ||
if (el.pendingObject) return | ||
const { object, key, isRealtime, isCrdt } = getAttributes(el); | ||
if (!isRealtime || isRealtime === "false" || key === "_id") return; | ||
if (isCrdt == "true" && object && object !== 'pending') return | ||
if (e.detail && e.detail.skip == true) return; | ||
if (data.type !== 'object' && data[data.type] === 'pending') return | ||
save(el); | ||
}); | ||
} | ||
} | ||
@@ -114,0 +122,0 @@ } |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
231443
1692