@loaders.gl/draco 4.0.4 → 4.1.0-alpha.10

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/dist.dev.js CHANGED
@@ -56,17 +56,9 @@ var __exports__ = (() => {
56
56
  });
57
57
 
58
58
  // src/lib/utils/version.ts
59
- var VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
59
+ var VERSION = true ? "4.1.0-alpha.10" : "latest";
60
60
 
61
61
  // src/draco-loader.ts
62
- var DEFAULT_DRACO_OPTIONS = {
63
- draco: {
64
- decoderType: typeof WebAssembly === "object" ? "wasm" : "js",
65
- libraryPath: "libs/",
66
- extraAttributes: {},
67
- attributeNameEntry: void 0
68
- }
69
- };
70
62
  var DracoLoader = {
71
63
  name: "Draco",
72
64
  id: "draco",
@@ -77,7 +69,14 @@ var __exports__ = (() => {
77
69
  mimeTypes: ["application/octet-stream"],
78
70
  binary: true,
79
71
  tests: ["DRACO"],
80
- options: DEFAULT_DRACO_OPTIONS
72
+ options: {
73
+ draco: {
74
+ decoderType: typeof WebAssembly === "object" ? "wasm" : "js",
75
+ libraryPath: "libs/",
76
+ extraAttributes: {},
77
+ attributeNameEntry: void 0
78
+ }
79
+ }
81
80
  };
82
81
 
83
82
  // ../schema/src/lib/table/simple-table/data-type.ts
@@ -556,15 +555,14 @@ var __exports__ = (() => {
556
555
  }
557
556
 
558
557
  // ../worker-utils/src/lib/env-utils/version.ts
559
- var NPM_TAG = "latest";
560
558
  function getVersion() {
561
559
  if (!globalThis._loadersgl_?.version) {
562
560
  globalThis._loadersgl_ = globalThis._loadersgl_ || {};
563
- if (typeof __VERSION__ === "undefined") {
561
+ if (false) {
564
562
  console.warn("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
565
563
  globalThis._loadersgl_.version = NPM_TAG;
566
564
  } else {
567
- globalThis._loadersgl_.version = __VERSION__;
565
+ globalThis._loadersgl_.version = "4.1.0-alpha.10";
568
566
  }
569
567
  }
570
568
  return globalThis._loadersgl_.version;
@@ -1 +1 @@
1
- {"version":3,"file":"draco-loader.d.ts","sourceRoot":"","sources":["../src/draco-loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAG1D,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG;IAC/C,KAAK,CAAC,EAAE,iBAAiB,GAAG;QAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,eAAe,CAAC,MAAC;QACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH,CAAC;AAWF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,kBAAkB,CAYpE,CAAC"}
1
+ {"version":3,"file":"draco-loader.d.ts","sourceRoot":"","sources":["../src/draco-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAG1D,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG;IAC/C,KAAK,CAAC,EAAE,iBAAiB,GAAG;QAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,eAAe,CAAC,MAAC;QACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,kBAAkB,CAmBpE,CAAC"}
@@ -1,12 +1,4 @@
1
1
  import { VERSION } from "./lib/utils/version.js";
2
- const DEFAULT_DRACO_OPTIONS = {
3
- draco: {
4
- decoderType: typeof WebAssembly === 'object' ? 'wasm' : 'js',
5
- libraryPath: 'libs/',
6
- extraAttributes: {},
7
- attributeNameEntry: undefined
8
- }
9
- };
10
2
  export const DracoLoader = {
11
3
  name: 'Draco',
12
4
  id: 'draco',
@@ -17,6 +9,13 @@ export const DracoLoader = {
17
9
  mimeTypes: ['application/octet-stream'],
18
10
  binary: true,
19
11
  tests: ['DRACO'],
20
- options: DEFAULT_DRACO_OPTIONS
12
+ options: {
13
+ draco: {
14
+ decoderType: typeof WebAssembly === 'object' ? 'wasm' : 'js',
15
+ libraryPath: 'libs/',
16
+ extraAttributes: {},
17
+ attributeNameEntry: undefined
18
+ }
19
+ }
21
20
  };
22
21
  //# sourceMappingURL=draco-loader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"draco-loader.js","names":["VERSION","DEFAULT_DRACO_OPTIONS","draco","decoderType","WebAssembly","libraryPath","extraAttributes","attributeNameEntry","undefined","DracoLoader","name","id","module","version","worker","extensions","mimeTypes","binary","tests","options"],"sources":["../src/draco-loader.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\nimport type {Loader, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {DracoMesh} from './lib/draco-types';\nimport type {DracoParseOptions} from './lib/draco-parser';\nimport {VERSION} from './lib/utils/version';\n\nexport type DracoLoaderOptions = LoaderOptions & {\n draco?: DracoParseOptions & {\n decoderType?: 'wasm' | 'js';\n libraryPath?: string;\n extraAttributes?;\n attributeNameEntry?: string;\n workerUrl?: string;\n };\n};\n\nconst DEFAULT_DRACO_OPTIONS: DracoLoaderOptions = {\n draco: {\n decoderType: typeof WebAssembly === 'object' ? 'wasm' : 'js', // 'js' for IE11\n libraryPath: 'libs/',\n extraAttributes: {},\n attributeNameEntry: undefined\n }\n};\n\n/**\n * Worker loader for Draco3D compressed geometries\n */\nexport const DracoLoader: Loader<DracoMesh, never, DracoLoaderOptions> = {\n name: 'Draco',\n id: 'draco',\n module: 'draco',\n // shapes: ['mesh'],\n version: VERSION,\n worker: true,\n extensions: ['drc'],\n mimeTypes: ['application/octet-stream'],\n binary: true,\n tests: ['DRACO'],\n options: DEFAULT_DRACO_OPTIONS\n};\n"],"mappings":"SAKQA,OAAO;AAYf,MAAMC,qBAAyC,GAAG;EAChDC,KAAK,EAAE;IACLC,WAAW,EAAE,OAAOC,WAAW,KAAK,QAAQ,GAAG,MAAM,GAAG,IAAI;IAC5DC,WAAW,EAAE,OAAO;IACpBC,eAAe,EAAE,CAAC,CAAC;IACnBC,kBAAkB,EAAEC;EACtB;AACF,CAAC;AAKD,OAAO,MAAMC,WAAyD,GAAG;EACvEC,IAAI,EAAE,OAAO;EACbC,EAAE,EAAE,OAAO;EACXC,MAAM,EAAE,OAAO;EAEfC,OAAO,EAAEb,OAAO;EAChBc,MAAM,EAAE,IAAI;EACZC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,SAAS,EAAE,CAAC,0BAA0B,CAAC;EACvCC,MAAM,EAAE,IAAI;EACZC,KAAK,EAAE,CAAC,OAAO,CAAC;EAChBC,OAAO,EAAElB;AACX,CAAC"}
1
+ {"version":3,"file":"draco-loader.js","names":["VERSION","DracoLoader","name","id","module","version","worker","extensions","mimeTypes","binary","tests","options","draco","decoderType","WebAssembly","libraryPath","extraAttributes","attributeNameEntry","undefined"],"sources":["../src/draco-loader.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Loader, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {DracoMesh} from './lib/draco-types';\nimport type {DracoParseOptions} from './lib/draco-parser';\nimport {VERSION} from './lib/utils/version';\n\nexport type DracoLoaderOptions = LoaderOptions & {\n draco?: DracoParseOptions & {\n decoderType?: 'wasm' | 'js';\n libraryPath?: string;\n extraAttributes?;\n attributeNameEntry?: string;\n workerUrl?: string;\n };\n};\n\n/**\n * Worker loader for Draco3D compressed geometries\n */\nexport const DracoLoader: Loader<DracoMesh, never, DracoLoaderOptions> = {\n name: 'Draco',\n id: 'draco',\n module: 'draco',\n // shapes: ['mesh'],\n version: VERSION,\n worker: true,\n extensions: ['drc'],\n mimeTypes: ['application/octet-stream'],\n binary: true,\n tests: ['DRACO'],\n options: {\n draco: {\n decoderType: typeof WebAssembly === 'object' ? 'wasm' : 'js', // 'js' for IE11\n libraryPath: 'libs/',\n extraAttributes: {},\n attributeNameEntry: undefined\n }\n }\n};\n"],"mappings":"SAOQA,OAAO;AAef,OAAO,MAAMC,WAAyD,GAAG;EACvEC,IAAI,EAAE,OAAO;EACbC,EAAE,EAAE,OAAO;EACXC,MAAM,EAAE,OAAO;EAEfC,OAAO,EAAEL,OAAO;EAChBM,MAAM,EAAE,IAAI;EACZC,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,SAAS,EAAE,CAAC,0BAA0B,CAAC;EACvCC,MAAM,EAAE,IAAI;EACZC,KAAK,EAAE,CAAC,OAAO,CAAC;EAChBC,OAAO,EAAE;IACPC,KAAK,EAAE;MACLC,WAAW,EAAE,OAAOC,WAAW,KAAK,QAAQ,GAAG,MAAM,GAAG,IAAI;MAC5DC,WAAW,EAAE,OAAO;MACpBC,eAAe,EAAE,CAAC,CAAC;MACnBC,kBAAkB,EAAEC;IACtB;EACF;AACF,CAAC"}
@@ -63711,7 +63711,7 @@ function getVersion() {
63711
63711
  );
63712
63712
  globalThis._loadersgl_.version = NPM_TAG;
63713
63713
  } else {
63714
- globalThis._loadersgl_.version = "4.0.4";
63714
+ globalThis._loadersgl_.version = "4.1.0-alpha.10";
63715
63715
  }
63716
63716
  }
63717
63717
  return globalThis._loadersgl_.version;
@@ -64093,6 +64093,9 @@ async function parseData({
64093
64093
 
64094
64094
  // ../loader-utils/src/lib/binary-utils/array-buffer-utils.ts
64095
64095
  function concatenateArrayBuffers(...sources) {
64096
+ return concatenateArrayBuffersFromArray(sources);
64097
+ }
64098
+ function concatenateArrayBuffersFromArray(sources) {
64096
64099
  const sourceArrays = sources.map(
64097
64100
  (source2) => source2 instanceof ArrayBuffer ? new Uint8Array(source2) : source2
64098
64101
  );
@@ -64147,6 +64150,32 @@ var NodeFile = class {
64147
64150
  import_fs.default.close(this.handle, (err) => err ? reject(err) : resolve());
64148
64151
  });
64149
64152
  }
64153
+ async truncate(length) {
64154
+ return new Promise((resolve, reject) => {
64155
+ import_fs.default.ftruncate(this.handle, length, (err) => {
64156
+ if (err) {
64157
+ reject(err);
64158
+ } else {
64159
+ this.bigsize = BigInt(length);
64160
+ this.size = Number(this.bigsize);
64161
+ resolve();
64162
+ }
64163
+ });
64164
+ });
64165
+ }
64166
+ async append(data) {
64167
+ return new Promise((resolve, reject) => {
64168
+ import_fs.default.appendFile(this.handle, data, (err) => {
64169
+ if (err) {
64170
+ reject(err);
64171
+ } else {
64172
+ this.bigsize = this.bigsize + BigInt(data.length);
64173
+ this.size = Number(this.bigsize);
64174
+ resolve();
64175
+ }
64176
+ });
64177
+ });
64178
+ }
64150
64179
  async stat() {
64151
64180
  return await new Promise(
64152
64181
  (resolve, reject) => import_fs.default.fstat(this.handle, { bigint: true }, (err, info) => {
@@ -65216,18 +65245,9 @@ if (nodeVersion2 < 18) {
65216
65245
  }
65217
65246
 
65218
65247
  // src/lib/utils/version.ts
65219
- var VERSION2 = true ? "4.0.4" : "latest";
65248
+ var VERSION2 = true ? "4.1.0-alpha.10" : "latest";
65220
65249
 
65221
65250
  // src/draco-loader.ts
65222
- var DEFAULT_DRACO_OPTIONS = {
65223
- draco: {
65224
- decoderType: typeof WebAssembly === "object" ? "wasm" : "js",
65225
- // 'js' for IE11
65226
- libraryPath: "libs/",
65227
- extraAttributes: {},
65228
- attributeNameEntry: void 0
65229
- }
65230
- };
65231
65251
  var DracoLoader = {
65232
65252
  name: "Draco",
65233
65253
  id: "draco",
@@ -65239,7 +65259,15 @@ var DracoLoader = {
65239
65259
  mimeTypes: ["application/octet-stream"],
65240
65260
  binary: true,
65241
65261
  tests: ["DRACO"],
65242
- options: DEFAULT_DRACO_OPTIONS
65262
+ options: {
65263
+ draco: {
65264
+ decoderType: typeof WebAssembly === "object" ? "wasm" : "js",
65265
+ // 'js' for IE11
65266
+ libraryPath: "libs/",
65267
+ extraAttributes: {},
65268
+ attributeNameEntry: void 0
65269
+ }
65270
+ }
65243
65271
  };
65244
65272
 
65245
65273
  // ../schema/src/lib/table/simple-table/data-type.ts