@tscircuit/schematic-viewer 0.0.2 → 0.0.3

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 (49) hide show
  1. package/dist/Schematic.js +1178 -137
  2. package/dist/Schematic.js.map +1 -1
  3. package/dist/index.js +1178 -137
  4. package/dist/index.js.map +1 -1
  5. package/dist/pages/_app.js +950 -8
  6. package/dist/pages/_app.js.map +1 -1
  7. package/dist/pages/index.js +1185 -138
  8. package/dist/pages/index.js.map +1 -1
  9. package/dist/pages/led-circuit-react.js +1251 -160
  10. package/dist/pages/led-circuit-react.js.map +1 -1
  11. package/dist/pages/led-circuit.js +1190 -138
  12. package/dist/pages/led-circuit.js.map +1 -1
  13. package/dist/schematic-components/MovableGrid/MovableGrid.stories.js +3062 -2
  14. package/dist/schematic-components/MovableGrid/MovableGrid.stories.js.map +1 -1
  15. package/dist/schematic-components/MovableGrid/index.js +3058 -1
  16. package/dist/schematic-components/MovableGrid/index.js.map +1 -1
  17. package/dist/schematic-components/ProjectComponent.js +1174 -136
  18. package/dist/schematic-components/ProjectComponent.js.map +1 -1
  19. package/dist/schematic-components/RenderError.js +3069 -11
  20. package/dist/schematic-components/RenderError.js.map +1 -1
  21. package/dist/schematic-components/SVGPathComponent.js +3067 -6
  22. package/dist/schematic-components/SVGPathComponent.js.map +1 -1
  23. package/dist/schematic-components/SchematicBug.js +3090 -26
  24. package/dist/schematic-components/SchematicBug.js.map +1 -1
  25. package/dist/schematic-components/SchematicComponent.js +1090 -77
  26. package/dist/schematic-components/SchematicComponent.js.map +1 -1
  27. package/dist/schematic-components/SchematicPort.js +997 -18
  28. package/dist/schematic-components/SchematicPort.js.map +1 -1
  29. package/dist/schematic-components/SchematicText.js +3059 -6
  30. package/dist/schematic-components/SchematicText.js.map +1 -1
  31. package/dist/schematic-components/SchematicTrace.js +3098 -25
  32. package/dist/schematic-components/SchematicTrace.js.map +1 -1
  33. package/dist/schematic-components/SimpleCapacitor.js +3079 -12
  34. package/dist/schematic-components/SimpleCapacitor.js.map +1 -1
  35. package/dist/schematic-components/SimpleDiode.js +3079 -12
  36. package/dist/schematic-components/SimpleDiode.js.map +1 -1
  37. package/dist/schematic-components/SimpleGround.js +3080 -13
  38. package/dist/schematic-components/SimpleGround.js.map +1 -1
  39. package/dist/schematic-components/SimpleInductor.js +3080 -13
  40. package/dist/schematic-components/SimpleInductor.js.map +1 -1
  41. package/dist/schematic-components/SimplePowerSource.js +3080 -13
  42. package/dist/schematic-components/SimplePowerSource.js.map +1 -1
  43. package/dist/schematic-components/SimpleResistor.js +3080 -13
  44. package/dist/schematic-components/SimpleResistor.js.map +1 -1
  45. package/dist/schematic-components/index.js +1175 -137
  46. package/dist/schematic-components/index.js.map +1 -1
  47. package/package.json +1 -1
  48. package/src/pages/led-circuit.tsx +8 -1
  49. package/tsconfig.json +2 -1
@@ -7875,6 +7875,915 @@ var require_react = __commonJS({
7875
7875
  }
7876
7876
  });
7877
7877
 
