saloe 0.0.39 → 0.0.41
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/listener.cjs.js +3 -0
- package/dist/listener.es.js +3 -0
- package/package.json +1 -1
- package/src/listener.js +4 -0
package/dist/listener.cjs.js
CHANGED
|
@@ -122,6 +122,7 @@ const listener = ({
|
|
|
122
122
|
scriptNames == null ? void 0 : scriptNames.forEach((scriptName) => acc == null ? void 0 : acc.set(scriptName, 1));
|
|
123
123
|
return acc;
|
|
124
124
|
}, /* @__PURE__ */ new Map())) == null ? void 0 : _a.keys()];
|
|
125
|
+
console.log("--- uniqueScriptNames =", uniqueScriptNames);
|
|
125
126
|
uniqueScriptNames == null ? void 0 : uniqueScriptNames.forEach(async (scriptName) => {
|
|
126
127
|
const observedSrcElements = document.querySelectorAll(`[on-observe*="${scriptName}"]`);
|
|
127
128
|
const script = await importScriptDynamically({ path: `/${scriptName == null ? void 0 : scriptName.trim()}.js` });
|
|
@@ -129,6 +130,8 @@ const listener = ({
|
|
|
129
130
|
if (!listener2) return;
|
|
130
131
|
const observer = new IntersectionObserver((entries) => {
|
|
131
132
|
entries.forEach((entry) => listener2({ entry, observer }));
|
|
133
|
+
}, {
|
|
134
|
+
threshold: 0.5
|
|
132
135
|
});
|
|
133
136
|
observedSrcElements == null ? void 0 : observedSrcElements.forEach((observerSrcElement) => {
|
|
134
137
|
var _a2, _b;
|
package/dist/listener.es.js
CHANGED
|
@@ -120,6 +120,7 @@ const listener = ({
|
|
|
120
120
|
scriptNames == null ? void 0 : scriptNames.forEach((scriptName) => acc == null ? void 0 : acc.set(scriptName, 1));
|
|
121
121
|
return acc;
|
|
122
122
|
}, /* @__PURE__ */ new Map())) == null ? void 0 : _a.keys()];
|
|
123
|
+
console.log("--- uniqueScriptNames =", uniqueScriptNames);
|
|
123
124
|
uniqueScriptNames == null ? void 0 : uniqueScriptNames.forEach(async (scriptName) => {
|
|
124
125
|
const observedSrcElements = document.querySelectorAll(`[on-observe*="${scriptName}"]`);
|
|
125
126
|
const script = await importScriptDynamically({ path: `/${scriptName == null ? void 0 : scriptName.trim()}.js` });
|
|
@@ -127,6 +128,8 @@ const listener = ({
|
|
|
127
128
|
if (!listener2) return;
|
|
128
129
|
const observer = new IntersectionObserver((entries) => {
|
|
129
130
|
entries.forEach((entry) => listener2({ entry, observer }));
|
|
131
|
+
}, {
|
|
132
|
+
threshold: 0.5
|
|
130
133
|
});
|
|
131
134
|
observedSrcElements == null ? void 0 : observedSrcElements.forEach((observerSrcElement) => {
|
|
132
135
|
var _a2, _b;
|
package/package.json
CHANGED
package/src/listener.js
CHANGED
|
@@ -181,6 +181,8 @@ const listener = ({
|
|
|
181
181
|
return acc
|
|
182
182
|
}, new Map())?.keys()]
|
|
183
183
|
|
|
184
|
+
console.log('--- uniqueScriptNames =', uniqueScriptNames)
|
|
185
|
+
|
|
184
186
|
uniqueScriptNames?.forEach(async (scriptName) => {
|
|
185
187
|
const observedSrcElements = document.querySelectorAll(`[on-observe*="${scriptName}"]`)
|
|
186
188
|
|
|
@@ -191,6 +193,8 @@ const listener = ({
|
|
|
191
193
|
|
|
192
194
|
const observer = new IntersectionObserver((entries) => {
|
|
193
195
|
entries.forEach((entry) => listener({ entry, observer }))
|
|
196
|
+
}, {
|
|
197
|
+
threshold: .5,
|
|
194
198
|
})
|
|
195
199
|
|
|
196
200
|
observedSrcElements?.forEach((observerSrcElement) => {
|