@tscircuit/core 0.0.895 → 0.0.896

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.
Files changed (2) hide show
  1. package/dist/index.js +12 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3133,6 +3133,13 @@ var Hole = class extends PrimitiveComponent2 {
3133
3133
  // lib/components/primitive-components/SilkscreenText.ts
3134
3134
  import { silkscreenTextProps } from "@tscircuit/props";
3135
3135
  import { decomposeTSR as decomposeTSR3 } from "transformation-matrix";
3136
+
3137
+ // lib/utils/normalizeTextForCircuitJson.ts
3138
+ function normalizeTextForCircuitJson(text) {
3139
+ return text.replace(/\\n/g, "\n");
3140
+ }
3141
+
3142
+ // lib/components/primitive-components/SilkscreenText.ts
3136
3143
  var SilkscreenText = class extends PrimitiveComponent2 {
3137
3144
  isPcbPrimitive = true;
3138
3145
  get config() {
@@ -3174,7 +3181,7 @@ var SilkscreenText = class extends PrimitiveComponent2 {
3174
3181
  font: props.font ?? "tscircuit2024",
3175
3182
  font_size: fontSize,
3176
3183
  layer: maybeFlipLayer(layer),
3177
- text: props.text ?? "",
3184
+ text: normalizeTextForCircuitJson(props.text ?? ""),
3178
3185
  ccw_rotation: rotation4,
3179
3186
  pcb_component_id: container.pcb_component_id,
3180
3187
  subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
@@ -16918,7 +16925,7 @@ var FabricationNoteText = class extends PrimitiveComponent2 {
16918
16925
  font_size: props.fontSize ?? 1,
16919
16926
  layer: "top",
16920
16927
  color: props.color,
16921
- text: props.text ?? "",
16928
+ text: normalizeTextForCircuitJson(props.text ?? ""),
16922
16929
  pcb_component_id: container.pcb_component_id,
16923
16930
  subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
16924
16931
  pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
@@ -17137,7 +17144,7 @@ var PcbNoteText = class extends PrimitiveComponent2 {
17137
17144
  pcb_group_id: group?.pcb_group_id ?? void 0,
17138
17145
  font: props.font ?? "tscircuit2024",
17139
17146
  font_size: props.fontSize ?? 1,
17140
- text: props.text,
17147
+ text: normalizeTextForCircuitJson(props.text),
17141
17148
  anchor_position: anchorPosition,
17142
17149
  anchor_alignment: props.anchorAlignment ?? "center",
17143
17150
  color: props.color
@@ -18538,7 +18545,7 @@ var SchematicText = class extends PrimitiveComponent2 {
18538
18545
  const globalPos = this._getGlobalSchematicPositionBeforeLayout();
18539
18546
  db.schematic_text.insert({
18540
18547
  anchor: props.anchor ?? "center",
18541
- text: props.text,
18548
+ text: normalizeTextForCircuitJson(props.text),
18542
18549
  font_size: props.fontSize,
18543
18550
  color: props.color || "#000000",
18544
18551
  position: {
@@ -19224,7 +19231,7 @@ import { identity as identity6 } from "transformation-matrix";
19224
19231
  var package_default = {
19225
19232
  name: "@tscircuit/core",
19226
19233
  type: "module",
19227
- version: "0.0.894",
19234
+ version: "0.0.895",
19228
19235
  types: "dist/index.d.ts",
19229
19236
  main: "dist/index.js",
19230
19237
  module: "dist/index.js",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.895",
4
+ "version": "0.0.896",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",