7878
+ // node_modules/react/cjs/react-jsx-runtime.production.min.js
7879
+ var require_react_jsx_runtime_production_min = __commonJS({
7880
+ "node_modules/react/cjs/react-jsx-runtime.production.min.js"(exports) {
7881
+ "use strict";
7882
+ var f = require_react();
7883
+ var k = Symbol.for("react.element");
7884
+ var l = Symbol.for("react.fragment");
7885
+ var m = Object.prototype.hasOwnProperty;
7886
+ var n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner;
7887
+ var p = { key: true, ref: true, __self: true, __source: true };
7888
+ function q(c, a, g) {
7889
+ var b, d = {}, e = null, h = null;
7890
+ void 0 !== g && (e = "" + g);
7891
+ void 0 !== a.key && (e = "" + a.key);
7892
+ void 0 !== a.ref && (h = a.ref);
7893
+ for (b in a)
7894
+ m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
7895
+ if (c && c.defaultProps)
7896
+ for (b in a = c.defaultProps, a)
7897
+ void 0 === d[b] && (d[b] = a[b]);
7898
+ return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
7899
+ }
7900
+ exports.Fragment = l;
7901
+ exports.jsx = q;
7902
+ exports.jsxs = q;
7903
+ }
7904
+ });
7905
+
7906
+ // node_modules/react/cjs/react-jsx-runtime.development.js
7907
+ var require_react_jsx_runtime_development = __commonJS({
7908
+ "node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
7909
+ "use strict";
7910
+ if (process.env.NODE_ENV !== "production") {
7911
+ (function() {
7912
+ "use strict";
7913
+ var React = require_react();
7914
+ var REACT_ELEMENT_TYPE = Symbol.for("react.element");
7915
+ var REACT_PORTAL_TYPE = Symbol.for("react.portal");
7916
+ var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
7917
+ var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
7918
+ var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
7919
+ var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
7920
+ var REACT_CONTEXT_TYPE = Symbol.for("react.context");
7921
+ var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
7922
+ var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
7923
+ var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
7924
+ var REACT_MEMO_TYPE = Symbol.for("react.memo");
7925
+ var REACT_LAZY_TYPE = Symbol.for("react.lazy");
7926
+ var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
7927
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
7928
+ var FAUX_ITERATOR_SYMBOL = "@@iterator";
7929
+ function getIteratorFn(maybeIterable) {
7930
+ if (maybeIterable === null || typeof maybeIterable !== "object") {
7931
+ return null;
7932
+ }
7933
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
7934
+ if (typeof maybeIterator === "function") {
7935
+ return maybeIterator;
7936
+ }
7937
+ return null;
7938
+ }
7939
+ var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
7940
+ function error(format) {
7941
+ {
7942
+ {
7943
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
7944
+ args[_key2 - 1] = arguments[_key2];
7945
+ }
7946
+ printWarning("error", format, args);
7947
+ }
7948
+ }
7949
+ }
7950
+ function printWarning(level, format, args) {
7951
+ {
7952
+ var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
7953
+ var stack = ReactDebugCurrentFrame2.getStackAddendum();
7954
+ if (stack !== "") {
7955
+ format += "%s";
7956
+ args = args.concat([stack]);
7957
+ }
7958
+ var argsWithFormat = args.map(function(item) {
7959
+ return String(item);
7960
+ });
7961
+ argsWithFormat.unshift("Warning: " + format);
7962
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
7963
+ }
7964
+ }
7965
+ var enableScopeAPI = false;
7966
+ var enableCacheElement = false;
7967
+ var enableTransitionTracing = false;
7968
+ var enableLegacyHidden = false;
7969
+ var enableDebugTracing = false;
7970
+ var REACT_MODULE_REFERENCE;
7971
+ {
7972
+ REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
7973
+ }
7974
+ function isValidElementType(type) {
7975
+ if (typeof type === "string" || typeof type === "function") {
7976
+ return true;
7977
+ }
7978
+ if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
7979
+ return true;
7980
+ }
7981
+ if (typeof type === "object" && type !== null) {
7982
+ if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
7983
+ return true;
7984
+ }
7985
+ }
7986
+ return false;
7987
+ }
7988
+ function getWrappedName(outerType, innerType, wrapperName) {
7989
+ var displayName = outerType.displayName;
7990
+ if (displayName) {
7991
+ return displayName;
7992
+ }
7993
+ var functionName = innerType.displayName || innerType.name || "";
7994
+ return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
7995
+ }
7996
+ function getContextName(type) {
7997
+ return type.displayName || "Context";
7998
+ }
7999
+ function getComponentNameFromType(type) {
8000
+ if (type == null) {
8001
+ return null;
8002
+ }
8003
+ {
8004
+ if (typeof type.tag === "number") {
8005
+ error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
8006
+ }
8007
+ }
8008
+ if (typeof type === "function") {
8009
+ return type.displayName || type.name || null;
8010
+ }
8011
+ if (typeof type === "string") {
8012
+ return type;
8013
+ }
8014
+ switch (type) {
8015
+ case REACT_FRAGMENT_TYPE:
8016
+ return "Fragment";
8017
+ case REACT_PORTAL_TYPE:
8018
+ return "Portal";
8019
+ case REACT_PROFILER_TYPE:
8020
+ return "Profiler";
8021
+ case REACT_STRICT_MODE_TYPE:
8022
+ return "StrictMode";
8023
+ case REACT_SUSPENSE_TYPE:
8024
+ return "Suspense";
8025
+ case REACT_SUSPENSE_LIST_TYPE:
8026
+ return "SuspenseList";
8027
+ }
8028
+ if (typeof type === "object") {
8029
+ switch (type.$$typeof) {
8030
+ case REACT_CONTEXT_TYPE:
8031
+ var context = type;
8032
+ return getContextName(context) + ".Consumer";
8033
+ case REACT_PROVIDER_TYPE:
8034
+ var provider = type;
8035
+ return getContextName(provider._context) + ".Provider";
8036
+ case REACT_FORWARD_REF_TYPE:
8037
+ return getWrappedName(type, type.render, "ForwardRef");
8038
+ case REACT_MEMO_TYPE:
8039
+ var outerName = type.displayName || null;
8040
+ if (outerName !== null) {
8041
+ return outerName;
8042
+ }
8043
+ return getComponentNameFromType(type.type) || "Memo";
8044
+ case REACT_LAZY_TYPE: {
8045
+ var lazyComponent = type;
8046
+ var payload = lazyComponent._payload;
8047
+ var init = lazyComponent._init;
8048
+ try {
8049
+ return getComponentNameFromType(init(payload));
8050
+ } catch (x) {
8051
+ return null;
8052
+ }
8053
+ }
8054
+ }
8055
+ }
8056
+ return null;
8057
+ }
8058
+ var assign = Object.assign;
8059
+ var disabledDepth = 0;
8060
+ var prevLog;
8061
+ var prevInfo;
8062
+ var prevWarn;
8063
+ var prevError;
8064
+ var prevGroup;
8065
+ var prevGroupCollapsed;
8066
+ var prevGroupEnd;
8067
+ function disabledLog() {
8068
+ }
8069
+ disabledLog.__reactDisabledLog = true;
8070
+ function disableLogs() {
8071
+ {
8072
+ if (disabledDepth === 0) {
8073
+ prevLog = console.log;
8074
+ prevInfo = console.info;
8075
+ prevWarn = console.warn;
8076
+ prevError = console.error;
8077
+ prevGroup = console.group;
8078
+ prevGroupCollapsed = console.groupCollapsed;
8079
+ prevGroupEnd = console.groupEnd;
8080
+ var props = {
8081
+ configurable: true,
8082
+ enumerable: true,
8083
+ value: disabledLog,
8084
+ writable: true
8085
+ };
8086
+ Object.defineProperties(console, {
8087
+ info: props,
8088
+ log: props,
8089
+ warn: props,
8090
+ error: props,
8091
+ group: props,
8092
+ groupCollapsed: props,
8093
+ groupEnd: props
8094
+ });
8095
+ }
8096
+ disabledDepth++;
8097
+ }
8098
+ }
8099
+ function reenableLogs() {
8100
+ {
8101
+ disabledDepth--;
8102
+ if (disabledDepth === 0) {
8103
+ var props = {
8104
+ configurable: true,
8105
+ enumerable: true,
8106
+ writable: true
8107
+ };
8108
+ Object.defineProperties(console, {
8109
+ log: assign({}, props, {
8110
+ value: prevLog
8111
+ }),
8112
+ info: assign({}, props, {
8113
+ value: prevInfo
8114
+ }),
8115
+ warn: assign({}, props, {
8116
+ value: prevWarn
8117
+ }),
8118
+ error: assign({}, props, {
8119
+ value: prevError
8120
+ }),
8121
+ group: assign({}, props, {
8122
+ value: prevGroup
8123
+ }),
8124
+ groupCollapsed: assign({}, props, {
8125
+ value: prevGroupCollapsed
8126
+ }),
8127
+ groupEnd: assign({}, props, {
8128
+ value: prevGroupEnd
8129
+ })
8130
+ });
8131
+ }
8132
+ if (disabledDepth < 0) {
8133
+ error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
8134
+ }
8135
+ }
8136
+ }
8137
+ var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
8138
+ var prefix;
8139
+ function describeBuiltInComponentFrame(name, source, ownerFn) {
8140
+ {
8141
+ if (prefix === void 0) {
8142
+ try {
8143
+ throw Error();
8144
+ } catch (x) {
8145
+ var match = x.stack.trim().match(/\n( *(at )?)/);
8146
+ prefix = match && match[1] || "";
8147
+ }
8148
+ }
8149
+ return "\n" + prefix + name;
8150
+ }
8151
+ }
8152
+ var reentry = false;
8153
+ var componentFrameCache;
8154
+ {
8155
+ var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
8156
+ componentFrameCache = new PossiblyWeakMap();
8157
+ }
8158
+ function describeNativeComponentFrame(fn, construct) {
8159
+ if (!fn || reentry) {
8160
+ return "";
8161
+ }
8162
+ {
8163
+ var frame = componentFrameCache.get(fn);
8164
+ if (frame !== void 0) {
8165
+ return frame;
8166
+ }
8167
+ }
8168
+ var control;
8169
+ reentry = true;
8170
+ var previousPrepareStackTrace = Error.prepareStackTrace;
8171
+ Error.prepareStackTrace = void 0;
8172
+ var previousDispatcher;
8173
+ {
8174
+ previousDispatcher = ReactCurrentDispatcher.current;
8175
+ ReactCurrentDispatcher.current = null;
8176
+ disableLogs();
8177
+ }
8178
+ try {
8179
+ if (construct) {
8180
+ var Fake = function() {
8181
+ throw Error();
8182
+ };
8183
+ Object.defineProperty(Fake.prototype, "props", {
8184
+ set: function() {
8185
+ throw Error();
8186
+ }
8187
+ });
8188
+ if (typeof Reflect === "object" && Reflect.construct) {
8189
+ try {
8190
+ Reflect.construct(Fake, []);
8191
+ } catch (x) {
8192
+ control = x;
8193
+ }
8194
+ Reflect.construct(fn, [], Fake);
8195
+ } else {
8196
+ try {
8197
+ Fake.call();
8198
+ } catch (x) {
8199
+ control = x;
8200
+ }
8201
+ fn.call(Fake.prototype);
8202
+ }
8203
+ } else {
8204
+ try {
8205
+ throw Error();
8206
+ } catch (x) {
8207
+ control = x;
8208
+ }
8209
+ fn();
8210
+ }
8211
+ } catch (sample) {
8212
+ if (sample && control && typeof sample.stack === "string") {
8213
+ var sampleLines = sample.stack.split("\n");
8214
+ var controlLines = control.stack.split("\n");
8215
+ var s = sampleLines.length - 1;
8216
+ var c = controlLines.length - 1;
8217
+ while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
8218
+ c--;
8219
+ }
8220
+ for (; s >= 1 && c >= 0; s--, c--) {
8221
+ if (sampleLines[s] !== controlLines[c]) {
8222
+ if (s !== 1 || c !== 1) {
8223
+ do {
8224
+ s--;
8225
+ c--;
8226
+ if (c < 0 || sampleLines[s] !== controlLines[c]) {
8227
+ var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
8228
+ if (fn.displayName && _frame.includes("<anonymous>")) {
8229
+ _frame = _frame.replace("<anonymous>", fn.displayName);
8230
+ }
8231
+ {
8232
+ if (typeof fn === "function") {
8233
+ componentFrameCache.set(fn, _frame);
8234
+ }
8235
+ }
8236
+ return _frame;
8237
+ }
8238
+ } while (s >= 1 && c >= 0);
8239
+ }
8240
+ break;
8241
+ }
8242
+ }
8243
+ }
8244
+ } finally {
8245
+ reentry = false;
8246
+ {
8247
+ ReactCurrentDispatcher.current = previousDispatcher;
8248
+ reenableLogs();
8249
+ }
8250
+ Error.prepareStackTrace = previousPrepareStackTrace;
8251
+ }
8252
+ var name = fn ? fn.displayName || fn.name : "";
8253
+ var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
8254
+ {
8255
+ if (typeof fn === "function") {
8256
+ componentFrameCache.set(fn, syntheticFrame);
8257
+ }
8258
+ }
8259
+ return syntheticFrame;
8260
+ }
8261
+ function describeFunctionComponentFrame(fn, source, ownerFn) {
8262
+ {
8263
+ return describeNativeComponentFrame(fn, false);
8264
+ }
8265
+ }
8266
+ function shouldConstruct(Component) {
8267
+ var prototype = Component.prototype;
8268
+ return !!(prototype && prototype.isReactComponent);
8269
+ }
8270
+ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
8271
+ if (type == null) {
8272
+ return "";
8273
+ }
8274
+ if (typeof type === "function") {
8275
+ {
8276
+ return describeNativeComponentFrame(type, shouldConstruct(type));
8277
+ }
8278
+ }
8279
+ if (typeof type === "string") {
8280
+ return describeBuiltInComponentFrame(type);
8281
+ }
8282
+ switch (type) {
8283
+ case REACT_SUSPENSE_TYPE:
8284
+ return describeBuiltInComponentFrame("Suspense");
8285
+ case REACT_SUSPENSE_LIST_TYPE:
8286
+ return describeBuiltInComponentFrame("SuspenseList");
8287
+ }
8288
+ if (typeof type === "object") {
8289
+ switch (type.$$typeof) {
8290
+ case REACT_FORWARD_REF_TYPE:
8291
+ return describeFunctionComponentFrame(type.render);
8292
+ case REACT_MEMO_TYPE:
8293
+ return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
8294
+ case REACT_LAZY_TYPE: {
8295
+ var lazyComponent = type;
8296
+ var payload = lazyComponent._payload;
8297
+ var init = lazyComponent._init;
8298
+ try {
8299
+ return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
8300
+ } catch (x) {
8301
+ }
8302
+ }
8303
+ }
8304
+ }
8305
+ return "";
8306
+ }
8307
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
8308
+ var loggedTypeFailures = {};
8309
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
8310
+ function setCurrentlyValidatingElement(element) {
8311
+ {
8312
+ if (element) {
8313
+ var owner = element._owner;
8314
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
8315
+ ReactDebugCurrentFrame.setExtraStackFrame(stack);
8316
+ } else {
8317
+ ReactDebugCurrentFrame.setExtraStackFrame(null);
8318
+ }
8319
+ }
8320
+ }
8321
+ function checkPropTypes(typeSpecs, values, location, componentName, element) {
8322
+ {
8323
+ var has = Function.call.bind(hasOwnProperty);
8324
+ for (var typeSpecName in typeSpecs) {
8325
+ if (has(typeSpecs, typeSpecName)) {
8326
+ var error$1 = void 0;
8327
+ try {
8328
+ if (typeof typeSpecs[typeSpecName] !== "function") {
8329
+ var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
8330
+ err.name = "Invariant Violation";
8331
+ throw err;
8332
+ }
8333
+ error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
8334
+ } catch (ex) {
8335
+ error$1 = ex;
8336
+ }
8337
+ if (error$1 && !(error$1 instanceof Error)) {
8338
+ setCurrentlyValidatingElement(element);
8339
+ error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
8340
+ setCurrentlyValidatingElement(null);
8341
+ }
8342
+ if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
8343
+ loggedTypeFailures[error$1.message] = true;
8344
+ setCurrentlyValidatingElement(element);
8345
+ error("Failed %s type: %s", location, error$1.message);
8346
+ setCurrentlyValidatingElement(null);
8347
+ }
8348
+ }
8349
+ }
8350
+ }
8351
+ }
8352
+ var isArrayImpl = Array.isArray;
8353
+ function isArray(a) {
8354
+ return isArrayImpl(a);
8355
+ }
8356
+ function typeName(value) {
8357
+ {
8358
+ var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
8359
+ var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
8360
+ return type;
8361
+ }
8362
+ }
8363
+ function willCoercionThrow(value) {
8364
+ {
8365
+ try {
8366
+ testStringCoercion(value);
8367
+ return false;
8368
+ } catch (e) {
8369
+ return true;
8370
+ }
8371
+ }
8372
+ }
8373
+ function testStringCoercion(value) {
8374
+ return "" + value;
8375
+ }
8376
+ function checkKeyStringCoercion(value) {
8377
+ {
8378
+ if (willCoercionThrow(value)) {
8379
+ error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
8380
+ return testStringCoercion(value);
8381
+ }
8382
+ }
8383
+ }
8384
+ var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
8385
+ var RESERVED_PROPS = {
8386
+ key: true,
8387
+ ref: true,
8388
+ __self: true,
8389
+ __source: true
8390
+ };
8391
+ var specialPropKeyWarningShown;
8392
+ var specialPropRefWarningShown;
8393
+ var didWarnAboutStringRefs;
8394
+ {
8395
+ didWarnAboutStringRefs = {};
8396
+ }
8397
+ function hasValidRef(config) {
8398
+ {
8399
+ if (hasOwnProperty.call(config, "ref")) {
8400
+ var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
8401
+ if (getter && getter.isReactWarning) {
8402
+ return false;
8403
+ }
8404
+ }
8405
+ }
8406
+ return config.ref !== void 0;
8407
+ }
8408
+ function hasValidKey(config) {
8409
+ {
8410
+ if (hasOwnProperty.call(config, "key")) {
8411
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
8412
+ if (getter && getter.isReactWarning) {
8413
+ return false;
8414
+ }
8415
+ }
8416
+ }
8417
+ return config.key !== void 0;
8418
+ }
8419
+ function warnIfStringRefCannotBeAutoConverted(config, self2) {
8420
+ {
8421
+ if (typeof config.ref === "string" && ReactCurrentOwner.current && self2 && ReactCurrentOwner.current.stateNode !== self2) {
8422
+ var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
8423
+ if (!didWarnAboutStringRefs[componentName]) {
8424
+ error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
8425
+ didWarnAboutStringRefs[componentName] = true;
8426
+ }
8427
+ }
8428
+ }
8429
+ }
8430
+ function defineKeyPropWarningGetter(props, displayName) {
8431
+ {
8432
+ var warnAboutAccessingKey = function() {
8433
+ if (!specialPropKeyWarningShown) {
8434
+ specialPropKeyWarningShown = true;
8435
+ error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
8436
+ }
8437
+ };
8438
+ warnAboutAccessingKey.isReactWarning = true;
8439
+ Object.defineProperty(props, "key", {
8440
+ get: warnAboutAccessingKey,
8441
+ configurable: true
8442
+ });
8443
+ }
8444
+ }
8445
+ function defineRefPropWarningGetter(props, displayName) {
8446
+ {
8447
+ var warnAboutAccessingRef = function() {
8448
+ if (!specialPropRefWarningShown) {
8449
+ specialPropRefWarningShown = true;
8450
+ error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
8451
+ }
8452
+ };
8453
+ warnAboutAccessingRef.isReactWarning = true;
8454
+ Object.defineProperty(props, "ref", {
8455
+ get: warnAboutAccessingRef,
8456
+ configurable: true
8457
+ });
8458
+ }
8459
+ }
8460
+ var ReactElement = function(type, key, ref, self2, source, owner, props) {
8461
+ var element = {
8462
+ $$typeof: REACT_ELEMENT_TYPE,
8463
+ type,
8464
+ key,
8465
+ ref,
8466
+ props,
8467
+ _owner: owner
8468
+ };
8469
+ {
8470
+ element._store = {};
8471
+ Object.defineProperty(element._store, "validated", {
8472
+ configurable: false,
8473
+ enumerable: false,
8474
+ writable: true,
8475
+ value: false
8476
+ });
8477
+ Object.defineProperty(element, "_self", {
8478
+ configurable: false,
8479
+ enumerable: false,
8480
+ writable: false,
8481
+ value: self2
8482
+ });
8483
+ Object.defineProperty(element, "_source", {
8484
+ configurable: false,
8485
+ enumerable: false,
8486
+ writable: false,
8487
+ value: source
8488
+ });
8489
+ if (Object.freeze) {
8490
+ Object.freeze(element.props);
8491
+ Object.freeze(element);
8492
+ }
8493
+ }
8494
+ return element;
8495
+ };
8496
+ function jsxDEV(type, config, maybeKey, source, self2) {
8497
+ {
8498
+ var propName;
8499
+ var props = {};
8500
+ var key = null;
8501
+ var ref = null;
8502
+ if (maybeKey !== void 0) {
8503
+ {
8504
+ checkKeyStringCoercion(maybeKey);
8505
+ }
8506
+ key = "" + maybeKey;
8507
+ }
8508
+ if (hasValidKey(config)) {
8509
+ {
8510
+ checkKeyStringCoercion(config.key);
8511
+ }
8512
+ key = "" + config.key;
8513
+ }
8514
+ if (hasValidRef(config)) {
8515
+ ref = config.ref;
8516
+ warnIfStringRefCannotBeAutoConverted(config, self2);
8517
+ }
8518
+ for (propName in config) {
8519
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
8520
+ props[propName] = config[propName];
8521
+ }
8522
+ }
8523
+ if (type && type.defaultProps) {
8524
+ var defaultProps = type.defaultProps;
8525
+ for (propName in defaultProps) {
8526
+ if (props[propName] === void 0) {
8527
+ props[propName] = defaultProps[propName];
8528
+ }
8529
+ }
8530
+ }
8531
+ if (key || ref) {
8532
+ var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
8533
+ if (key) {
8534
+ defineKeyPropWarningGetter(props, displayName);
8535
+ }
8536
+ if (ref) {
8537
+ defineRefPropWarningGetter(props, displayName);
8538
+ }
8539
+ }
8540
+ return ReactElement(type, key, ref, self2, source, ReactCurrentOwner.current, props);
8541
+ }
8542
+ }
8543
+ var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
8544
+ var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
8545
+ function setCurrentlyValidatingElement$1(element) {
8546
+ {
8547
+ if (element) {
8548
+ var owner = element._owner;
8549
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
8550
+ ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
8551
+ } else {
8552
+ ReactDebugCurrentFrame$1.setExtraStackFrame(null);
8553
+ }
8554
+ }
8555
+ }
8556
+ var propTypesMisspellWarningShown;
8557
+ {
8558
+ propTypesMisspellWarningShown = false;
8559
+ }
8560
+ function isValidElement(object) {
8561
+ {
8562
+ return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
8563
+ }
8564
+ }
8565
+ function getDeclarationErrorAddendum() {
8566
+ {
8567
+ if (ReactCurrentOwner$1.current) {
8568
+ var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
8569
+ if (name) {
8570
+ return "\n\nCheck the render method of `" + name + "`.";
8571
+ }
8572
+ }
8573
+ return "";
8574
+ }
8575
+ }
8576
+ function getSourceInfoErrorAddendum(source) {
8577
+ {
8578
+ if (source !== void 0) {
8579
+ var fileName = source.fileName.replace(/^.*[\\\/]/, "");
8580
+ var lineNumber = source.lineNumber;
8581
+ return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
8582
+ }
8583
+ return "";
8584
+ }
8585
+ }
8586
+ var ownerHasKeyUseWarning = {};
8587
+ function getCurrentComponentErrorInfo(parentType) {
8588
+ {
8589
+ var info = getDeclarationErrorAddendum();
8590
+ if (!info) {
8591
+ var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
8592
+ if (parentName) {
8593
+ info = "\n\nCheck the top-level render call using <" + parentName + ">.";
8594
+ }
8595
+ }
8596
+ return info;
8597
+ }
8598
+ }
8599
+ function validateExplicitKey(element, parentType) {
8600
+ {
8601
+ if (!element._store || element._store.validated || element.key != null) {
8602
+ return;
8603
+ }
8604
+ element._store.validated = true;
8605
+ var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
8606
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
8607
+ return;
8608
+ }
8609
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
8610
+ var childOwner = "";
8611
+ if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
8612
+ childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
8613
+ }
8614
+ setCurrentlyValidatingElement$1(element);
8615
+ error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
8616
+ setCurrentlyValidatingElement$1(null);
8617
+ }
8618
+ }
8619
+ function validateChildKeys(node, parentType) {
8620
+ {
8621
+ if (typeof node !== "object") {
8622
+ return;
8623
+ }
8624
+ if (isArray(node)) {
8625
+ for (var i = 0; i < node.length; i++) {
8626
+ var child = node[i];
8627
+ if (isValidElement(child)) {
8628
+ validateExplicitKey(child, parentType);
8629
+ }
8630
+ }
8631
+ } else if (isValidElement(node)) {
8632
+ if (node._store) {
8633
+ node._store.validated = true;
8634
+ }
8635
+ } else if (node) {
8636
+ var iteratorFn = getIteratorFn(node);
8637
+ if (typeof iteratorFn === "function") {
8638
+ if (iteratorFn !== node.entries) {
8639
+ var iterator = iteratorFn.call(node);
8640
+ var step;
8641
+ while (!(step = iterator.next()).done) {
8642
+ if (isValidElement(step.value)) {
8643
+ validateExplicitKey(step.value, parentType);
8644
+ }
8645
+ }
8646
+ }
8647
+ }
8648
+ }
8649
+ }
8650
+ }
8651
+ function validatePropTypes(element) {
8652
+ {
8653
+ var type = element.type;
8654
+ if (type === null || type === void 0 || typeof type === "string") {
8655
+ return;
8656
+ }
8657
+ var propTypes;
8658
+ if (typeof type === "function") {
8659
+ propTypes = type.propTypes;
8660
+ } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MEMO_TYPE)) {
8661
+ propTypes = type.propTypes;
8662
+ } else {
8663
+ return;
8664
+ }
8665
+ if (propTypes) {
8666
+ var name = getComponentNameFromType(type);
8667
+ checkPropTypes(propTypes, element.props, "prop", name, element);
8668
+ } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
8669
+ propTypesMisspellWarningShown = true;
8670
+ var _name = getComponentNameFromType(type);
8671
+ error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
8672
+ }
8673
+ if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
8674
+ error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
8675
+ }
8676
+ }
8677
+ }
8678
+ function validateFragmentProps(fragment) {
8679
+ {
8680
+ var keys = Object.keys(fragment.props);
8681
+ for (var i = 0; i < keys.length; i++) {
8682
+ var key = keys[i];
8683
+ if (key !== "children" && key !== "key") {
8684
+ setCurrentlyValidatingElement$1(fragment);
8685
+ error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
8686
+ setCurrentlyValidatingElement$1(null);
8687
+ break;
8688
+ }
8689
+ }
8690
+ if (fragment.ref !== null) {
8691
+ setCurrentlyValidatingElement$1(fragment);
8692
+ error("Invalid attribute `ref` supplied to `React.Fragment`.");
8693
+ setCurrentlyValidatingElement$1(null);
8694
+ }
8695
+ }
8696
+ }
8697
+ function jsxWithValidation(type, props, key, isStaticChildren, source, self2) {
8698
+ {
8699
+ var validType = isValidElementType(type);
8700
+ if (!validType) {
8701
+ var info = "";
8702
+ if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
8703
+ info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
8704
+ }
8705
+ var sourceInfo = getSourceInfoErrorAddendum(source);
8706
+ if (sourceInfo) {
8707
+ info += sourceInfo;
8708
+ } else {
8709
+ info += getDeclarationErrorAddendum();
8710
+ }
8711
+ var typeString;
8712
+ if (type === null) {
8713
+ typeString = "null";
8714
+ } else if (isArray(type)) {
8715
+ typeString = "array";
8716
+ } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
8717
+ typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
8718
+ info = " Did you accidentally export a JSX literal instead of a component?";
8719
+ } else {
8720
+ typeString = typeof type;
8721
+ }
8722
+ error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
8723
+ }
8724
+ var element = jsxDEV(type, props, key, source, self2);
8725
+ if (element == null) {
8726
+ return element;
8727
+ }
8728
+ if (validType) {
8729
+ var children = props.children;
8730
+ if (children !== void 0) {
8731
+ if (isStaticChildren) {
8732
+ if (isArray(children)) {
8733
+ for (var i = 0; i < children.length; i++) {
8734
+ validateChildKeys(children[i], type);
8735
+ }
8736
+ if (Object.freeze) {
8737
+ Object.freeze(children);
8738
+ }
8739
+ } else {
8740
+ error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
8741
+ }
8742
+ } else {
8743
+ validateChildKeys(children, type);
8744
+ }
8745
+ }
8746
+ }
8747
+ if (type === REACT_FRAGMENT_TYPE) {
8748
+ validateFragmentProps(element);
8749
+ } else {
8750
+ validatePropTypes(element);
8751
+ }
8752
+ return element;
8753
+ }
8754
+ }
8755
+ function jsxWithValidationStatic(type, props, key) {
8756
+ {
8757
+ return jsxWithValidation(type, props, key, true);
8758
+ }
8759
+ }
8760
+ function jsxWithValidationDynamic(type, props, key) {
8761
+ {
8762
+ return jsxWithValidation(type, props, key, false);
8763
+ }
8764
+ }
8765
+ var jsx18 = jsxWithValidationDynamic;
8766
+ var jsxs4 = jsxWithValidationStatic;
8767
+ exports.Fragment = REACT_FRAGMENT_TYPE;
8768
+ exports.jsx = jsx18;
8769
+ exports.jsxs = jsxs4;
8770
+ })();
8771
+ }
8772
+ }
8773
+ });
8774
+
8775
+ // node_modules/react/jsx-runtime.js
8776
+ var require_jsx_runtime = __commonJS({
8777
+ "node_modules/react/jsx-runtime.js"(exports, module2) {
8778
+ "use strict";
8779
+ if (process.env.NODE_ENV === "production") {
8780
+ module2.exports = require_react_jsx_runtime_production_min();
8781
+ } else {
8782
+ module2.exports = require_react_jsx_runtime_development();
8783
+ }
8784
+ }
8785
+ });
8786
+
7878
8787
  // node_modules/lodash/_baseRange.js
