viral-viewer-2 4.5.7 → 4.5.9

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,4 +1,3 @@
1
- import { ViralViewerRevitProject } from "../../types";
2
1
  export declare class ViralCompressProcessor {
3
- decompressed(path: string): Promise<ViralViewerRevitProject | null>;
2
+ pakoUnzip(buffer: ArrayBuffer): string;
4
3
  }
@@ -1,28 +1,12 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.ViralCompressProcessor = void 0;
13
- const lzstring = require("lz-string");
4
+ const Pako = require("pako");
14
5
  class ViralCompressProcessor {
15
- decompressed(path) {
16
- return __awaiter(this, void 0, void 0, function* () {
17
- let result = null;
18
- let res = yield fetch(path);
19
- if (res) {
20
- let text = yield res.text();
21
- let decompress = lzstring.decompressFromEncodedURIComponent(text);
22
- result = JSON.parse(decompress);
23
- }
24
- return result;
25
- });
6
+ pakoUnzip(buffer) {
7
+ const uint8Array = new Uint8Array(buffer);
8
+ const inflatedData = Pako.inflate(uint8Array, { to: "string" });
9
+ return inflatedData;
26
10
  }
27
11
  }
28
12
  exports.ViralCompressProcessor = ViralCompressProcessor;
@@ -1 +1 @@
1
- {"version":3,"file":"viral-compress.processor.js","sourceRoot":"","sources":["../../../src/components/compress/viral-compress.processor.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,sCAAsC;AAEtC,MAAa,sBAAsB;IAClB,YAAY,CAAC,IAAY;;YAClC,IAAI,MAAM,GAAmC,IAAI,CAAC;YAClD,IAAI,GAAG,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;YAC5B,IAAI,GAAG,EAAE;gBACL,IAAI,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;gBAC5B,IAAI,UAAU,GAAG,QAAQ,CAAC,iCAAiC,CAAC,IAAI,CAAC,CAAC;gBAElE,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;aACnC;YACD,OAAO,MAAM,CAAC;QAClB,CAAC;KAAA;CACJ;AAZD,wDAYC"}
1
+ {"version":3,"file":"viral-compress.processor.js","sourceRoot":"","sources":["../../../src/components/compress/viral-compress.processor.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,MAAa,sBAAsB;IAC1B,SAAS,CAAC,MAAmB;QAClC,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;QAC1C,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QAChE,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AAND,wDAMC"}
@@ -34046,8 +34046,8 @@ which can be placed in CurveUtils.
34046
34046
  let result = [];
34047
34047
  for (let index = 0; index < json.Solids.length; index++) {
34048
34048
  const element = json.Solids[index];
34049
- // let buffer = addMesh(element.Indices, element.Vertices);
34050
- const buffer = new Float32Array(element.Buffer);
34049
+ let buffer = addMesh(element.Indices, element.Vertices);
34050
+ // const buffer = new Float32Array(element.Buffer);
34051
34051
  let dummyGeometry = new BufferGeometry();
34052
34052
  dummyGeometry.setAttribute("position", new BufferAttribute(buffer, 3));
34053
34053
  let geometry = new BufferGeometry();