@tscircuit/core 0.0.934 → 0.0.935
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/index.js +26 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4978,6 +4978,8 @@ import { decomposeTSR as decomposeTSR4 } from "transformation-matrix";
|
|
|
4978
4978
|
// lib/components/base-components/NormalComponent/utils/getFileExtension.ts
|
|
4979
4979
|
var getFileExtension = (filename) => {
|
|
4980
4980
|
if (!filename) return null;
|
|
4981
|
+
const fragmentMatch = filename.match(/#ext=(\w+)$/);
|
|
4982
|
+
if (fragmentMatch) return fragmentMatch[1].toLowerCase();
|
|
4981
4983
|
const withoutQuery = filename.split("?")[0];
|
|
4982
4984
|
const sanitized = withoutQuery.split("#")[0];
|
|
4983
4985
|
const lastSegment = sanitized.split("/").pop() ?? sanitized;
|
|
@@ -5053,20 +5055,36 @@ var CadModel = class extends PrimitiveComponent2 {
|
|
|
5053
5055
|
const zOffsetFromSurface = props.zOffsetFromSurface !== void 0 ? distance4.parse(props.zOffsetFromSurface) : 0;
|
|
5054
5056
|
const layer = parent.props.layer === "bottom" ? "bottom" : "top";
|
|
5055
5057
|
const ext = props.modelUrl ? getFileExtension(props.modelUrl) : void 0;
|
|
5058
|
+
const modelUrlWithoutExtFragment = props.modelUrl?.replace(/#ext=\w+$/, "");
|
|
5056
5059
|
const urlProps = {};
|
|
5057
5060
|
if (ext === "stl")
|
|
5058
|
-
urlProps.model_stl_url = this._addCachebustToModelUrl(
|
|
5061
|
+
urlProps.model_stl_url = this._addCachebustToModelUrl(
|
|
5062
|
+
modelUrlWithoutExtFragment
|
|
5063
|
+
);
|
|
5059
5064
|
else if (ext === "obj")
|
|
5060
|
-
urlProps.model_obj_url = this._addCachebustToModelUrl(
|
|
5065
|
+
urlProps.model_obj_url = this._addCachebustToModelUrl(
|
|
5066
|
+
modelUrlWithoutExtFragment
|
|
5067
|
+
);
|
|
5061
5068
|
else if (ext === "gltf")
|
|
5062
|
-
urlProps.model_gltf_url = this._addCachebustToModelUrl(
|
|
5069
|
+
urlProps.model_gltf_url = this._addCachebustToModelUrl(
|
|
5070
|
+
modelUrlWithoutExtFragment
|
|
5071
|
+
);
|
|
5063
5072
|
else if (ext === "glb")
|
|
5064
|
-
urlProps.model_glb_url = this._addCachebustToModelUrl(
|
|
5073
|
+
urlProps.model_glb_url = this._addCachebustToModelUrl(
|
|
5074
|
+
modelUrlWithoutExtFragment
|
|
5075
|
+
);
|
|
5065
5076
|
else if (ext === "step" || ext === "stp")
|
|
5066
|
-
urlProps.model_step_url = this._addCachebustToModelUrl(
|
|
5077
|
+
urlProps.model_step_url = this._addCachebustToModelUrl(
|
|
5078
|
+
modelUrlWithoutExtFragment
|
|
5079
|
+
);
|
|
5067
5080
|
else if (ext === "wrl" || ext === "vrml")
|
|
5068
|
-
urlProps.model_wrl_url = this._addCachebustToModelUrl(
|
|
5069
|
-
|
|
5081
|
+
urlProps.model_wrl_url = this._addCachebustToModelUrl(
|
|
5082
|
+
modelUrlWithoutExtFragment
|
|
5083
|
+
);
|
|
5084
|
+
else
|
|
5085
|
+
urlProps.model_stl_url = this._addCachebustToModelUrl(
|
|
5086
|
+
modelUrlWithoutExtFragment
|
|
5087
|
+
);
|
|
5070
5088
|
if (props.stepUrl) {
|
|
5071
5089
|
const transformed = this._addCachebustToModelUrl(props.stepUrl);
|
|
5072
5090
|
if (transformed) urlProps.model_step_url = transformed;
|
|
@@ -19667,7 +19685,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
19667
19685
|
var package_default = {
|
|
19668
19686
|
name: "@tscircuit/core",
|
|
19669
19687
|
type: "module",
|
|
19670
|
-
version: "0.0.
|
|
19688
|
+
version: "0.0.934",
|
|
19671
19689
|
types: "dist/index.d.ts",
|
|
19672
19690
|
main: "dist/index.js",
|
|
19673
19691
|
module: "dist/index.js",
|