@areb0s/scip.js 1.0.5 → 1.0.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/dist/scip.js +15 -10
- package/dist/scip.js.map +1 -1
- package/dist/scip.min.js +15 -10
- package/dist/scip.min.js.map +1 -1
- package/dist/types.d.ts +157 -215
- package/package.json +1 -1
package/dist/scip.js
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
|
|
2
|
-
// Polyfill for import.meta.url in IIFE context (supports Worker)
|
|
2
|
+
// Polyfill for import.meta.url in IIFE context (supports Worker & SSR)
|
|
3
3
|
var __importMetaUrl = (function() {
|
|
4
|
+
var CDN_BASE = 'https://cdn.jsdelivr.net/gh/areb0s/scip.js/dist/scip.min.js';
|
|
5
|
+
|
|
6
|
+
// Check for explicit SCIP_BASE_URL first
|
|
7
|
+
if (typeof SCIP_BASE_URL !== 'undefined' && SCIP_BASE_URL) {
|
|
8
|
+
return SCIP_BASE_URL + 'scip.min.js';
|
|
9
|
+
}
|
|
10
|
+
|
|
4
11
|
// Worker environment
|
|
5
|
-
if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
|
|
6
|
-
|
|
7
|
-
if (typeof SCIP_WASM_BASE_URL !== 'undefined') {
|
|
8
|
-
return SCIP_WASM_BASE_URL;
|
|
9
|
-
}
|
|
10
|
-
// Fallback to self.location
|
|
11
|
-
return self.location.href;
|
|
12
|
+
if (typeof WorkerGlobalScope !== 'undefined' && typeof self !== 'undefined' && self instanceof WorkerGlobalScope) {
|
|
13
|
+
return self.location.href || CDN_BASE;
|
|
12
14
|
}
|
|
15
|
+
|
|
13
16
|
// Browser main thread
|
|
14
|
-
if (typeof document !== 'undefined') {
|
|
17
|
+
if (typeof document !== 'undefined' && typeof window !== 'undefined') {
|
|
15
18
|
if (document.currentScript && document.currentScript.src) {
|
|
16
19
|
return document.currentScript.src;
|
|
17
20
|
}
|
|
@@ -24,7 +27,9 @@ var __importMetaUrl = (function() {
|
|
|
24
27
|
}
|
|
25
28
|
return window.location.href;
|
|
26
29
|
}
|
|
27
|
-
|
|
30
|
+
|
|
31
|
+
// SSR or unknown environment - use CDN
|
|
32
|
+
return CDN_BASE;
|
|
28
33
|
})();
|
|
29
34
|
|
|
30
35
|
var SCIPModule = (() => {
|