@tscircuit/core 0.0.772 → 0.0.774
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 +18 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4316,6 +4316,19 @@ var Footprint = class extends PrimitiveComponent2 {
|
|
|
4316
4316
|
import { cadmodelProps, point3 } from "@tscircuit/props";
|
|
4317
4317
|
import { z as z7 } from "zod";
|
|
4318
4318
|
import { decomposeTSR as decomposeTSR4 } from "transformation-matrix";
|
|
4319
|
+
|
|
4320
|
+
// lib/components/base-components/NormalComponent/utils/getFileExtension.ts
|
|
4321
|
+
var getFileExtension = (filename) => {
|
|
4322
|
+
if (!filename) return null;
|
|
4323
|
+
const withoutQuery = filename.split("?")[0];
|
|
4324
|
+
const sanitized = withoutQuery.split("#")[0];
|
|
4325
|
+
const lastSegment = sanitized.split("/").pop() ?? sanitized;
|
|
4326
|
+
if (!lastSegment.includes(".")) return null;
|
|
4327
|
+
const extension = lastSegment.split(".").pop();
|
|
4328
|
+
return extension?.toLowerCase() ?? null;
|
|
4329
|
+
};
|
|
4330
|
+
|
|
4331
|
+
// lib/components/primitive-components/CadModel.ts
|
|
4319
4332
|
var rotation = z7.union([z7.number(), z7.string()]);
|
|
4320
4333
|
var rotation3 = z7.object({ x: rotation, y: rotation, z: rotation });
|
|
4321
4334
|
var CadModel = class extends PrimitiveComponent2 {
|
|
@@ -4354,7 +4367,7 @@ var CadModel = class extends PrimitiveComponent2 {
|
|
|
4354
4367
|
...typeof props.positionOffset === "object" ? props.positionOffset : {}
|
|
4355
4368
|
});
|
|
4356
4369
|
const layer = parent.props.layer === "bottom" ? "bottom" : "top";
|
|
4357
|
-
const ext =
|
|
4370
|
+
const ext = getFileExtension(props.modelUrl);
|
|
4358
4371
|
const urlProps = {};
|
|
4359
4372
|
if (ext === "stl")
|
|
4360
4373
|
urlProps.model_stl_url = this._addCachebustToModelUrl(props.modelUrl);
|
|
@@ -6999,13 +7012,6 @@ import {
|
|
|
6999
7012
|
external_footprint_load_error
|
|
7000
7013
|
} from "circuit-json";
|
|
7001
7014
|
|
|
7002
|
-
// lib/components/base-components/NormalComponent/utils/getFileExtension.ts
|
|
7003
|
-
var getFileExtension = (filename) => {
|
|
7004
|
-
if (!filename) return null;
|
|
7005
|
-
const cleanFilename = filename.split("?")[0];
|
|
7006
|
-
return cleanFilename.split(".").pop();
|
|
7007
|
-
};
|
|
7008
|
-
|
|
7009
7015
|
// lib/utils/constructAssetUrl.ts
|
|
7010
7016
|
var constructAssetUrl = (targetUrl, baseUrl) => {
|
|
7011
7017
|
if (!baseUrl) {
|
|
@@ -8086,7 +8092,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
8086
8092
|
for (const [pinName, target] of Object.entries(props.connections)) {
|
|
8087
8093
|
const targets = Array.isArray(target) ? target : [target];
|
|
8088
8094
|
for (const targetPath of targets) {
|
|
8089
|
-
propsWithConnections.push(targetPath);
|
|
8095
|
+
propsWithConnections.push(String(targetPath));
|
|
8090
8096
|
}
|
|
8091
8097
|
}
|
|
8092
8098
|
}
|
|
@@ -8336,8 +8342,8 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
8336
8342
|
for (const targetPath of targets) {
|
|
8337
8343
|
this.add(
|
|
8338
8344
|
new Trace3({
|
|
8339
|
-
from:
|
|
8340
|
-
to: targetPath
|
|
8345
|
+
from: `.${this.name} > .${pinName}`,
|
|
8346
|
+
to: String(targetPath)
|
|
8341
8347
|
})
|
|
8342
8348
|
);
|
|
8343
8349
|
}
|
|
@@ -16125,7 +16131,7 @@ import { identity as identity6 } from "transformation-matrix";
|
|
|
16125
16131
|
var package_default = {
|
|
16126
16132
|
name: "@tscircuit/core",
|
|
16127
16133
|
type: "module",
|
|
16128
|
-
version: "0.0.
|
|
16134
|
+
version: "0.0.773",
|
|
16129
16135
|
types: "dist/index.d.ts",
|
|
16130
16136
|
main: "dist/index.js",
|
|
16131
16137
|
module: "dist/index.js",
|