7879
8788
  var require_baseRange = __commonJS({
7880
8789
  "node_modules/lodash/_baseRange.js"(exports, module2) {
@@ -8241,6 +9150,9 @@ var useMaybePromise = (promise) => {
8241
9150
  // src/Schematic.tsx
8242
9151
  var import_react2 = __toESM(require_react());
8243
9152
 
9153
+ // src/schematic-components/MovableGrid/index.tsx
9154
+ var import_jsx_runtime = __toESM(require_jsx_runtime());
9155
+
8244
9156
  // src/lib/render-context/index.ts
8245
9157
  var import_zustand = __toESM(require("zustand"));
8246
9158
  var import_transformation_matrix = require("transformation-matrix");
@@ -8270,6 +9182,7 @@ var get_svg_path_bounds_default = getSVGPathBounds;
8270
9182
 
8271
9183
  // src/schematic-components/SVGPathComponent.tsx
8272
9184
  var import_transformation_matrix2 = require("transformation-matrix");
9185
+ var import_jsx_runtime2 = __toESM(require_jsx_runtime());
8273
9186
  var SVGPathComponent = ({ size, center, rotation, paths }) => {
8274
9187
  const ct = useCameraTransform();
8275
9188
  const pathBounds = get_svg_path_bounds_default(paths.map((p) => p.d));
@@ -8286,98 +9199,152 @@ var SVGPathComponent = ({ size, center, rotation, paths }) => {
8286
9199
  width: Math.max(1, size.width * ct.a),
8287
9200
  height: Math.max(1, size.height * ct.d)
8288
9201
  };
8289
- return <svg style={{
8290
- position: "absolute",
8291
- transform: rotation === 0 ? "" : `rotate(${rotation}rad)`,
8292
- left: absoluteCenter.x - absoluteSize.width / 2,
8293
- top: absoluteCenter.y - absoluteSize.height / 2
8294
- }} overflow="visible" width={absoluteSize.width} height={absoluteSize.height} viewBox={`${pathBounds.minX} ${pathBounds.minY} ${pathBounds.width} ${pathBounds.height}`}>{paths.map((p, i) => <path key={i} fill="none" strokeWidth={2 * (p.strokeWidth || 1)} stroke={p.stroke || "red"} d={p.d} />)}</svg>;
9202
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", {
9203
+ style: {
9204
+ position: "absolute",
9205
+ transform: rotation === 0 ? "" : `rotate(${rotation}rad)`,
9206
+ left: absoluteCenter.x - absoluteSize.width / 2,
9207
+ top: absoluteCenter.y - absoluteSize.height / 2
9208
+ },
9209
+ overflow: "visible",
9210
+ width: absoluteSize.width,
9211
+ height: absoluteSize.height,
9212
+ viewBox: `${pathBounds.minX} ${pathBounds.minY} ${pathBounds.width} ${pathBounds.height}`,
9213
+ children: paths.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", {
9214
+ fill: "none",
9215
+ strokeWidth: 2 * (p.strokeWidth || 1),
9216
+ stroke: p.stroke || "red",
9217
+ d: p.d
9218
+ }, i))
9219
+ });
8295
9220
  };
