vaderjs 1.2.5 → 1.2.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vaderjs",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "A Reactive Framework for Single-Page Applications (SPA)",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/vader.js CHANGED
@@ -181,8 +181,18 @@ export class Component {
181
181
  },
182
182
  });
183
183
  this.snapshots = [];
184
+
184
185
  }
185
186
 
187
+ /**
188
+ * @method adapter
189
+ * @description Allows you to create an adapter - this is used to create custom logic
190
+ *
191
+ *
192
+ */
193
+ adapter() {
194
+ return
195
+ }
186
196
  init() {
187
197
  this.registerComponent();
188
198
  }
@@ -860,8 +870,10 @@ export class Component {
860
870
  throw new SyntaxError(
861
871
  `Image: ${element.outerHTML} alt attribute cannot be empty`
862
872
  );
873
+
863
874
  } else if (
864
875
  element.hasAttribute("src") &&
876
+ !element.getAttribute("src")?.includes("http") || !element.getAttribute("src")?.includes("https") &&
865
877
  !document.documentElement.outerHTML
866
878
  .trim()
867
879
  .includes("<!-- #vader-disable_accessibility -->")
@@ -955,16 +967,17 @@ export class Component {
955
967
  }
956
968
 
957
969
  if (
958
- element.hasAttribute("src") &&
959
- // @ts-ignore
960
- element.getAttribute("src").startsWith("/") &&
961
- !document.documentElement.outerHTML
962
- .trim()
963
- .includes("<!-- #vader-disable_relative-paths -->")
970
+ element.hasAttribute("src") &&
971
+ // @ts-ignore
972
+ !element.getAttribute("src").includes("http") &&
973
+ // @ts-ignore
974
+ !element.getAttribute("src").includes("https") &&
975
+ !document.documentElement.outerHTML.includes(`<!-- #vader-disable_relative-paths -->`)
964
976
  ) {
965
977
  element.setAttribute(
966
978
  "src",
967
- `${window.location.origin}/public${element.getAttribute("src")}`
979
+ // @ts-ignore
980
+ `./public/${element.getAttribute("src")}`
968
981
  );
969
982
  }
970
983
  break;
@@ -1124,4 +1137,4 @@ export const include = async (path) => {
1124
1137
  });
1125
1138
  };
1126
1139
 
1127
- export default Vader
1140
+ export default Vader;
package/vaderRouter.js CHANGED
@@ -226,6 +226,4 @@ class VaderRouter{
226
226
 
227
227
  }
228
228
 
229
- export default VaderRouter;
230
-
231
-
229
+ export default VaderRouter;