Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into speckle
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhathcock committed Nov 19, 2024
2 parents 8b345d1 + d6934bb commit 05e8ea7
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 41 deletions.
2 changes: 1 addition & 1 deletion examples/viewer/web-ifc-viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as ts from "typescript";
import { exampleCode } from './example';

let ifcAPI = new IfcAPI();
ifcAPI.SetWasmPath("./",true)
ifcAPI.SetWasmPath("./")
let ifcThree = new IfcThree(ifcAPI);

let timeout = undefined;
Expand Down
36 changes: 18 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web-ifc",
"version": "0.0.64",
"version": "0.0.65",
"description": "ifc loading on the web",
"module": "./web-ifc-api.js",
"main": "./web-ifc-api-node.js",
Expand Down Expand Up @@ -62,7 +62,7 @@
],
"devDependencies": {
"@types/jest": "^27.5.2",
"@types/three": "^0.169.0",
"@types/three": "^0.170.0",
"adm-zip": "^0.5.10",
"cpy-cli": "^5.0.0",
"esbuild": "^0.24.0",
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#pragma once
#include<string_view>

const std::string_view WEB_IFC_VERSION_NUMBER = "0.0.64";
const std::string_view WEB_IFC_VERSION_NUMBER = "0.0.65";
10 changes: 7 additions & 3 deletions src/ts/web-ifc-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ declare var __WASM_PATH__:string;

let WebIFCWasm: any;


let currentScriptPath: string;
if (typeof document !== 'undefined') {
const currentScriptData = (document.currentScript as HTMLScriptElement);
currentScriptPath = currentScriptData.src.substring(0, currentScriptData.src.lastIndexOf("/") + 1) ;
}

export * from "./ifc-schema";
import { Properties } from "./helpers/properties";
Expand Down Expand Up @@ -193,10 +197,10 @@ export class IfcAPI {
return this.wasmPath + path;
}

return prefix + this.wasmPath + path;
return (currentScriptPath !== undefined ? currentScriptPath : prefix) + this.wasmPath + path;
}
// otherwise use the default path
return prefix + path;
return (currentScriptPath !== undefined ? currentScriptPath : prefix) + path;
}

//@ts-ignore
Expand Down
32 changes: 16 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -750,10 +750,10 @@
resolved "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.3.tgz"
integrity sha512-pXNfAD3KHOdif9EQXZ9deK82HVNaXP5ZIF5RP2QG6OQFNTaY2YIetfrE9t528vEreGQvEPRDDc8muaoYeK0SxQ==

"@types/three@^0.169.0":
version "0.169.0"
resolved "https://registry.npmjs.org/@types/three/-/three-0.169.0.tgz"
integrity sha512-oan7qCgJBt03wIaK+4xPWclYRPG9wzcg7Z2f5T8xYTNEF95kh0t0lklxLLYBDo7gQiGLYzE6iF4ta7nXF2bcsw==
"@types/three@^0.170.0":
version "0.170.0"
resolved "https://registry.npmjs.org/@types/three/-/three-0.170.0.tgz"
integrity sha512-CUm2uckq+zkCY7ZbFpviRttY+6f9fvwm6YqSqPfA5K22s9w7R4VnA3rzJse8kHVvuzLcTx+CjNCs2NYe0QFAyg==
dependencies:
"@tweenjs/tween.js" "~23.1.3"
"@types/stats.js" "*"
Expand Down Expand Up @@ -795,9 +795,9 @@
integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==

"@webgpu/types@*":
version "0.1.49"
resolved "https://registry.npmjs.org/@webgpu/types/-/types-0.1.49.tgz"
integrity sha512-NMmS8/DofhH/IFeW+876XrHVWel+J/vdcFCHLDqeJgkH9x0DeiwjVd8LcBdaxdG/T7Rf8VUAYsA8X1efMzLjRQ==
version "0.1.51"
resolved "https://registry.npmjs.org/@webgpu/types/-/types-0.1.51.tgz"
integrity sha512-ktR3u64NPjwIViNCck+z9QeyN0iPkQCUOQ07ZCV1RzlkfP+olLTeEZ95O1QHS+v4w9vJeY9xj/uJuSphsHy5rQ==

abab@^2.0.3, abab@^2.0.5:
version "2.0.6"
Expand Down Expand Up @@ -1147,9 +1147,9 @@ camelcase@^6.2.0:
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==

caniuse-lite@^1.0.30001669:
version "1.0.30001677"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001677.tgz"
integrity sha512-fmfjsOlJUpMWu+mAAtZZZHz7UEwsUxIIvu1TJfO1HqFQvB/B+ii0xr9B5HpbZY/mC4XZ8SvjHJqtAY6pDPQEog==
version "1.0.30001680"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001680.tgz"
integrity sha512-rPQy70G6AGUMnbwS1z6Xg+RkHYPAi18ihs47GH0jcxIG7wArmPgY3XbS2sRdBbxJljp3thdT8BIqv9ccCypiPA==

ccount@^2.0.0:
version "2.0.1"
Expand Down Expand Up @@ -3174,9 +3174,9 @@ methods@~1.1.0:
integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==

micromark-util-character@^2.0.0:
version "2.1.0"
resolved "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz"
integrity sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==
version "2.1.1"
resolved "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz"
integrity sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==
dependencies:
micromark-util-symbol "^2.0.0"
micromark-util-types "^2.0.0"
Expand All @@ -3196,9 +3196,9 @@ micromark-util-sanitize-uri@^2.0.0:
micromark-util-symbol "^2.0.0"

micromark-util-symbol@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz"
integrity sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==
version "2.0.1"
resolved "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz"
integrity sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==

micromark-util-types@^2.0.0:
version "2.0.0"
Expand Down

0 comments on commit 05e8ea7

Please sign in to comment.