@loaders.gl/i3s 4.3.0-alpha.8 → 4.3.0-beta.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.
- package/dist/arcgis-webscene-loader.d.ts.map +1 -1
- package/dist/arcgis-webscene-loader.js +1 -1
- package/dist/dist.dev.js +1 -4
- package/dist/dist.min.js +1 -1
- package/dist/i3s-attribute-loader.d.ts.map +1 -1
- package/dist/i3s-attribute-loader.js +1 -1
- package/dist/i3s-building-scene-layer-loader.d.ts.map +1 -1
- package/dist/i3s-building-scene-layer-loader.js +1 -1
- package/dist/i3s-content-loader.d.ts.map +1 -1
- package/dist/i3s-content-loader.js +1 -1
- package/dist/i3s-content-worker-node.js +45 -45
- package/dist/i3s-content-worker-node.js.map +4 -4
- package/dist/i3s-content-worker.js +97 -243
- package/dist/i3s-loader.d.ts.map +1 -1
- package/dist/i3s-loader.js +1 -1
- package/dist/i3s-node-page-loader.d.ts.map +1 -1
- package/dist/i3s-node-page-loader.js +1 -1
- package/dist/i3s-slpk-loader.d.ts.map +1 -1
- package/dist/i3s-slpk-loader.js +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.cjs.map +2 -2
- package/dist/lib/helpers/i3s-nodepages-tiles.d.ts.map +1 -1
- package/package.json +12 -12
|
@@ -41,85 +41,37 @@
|
|
|
41
41
|
var matches = typeof process !== "undefined" && process.version && /v([0-9]*)/.exec(process.version);
|
|
42
42
|
var nodeVersion = matches && parseFloat(matches[1]) || 0;
|
|
43
43
|
|
|
44
|
-
// ../../node_modules/@
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
51
|
-
}, _typeof(obj);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
|
55
|
-
function _toPrimitive(input, hint) {
|
|
56
|
-
if (_typeof(input) !== "object" || input === null)
|
|
57
|
-
return input;
|
|
58
|
-
var prim = input[Symbol.toPrimitive];
|
|
59
|
-
if (prim !== void 0) {
|
|
60
|
-
var res = prim.call(input, hint || "default");
|
|
61
|
-
if (_typeof(res) !== "object")
|
|
62
|
-
return res;
|
|
63
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
64
|
-
}
|
|
65
|
-
return (hint === "string" ? String : Number)(input);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
|
69
|
-
function _toPropertyKey(arg) {
|
|
70
|
-
var key = _toPrimitive(arg, "string");
|
|
71
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
75
|
-
function _defineProperty(obj, key, value) {
|
|
76
|
-
key = _toPropertyKey(key);
|
|
77
|
-
if (key in obj) {
|
|
78
|
-
Object.defineProperty(obj, key, {
|
|
79
|
-
value,
|
|
80
|
-
enumerable: true,
|
|
81
|
-
configurable: true,
|
|
82
|
-
writable: true
|
|
83
|
-
});
|
|
84
|
-
} else {
|
|
85
|
-
obj[key] = value;
|
|
86
|
-
}
|
|
87
|
-
return obj;
|
|
88
|
-
}
|
|
44
|
+
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/lib/globals.js
|
|
45
|
+
var window_2 = globalThis;
|
|
46
|
+
var document_2 = globalThis.document || {};
|
|
47
|
+
var process_ = globalThis.process || {};
|
|
48
|
+
var console_ = globalThis.console;
|
|
49
|
+
var navigator_ = globalThis.navigator || {};
|
|
89
50
|
|
|
90
51
|
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/lib/is-electron.js
|
|
91
52
|
function isElectron(mockUserAgent) {
|
|
92
|
-
if (typeof window !== "undefined" &&
|
|
53
|
+
if (typeof window !== "undefined" && window.process?.type === "renderer") {
|
|
93
54
|
return true;
|
|
94
55
|
}
|
|
95
|
-
if (typeof process !== "undefined" &&
|
|
56
|
+
if (typeof process !== "undefined" && Boolean(process.versions?.["electron"])) {
|
|
96
57
|
return true;
|
|
97
58
|
}
|
|
98
|
-
const realUserAgent = typeof navigator
|
|
59
|
+
const realUserAgent = typeof navigator !== "undefined" && navigator.userAgent;
|
|
99
60
|
const userAgent = mockUserAgent || realUserAgent;
|
|
100
|
-
|
|
101
|
-
return true;
|
|
102
|
-
}
|
|
103
|
-
return false;
|
|
61
|
+
return Boolean(userAgent && userAgent.indexOf("Electron") >= 0);
|
|
104
62
|
}
|
|
105
63
|
|
|
106
64
|
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/lib/is-browser.js
|
|
107
65
|
function isBrowser2() {
|
|
108
|
-
const isNode =
|
|
66
|
+
const isNode = (
|
|
67
|
+
// @ts-expect-error
|
|
68
|
+
typeof process === "object" && String(process) === "[object process]" && !process?.browser
|
|
69
|
+
);
|
|
109
70
|
return !isNode || isElectron();
|
|
110
71
|
}
|
|
111
72
|
|
|
112
|
-
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/
|
|
113
|
-
var
|
|
114
|
-
var window_2 = globalThis.window || globalThis.self || globalThis.global;
|
|
115
|
-
var document_2 = globalThis.document || {};
|
|
116
|
-
var process_ = globalThis.process || {};
|
|
117
|
-
var console_ = globalThis.console;
|
|
118
|
-
var navigator_ = globalThis.navigator || {};
|
|
119
|
-
|
|
120
|
-
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/utils/globals.js
|
|
121
|
-
var VERSION = true ? "4.3.0-alpha.7" : "untranspiled source";
|
|
122
|
-
var isBrowser3 = isBrowser2();
|
|
73
|
+
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/index.js
|
|
74
|
+
var VERSION = true ? "4.0.7" : "untranspiled source";
|
|
123
75
|
|
|
124
76
|
// ../../node_modules/@probe.gl/log/dist/utils/local-storage.js
|
|
125
77
|
function getStorage(type) {
|
|
@@ -134,11 +86,7 @@
|
|
|
134
86
|
}
|
|
135
87
|
}
|
|
136
88
|
var LocalStorage = class {
|
|
137
|
-
constructor(id, defaultConfig) {
|
|
138
|
-
let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
|
|
139
|
-
_defineProperty(this, "storage", void 0);
|
|
140
|
-
_defineProperty(this, "id", void 0);
|
|
141
|
-
_defineProperty(this, "config", void 0);
|
|
89
|
+
constructor(id, defaultConfig, type = "sessionStorage") {
|
|
142
90
|
this.storage = getStorage(type);
|
|
143
91
|
this.id = id;
|
|
144
92
|
this.config = defaultConfig;
|
|
@@ -154,6 +102,7 @@
|
|
|
154
102
|
this.storage.setItem(this.id, serialized);
|
|
155
103
|
}
|
|
156
104
|
}
|
|
105
|
+
// Get config from persistent store, if available
|
|
157
106
|
_loadConfiguration() {
|
|
158
107
|
let configuration = {};
|
|
159
108
|
if (this.storage) {
|
|
@@ -169,31 +118,19 @@
|
|
|
169
118
|
function formatTime(ms) {
|
|
170
119
|
let formatted;
|
|
171
120
|
if (ms < 10) {
|
|
172
|
-
formatted =
|
|
121
|
+
formatted = `${ms.toFixed(2)}ms`;
|
|
173
122
|
} else if (ms < 100) {
|
|
174
|
-
formatted =
|
|
123
|
+
formatted = `${ms.toFixed(1)}ms`;
|
|
175
124
|
} else if (ms < 1e3) {
|
|
176
|
-
formatted =
|
|
125
|
+
formatted = `${ms.toFixed(0)}ms`;
|
|
177
126
|
} else {
|
|
178
|
-
formatted =
|
|
127
|
+
formatted = `${(ms / 1e3).toFixed(2)}s`;
|
|
179
128
|
}
|
|
180
129
|
return formatted;
|
|
181
130
|
}
|
|
182
|
-
function leftPad(string) {
|
|
183
|
-
let length2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
|
|
131
|
+
function leftPad(string, length2 = 8) {
|
|
184
132
|
const padLength = Math.max(length2 - string.length, 0);
|
|
185
|
-
return "
|
|
186
|
-
}
|
|
187
|
-
function formatImage(image, message, scale3) {
|
|
188
|
-
let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
|
|
189
|
-
const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
|
|
190
|
-
if (image.width > maxWidth) {
|
|
191
|
-
scale3 = Math.min(scale3, maxWidth / image.width);
|
|
192
|
-
}
|
|
193
|
-
const width = image.width * scale3;
|
|
194
|
-
const height = image.height * scale3;
|
|
195
|
-
const style = ["font-size:1px;", "padding:".concat(Math.floor(height / 2), "px ").concat(Math.floor(width / 2), "px;"), "line-height:".concat(height, "px;"), "background:url(".concat(imageUrl, ");"), "background-size:".concat(width, "px ").concat(height, "px;"), "color:transparent;"].join("");
|
|
196
|
-
return ["".concat(message, " %c+"), style];
|
|
133
|
+
return `${" ".repeat(padLength)}${string}`;
|
|
197
134
|
}
|
|
198
135
|
|
|
199
136
|
// ../../node_modules/@probe.gl/log/dist/utils/color.js
|
|
@@ -228,19 +165,18 @@
|
|
|
228
165
|
if (!isBrowser2 && typeof string === "string") {
|
|
229
166
|
if (color) {
|
|
230
167
|
const colorCode = getColor(color);
|
|
231
|
-
string =
|
|
168
|
+
string = `\x1B[${colorCode}m${string}\x1B[39m`;
|
|
232
169
|
}
|
|
233
170
|
if (background) {
|
|
234
171
|
const colorCode = getColor(background);
|
|
235
|
-
string =
|
|
172
|
+
string = `\x1B[${colorCode + BACKGROUND_INCREMENT}m${string}\x1B[49m`;
|
|
236
173
|
}
|
|
237
174
|
}
|
|
238
175
|
return string;
|
|
239
176
|
}
|
|
240
177
|
|
|
241
178
|
// ../../node_modules/@probe.gl/log/dist/utils/autobind.js
|
|
242
|
-
function autobind(obj) {
|
|
243
|
-
let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
|
|
179
|
+
function autobind(obj, predefined = ["constructor"]) {
|
|
244
180
|
const proto = Object.getPrototypeOf(obj);
|
|
245
181
|
const propNames = Object.getOwnPropertyNames(proto);
|
|
246
182
|
const object = obj;
|
|
@@ -265,11 +201,9 @@
|
|
|
265
201
|
function getHiResTimestamp() {
|
|
266
202
|
let timestamp;
|
|
267
203
|
if (isBrowser2() && window_2.performance) {
|
|
268
|
-
|
|
269
|
-
timestamp = window_2 === null || window_2 === void 0 ? void 0 : (_window$performance = window_2.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$n = _window$performance.now) === null || _window$performance$n === void 0 ? void 0 : _window$performance$n.call(_window$performance);
|
|
204
|
+
timestamp = window_2?.performance?.now?.();
|
|
270
205
|
} else if ("hrtime" in process_) {
|
|
271
|
-
|
|
272
|
-
const timeParts = process_ === null || process_ === void 0 ? void 0 : (_process$hrtime = process_.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_);
|
|
206
|
+
const timeParts = process_?.hrtime?.();
|
|
273
207
|
timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
|
|
274
208
|
} else {
|
|
275
209
|
timestamp = Date.now();
|
|
@@ -292,27 +226,18 @@
|
|
|
292
226
|
function noop() {
|
|
293
227
|
}
|
|
294
228
|
var cache = {};
|
|
295
|
-
var ONCE = {
|
|
296
|
-
once: true
|
|
297
|
-
};
|
|
229
|
+
var ONCE = { once: true };
|
|
298
230
|
var Log = class {
|
|
299
|
-
constructor() {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
_defineProperty(this, "id", void 0);
|
|
306
|
-
_defineProperty(this, "VERSION", VERSION);
|
|
307
|
-
_defineProperty(this, "_startTs", getHiResTimestamp());
|
|
308
|
-
_defineProperty(this, "_deltaTs", getHiResTimestamp());
|
|
309
|
-
_defineProperty(this, "_storage", void 0);
|
|
310
|
-
_defineProperty(this, "userData", {});
|
|
311
|
-
_defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
|
|
231
|
+
constructor({ id } = { id: "" }) {
|
|
232
|
+
this.VERSION = VERSION;
|
|
233
|
+
this._startTs = getHiResTimestamp();
|
|
234
|
+
this._deltaTs = getHiResTimestamp();
|
|
235
|
+
this.userData = {};
|
|
236
|
+
this.LOG_THROTTLE_TIMEOUT = 0;
|
|
312
237
|
this.id = id;
|
|
313
238
|
this.userData = {};
|
|
314
|
-
this._storage = new LocalStorage(
|
|
315
|
-
this.timeStamp(
|
|
239
|
+
this._storage = new LocalStorage(`__probe-${this.id}__`, DEFAULT_LOG_CONFIGURATION);
|
|
240
|
+
this.timeStamp(`${this.id} started`);
|
|
316
241
|
autobind(this);
|
|
317
242
|
Object.seal(this);
|
|
318
243
|
}
|
|
@@ -328,42 +253,44 @@
|
|
|
328
253
|
getLevel() {
|
|
329
254
|
return this._storage.config.level;
|
|
330
255
|
}
|
|
256
|
+
/** @return milliseconds, with fractions */
|
|
331
257
|
getTotal() {
|
|
332
258
|
return Number((getHiResTimestamp() - this._startTs).toPrecision(10));
|
|
333
259
|
}
|
|
260
|
+
/** @return milliseconds, with fractions */
|
|
334
261
|
getDelta() {
|
|
335
262
|
return Number((getHiResTimestamp() - this._deltaTs).toPrecision(10));
|
|
336
263
|
}
|
|
264
|
+
/** @deprecated use logLevel */
|
|
337
265
|
set priority(newPriority) {
|
|
338
266
|
this.level = newPriority;
|
|
339
267
|
}
|
|
268
|
+
/** @deprecated use logLevel */
|
|
340
269
|
get priority() {
|
|
341
270
|
return this.level;
|
|
342
271
|
}
|
|
272
|
+
/** @deprecated use logLevel */
|
|
343
273
|
getPriority() {
|
|
344
274
|
return this.level;
|
|
345
275
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
this._storage.setConfiguration({
|
|
349
|
-
enabled
|
|
350
|
-
});
|
|
276
|
+
// Configure
|
|
277
|
+
enable(enabled = true) {
|
|
278
|
+
this._storage.setConfiguration({ enabled });
|
|
351
279
|
return this;
|
|
352
280
|
}
|
|
353
281
|
setLevel(level) {
|
|
354
|
-
this._storage.setConfiguration({
|
|
355
|
-
level
|
|
356
|
-
});
|
|
282
|
+
this._storage.setConfiguration({ level });
|
|
357
283
|
return this;
|
|
358
284
|
}
|
|
285
|
+
/** return the current status of the setting */
|
|
359
286
|
get(setting) {
|
|
360
287
|
return this._storage.config[setting];
|
|
361
288
|
}
|
|
289
|
+
// update the status of the setting
|
|
362
290
|
set(setting, value) {
|
|
363
|
-
this._storage.setConfiguration({
|
|
364
|
-
[setting]: value
|
|
365
|
-
});
|
|
291
|
+
this._storage.setConfiguration({ [setting]: value });
|
|
366
292
|
}
|
|
293
|
+
/** Logs the current settings as a table */
|
|
367
294
|
settings() {
|
|
368
295
|
if (console.table) {
|
|
369
296
|
console.table(this._storage.config);
|
|
@@ -371,8 +298,11 @@
|
|
|
371
298
|
console.log(this._storage.config);
|
|
372
299
|
}
|
|
373
300
|
}
|
|
301
|
+
// Unconditional logging
|
|
374
302
|
assert(condition, message) {
|
|
375
|
-
|
|
303
|
+
if (!condition) {
|
|
304
|
+
throw new Error(message || "Assertion failed");
|
|
305
|
+
}
|
|
376
306
|
}
|
|
377
307
|
warn(message) {
|
|
378
308
|
return this._getLogFunction(0, message, originalConsole.warn, arguments, ONCE);
|
|
@@ -380,11 +310,13 @@
|
|
|
380
310
|
error(message) {
|
|
381
311
|
return this._getLogFunction(0, message, originalConsole.error, arguments);
|
|
382
312
|
}
|
|
313
|
+
/** Print a deprecation warning */
|
|
383
314
|
deprecated(oldUsage, newUsage) {
|
|
384
|
-
return this.warn(
|
|
315
|
+
return this.warn(`\`${oldUsage}\` is deprecated and will be removed in a later version. Use \`${newUsage}\` instead`);
|
|
385
316
|
}
|
|
317
|
+
/** Print a removal warning */
|
|
386
318
|
removed(oldUsage, newUsage) {
|
|
387
|
-
return this.error(
|
|
319
|
+
return this.error(`\`${oldUsage}\` has been removed. Use \`${newUsage}\` instead`);
|
|
388
320
|
}
|
|
389
321
|
probe(logLevel, message) {
|
|
390
322
|
return this._getLogFunction(logLevel, message, originalConsole.log, arguments, {
|
|
@@ -401,6 +333,7 @@
|
|
|
401
333
|
once(logLevel, message) {
|
|
402
334
|
return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE);
|
|
403
335
|
}
|
|
336
|
+
/** Logs an object as a table */
|
|
404
337
|
table(logLevel, table, columns) {
|
|
405
338
|
if (table) {
|
|
406
339
|
return this._getLogFunction(logLevel, table, console.table || noop, columns && [columns], {
|
|
@@ -409,27 +342,6 @@
|
|
|
409
342
|
}
|
|
410
343
|
return noop;
|
|
411
344
|
}
|
|
412
|
-
image(_ref) {
|
|
413
|
-
let {
|
|
414
|
-
logLevel,
|
|
415
|
-
priority,
|
|
416
|
-
image,
|
|
417
|
-
message = "",
|
|
418
|
-
scale: scale3 = 1
|
|
419
|
-
} = _ref;
|
|
420
|
-
if (!this._shouldLog(logLevel || priority)) {
|
|
421
|
-
return noop;
|
|
422
|
-
}
|
|
423
|
-
return isBrowser2() ? logImageInBrowser({
|
|
424
|
-
image,
|
|
425
|
-
message,
|
|
426
|
-
scale: scale3
|
|
427
|
-
}) : logImageInNode({
|
|
428
|
-
image,
|
|
429
|
-
message,
|
|
430
|
-
scale: scale3
|
|
431
|
-
});
|
|
432
|
-
}
|
|
433
345
|
time(logLevel, message) {
|
|
434
346
|
return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
|
|
435
347
|
}
|
|
@@ -439,30 +351,19 @@
|
|
|
439
351
|
timeStamp(logLevel, message) {
|
|
440
352
|
return this._getLogFunction(logLevel, message, console.timeStamp || noop);
|
|
441
353
|
}
|
|
442
|
-
group(logLevel, message) {
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
};
|
|
446
|
-
const options = normalizeArguments({
|
|
447
|
-
logLevel,
|
|
448
|
-
message,
|
|
449
|
-
opts
|
|
450
|
-
});
|
|
451
|
-
const {
|
|
452
|
-
collapsed
|
|
453
|
-
} = opts;
|
|
354
|
+
group(logLevel, message, opts = { collapsed: false }) {
|
|
355
|
+
const options = normalizeArguments({ logLevel, message, opts });
|
|
356
|
+
const { collapsed } = opts;
|
|
454
357
|
options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
|
|
455
358
|
return this._getLogFunction(options);
|
|
456
359
|
}
|
|
457
|
-
groupCollapsed(logLevel, message) {
|
|
458
|
-
|
|
459
|
-
return this.group(logLevel, message, Object.assign({}, opts, {
|
|
460
|
-
collapsed: true
|
|
461
|
-
}));
|
|
360
|
+
groupCollapsed(logLevel, message, opts = {}) {
|
|
361
|
+
return this.group(logLevel, message, Object.assign({}, opts, { collapsed: true }));
|
|
462
362
|
}
|
|
463
363
|
groupEnd(logLevel) {
|
|
464
364
|
return this._getLogFunction(logLevel, "", console.groupEnd || noop);
|
|
465
365
|
}
|
|
366
|
+
// EXPERIMENTAL
|
|
466
367
|
withGroup(logLevel, message, func) {
|
|
467
368
|
this.group(logLevel, message)();
|
|
468
369
|
try {
|
|
@@ -476,17 +377,14 @@
|
|
|
476
377
|
console.trace();
|
|
477
378
|
}
|
|
478
379
|
}
|
|
380
|
+
// PRIVATE METHODS
|
|
381
|
+
/** Deduces log level from a variety of arguments */
|
|
479
382
|
_shouldLog(logLevel) {
|
|
480
383
|
return this.isEnabled() && this.getLevel() >= normalizeLogLevel(logLevel);
|
|
481
384
|
}
|
|
482
385
|
_getLogFunction(logLevel, message, method, args, opts) {
|
|
483
386
|
if (this._shouldLog(logLevel)) {
|
|
484
|
-
opts = normalizeArguments({
|
|
485
|
-
logLevel,
|
|
486
|
-
message,
|
|
487
|
-
args,
|
|
488
|
-
opts
|
|
489
|
-
});
|
|
387
|
+
opts = normalizeArguments({ logLevel, message, args, opts });
|
|
490
388
|
method = method || opts.method;
|
|
491
389
|
assert2(method);
|
|
492
390
|
opts.total = this.getTotal();
|
|
@@ -506,7 +404,7 @@
|
|
|
506
404
|
return noop;
|
|
507
405
|
}
|
|
508
406
|
};
|
|
509
|
-
|
|
407
|
+
Log.VERSION = VERSION;
|
|
510
408
|
function normalizeLogLevel(logLevel) {
|
|
511
409
|
if (!logLevel) {
|
|
512
410
|
return 0;
|
|
@@ -526,10 +424,7 @@
|
|
|
526
424
|
return resolvedLevel;
|
|
527
425
|
}
|
|
528
426
|
function normalizeArguments(opts) {
|
|
529
|
-
const {
|
|
530
|
-
logLevel,
|
|
531
|
-
message
|
|
532
|
-
} = opts;
|
|
427
|
+
const { logLevel, message } = opts;
|
|
533
428
|
opts.logLevel = normalizeLogLevel(logLevel);
|
|
534
429
|
const args = opts.args ? Array.from(opts.args) : [];
|
|
535
430
|
while (args.length && args.shift() !== message) {
|
|
@@ -552,55 +447,16 @@
|
|
|
552
447
|
}
|
|
553
448
|
const messageType = typeof opts.message;
|
|
554
449
|
assert2(messageType === "string" || messageType === "object");
|
|
555
|
-
return Object.assign(opts, {
|
|
556
|
-
args
|
|
557
|
-
}, opts.opts);
|
|
450
|
+
return Object.assign(opts, { args }, opts.opts);
|
|
558
451
|
}
|
|
559
452
|
function decorateMessage(id, message, opts) {
|
|
560
453
|
if (typeof message === "string") {
|
|
561
454
|
const time = opts.time ? leftPad(formatTime(opts.total)) : "";
|
|
562
|
-
message = opts.time ?
|
|
455
|
+
message = opts.time ? `${id}: ${time} ${message}` : `${id}: ${message}`;
|
|
563
456
|
message = addColor(message, opts.color, opts.background);
|
|
564
457
|
}
|
|
565
458
|
return message;
|
|
566
459
|
}
|
|
567
|
-
function logImageInNode(_ref2) {
|
|
568
|
-
let {
|
|
569
|
-
image,
|
|
570
|
-
message = "",
|
|
571
|
-
scale: scale3 = 1
|
|
572
|
-
} = _ref2;
|
|
573
|
-
console.warn("removed");
|
|
574
|
-
return noop;
|
|
575
|
-
}
|
|
576
|
-
function logImageInBrowser(_ref3) {
|
|
577
|
-
let {
|
|
578
|
-
image,
|
|
579
|
-
message = "",
|
|
580
|
-
scale: scale3 = 1
|
|
581
|
-
} = _ref3;
|
|
582
|
-
if (typeof image === "string") {
|
|
583
|
-
const img = new Image();
|
|
584
|
-
img.onload = () => {
|
|
585
|
-
const args = formatImage(img, message, scale3);
|
|
586
|
-
console.log(...args);
|
|
587
|
-
};
|
|
588
|
-
img.src = image;
|
|
589
|
-
return noop;
|
|
590
|
-
}
|
|
591
|
-
const element = image.nodeName || "";
|
|
592
|
-
if (element.toLowerCase() === "img") {
|
|
593
|
-
console.log(...formatImage(image, message, scale3));
|
|
594
|
-
return noop;
|
|
595
|
-
}
|
|
596
|
-
if (element.toLowerCase() === "canvas") {
|
|
597
|
-
const img = new Image();
|
|
598
|
-
img.onload = () => console.log(...formatImage(img, message, scale3));
|
|
599
|
-
img.src = image.toDataURL();
|
|
600
|
-
return noop;
|
|
601
|
-
}
|
|
602
|
-
return noop;
|
|
603
|
-
}
|
|
604
460
|
function getTableHeader(table) {
|
|
605
461
|
for (const key in table) {
|
|
606
462
|
for (const title in table[key]) {
|
|
@@ -610,13 +466,14 @@
|
|
|
610
466
|
return "empty";
|
|
611
467
|
}
|
|
612
468
|
|
|
469
|
+
// ../../node_modules/@probe.gl/log/dist/init.js
|
|
470
|
+
globalThis.probe = {};
|
|
471
|
+
|
|
613
472
|
// ../../node_modules/@probe.gl/log/dist/index.js
|
|
614
|
-
var dist_default = new Log({
|
|
615
|
-
id: "@probe.gl/log"
|
|
616
|
-
});
|
|
473
|
+
var dist_default = new Log({ id: "@probe.gl/log" });
|
|
617
474
|
|
|
618
475
|
// ../loader-utils/src/lib/log-utils/log.ts
|
|
619
|
-
var VERSION2 = true ? "4.3.0-
|
|
476
|
+
var VERSION2 = true ? "4.3.0-beta.1" : "latest";
|
|
620
477
|
var version = VERSION2[0] >= "0" && VERSION2[0] <= "9" ? `v${VERSION2}` : "";
|
|
621
478
|
function createLog() {
|
|
622
479
|
const log2 = new Log({ id: "loaders.gl" });
|
|
@@ -674,7 +531,7 @@
|
|
|
674
531
|
);
|
|
675
532
|
globalThis._loadersgl_.version = NPM_TAG;
|
|
676
533
|
} else {
|
|
677
|
-
globalThis._loadersgl_.version = "4.3.0-
|
|
534
|
+
globalThis._loadersgl_.version = "4.3.0-beta.1";
|
|
678
535
|
}
|
|
679
536
|
}
|
|
680
537
|
return globalThis._loadersgl_.version;
|
|
@@ -695,11 +552,11 @@
|
|
|
695
552
|
global: typeof global !== "undefined" && global,
|
|
696
553
|
document: typeof document !== "undefined" && document
|
|
697
554
|
};
|
|
698
|
-
var
|
|
555
|
+
var self_2 = globals2.self || globals2.window || globals2.global || {};
|
|
699
556
|
var window_3 = globals2.window || globals2.self || globals2.global || {};
|
|
700
557
|
var global_3 = globals2.global || globals2.self || globals2.window || {};
|
|
701
558
|
var document_3 = globals2.document || {};
|
|
702
|
-
var
|
|
559
|
+
var isBrowser3 = (
|
|
703
560
|
// @ts-ignore process.browser
|
|
704
561
|
typeof process !== "object" || String(process) !== "[object process]" || process.browser
|
|
705
562
|
);
|
|
@@ -851,7 +708,7 @@
|
|
|
851
708
|
_loadableURL = "";
|
|
852
709
|
/** Checks if workers are supported on this platform */
|
|
853
710
|
static isSupported() {
|
|
854
|
-
return typeof Worker !== "undefined" &&
|
|
711
|
+
return typeof Worker !== "undefined" && isBrowser3 || typeof NodeWorker !== "undefined" && !isBrowser3;
|
|
855
712
|
}
|
|
856
713
|
constructor(props) {
|
|
857
714
|
const { name, source, url } = props;
|
|
@@ -861,7 +718,7 @@
|
|
|
861
718
|
this.url = url;
|
|
862
719
|
this.onMessage = NOOP;
|
|
863
720
|
this.onError = (error) => console.log(error);
|
|
864
|
-
this.worker =
|
|
721
|
+
this.worker = isBrowser3 ? this._createBrowserWorker() : this._createNodeWorker();
|
|
865
722
|
}
|
|
866
723
|
/**
|
|
867
724
|
* Terminate this worker thread
|
|
@@ -1057,7 +914,7 @@
|
|
|
1057
914
|
const shouldDestroyWorker = (
|
|
1058
915
|
// Workers on Node.js prevent the process from exiting.
|
|
1059
916
|
// Until we figure out how to close them before exit, we always destroy them
|
|
1060
|
-
!
|
|
917
|
+
!isBrowser3 || // If the pool is destroyed, there is no reason to keep the worker around
|
|
1061
918
|
this.isDestroyed || // If the app has disabled worker reuse, any completed workers should be destroyed
|
|
1062
919
|
!this.reuseWorkers || // If concurrency has been lowered, this worker might be surplus to requirements
|
|
1063
920
|
this.count > this._getMaxConcurrency()
|
|
@@ -1257,13 +1114,13 @@
|
|
|
1257
1114
|
// ../worker-utils/src/lib/worker-api/get-worker-url.ts
|
|
1258
1115
|
function getWorkerURL(worker, options = {}) {
|
|
1259
1116
|
const workerOptions = options[worker.id] || {};
|
|
1260
|
-
const workerFile =
|
|
1117
|
+
const workerFile = isBrowser3 ? `${worker.id}-worker.js` : `${worker.id}-worker-node.js`;
|
|
1261
1118
|
let url = workerOptions.workerUrl;
|
|
1262
1119
|
if (!url && worker.id === "compression") {
|
|
1263
1120
|
url = options.workerUrl;
|
|
1264
1121
|
}
|
|
1265
1122
|
if (options._workerType === "test") {
|
|
1266
|
-
if (
|
|
1123
|
+
if (isBrowser3) {
|
|
1267
1124
|
url = `modules/${worker.module}/dist/${workerFile}`;
|
|
1268
1125
|
} else {
|
|
1269
1126
|
url = `modules/${worker.module}/src/workers/${worker.id}-worker-node.ts`;
|
|
@@ -1310,7 +1167,7 @@
|
|
|
1310
1167
|
if (modules[libraryName]) {
|
|
1311
1168
|
return modules[libraryName];
|
|
1312
1169
|
}
|
|
1313
|
-
if (!
|
|
1170
|
+
if (!isBrowser3) {
|
|
1314
1171
|
return `modules/${moduleName}/dist/libs/${libraryName}`;
|
|
1315
1172
|
}
|
|
1316
1173
|
if (options.CDN) {
|
|
@@ -1326,7 +1183,7 @@
|
|
|
1326
1183
|
if (libraryUrl.endsWith("wasm")) {
|
|
1327
1184
|
return await loadAsArrayBuffer(libraryUrl);
|
|
1328
1185
|
}
|
|
1329
|
-
if (!
|
|
1186
|
+
if (!isBrowser3) {
|
|
1330
1187
|
try {
|
|
1331
1188
|
const { requireFromFile } = globalThis.loaders || {};
|
|
1332
1189
|
return await requireFromFile?.(libraryUrl);
|
|
@@ -1342,7 +1199,7 @@
|
|
|
1342
1199
|
return loadLibraryFromString(scriptSource, libraryUrl);
|
|
1343
1200
|
}
|
|
1344
1201
|
function loadLibraryFromString(scriptSource, id) {
|
|
1345
|
-
if (!
|
|
1202
|
+
if (!isBrowser3) {
|
|
1346
1203
|
const { requireFromString } = globalThis.loaders || {};
|
|
1347
1204
|
return requireFromString?.(scriptSource, id);
|
|
1348
1205
|
}
|
|
@@ -1362,7 +1219,7 @@
|
|
|
1362
1219
|
}
|
|
1363
1220
|
async function loadAsArrayBuffer(url) {
|
|
1364
1221
|
const { readFileAsArrayBuffer } = globalThis.loaders || {};
|
|
1365
|
-
if (
|
|
1222
|
+
if (isBrowser3 || !readFileAsArrayBuffer || url.startsWith("http")) {
|
|
1366
1223
|
const response = await fetch(url);
|
|
1367
1224
|
return await response.arrayBuffer();
|
|
1368
1225
|
}
|
|
@@ -1370,7 +1227,7 @@
|
|
|
1370
1227
|
}
|
|
1371
1228
|
async function loadAsText(url) {
|
|
1372
1229
|
const { readFileAsText } = globalThis.loaders || {};
|
|
1373
|
-
if (
|
|
1230
|
+
if (isBrowser3 || !readFileAsText || url.startsWith("http")) {
|
|
1374
1231
|
const response = await fetch(url);
|
|
1375
1232
|
return await response.text();
|
|
1376
1233
|
}
|
|
@@ -1463,7 +1320,7 @@
|
|
|
1463
1320
|
if (!WorkerFarm.isSupported()) {
|
|
1464
1321
|
return false;
|
|
1465
1322
|
}
|
|
1466
|
-
if (!
|
|
1323
|
+
if (!isBrowser3 && !options?._nodeWorkers) {
|
|
1467
1324
|
return false;
|
|
1468
1325
|
}
|
|
1469
1326
|
return loader.worker && options?.worker;
|
|
@@ -5489,7 +5346,7 @@
|
|
|
5489
5346
|
Ellipsoid.WGS84 = new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z);
|
|
5490
5347
|
|
|
5491
5348
|
// ../images/src/lib/utils/version.ts
|
|
5492
|
-
var VERSION4 = true ? "4.3.0-
|
|
5349
|
+
var VERSION4 = true ? "4.3.0-beta.1" : "latest";
|
|
5493
5350
|
|
|
5494
5351
|
// ../images/src/lib/category-api/image-type.ts
|
|
5495
5352
|
var parseImageNode = globalThis.loaders?.parseImageNode;
|
|
@@ -5897,7 +5754,7 @@
|
|
|
5897
5754
|
};
|
|
5898
5755
|
|
|
5899
5756
|
// ../draco/src/lib/utils/version.ts
|
|
5900
|
-
var VERSION5 = true ? "4.3.0-
|
|
5757
|
+
var VERSION5 = true ? "4.3.0-beta.1" : "latest";
|
|
5901
5758
|
|
|
5902
5759
|
// ../draco/src/draco-loader.ts
|
|
5903
5760
|
var DracoLoader = {
|
|
@@ -6513,7 +6370,7 @@
|
|
|
6513
6370
|
}
|
|
6514
6371
|
|
|
6515
6372
|
// ../textures/src/lib/utils/version.ts
|
|
6516
|
-
var VERSION6 = true ? "4.3.0-
|
|
6373
|
+
var VERSION6 = true ? "4.3.0-beta.1" : "latest";
|
|
6517
6374
|
|
|
6518
6375
|
// ../textures/src/lib/parsers/basis-module-loader.ts
|
|
6519
6376
|
var BASIS_EXTERNAL_LIBRARIES = {
|
|
@@ -6814,10 +6671,7 @@
|
|
|
6814
6671
|
10
|
|
6815
6672
|
];
|
|
6816
6673
|
function decodeText(buffer) {
|
|
6817
|
-
|
|
6818
|
-
return new TextDecoder().decode(buffer);
|
|
6819
|
-
}
|
|
6820
|
-
return Buffer.from(buffer).toString("utf8");
|
|
6674
|
+
return new TextDecoder().decode(buffer);
|
|
6821
6675
|
}
|
|
6822
6676
|
function read(data) {
|
|
6823
6677
|
const id = new Uint8Array(data.buffer, data.byteOffset, KTX2_ID.length);
|
|
@@ -8199,7 +8053,7 @@
|
|
|
8199
8053
|
}
|
|
8200
8054
|
|
|
8201
8055
|
// src/i3s-content-loader.ts
|
|
8202
|
-
var VERSION7 = true ? "4.3.0-
|
|
8056
|
+
var VERSION7 = true ? "4.3.0-beta.1" : "latest";
|
|
8203
8057
|
var I3SContentLoader = {
|
|
8204
8058
|
dataType: null,
|
|
8205
8059
|
batchType: null,
|
package/dist/i3s-loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-loader.d.ts","sourceRoot":"","sources":["../src/i3s-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAmB,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAE9E,OAAO,KAAK,EAAC,gBAAgB,EAAC,mBAAgB;AAG9C,OAAO,EAAC,iBAAiB,EAAC,mCAAgC;AAC1D,OAAO,EAAC,eAAe,EAAC,mBAAgB;AAaxC,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,GAAG,CAAC,EAAE,eAAe,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"i3s-loader.d.ts","sourceRoot":"","sources":["../src/i3s-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAmB,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAE9E,OAAO,KAAK,EAAC,gBAAgB,EAAC,mBAAgB;AAG9C,OAAO,EAAC,iBAAiB,EAAC,mCAAgC;AAC1D,OAAO,EAAC,eAAe,EAAC,mBAAgB;AAaxC,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,GAAG,CAAC,EAAE,eAAe,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS;uBACS,gBAAgB;wBAC1B,KAAK;;;;;;;;;;;;;;;;;;;;;;;CAwBmD,CAAC;AAE9E,iBAAe,QAAQ,CAAC,IAAI,KAAA,EAAE,OAAO,EAAE,gBAAgB,YAAK,EAAE,OAAO,KAAA,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAoChG"}
|