saloe 0.0.43 → 0.0.45

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/html.cjs.js CHANGED
@@ -69,7 +69,7 @@ const awaitHtml = async ({ pending, success, error }) => {
69
69
  >
70
70
  (async () => {
71
71
  const pendingEl = document?.querySelector('[data-await-pending-template="`, `"]')
72
- const response = await fetch('`, "')\n const templateString = await response.text()\n pendingEl.outerHTML = templateString\n })()\n <\/script>\n "])), await pending({ id: pendingId }), id, pendingId, pendingRoutePathname);
72
+ const response = await fetch('`, "')\n const templateString = await response.text()\n pendingEl.outerHTML = templateString\n\n if (document?.body?.saloeListen) document?.body?.saloeListen()\n })()\n <\/script>\n "])), await pending({ id: pendingId }), id, pendingId, pendingRoutePathname);
73
73
  };
74
74
  exports.awaitHtml = awaitHtml;
75
75
  exports.html = html;
package/dist/html.es.js CHANGED
@@ -67,7 +67,7 @@ const awaitHtml = async ({ pending, success, error }) => {
67
67
  >
68
68
  (async () => {
69
69
  const pendingEl = document?.querySelector('[data-await-pending-template="`, `"]')
70
- const response = await fetch('`, "')\n const templateString = await response.text()\n pendingEl.outerHTML = templateString\n })()\n <\/script>\n "])), await pending({ id: pendingId }), id, pendingId, pendingRoutePathname);
70
+ const response = await fetch('`, "')\n const templateString = await response.text()\n pendingEl.outerHTML = templateString\n\n if (document?.body?.saloeListen) document?.body?.saloeListen()\n })()\n <\/script>\n "])), await pending({ id: pendingId }), id, pendingId, pendingRoutePathname);
71
71
  };
72
72
  export {
73
73
  awaitHtml,
@@ -163,23 +163,23 @@ const listener = ({
163
163
  if (srcElement == null ? void 0 : srcElement.removeAttribute) srcElement.removeAttribute(`on-${event}`);
164
164
  };
165
165
  });
166
- const customListenEvent = new customListenEvent("customListenEvent", {
166
+ const saloeListenEvent = new CustomEvent("saloeListen", {
167
167
  detail: { message: "This is a custom event!" }
168
168
  });
169
- document.body.addEventListener("customListenEvent", async (event) => {
169
+ document.body.addEventListener("saloeListen", async (event) => {
170
170
  await addScripts();
171
171
  fireLoadListener();
172
172
  console.log("--- event =", event);
173
173
  fireObserverListeners();
174
174
  });
175
- document.body.customListenEvent = function() {
176
- document.body.dispatchEvent(customListenEvent);
175
+ document.body.saloeListen = function() {
176
+ document.body.dispatchEvent(saloeListenEvent);
177
177
  };
178
178
  };
179
179
  fireListeners();
180
180
  window.onload = () => {
181
181
  setTimeout(() => {
182
- document.body.customListenEvent();
182
+ document.body.saloeListen();
183
183
  }, 2500);
184
184
  };
185
185
  };
@@ -161,23 +161,23 @@ const listener = ({
161
161
  if (srcElement == null ? void 0 : srcElement.removeAttribute) srcElement.removeAttribute(`on-${event}`);
162
162
  };
163
163
  });
164
- const customListenEvent = new customListenEvent("customListenEvent", {
164
+ const saloeListenEvent = new CustomEvent("saloeListen", {
165
165
  detail: { message: "This is a custom event!" }
166
166
  });
167
- document.body.addEventListener("customListenEvent", async (event) => {
167
+ document.body.addEventListener("saloeListen", async (event) => {
168
168
  await addScripts();
169
169
  fireLoadListener();
170
170
  console.log("--- event =", event);
171
171
  fireObserverListeners();
172
172
  });
173
- document.body.customListenEvent = function() {
174
- document.body.dispatchEvent(customListenEvent);
173
+ document.body.saloeListen = function() {
174
+ document.body.dispatchEvent(saloeListenEvent);
175
175
  };
176
176
  };
177
177
  fireListeners();
178
178
  window.onload = () => {
179
179
  setTimeout(() => {
180
- document.body.customListenEvent();
180
+ document.body.saloeListen();
181
181
  }, 2500);
182
182
  };
183
183
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saloe",
3
- "version": "0.0.43",
3
+ "version": "0.0.45",
4
4
  "description": "Tools for making web development easy and efficient",
5
5
  "type": "module",
6
6
  "scripts": {
package/src/html.js CHANGED
@@ -85,6 +85,8 @@ const awaitHtml = async ({ pending, success, error }) => {
85
85
  const response = await fetch('${pendingRoutePathname}')
86
86
  const templateString = await response.text()
87
87
  pendingEl.outerHTML = templateString
88
+
89
+ if (document?.body?.saloeListen) document?.body?.saloeListen()
88
90
  })()
89
91
  </script>
90
92
  `
package/src/listener.js CHANGED
@@ -242,19 +242,19 @@ const listener = ({
242
242
  }
243
243
  })
244
244
 
245
- const customListenEvent = new customListenEvent('customListenEvent', {
245
+ const saloeListenEvent = new CustomEvent('saloeListen', {
246
246
  detail: { message: 'This is a custom event!' }
247
247
  })
248
248
 
249
- document.body.addEventListener('customListenEvent', async (event) => {
249
+ document.body.addEventListener('saloeListen', async (event) => {
250
250
  await addScripts()
251
251
  fireLoadListener()
252
252
  console.log('--- event =', event)
253
253
  fireObserverListeners()
254
254
  })
255
255
 
256
- document.body.customListenEvent = function () {
257
- document.body.dispatchEvent(customListenEvent)
256
+ document.body.saloeListen = function () {
257
+ document.body.dispatchEvent(saloeListenEvent)
258
258
  }
259
259
 
260
260
  }
@@ -264,7 +264,7 @@ const listener = ({
264
264
  window.onload = () => {
265
265
  setTimeout(() => {
266
266
  // document?.body?.click()
267
- document.body.customListenEvent()
267
+ document.body.saloeListen()
268
268
  }, 2_500)
269
269
  }
270
270
  }