8296
9221
  var SVGPathComponent_default = SVGPathComponent;
8297
9222
 
8298
9223
  // src/schematic-components/SimpleResistor.tsx
9224
+ var import_jsx_runtime3 = __toESM(require_jsx_runtime());
8299
9225
  var SimpleResistor = ({ component: { source, schematic } }) => {
8300
- return <SVGPathComponent_default rotation={schematic.rotation} center={schematic.center} size={schematic.size} paths={[
8301
- {
8302
- stroke: "red",
8303
- strokeWidth: 1,
8304
- d: "M 0 15 l 10 0 l 0 -6 l 20 0 l 0 12 l -20 0 l 0 -6 m 20 0 l 10 0"
8305
- }
8306
- ]} />;
9226
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SVGPathComponent_default, {
9227
+ rotation: schematic.rotation,
9228
+ center: schematic.center,
9229
+ size: schematic.size,
9230
+ paths: [
9231
+ {
9232
+ stroke: "red",
9233
+ strokeWidth: 1,
9234
+ d: "M 0 15 l 10 0 l 0 -6 l 20 0 l 0 12 l -20 0 l 0 -6 m 20 0 l 10 0"
9235
+ }
9236
+ ]
9237
+ });
8307
9238
  };
8308
9239
 
8309
9240
  // src/schematic-components/SimpleCapacitor.tsx
