@customviews-js/customviews 1.1.1 → 1.1.2

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @customviews-js/customviews v1.1.1
2
+ * @customviews-js/customviews v1.1.2
3
3
  * (c) 2025 Chan Ger Teck
4
4
  * Released under the MIT License.
5
5
  */
@@ -2293,14 +2293,14 @@ function initializeFromScript() {
2293
2293
  // Fallback if currentScript is not available (executed after page load)
2294
2294
  if (!scriptTag) {
2295
2295
  // Try to find the script tag by looking for our script
2296
- const scripts = document.querySelectorAll('script[src*="custom-views"]');
2296
+ const scripts = document.querySelectorAll('script[src*="@customviews-js"]');
2297
2297
  if (scripts.length > 0) {
2298
2298
  // Find the most specific match (to avoid matching other custom-views scripts)
2299
2299
  for (let i = 0; i < scripts.length; i++) {
2300
2300
  const script = scripts[i];
2301
2301
  const src = script.getAttribute('src') || '';
2302
- // Look for .min.js or .js at the end
2303
- if (src.match(/custom-views(\.min)?\.js($|\?)/)) {
2302
+ // Look for .min.js or .js at the end, or the package root
2303
+ if (src.match(/@customviews-js\/customviews(\.min)?\.js($|\?)/) || src.includes('@customviews-js/customviews')) {
2304
2304
  scriptTag = script;
2305
2305
  break;
2306
2306
  }