saloe 0.0.22 → 0.0.24

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.
@@ -142,7 +142,7 @@ const listener = () => {
142
142
  const attribute = `on-${event}`;
143
143
  const hasScriptName = srcElement == null ? void 0 : srcElement.hasAttribute(attribute);
144
144
  if (hasScriptName) return srcElement;
145
- const query = SRC_ELEMEMENTS_QUERY ? `is(${SRC_ELEMEMENTS_QUERY == null ? void 0 : SRC_ELEMEMENTS_QUERY.join(",")})[${attribute}]` : `:is(a, button, li)[${attribute}]`;
145
+ const query = `:is(${["a", "button", ...SRC_ELEMEMENTS_QUERY].join(",")})[${attribute}]`;
146
146
  const closestButton = srcElement == null ? void 0 : srcElement.closest(query);
147
147
  if (closestButton) return closestButton;
148
148
  return srcElement;
@@ -171,7 +171,9 @@ const listener = () => {
171
171
  }, 2500);
172
172
  };
173
173
  };
174
- const getScriptListener = ({ SRC_ELEMEMENTS_QUERY: SRC_ELEMEMENTS_QUERY2 }) => {
174
+ const getScriptListener = ({
175
+ SRC_ELEMEMENTS_QUERY: SRC_ELEMEMENTS_QUERY2 = []
176
+ }) => {
175
177
  return `<script defer>(${listener.toString()})({ SRC_ELEMEMENTS_QUERY: ${SRC_ELEMEMENTS_QUERY2} })<\/script>`;
176
178
  };
177
179
  exports.getScriptListener = getScriptListener;
@@ -140,7 +140,7 @@ const listener = () => {
140
140
  const attribute = `on-${event}`;
141
141
  const hasScriptName = srcElement == null ? void 0 : srcElement.hasAttribute(attribute);
142
142
  if (hasScriptName) return srcElement;
143
- const query = SRC_ELEMEMENTS_QUERY ? `is(${SRC_ELEMEMENTS_QUERY == null ? void 0 : SRC_ELEMEMENTS_QUERY.join(",")})[${attribute}]` : `:is(a, button, li)[${attribute}]`;
143
+ const query = `:is(${["a", "button", ...SRC_ELEMEMENTS_QUERY].join(",")})[${attribute}]`;
144
144
  const closestButton = srcElement == null ? void 0 : srcElement.closest(query);
145
145
  if (closestButton) return closestButton;
146
146
  return srcElement;
@@ -169,7 +169,9 @@ const listener = () => {
169
169
  }, 2500);
170
170
  };
171
171
  };
172
- const getScriptListener = ({ SRC_ELEMEMENTS_QUERY: SRC_ELEMEMENTS_QUERY2 }) => {
172
+ const getScriptListener = ({
173
+ SRC_ELEMEMENTS_QUERY: SRC_ELEMEMENTS_QUERY2 = []
174
+ }) => {
173
175
  return `<script defer>(${listener.toString()})({ SRC_ELEMEMENTS_QUERY: ${SRC_ELEMEMENTS_QUERY2} })<\/script>`;
174
176
  };
175
177
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saloe",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "description": "Tools for making web development easy and efficient",
5
5
  "type": "module",
6
6
  "scripts": {
package/src/listener.js CHANGED
@@ -202,7 +202,7 @@ const listener = () => {
202
202
  const hasScriptName = srcElement?.hasAttribute(attribute)
203
203
  if (hasScriptName) return srcElement
204
204
 
205
- const query = SRC_ELEMEMENTS_QUERY ? `is(${SRC_ELEMEMENTS_QUERY?.join(',')})[${attribute}]` : `:is(a, button, li)[${attribute}]`
205
+ const query = `:is(${['a', 'button', ...SRC_ELEMEMENTS_QUERY].join(',')})[${attribute}]`
206
206
  const closestButton = srcElement?.closest(query)
207
207
  if (closestButton) return closestButton
208
208
 
@@ -238,7 +238,9 @@ const listener = () => {
238
238
  }
239
239
  }
240
240
 
241
- const getScriptListener = ({ SRC_ELEMEMENTS_QUERY }) => {
241
+ const getScriptListener = ({
242
+ SRC_ELEMEMENTS_QUERY = [],
243
+ }) => {
242
244
  return `<script defer>(${listener.toString()})({ SRC_ELEMEMENTS_QUERY: ${SRC_ELEMEMENTS_QUERY} })</script>`
243
245
  }
244
246