9241
+ var import_jsx_runtime4 = __toESM(require_jsx_runtime());
8310
9242
  var SimpleCapacitor = ({
8311
9243
  component: { source, schematic }
8312
9244
  }) => {
8313
- return <SVGPathComponent_default rotation={schematic.rotation} center={schematic.center} size={schematic.size} paths={[
8314
- { stroke: "red", strokeWidth: 1, d: "M 0 15 l 12 0" },
8315
- { stroke: "red", strokeWidth: 2, d: "M 12 0 l 0 30" },
8316
- { stroke: "red", strokeWidth: 2, d: "M 18 0 l 0 30" },
8317
- { stroke: "red", strokeWidth: 1, d: "M 18 15 l 12 0" }
8318
- ]} />;
9245
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SVGPathComponent_default, {
9246
+ rotation: schematic.rotation,
9247
+ center: schematic.center,
9248
+ size: schematic.size,
9249
+ paths: [
9250
+ { stroke: "red", strokeWidth: 1, d: "M 0 15 l 12 0" },
9251
+ { stroke: "red", strokeWidth: 2, d: "M 12 0 l 0 30" },
9252
+ { stroke: "red", strokeWidth: 2, d: "M 18 0 l 0 30" },
9253
+ { stroke: "red", strokeWidth: 1, d: "M 18 15 l 12 0" }
9254
+ ]
9255
+ });
8319
9256
  };
