@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.
- package/dist/Schematic.js +1178 -137
- package/dist/Schematic.js.map +1 -1
- package/dist/index.js +1178 -137
- package/dist/index.js.map +1 -1
- package/dist/pages/_app.js +950 -8
- package/dist/pages/_app.js.map +1 -1
- package/dist/pages/index.js +1185 -138
- package/dist/pages/index.js.map +1 -1
- package/dist/pages/led-circuit-react.js +1251 -160
- package/dist/pages/led-circuit-react.js.map +1 -1
- package/dist/pages/led-circuit.js +1190 -138
- package/dist/pages/led-circuit.js.map +1 -1
- package/dist/schematic-components/MovableGrid/MovableGrid.stories.js +3062 -2
- package/dist/schematic-components/MovableGrid/MovableGrid.stories.js.map +1 -1
- package/dist/schematic-components/MovableGrid/index.js +3058 -1
- package/dist/schematic-components/MovableGrid/index.js.map +1 -1
- package/dist/schematic-components/ProjectComponent.js +1174 -136
- package/dist/schematic-components/ProjectComponent.js.map +1 -1
- package/dist/schematic-components/RenderError.js +3069 -11
- package/dist/schematic-components/RenderError.js.map +1 -1
- package/dist/schematic-components/SVGPathComponent.js +3067 -6
- package/dist/schematic-components/SVGPathComponent.js.map +1 -1
- package/dist/schematic-components/SchematicBug.js +3090 -26
- package/dist/schematic-components/SchematicBug.js.map +1 -1
- package/dist/schematic-components/SchematicComponent.js +1090 -77
- package/dist/schematic-components/SchematicComponent.js.map +1 -1
- package/dist/schematic-components/SchematicPort.js +997 -18
- package/dist/schematic-components/SchematicPort.js.map +1 -1
- package/dist/schematic-components/SchematicText.js +3059 -6
- package/dist/schematic-components/SchematicText.js.map +1 -1
- package/dist/schematic-components/SchematicTrace.js +3098 -25
- package/dist/schematic-components/SchematicTrace.js.map +1 -1
- package/dist/schematic-components/SimpleCapacitor.js +3079 -12
- package/dist/schematic-components/SimpleCapacitor.js.map +1 -1
- package/dist/schematic-components/SimpleDiode.js +3079 -12
- package/dist/schematic-components/SimpleDiode.js.map +1 -1
- package/dist/schematic-components/SimpleGround.js +3080 -13
- package/dist/schematic-components/SimpleGround.js.map +1 -1
- package/dist/schematic-components/SimpleInductor.js +3080 -13
- package/dist/schematic-components/SimpleInductor.js.map +1 -1
- package/dist/schematic-components/SimplePowerSource.js +3080 -13
- package/dist/schematic-components/SimplePowerSource.js.map +1 -1
- package/dist/schematic-components/SimpleResistor.js +3080 -13
- package/dist/schematic-components/SimpleResistor.js.map +1 -1
- package/dist/schematic-components/index.js +1175 -137
- package/dist/schematic-components/index.js.map +1 -1
- package/package.json +1 -1
- package/src/pages/led-circuit.tsx +8 -1
- package/tsconfig.json +2 -1
|
@@ -7875,6 +7875,915 @@ var require_dist = __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 jsx16 = jsxWithValidationDynamic;
|
|
8766
|
+
var jsxs3 = jsxWithValidationStatic;
|
|
8767
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
8768
|
+
exports.jsx = jsx16;
|
|
8769
|
+
exports.jsxs = jsxs3;
|
|
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-components/ProjectComponent.tsx
|
|
8242
9151
|
var import_builder = __toESM(require_dist());
|
|
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,68 +9199,109 @@ 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
|
|
8290
|
-
|
|
8291
|
-
|
|
8292
|
-
|
|
8293
|
-
|
|
8294
|
-
|
|
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
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
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
|
|
8314
|
-
|
|
8315
|
-
|
|
8316
|
-
|
|
8317
|
-
|
|
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/SchematicComponent.tsx
|
|
9259
|
+
var import_jsx_runtime5 = __toESM(require_jsx_runtime());
|
|
8322
9260
|
var SchematicComponent = ({ component }) => {
|
|
8323
9261
|
const { source, schematic } = component;
|
|
8324
9262
|
switch (source.ftype) {
|
|
8325
9263
|
case "simple_resistor": {
|
|
8326
|
-
return
|
|
9264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SimpleResistor, {
|
|
9265
|
+
component: { source, schematic }
|
|
9266
|
+
});
|
|
8327
9267
|
}
|
|
8328
9268
|
case "simple_capacitor": {
|
|
8329
|
-
return
|
|
9269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SimpleCapacitor, {
|
|
9270
|
+
component: { source, schematic }
|
|
9271
|
+
});
|
|
8330
9272
|
}
|
|
8331
9273
|
case "simple_power_source": {
|
|
8332
|
-
return
|
|
9274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SimplePowerSource, {
|
|
9275
|
+
component: { source, schematic }
|
|
9276
|
+
});
|
|
8333
9277
|
}
|
|
8334
9278
|
case "simple_ground": {
|
|
8335
|
-
return
|
|
9279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SimpleGround, {
|
|
9280
|
+
component: { source, schematic }
|
|
9281
|
+
});
|
|
8336
9282
|
}
|
|
8337
9283
|
case "simple_inductor": {
|
|
8338
|
-
return
|
|
9284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SimpleInductor, {
|
|
9285
|
+
component: { source, schematic }
|
|
9286
|
+
});
|
|
8339
9287
|
}
|
|
8340
9288
|
case "simple_bug": {
|
|
8341
|
-
return
|
|
9289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SchematicBug, {
|
|
9290
|
+
component: { source, schematic }
|
|
9291
|
+
});
|
|
8342
9292
|
}
|
|
8343
9293
|
case "simple_diode": {
|
|
8344
|
-
return
|
|
9294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SimpleDiode, {
|
|
9295
|
+
component: { source, schematic }
|
|
9296
|
+
});
|
|
8345
9297
|
}
|
|
8346
9298
|
default: {
|
|
8347
|
-
return
|
|
8348
|
-
|
|
8349
|
-
|
|
8350
|
-
|
|
9299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", {
|
|
9300
|
+
children: [
|
|
9301
|
+
"unknown ftype: ",
|
|
9302
|
+
component.source.ftype
|
|
9303
|
+
]
|
|
9304
|
+
});
|
|
8351
9305
|
}
|
|
8352
9306
|
}
|
|
8353
9307
|
};
|
|
@@ -8367,24 +9321,31 @@ var directionToVec = (direction) => {
|
|
|
8367
9321
|
};
|
|
8368
9322
|
|
|
8369
9323
|
// src/schematic-components/SchematicPort.tsx
|
|
9324
|
+
var import_jsx_runtime6 = __toESM(require_jsx_runtime());
|
|
8370
9325
|
var SchematicPort = ({ port: { source, schematic } }) => {
|
|
8371
|
-
return
|
|
8372
|
-
|
|
8373
|
-
|
|
8374
|
-
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
|
|
8382
|
-
|
|
9326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SVGPathComponent, {
|
|
9327
|
+
rotation: 0,
|
|
9328
|
+
center: schematic.center,
|
|
9329
|
+
size: { width: 0.2, height: 0.2 },
|
|
9330
|
+
paths: [
|
|
9331
|
+
{
|
|
9332
|
+
stroke: "blue",
|
|
9333
|
+
strokeWidth: 1,
|
|
9334
|
+
d: "M 0 0 l 10 0 l 0 10 l -10 0 z"
|
|
9335
|
+
},
|
|
9336
|
+
schematic.facing_direction ? {
|
|
9337
|
+
stroke: "blue",
|
|
9338
|
+
strokeWidth: 0.5,
|
|
9339
|
+
d: `M 5 5 l ${directionToVec(schematic.facing_direction).x * 7} ${directionToVec(schematic.facing_direction).y * 7}`
|
|
9340
|
+
} : null
|
|
9341
|
+
].filter(Boolean)
|
|
9342
|
+
});
|
|
8383
9343
|
};
|
|
8384
9344
|
|
|
8385
9345
|
// src/schematic-components/SchematicText.tsx
|
|
8386
9346
|
var import_transformation_matrix3 = require("transformation-matrix");
|
|
8387
9347
|
var import_react_use_measure = __toESM(require("react-use-measure"));
|
|
9348
|
+
var import_jsx_runtime7 = __toESM(require_jsx_runtime());
|
|
8388
9349
|
var SchematicText = ({ schematic_text }) => {
|
|
8389
9350
|
const ct = useCameraTransform();
|
|
8390
9351
|
const { text, position, anchor } = schematic_text;
|
|
@@ -8398,37 +9359,48 @@ var SchematicText = ({ schematic_text }) => {
|
|
|
8398
9359
|
} else if (anchor === "right") {
|
|
8399
9360
|
offset = [-bounds.width, -bounds.height / 2];
|
|
8400
9361
|
}
|
|
8401
|
-
return
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
9362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", {
|
|
9363
|
+
ref: boundsRef,
|
|
9364
|
+
style: {
|
|
9365
|
+
fontFamily: "'IBM Plex Mono', monospace",
|
|
9366
|
+
position: "absolute",
|
|
9367
|
+
left: tPos.x + offset[0],
|
|
9368
|
+
top: tPos.y + offset[1]
|
|
9369
|
+
},
|
|
9370
|
+
children: text
|
|
9371
|
+
});
|
|
8407
9372
|
};
|
|
8408
9373
|
|
|
8409
9374
|
// src/schematic-components/SchematicTrace.tsx
|
|
8410
9375
|
var import_svg_path_generator = __toESM(require("svg-path-generator"));
|
|
8411
9376
|
|
|
8412
9377
|
// src/schematic-components/RenderError.tsx
|
|
9378
|
+
var import_jsx_runtime8 = __toESM(require_jsx_runtime());
|
|
8413
9379
|
var RenderError_default = ({ text }) => {
|
|
8414
|
-
return
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
|
|
9380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", {
|
|
9381
|
+
style: {
|
|
9382
|
+
position: "fixed",
|
|
9383
|
+
backgroundColor: "red",
|
|
9384
|
+
color: "white",
|
|
9385
|
+
fontSize: 14,
|
|
9386
|
+
fontFamily: "sans-serif",
|
|
9387
|
+
padding: 5,
|
|
9388
|
+
right: 0,
|
|
9389
|
+
top: 0,
|
|
9390
|
+
opacity: 0.75
|
|
9391
|
+
},
|
|
9392
|
+
children: text
|
|
9393
|
+
});
|
|
8425
9394
|
};
|
|
8426
9395
|
|
|
8427
9396
|
// src/schematic-components/SchematicTrace.tsx
|
|
9397
|
+
var import_jsx_runtime9 = __toESM(require_jsx_runtime());
|
|
8428
9398
|
var SchematicTrace = ({ trace: { source, schematic } }) => {
|
|
8429
9399
|
const edges = schematic.edges;
|
|
8430
9400
|
if (edges.length === 0) {
|
|
8431
|
-
return
|
|
9401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RenderError_default, {
|
|
9402
|
+
text: "Route with 0 edges"
|
|
9403
|
+
});
|
|
8432
9404
|
}
|
|
8433
9405
|
const path = (0, import_svg_path_generator.default)();
|
|
8434
9406
|
for (let i = 0; i < edges.length; i++) {
|
|
@@ -8443,17 +9415,23 @@ var SchematicTrace = ({ trace: { source, schematic } }) => {
|
|
|
8443
9415
|
x: pathBounds.minX + pathBounds.width / 2,
|
|
8444
9416
|
y: pathBounds.minY + pathBounds.height / 2
|
|
8445
9417
|
};
|
|
8446
|
-
return
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
9418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SVGPathComponent_default, {
|
|
9419
|
+
rotation: 0,
|
|
9420
|
+
center,
|
|
9421
|
+
size: pathBounds,
|
|
9422
|
+
paths: [
|
|
9423
|
+
{
|
|
9424
|
+
stroke: "green",
|
|
9425
|
+
strokeWidth: 0.02,
|
|
9426
|
+
d
|
|
9427
|
+
}
|
|
9428
|
+
]
|
|
9429
|
+
});
|
|
8453
9430
|
};
|
|
8454
9431
|
|
|
8455
9432
|
// src/schematic-components/SchematicBug.tsx
|
|
8456
9433
|
var import_range = __toESM(require_range());
|
|
9434
|
+
var import_jsx_runtime10 = __toESM(require_jsx_runtime());
|
|
8457
9435
|
var SchematicBug = ({ component: { source, schematic } }) => {
|
|
8458
9436
|
const ports_arrangement = schematic.port_arrangement;
|
|
8459
9437
|
const port_labels = schematic.port_labels;
|
|
@@ -8461,108 +9439,168 @@ var SchematicBug = ({ component: { source, schematic } }) => {
|
|
|
8461
9439
|
const rh = 15;
|
|
8462
9440
|
const pd = 7.5;
|
|
8463
9441
|
const bugh = Math.max(ports_arrangement.left_size, ports_arrangement.right_size) * rh;
|
|
8464
|
-
return
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
...(0, import_range.default)(
|
|
8471
|
-
0,
|
|
8472
|
-
ports_arrangement.left_size + ports_arrangement.right_size
|
|
8473
|
-
).map((i) => {
|
|
8474
|
-
const ls = ports_arrangement.left_size;
|
|
8475
|
-
const left = i < ls;
|
|
8476
|
-
const rowi = i % ls;
|
|
8477
|
-
const p1 = [left ? 0 : bugw, rh / 2 + rowi * rh];
|
|
8478
|
-
const rd = [left ? -pd : pd, 0];
|
|
8479
|
-
return {
|
|
9442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SVGPathComponent_default, {
|
|
9443
|
+
rotation: schematic.rotation,
|
|
9444
|
+
center: schematic.center,
|
|
9445
|
+
size: schematic.size,
|
|
9446
|
+
paths: [
|
|
9447
|
+
{
|
|
8480
9448
|
stroke: "red",
|
|
8481
9449
|
strokeWidth: 1,
|
|
8482
|
-
d: `M ${
|
|
8483
|
-
}
|
|
8484
|
-
|
|
8485
|
-
|
|
9450
|
+
d: `M 0 0 L ${bugw} 0 L ${bugw} ${bugh} L 0 ${bugh}Z`
|
|
9451
|
+
},
|
|
9452
|
+
...(0, import_range.default)(
|
|
9453
|
+
0,
|
|
9454
|
+
ports_arrangement.left_size + ports_arrangement.right_size
|
|
9455
|
+
).map((i) => {
|
|
9456
|
+
const ls = ports_arrangement.left_size;
|
|
9457
|
+
const left = i < ls;
|
|
9458
|
+
const rowi = i % ls;
|
|
9459
|
+
const p1 = [left ? 0 : bugw, rh / 2 + rowi * rh];
|
|
9460
|
+
const rd = [left ? -pd : pd, 0];
|
|
9461
|
+
return {
|
|
9462
|
+
stroke: "red",
|
|
9463
|
+
strokeWidth: 1,
|
|
9464
|
+
d: `M ${p1.join(" ")} l ${rd.join(" ")}`
|
|
9465
|
+
};
|
|
9466
|
+
})
|
|
9467
|
+
]
|
|
9468
|
+
});
|
|
8486
9469
|
};
|
|
8487
9470
|
|
|
8488
9471
|
// src/schematic-components/SimplePowerSource.tsx
|
|
9472
|
+
var import_jsx_runtime11 = __toESM(require_jsx_runtime());
|
|
8489
9473
|
var SimplePowerSource = ({
|
|
8490
9474
|
component: { source, schematic }
|
|
8491
9475
|
}) => {
|
|
8492
|
-
return
|
|
8493
|
-
|
|
8494
|
-
|
|
8495
|
-
|
|
8496
|
-
|
|
8497
|
-
|
|
8498
|
-
|
|
9476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SVGPathComponent_default, {
|
|
9477
|
+
rotation: schematic.rotation,
|
|
9478
|
+
center: schematic.center,
|
|
9479
|
+
size: schematic.size,
|
|
9480
|
+
paths: [
|
|
9481
|
+
{
|
|
9482
|
+
stroke: "red",
|
|
9483
|
+
strokeWidth: 1,
|
|
9484
|
+
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"
|
|
9485
|
+
}
|
|
9486
|
+
]
|
|
9487
|
+
});
|
|
8499
9488
|
};
|
|
8500
9489
|
|
|
8501
9490
|
// src/schematic-components/SimpleGround.tsx
|
|
9491
|
+
var import_jsx_runtime12 = __toESM(require_jsx_runtime());
|
|
8502
9492
|
var SimpleGround = ({ component: { source, schematic } }) => {
|
|
8503
|
-
return
|
|
8504
|
-
|
|
8505
|
-
|
|
8506
|
-
|
|
8507
|
-
|
|
8508
|
-
|
|
8509
|
-
|
|
9493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SVGPathComponent_default, {
|
|
9494
|
+
rotation: schematic.rotation,
|
|
9495
|
+
center: schematic.center,
|
|
9496
|
+
size: schematic.size,
|
|
9497
|
+
paths: [
|
|
9498
|
+
{
|
|
9499
|
+
stroke: "red",
|
|
9500
|
+
strokeWidth: 0.7,
|
|
9501
|
+
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"
|
|
9502
|
+
}
|
|
9503
|
+
]
|
|
9504
|
+
});
|
|
8510
9505
|
};
|
|
8511
9506
|
|
|
8512
9507
|
// src/schematic-components/SimpleInductor.tsx
|
|
9508
|
+
var import_jsx_runtime13 = __toESM(require_jsx_runtime());
|
|
8513
9509
|
var SimpleInductor = ({ component: { source, schematic } }) => {
|
|
8514
|
-
return
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
|
|
8520
|
-
|
|
9510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SVGPathComponent_default, {
|
|
9511
|
+
rotation: schematic.rotation,
|
|
9512
|
+
center: schematic.center,
|
|
9513
|
+
size: schematic.size,
|
|
9514
|
+
paths: [
|
|
9515
|
+
{
|
|
9516
|
+
stroke: "red",
|
|
9517
|
+
strokeWidth: 1,
|
|
9518
|
+
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"
|
|
9519
|
+
}
|
|
9520
|
+
]
|
|
9521
|
+
});
|
|
8521
9522
|
};
|
|
8522
9523
|
|
|
8523
9524
|
// src/schematic-components/SimpleDiode.tsx
|
|
9525
|
+
var import_jsx_runtime14 = __toESM(require_jsx_runtime());
|
|
8524
9526
|
var SimpleDiode = ({ component: { source, schematic } }) => {
|
|
8525
|
-
return
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8529
|
-
|
|
8530
|
-
|
|
9527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SVGPathComponent_default, {
|
|
9528
|
+
rotation: schematic.rotation,
|
|
9529
|
+
center: schematic.center,
|
|
9530
|
+
size: schematic.size,
|
|
9531
|
+
paths: [
|
|
9532
|
+
{ stroke: "red", strokeWidth: 2, d: "M 0,0 H 21" },
|
|
9533
|
+
{ stroke: "red", strokeWidth: 2, d: "M 49,0 H 59" },
|
|
9534
|
+
{ stroke: "red", strokeWidth: 2, d: "M 49,0 L 21 14 V -14 Z" },
|
|
9535
|
+
{ stroke: "red", strokeWidth: 2, d: "M 49,-14 V 14" }
|
|
9536
|
+
]
|
|
9537
|
+
});
|
|
8531
9538
|
};
|
|
8532
9539
|
|
|
8533
9540
|
// src/schematic-components/ProjectComponent.tsx
|
|
9541
|
+
var import_jsx_runtime15 = __toESM(require_jsx_runtime());
|
|
8534
9542
|
var ProjectComponent = ({ project: $project }) => {
|
|
8535
9543
|
const project = useMaybePromise($project);
|
|
8536
9544
|
if (!project)
|
|
8537
|
-
return
|
|
9545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", {
|
|
9546
|
+
children: "loading"
|
|
9547
|
+
});
|
|
8538
9548
|
const projectClass = new import_builder.ProjectClass(project);
|
|
8539
|
-
return
|
|
8540
|
-
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
|
|
8545
|
-
|
|
8546
|
-
|
|
8547
|
-
|
|
8548
|
-
|
|
8549
|
-
),
|
|
8550
|
-
|
|
8551
|
-
|
|
8552
|
-
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
|
|
8556
|
-
|
|
8557
|
-
|
|
8558
|
-
|
|
8559
|
-
|
|
9549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, {
|
|
9550
|
+
children: [
|
|
9551
|
+
project.schematic_components.map((schematic_component) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SchematicComponent, {
|
|
9552
|
+
component: {
|
|
9553
|
+
source: projectClass.getSourceComponent(
|
|
9554
|
+
schematic_component.source_component_id
|
|
9555
|
+
),
|
|
9556
|
+
schematic: schematic_component
|
|
9557
|
+
}
|
|
9558
|
+
}, schematic_component.schematic_component_id)),
|
|
9559
|
+
project.schematic_ports.map((schematic_port) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SchematicPort, {
|
|
9560
|
+
port: {
|
|
9561
|
+
source: projectClass.getSourcePort(
|
|
9562
|
+
schematic_port.schematic_port_id
|
|
9563
|
+
),
|
|
9564
|
+
schematic: schematic_port
|
|
9565
|
+
}
|
|
9566
|
+
}, schematic_port.schematic_port_id)),
|
|
9567
|
+
project.schematic_traces.map((schematic_trace) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SchematicTrace, {
|
|
9568
|
+
trace: {
|
|
9569
|
+
source: projectClass.getSourceTrace(
|
|
9570
|
+
schematic_trace.source_trace_id
|
|
9571
|
+
),
|
|
9572
|
+
schematic: schematic_trace
|
|
9573
|
+
}
|
|
9574
|
+
}, schematic_trace.schematic_trace_id)),
|
|
9575
|
+
project.schematic_texts.map((schematic_text) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SchematicText, {
|
|
9576
|
+
schematic_text
|
|
9577
|
+
}, schematic_text.schematic_text_id))
|
|
9578
|
+
]
|
|
9579
|
+
});
|
|
8560
9580
|
};
|
|
8561
9581
|
var ProjectComponent_default = ProjectComponent;
|
|
8562
9582
|
// Annotate the CommonJS export names for ESM import in node:
|
|
8563
9583
|
0 && (module.exports = {
|
|
8564
9584
|
ProjectComponent
|
|
8565
9585
|
});
|
|
9586
|
+
/**
|
|
9587
|
+
* @license React
|
|
9588
|
+
* react-jsx-runtime.development.js
|
|
9589
|
+
*
|
|
9590
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9591
|
+
*
|
|
9592
|
+
* This source code is licensed under the MIT license found in the
|
|
9593
|
+
* LICENSE file in the root directory of this source tree.
|
|
9594
|
+
*/
|
|
9595
|
+
/**
|
|
9596
|
+
* @license React
|
|
9597
|
+
* react-jsx-runtime.production.min.js
|
|
9598
|
+
*
|
|
9599
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9600
|
+
*
|
|
9601
|
+
* This source code is licensed under the MIT license found in the
|
|
9602
|
+
* LICENSE file in the root directory of this source tree.
|
|
9603
|
+
*/
|
|
8566
9604
|
/**
|
|
8567
9605
|
* @license React
|
|
8568
9606
|
* react.development.js
|