8320
9257
 
8321
9258
  // src/schematic-components/ProjectComponent.tsx
8322
9259
  var import_builder = __toESM(require_dist());
9260
+ var import_jsx_runtime5 = __toESM(require_jsx_runtime());
8323
9261
  var ProjectComponent = ({ project: $project }) => {
8324
9262
  const project = useMaybePromise($project);
8325
9263
  if (!project)
8326
- return <span>loading</span>;
9264
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", {
9265
+ children: "loading"
9266
+ });
8327
9267
  const projectClass = new import_builder.ProjectClass(project);
8328
- return <>
8329
- {project.schematic_components.map((schematic_component) => <SchematicComponent key={schematic_component.schematic_component_id} component={{
8330
- source: projectClass.getSourceComponent(
8331
- schematic_component.source_component_id
8332
- ),
8333
- schematic: schematic_component
8334
- }} />)}
8335
- {project.schematic_ports.map((schematic_port) => <SchematicPort key={schematic_port.schematic_port_id} port={{
8336
- source: projectClass.getSourcePort(
8337
- schematic_port.schematic_port_id
8338
- ),
8339
- schematic: schematic_port
8340
- }} />)}
8341
- {project.schematic_traces.map((schematic_trace) => <SchematicTrace key={schematic_trace.schematic_trace_id} trace={{
8342
- source: projectClass.getSourceTrace(
8343
- schematic_trace.source_trace_id
8344
- ),
8345
- schematic: schematic_trace
8346
- }} />)}
8347
- {project.schematic_texts.map((schematic_text) => <SchematicText key={schematic_text.schematic_text_id} schematic_text={schematic_text} />)}
8348
- </>;
9268
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, {
9269
+ children: [
9270
+ project.schematic_components.map((schematic_component) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SchematicComponent, {
9271
+ component: {
9272
+ source: projectClass.getSourceComponent(
9273
+ schematic_component.source_component_id
9274
+ ),
9275
+ schematic: schematic_component
9276
+ }
9277
+ }, schematic_component.schematic_component_id)),
9278
+ project.schematic_ports.map((schematic_port) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SchematicPort, {
9279
+ port: {
9280
+ source: projectClass.getSourcePort(
9281
+ schematic_port.schematic_port_id
9282
+ ),
9283
+ schematic: schematic_port
9284
+ }
9285
+ }, schematic_port.schematic_port_id)),
9286
+ project.schematic_traces.map((schematic_trace) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SchematicTrace, {
9287
+ trace: {
9288
+ source: projectClass.getSourceTrace(
9289
+ schematic_trace.source_trace_id
9290
+ ),
9291
+ schematic: schematic_trace
9292
+ }
9293
+ }, schematic_trace.schematic_trace_id)),
9294
+ project.schematic_texts.map((schematic_text) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SchematicText, {
9295
+ schematic_text
9296
+ }, schematic_text.schematic_text_id))
9297
+ ]
9298
+ });
8349
9299
  };
8350
9300
 
8351
9301
  // src/schematic-components/SchematicComponent.tsx
9302
+ var import_jsx_runtime6 = __toESM(require_jsx_runtime());
8352
9303
  var SchematicComponent = ({ component }) => {
8353
9304
  const { source, schematic } = component;
8354
9305
  switch (source.ftype) {
8355
9306
  case "simple_resistor": {
8356
- return <SimpleResistor component={{ source, schematic }} />;
9307
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SimpleResistor, {
9308
+ component: { source, schematic }
9309
+ });
8357
9310
  }
8358
9311
  case "simple_capacitor": {
8359
- return <SimpleCapacitor component={{ source, schematic }} />;
9312
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SimpleCapacitor, {
9313
+ component: { source, schematic }
9314
+ });
8360
9315
  }
8361
9316
  case "simple_power_source": {
8362
- return <SimplePowerSource component={{ source, schematic }} />;
9317
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SimplePowerSource, {
9318
+ component: { source, schematic }
9319
+ });
8363
9320
  }
8364
9321
  case "simple_ground": {
8365
- return <SimpleGround component={{ source, schematic }} />;
9322
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SimpleGround, {
9323
+ component: { source, schematic }
9324
+ });
8366
9325
  }
8367
9326
  case "simple_inductor": {
8368
- return <SimpleInductor component={{ source, schematic }} />;
9327
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SimpleInductor, {
9328
+ component: { source, schematic }
9329
+ });
8369
9330
  }
8370
9331
  case "simple_bug": {
8371
- return <SchematicBug component={{ source, schematic }} />;
9332
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SchematicBug, {
9333
+ component: { source, schematic }
9334
+ });
8372
9335
  }
8373
9336
  case "simple_diode": {
8374
- return <SimpleDiode component={{ source, schematic }} />;
9337
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SimpleDiode, {
9338
+ component: { source, schematic }
9339
+ });
8375
9340
  }
8376
9341
  default: {
8377
- return <div>
8378
- {"unknown ftype: "}
8379
- {component.source.ftype}
8380
- </div>;
9342
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", {
9343
+ children: [
9344
+ "unknown ftype: ",
9345
+ component.source.ftype
9346
+ ]
9347
+ });
8381
9348
  }
8382
9349
  }
8383
9350
  };
@@ -8397,24 +9364,31 @@ var directionToVec = (direction) => {
8397
9364
  };
8398
9365
 
8399
9366
  // src/schematic-components/SchematicPort.tsx
9367
+ var import_jsx_runtime7 = __toESM(require_jsx_runtime());
8400
9368
  var SchematicPort = ({ port: { source, schematic } }) => {
8401
- return <SVGPathComponent rotation={0} center={schematic.center} size={{ width: 0.2, height: 0.2 }} paths={[
8402
- {
8403
- stroke: "blue",
8404
- strokeWidth: 1,
8405
- d: "M 0 0 l 10 0 l 0 10 l -10 0 z"
8406
- },
8407
- schematic.facing_direction ? {
8408
- stroke: "blue",
8409
- strokeWidth: 0.5,
8410
- d: `M 5 5 l ${directionToVec(schematic.facing_direction).x * 7} ${directionToVec(schematic.facing_direction).y * 7}`
8411
- } : null
8412
- ].filter(Boolean)} />;
9369
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SVGPathComponent, {
9370
+ rotation: 0,
9371
+ center: schematic.center,
9372
+ size: { width: 0.2, height: 0.2 },
9373
+ paths: [
9374
+ {
9375
+ stroke: "blue",
9376
+ strokeWidth: 1,
9377
+ d: "M 0 0 l 10 0 l 0 10 l -10 0 z"
9378
+ },
9379
+ schematic.facing_direction ? {
9380
+ stroke: "blue",
9381
+ strokeWidth: 0.5,
9382
+ d: `M 5 5 l ${directionToVec(schematic.facing_direction).x * 7} ${directionToVec(schematic.facing_direction).y * 7}`
9383
+ } : null
9384
+ ].filter(Boolean)
9385
+ });
8413
9386
  };
8414
9387
 
8415
9388
  // src/schematic-components/SchematicText.tsx
8416
9389
  var import_transformation_matrix3 = require("transformation-matrix");
8417
9390
  var import_react_use_measure = __toESM(require("react-use-measure"));
9391
+ var import_jsx_runtime8 = __toESM(require_jsx_runtime());
8418
9392
  var SchematicText = ({ schematic_text }) => {
8419
9393
  const ct = useCameraTransform();
8420
9394
  const { text, position, anchor } = schematic_text;
@@ -8428,37 +9402,48 @@ var SchematicText = ({ schematic_text }) => {
8428
9402
  } else if (anchor === "right") {
8429
9403
  offset = [-bounds.width, -bounds.height / 2];
8430
9404
  }
8431
- return <div ref={boundsRef} style={{
8432
- fontFamily: "'IBM Plex Mono', monospace",
8433
- position: "absolute",
8434
- left: tPos.x + offset[0],
8435
- top: tPos.y + offset[1]
8436
- }}>{text}</div>;
9405
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", {
9406
+ ref: boundsRef,
9407
+ style: {
9408
+ fontFamily: "'IBM Plex Mono', monospace",
9409
+ position: "absolute",
9410
+ left: tPos.x + offset[0],
9411
+ top: tPos.y + offset[1]
9412
+ },
9413
+ children: text
9414
+ });
8437
9415
  };
8438
9416
 
8439
9417
  // src/schematic-components/SchematicTrace.tsx
8440
9418
  var import_svg_path_generator = __toESM(require("svg-path-generator"));
8441
9419
 
8442
9420
  // src/schematic-components/RenderError.tsx
9421
+ var import_jsx_runtime9 = __toESM(require_jsx_runtime());
8443
9422
  var RenderError_default = ({ text }) => {
8444
- return <div style={{
8445
- position: "fixed",
8446
- backgroundColor: "red",
8447
- color: "white",
8448
- fontSize: 14,
8449
- fontFamily: "sans-serif",
8450
- padding: 5,
8451
- right: 0,
8452
- top: 0,
8453
- opacity: 0.75
8454
- }}>{text}</div>;
9423
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", {
9424
+ style: {
9425
+ position: "fixed",
9426
+ backgroundColor: "red",
9427
+ color: "white",
9428
+ fontSize: 14,
9429
+ fontFamily: "sans-serif",
9430
+ padding: 5,
9431
+ right: 0,
9432
+ top: 0,
9433
+ opacity: 0.75
9434
+ },
9435
+ children: text
9436
+ });
8455
9437
  };
8456
9438
 
8457
9439
  // src/schematic-components/SchematicTrace.tsx
9440
+ var import_jsx_runtime10 = __toESM(require_jsx_runtime());
8458
9441
  var SchematicTrace = ({ trace: { source, schematic } }) => {
8459
9442
  const edges = schematic.edges;
8460
9443
  if (edges.length === 0) {
8461
- return <RenderError_default text="Route with 0 edges" />;
9444
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RenderError_default, {
9445
+ text: "Route with 0 edges"
9446
+ });
8462
9447
  }
8463
9448
  const path = (0, import_svg_path_generator.default)();
8464
9449
  for (let i = 0; i < edges.length; i++) {
@@ -8473,17 +9458,23 @@ var SchematicTrace = ({ trace: { source, schematic } }) => {
8473
9458
  x: pathBounds.minX + pathBounds.width / 2,
8474
9459
  y: pathBounds.minY + pathBounds.height / 2
8475
9460
  };
8476
- return <SVGPathComponent_default rotation={0} center={center} size={pathBounds} paths={[
8477
- {
8478
- stroke: "green",
8479
- strokeWidth: 0.02,
8480
- d
8481
- }
8482
- ]} />;
9461
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SVGPathComponent_default, {
9462
+ rotation: 0,
9463
+ center,
9464
+ size: pathBounds,
9465
+ paths: [
9466
+ {
9467
+ stroke: "green",
9468
+ strokeWidth: 0.02,
9469
+ d
9470
+ }
9471
+ ]
9472
+ });
8483
9473
  };
8484
9474
 
8485
9475
  // src/schematic-components/SchematicBug.tsx
8486
9476
  var import_range = __toESM(require_range());
9477
+ var import_jsx_runtime11 = __toESM(require_jsx_runtime());
8487
9478
  var SchematicBug = ({ component: { source, schematic } }) => {
8488
9479
  const ports_arrangement = schematic.port_arrangement;
8489
9480
  const port_labels = schematic.port_labels;
@@ -8491,78 +9482,108 @@ var SchematicBug = ({ component: { source, schematic } }) => {
8491
9482
  const rh = 15;
8492
9483
  const pd = 7.5;
8493
9484
  const bugh = Math.max(ports_arrangement.left_size, ports_arrangement.right_size) * rh;
8494
- return <SVGPathComponent_default rotation={schematic.rotation} center={schematic.center} size={schematic.size} paths={[
8495
- {
8496
- stroke: "red",
8497
- strokeWidth: 1,
8498
- d: `M 0 0 L ${bugw} 0 L ${bugw} ${bugh} L 0 ${bugh}Z`
8499
- },
8500
- ...(0, import_range.default)(
8501
- 0,
8502
- ports_arrangement.left_size + ports_arrangement.right_size
8503
- ).map((i) => {
8504
- const ls = ports_arrangement.left_size;
8505
- const left = i < ls;
8506
- const rowi = i % ls;
8507
- const p1 = [left ? 0 : bugw, rh / 2 + rowi * rh];
8508
- const rd = [left ? -pd : pd, 0];
8509
- return {
9485
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SVGPathComponent_default, {
9486
+ rotation: schematic.rotation,
9487
+ center: schematic.center,
9488
+ size: schematic.size,
9489
+ paths: [
9490
+ {
8510
9491
  stroke: "red",
8511
9492
  strokeWidth: 1,
8512
- d: `M ${p1.join(" ")} l ${rd.join(" ")}`
8513
- };
8514
- })
8515
- ]} />;
9493
+ d: `M 0 0 L ${bugw} 0 L ${bugw} ${bugh} L 0 ${bugh}Z`
9494
+ },
9495
+ ...(0, import_range.default)(
9496
+ 0,
9497
+ ports_arrangement.left_size + ports_arrangement.right_size
9498
+ ).map((i) => {
9499
+ const ls = ports_arrangement.left_size;
9500
+ const left = i < ls;
9501
+ const rowi = i % ls;
9502
+ const p1 = [left ? 0 : bugw, rh / 2 + rowi * rh];
9503
+ const rd = [left ? -pd : pd, 0];
9504
+ return {
9505
+ stroke: "red",
9506
+ strokeWidth: 1,
9507
+ d: `M ${p1.join(" ")} l ${rd.join(" ")}`
9508
+ };
9509
+ })
9510
+ ]
9511
+ });
8516
9512
  };
8517
9513
 
8518
9514
  // src/schematic-components/SimplePowerSource.tsx
9515
+ var import_jsx_runtime12 = __toESM(require_jsx_runtime());
8519
9516
  var SimplePowerSource = ({
8520
9517
  component: { source, schematic }
8521
9518
  }) => {
8522
- return <SVGPathComponent_default rotation={schematic.rotation} center={schematic.center} size={schematic.size} paths={[
8523
- {
8524
- stroke: "red",
8525
- strokeWidth: 1,
8526
- d: "M 0 -17 L 0 -3 M -8 3 L 8 3 M 0 17 L 0 3 M -12 -3 L 12 -3"
8527
- }
8528
- ]} />;
9519
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SVGPathComponent_default, {
9520
+ rotation: schematic.rotation,
9521
+ center: schematic.center,
9522
+ size: schematic.size,
9523
+ paths: [
9524
+ {
9525
+ stroke: "red",
9526
+ strokeWidth: 1,
9527
+ d: "M 0 -17 L 0 -3 M -8 3 L 8 3 M 0 17 L 0 3 M -12 -3 L 12 -3"
9528
+ }
9529
+ ]
9530
+ });
8529
9531
  };
8530
9532
 
8531
9533
  // src/schematic-components/SimpleGround.tsx
9534
+ var import_jsx_runtime13 = __toESM(require_jsx_runtime());
8532
9535
  var SimpleGround = ({ component: { source, schematic } }) => {
8533
- return <SVGPathComponent_default rotation={schematic.rotation} center={schematic.center} size={schematic.size} paths={[
8534
- {
8535
- stroke: "red",
8536
- strokeWidth: 0.7,
8537
- d: "M -3 3 L 3 3 M -6 0 L 6 0 M -9 -3 L 9 -3 M 0 -3 L 0 -12"
8538
- }
8539
- ]} />;
9536
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SVGPathComponent_default, {
9537
+ rotation: schematic.rotation,
9538
+ center: schematic.center,
9539
+ size: schematic.size,
9540
+ paths: [
9541
+ {
9542
+ stroke: "red",
9543
+ strokeWidth: 0.7,
9544
+ d: "M -3 3 L 3 3 M -6 0 L 6 0 M -9 -3 L 9 -3 M 0 -3 L 0 -12"
9545
+ }
9546
+ ]
9547
+ });
8540
9548
  };
8541
9549
 
8542
9550
  // src/schematic-components/SimpleInductor.tsx
9551
+ var import_jsx_runtime14 = __toESM(require_jsx_runtime());
8543
9552
  var SimpleInductor = ({ component: { source, schematic } }) => {
8544
- return <SVGPathComponent_default rotation={schematic.rotation} center={schematic.center} size={schematic.size} paths={[
8545
- {
8546
- stroke: "red",
8547
- strokeWidth: 1,
8548
- d: "m 371,710.41665 h -14 c -0.0421,-16.39898 -14.02104,-16.39898 -14,0 -0.021,-16.399 -14.04182,-16.34072 -14,0 -2.6e-4,-16.45722 -14.04236,-16.45722 -14,0 2.8e-4,-16.3407 -13.97896,-16.39898 -14,0 -0.0421,-16.39898 -13.91338,-16.39898 -13.91338,0 H 273"
8549
- }
8550
- ]} />;
9553
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SVGPathComponent_default, {
9554
+ rotation: schematic.rotation,
9555
+ center: schematic.center,
9556
+ size: schematic.size,
9557
+ paths: [
9558
+ {
9559
+ stroke: "red",
9560
+ strokeWidth: 1,
9561
+ d: "m 371,710.41665 h -14 c -0.0421,-16.39898 -14.02104,-16.39898 -14,0 -0.021,-16.399 -14.04182,-16.34072 -14,0 -2.6e-4,-16.45722 -14.04236,-16.45722 -14,0 2.8e-4,-16.3407 -13.97896,-16.39898 -14,0 -0.0421,-16.39898 -13.91338,-16.39898 -13.91338,0 H 273"
9562
+ }
9563
+ ]
9564
+ });
8551
9565
  };
8552
9566
 
8553
9567
  // src/schematic-components/SimpleDiode.tsx
9568
+ var import_jsx_runtime15 = __toESM(require_jsx_runtime());
8554
9569
  var SimpleDiode = ({ component: { source, schematic } }) => {
8555
- return <SVGPathComponent_default rotation={schematic.rotation} center={schematic.center} size={schematic.size} paths={[
8556
- { stroke: "red", strokeWidth: 2, d: "M 0,0 H 21" },
8557
- { stroke: "red", strokeWidth: 2, d: "M 49,0 H 59" },
8558
- { stroke: "red", strokeWidth: 2, d: "M 49,0 L 21 14 V -14 Z" },
8559
- { stroke: "red", strokeWidth: 2, d: "M 49,-14 V 14" }
8560
- ]} />;
9570
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SVGPathComponent_default, {
9571
+ rotation: schematic.rotation,
9572
+ center: schematic.center,
9573
+ size: schematic.size,
9574
+ paths: [
9575
+ { stroke: "red", strokeWidth: 2, d: "M 0,0 H 21" },
9576
+ { stroke: "red", strokeWidth: 2, d: "M 49,0 H 59" },
9577
+ { stroke: "red", strokeWidth: 2, d: "M 49,0 L 21 14 V -14 Z" },
9578
+ { stroke: "red", strokeWidth: 2, d: "M 49,-14 V 14" }
9579
+ ]
9580
+ });
8561
9581
  };
8562
9582
 
8563
9583
  // src/Schematic.tsx
8564
9584
  var import_builder2 = __toESM(require_dist());
8565
9585
  var import_react_fiber = require("@tscircuit/react-fiber");
9586
+ var import_jsx_runtime16 = __toESM(require_jsx_runtime());
8566
9587
  var Schematic = ({
8567
9588
  children,
8568
9589
  elements: initialElements = []
@@ -8585,10 +9606,13 @@ var Schematic = ({
8585
9606
  }, [children]);
8586
9607
  if (elements.length === 0)
8587
9608
  return null;
8588
- return <ProjectComponent project={project} />;
9609
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ProjectComponent, {
9610
+ project
9611
+ });
8589
9612
  };
8590
9613
 
8591
9614
  // src/pages/led-circuit.tsx
9615
+ var import_jsx_runtime17 = __toESM(require_jsx_runtime());
8592
9616
  var pb = (0, import_builder3.createProjectBuilder)();
8593
9617
  var $elements = pb.addGroup(
8594
9618
  (gb) => gb.addResistor(
@@ -8634,10 +9658,38 @@ var led_circuit_default = () => {
8634
9658
  const elements = useMaybePromise($elements);
8635
9659
  if (!elements)
8636
9660
  return null;
8637
- return <Schematic elements={elements} />;
9661
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, {
9662
+ children: [
9663
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Schematic, {
9664
+ elements
9665
+ }),
9666
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("pre", {
9667
+ style: { marginTop: 600 },
9668
+ children: JSON.stringify(elements, null, " ")
9669
+ })
9670
+ ]
9671
+ });
8638
9672
  };
8639
9673
  // Annotate the CommonJS export names for ESM import in node:
8640
9674
  0 && (module.exports = {});
9675
+ /**
9676
+ * @license React
9677
+ * react-jsx-runtime.development.js
9678
+ *
9679
+ * Copyright (c) Facebook, Inc. and its affiliates.
9680
+ *
9681
+ * This source code is licensed under the MIT license found in the
9682
+ * LICENSE file in the root directory of this source tree.
9683
+ */
9684
+ /**
9685
+ * @license React
9686
+ * react-jsx-runtime.production.min.js
9687
+ *
9688
+ * Copyright (c) Facebook, Inc. and its affiliates.
9689
+ *
9690
+ * This source code is licensed under the MIT license found in the
9691
+ * LICENSE file in the root directory of this source tree.
9692
+ */
8641
9693
  /**
8642
9694
  * @license React
8643
9695
  * react.development.js