@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
package/dist/pages/index.js
CHANGED
|
@@ -2128,6 +2128,915 @@ var require_react = __commonJS({
|
|
|
2128
2128
|
}
|
|
2129
2129
|
});
|
|
2130
2130
|
|
|
2131
|
+
// node_modules/react/cjs/react-jsx-runtime.production.min.js
|
|
2132
|
+
var require_react_jsx_runtime_production_min = __commonJS({
|
|
2133
|
+
"node_modules/react/cjs/react-jsx-runtime.production.min.js"(exports) {
|
|
2134
|
+
"use strict";
|
|
2135
|
+
var f = require_react();
|
|
2136
|
+
var k = Symbol.for("react.element");
|
|
2137
|
+
var l = Symbol.for("react.fragment");
|
|
2138
|
+
var m = Object.prototype.hasOwnProperty;
|
|
2139
|
+
var n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner;
|
|
2140
|
+
var p = { key: true, ref: true, __self: true, __source: true };
|
|
2141
|
+
function q(c, a, g) {
|
|
2142
|
+
var b, d = {}, e = null, h = null;
|
|
2143
|
+
void 0 !== g && (e = "" + g);
|
|
2144
|
+
void 0 !== a.key && (e = "" + a.key);
|
|
2145
|
+
void 0 !== a.ref && (h = a.ref);
|
|
2146
|
+
for (b in a)
|
|
2147
|
+
m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
|
2148
|
+
if (c && c.defaultProps)
|
|
2149
|
+
for (b in a = c.defaultProps, a)
|
|
2150
|
+
void 0 === d[b] && (d[b] = a[b]);
|
|
2151
|
+
return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
|
|
2152
|
+
}
|
|
2153
|
+
exports.Fragment = l;
|
|
2154
|
+
exports.jsx = q;
|
|
2155
|
+
exports.jsxs = q;
|
|
2156
|
+
}
|
|
2157
|
+
});
|
|
2158
|
+
|
|
2159
|
+
// node_modules/react/cjs/react-jsx-runtime.development.js
|
|
2160
|
+
var require_react_jsx_runtime_development = __commonJS({
|
|
2161
|
+
"node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
|
|
2162
|
+
"use strict";
|
|
2163
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2164
|
+
(function() {
|
|
2165
|
+
"use strict";
|
|
2166
|
+
var React = require_react();
|
|
2167
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
|
2168
|
+
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
2169
|
+
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
2170
|
+
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
|
2171
|
+
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
2172
|
+
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
|
2173
|
+
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
|
2174
|
+
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
|
2175
|
+
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
|
2176
|
+
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
|
2177
|
+
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
2178
|
+
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
2179
|
+
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
|
2180
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
2181
|
+
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
2182
|
+
function getIteratorFn(maybeIterable) {
|
|
2183
|
+
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
|
2184
|
+
return null;
|
|
2185
|
+
}
|
|
2186
|
+
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
2187
|
+
if (typeof maybeIterator === "function") {
|
|
2188
|
+
return maybeIterator;
|
|
2189
|
+
}
|
|
2190
|
+
return null;
|
|
2191
|
+
}
|
|
2192
|
+
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
2193
|
+
function error(format) {
|
|
2194
|
+
{
|
|
2195
|
+
{
|
|
2196
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
2197
|
+
args[_key2 - 1] = arguments[_key2];
|
|
2198
|
+
}
|
|
2199
|
+
printWarning("error", format, args);
|
|
2200
|
+
}
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
function printWarning(level, format, args) {
|
|
2204
|
+
{
|
|
2205
|
+
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2206
|
+
var stack = ReactDebugCurrentFrame2.getStackAddendum();
|
|
2207
|
+
if (stack !== "") {
|
|
2208
|
+
format += "%s";
|
|
2209
|
+
args = args.concat([stack]);
|
|
2210
|
+
}
|
|
2211
|
+
var argsWithFormat = args.map(function(item) {
|
|
2212
|
+
return String(item);
|
|
2213
|
+
});
|
|
2214
|
+
argsWithFormat.unshift("Warning: " + format);
|
|
2215
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
var enableScopeAPI = false;
|
|
2219
|
+
var enableCacheElement = false;
|
|
2220
|
+
var enableTransitionTracing = false;
|
|
2221
|
+
var enableLegacyHidden = false;
|
|
2222
|
+
var enableDebugTracing = false;
|
|
2223
|
+
var REACT_MODULE_REFERENCE;
|
|
2224
|
+
{
|
|
2225
|
+
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
2226
|
+
}
|
|
2227
|
+
function isValidElementType(type) {
|
|
2228
|
+
if (typeof type === "string" || typeof type === "function") {
|
|
2229
|
+
return true;
|
|
2230
|
+
}
|
|
2231
|
+
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) {
|
|
2232
|
+
return true;
|
|
2233
|
+
}
|
|
2234
|
+
if (typeof type === "object" && type !== null) {
|
|
2235
|
+
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) {
|
|
2236
|
+
return true;
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
return false;
|
|
2240
|
+
}
|
|
2241
|
+
function getWrappedName(outerType, innerType, wrapperName) {
|
|
2242
|
+
var displayName = outerType.displayName;
|
|
2243
|
+
if (displayName) {
|
|
2244
|
+
return displayName;
|
|
2245
|
+
}
|
|
2246
|
+
var functionName = innerType.displayName || innerType.name || "";
|
|
2247
|
+
return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
2248
|
+
}
|
|
2249
|
+
function getContextName(type) {
|
|
2250
|
+
return type.displayName || "Context";
|
|
2251
|
+
}
|
|
2252
|
+
function getComponentNameFromType(type) {
|
|
2253
|
+
if (type == null) {
|
|
2254
|
+
return null;
|
|
2255
|
+
}
|
|
2256
|
+
{
|
|
2257
|
+
if (typeof type.tag === "number") {
|
|
2258
|
+
error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
|
|
2259
|
+
}
|
|
2260
|
+
}
|
|
2261
|
+
if (typeof type === "function") {
|
|
2262
|
+
return type.displayName || type.name || null;
|
|
2263
|
+
}
|
|
2264
|
+
if (typeof type === "string") {
|
|
2265
|
+
return type;
|
|
2266
|
+
}
|
|
2267
|
+
switch (type) {
|
|
2268
|
+
case REACT_FRAGMENT_TYPE:
|
|
2269
|
+
return "Fragment";
|
|
2270
|
+
case REACT_PORTAL_TYPE:
|
|
2271
|
+
return "Portal";
|
|
2272
|
+
case REACT_PROFILER_TYPE:
|
|
2273
|
+
return "Profiler";
|
|
2274
|
+
case REACT_STRICT_MODE_TYPE:
|
|
2275
|
+
return "StrictMode";
|
|
2276
|
+
case REACT_SUSPENSE_TYPE:
|
|
2277
|
+
return "Suspense";
|
|
2278
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
2279
|
+
return "SuspenseList";
|
|
2280
|
+
}
|
|
2281
|
+
if (typeof type === "object") {
|
|
2282
|
+
switch (type.$$typeof) {
|
|
2283
|
+
case REACT_CONTEXT_TYPE:
|
|
2284
|
+
var context = type;
|
|
2285
|
+
return getContextName(context) + ".Consumer";
|
|
2286
|
+
case REACT_PROVIDER_TYPE:
|
|
2287
|
+
var provider = type;
|
|
2288
|
+
return getContextName(provider._context) + ".Provider";
|
|
2289
|
+
case REACT_FORWARD_REF_TYPE:
|
|
2290
|
+
return getWrappedName(type, type.render, "ForwardRef");
|
|
2291
|
+
case REACT_MEMO_TYPE:
|
|
2292
|
+
var outerName = type.displayName || null;
|
|
2293
|
+
if (outerName !== null) {
|
|
2294
|
+
return outerName;
|
|
2295
|
+
}
|
|
2296
|
+
return getComponentNameFromType(type.type) || "Memo";
|
|
2297
|
+
case REACT_LAZY_TYPE: {
|
|
2298
|
+
var lazyComponent = type;
|
|
2299
|
+
var payload = lazyComponent._payload;
|
|
2300
|
+
var init = lazyComponent._init;
|
|
2301
|
+
try {
|
|
2302
|
+
return getComponentNameFromType(init(payload));
|
|
2303
|
+
} catch (x) {
|
|
2304
|
+
return null;
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
}
|
|
2308
|
+
}
|
|
2309
|
+
return null;
|
|
2310
|
+
}
|
|
2311
|
+
var assign = Object.assign;
|
|
2312
|
+
var disabledDepth = 0;
|
|
2313
|
+
var prevLog;
|
|
2314
|
+
var prevInfo;
|
|
2315
|
+
var prevWarn;
|
|
2316
|
+
var prevError;
|
|
2317
|
+
var prevGroup;
|
|
2318
|
+
var prevGroupCollapsed;
|
|
2319
|
+
var prevGroupEnd;
|
|
2320
|
+
function disabledLog() {
|
|
2321
|
+
}
|
|
2322
|
+
disabledLog.__reactDisabledLog = true;
|
|
2323
|
+
function disableLogs() {
|
|
2324
|
+
{
|
|
2325
|
+
if (disabledDepth === 0) {
|
|
2326
|
+
prevLog = console.log;
|
|
2327
|
+
prevInfo = console.info;
|
|
2328
|
+
prevWarn = console.warn;
|
|
2329
|
+
prevError = console.error;
|
|
2330
|
+
prevGroup = console.group;
|
|
2331
|
+
prevGroupCollapsed = console.groupCollapsed;
|
|
2332
|
+
prevGroupEnd = console.groupEnd;
|
|
2333
|
+
var props = {
|
|
2334
|
+
configurable: true,
|
|
2335
|
+
enumerable: true,
|
|
2336
|
+
value: disabledLog,
|
|
2337
|
+
writable: true
|
|
2338
|
+
};
|
|
2339
|
+
Object.defineProperties(console, {
|
|
2340
|
+
info: props,
|
|
2341
|
+
log: props,
|
|
2342
|
+
warn: props,
|
|
2343
|
+
error: props,
|
|
2344
|
+
group: props,
|
|
2345
|
+
groupCollapsed: props,
|
|
2346
|
+
groupEnd: props
|
|
2347
|
+
});
|
|
2348
|
+
}
|
|
2349
|
+
disabledDepth++;
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
function reenableLogs() {
|
|
2353
|
+
{
|
|
2354
|
+
disabledDepth--;
|
|
2355
|
+
if (disabledDepth === 0) {
|
|
2356
|
+
var props = {
|
|
2357
|
+
configurable: true,
|
|
2358
|
+
enumerable: true,
|
|
2359
|
+
writable: true
|
|
2360
|
+
};
|
|
2361
|
+
Object.defineProperties(console, {
|
|
2362
|
+
log: assign({}, props, {
|
|
2363
|
+
value: prevLog
|
|
2364
|
+
}),
|
|
2365
|
+
info: assign({}, props, {
|
|
2366
|
+
value: prevInfo
|
|
2367
|
+
}),
|
|
2368
|
+
warn: assign({}, props, {
|
|
2369
|
+
value: prevWarn
|
|
2370
|
+
}),
|
|
2371
|
+
error: assign({}, props, {
|
|
2372
|
+
value: prevError
|
|
2373
|
+
}),
|
|
2374
|
+
group: assign({}, props, {
|
|
2375
|
+
value: prevGroup
|
|
2376
|
+
}),
|
|
2377
|
+
groupCollapsed: assign({}, props, {
|
|
2378
|
+
value: prevGroupCollapsed
|
|
2379
|
+
}),
|
|
2380
|
+
groupEnd: assign({}, props, {
|
|
2381
|
+
value: prevGroupEnd
|
|
2382
|
+
})
|
|
2383
|
+
});
|
|
2384
|
+
}
|
|
2385
|
+
if (disabledDepth < 0) {
|
|
2386
|
+
error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
2391
|
+
var prefix;
|
|
2392
|
+
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
2393
|
+
{
|
|
2394
|
+
if (prefix === void 0) {
|
|
2395
|
+
try {
|
|
2396
|
+
throw Error();
|
|
2397
|
+
} catch (x) {
|
|
2398
|
+
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
2399
|
+
prefix = match && match[1] || "";
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
return "\n" + prefix + name;
|
|
2403
|
+
}
|
|
2404
|
+
}
|
|
2405
|
+
var reentry = false;
|
|
2406
|
+
var componentFrameCache;
|
|
2407
|
+
{
|
|
2408
|
+
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
|
2409
|
+
componentFrameCache = new PossiblyWeakMap();
|
|
2410
|
+
}
|
|
2411
|
+
function describeNativeComponentFrame(fn, construct) {
|
|
2412
|
+
if (!fn || reentry) {
|
|
2413
|
+
return "";
|
|
2414
|
+
}
|
|
2415
|
+
{
|
|
2416
|
+
var frame = componentFrameCache.get(fn);
|
|
2417
|
+
if (frame !== void 0) {
|
|
2418
|
+
return frame;
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
var control;
|
|
2422
|
+
reentry = true;
|
|
2423
|
+
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
2424
|
+
Error.prepareStackTrace = void 0;
|
|
2425
|
+
var previousDispatcher;
|
|
2426
|
+
{
|
|
2427
|
+
previousDispatcher = ReactCurrentDispatcher.current;
|
|
2428
|
+
ReactCurrentDispatcher.current = null;
|
|
2429
|
+
disableLogs();
|
|
2430
|
+
}
|
|
2431
|
+
try {
|
|
2432
|
+
if (construct) {
|
|
2433
|
+
var Fake = function() {
|
|
2434
|
+
throw Error();
|
|
2435
|
+
};
|
|
2436
|
+
Object.defineProperty(Fake.prototype, "props", {
|
|
2437
|
+
set: function() {
|
|
2438
|
+
throw Error();
|
|
2439
|
+
}
|
|
2440
|
+
});
|
|
2441
|
+
if (typeof Reflect === "object" && Reflect.construct) {
|
|
2442
|
+
try {
|
|
2443
|
+
Reflect.construct(Fake, []);
|
|
2444
|
+
} catch (x) {
|
|
2445
|
+
control = x;
|
|
2446
|
+
}
|
|
2447
|
+
Reflect.construct(fn, [], Fake);
|
|
2448
|
+
} else {
|
|
2449
|
+
try {
|
|
2450
|
+
Fake.call();
|
|
2451
|
+
} catch (x) {
|
|
2452
|
+
control = x;
|
|
2453
|
+
}
|
|
2454
|
+
fn.call(Fake.prototype);
|
|
2455
|
+
}
|
|
2456
|
+
} else {
|
|
2457
|
+
try {
|
|
2458
|
+
throw Error();
|
|
2459
|
+
} catch (x) {
|
|
2460
|
+
control = x;
|
|
2461
|
+
}
|
|
2462
|
+
fn();
|
|
2463
|
+
}
|
|
2464
|
+
} catch (sample) {
|
|
2465
|
+
if (sample && control && typeof sample.stack === "string") {
|
|
2466
|
+
var sampleLines = sample.stack.split("\n");
|
|
2467
|
+
var controlLines = control.stack.split("\n");
|
|
2468
|
+
var s = sampleLines.length - 1;
|
|
2469
|
+
var c = controlLines.length - 1;
|
|
2470
|
+
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
2471
|
+
c--;
|
|
2472
|
+
}
|
|
2473
|
+
for (; s >= 1 && c >= 0; s--, c--) {
|
|
2474
|
+
if (sampleLines[s] !== controlLines[c]) {
|
|
2475
|
+
if (s !== 1 || c !== 1) {
|
|
2476
|
+
do {
|
|
2477
|
+
s--;
|
|
2478
|
+
c--;
|
|
2479
|
+
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
2480
|
+
var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
|
|
2481
|
+
if (fn.displayName && _frame.includes("<anonymous>")) {
|
|
2482
|
+
_frame = _frame.replace("<anonymous>", fn.displayName);
|
|
2483
|
+
}
|
|
2484
|
+
{
|
|
2485
|
+
if (typeof fn === "function") {
|
|
2486
|
+
componentFrameCache.set(fn, _frame);
|
|
2487
|
+
}
|
|
2488
|
+
}
|
|
2489
|
+
return _frame;
|
|
2490
|
+
}
|
|
2491
|
+
} while (s >= 1 && c >= 0);
|
|
2492
|
+
}
|
|
2493
|
+
break;
|
|
2494
|
+
}
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
} finally {
|
|
2498
|
+
reentry = false;
|
|
2499
|
+
{
|
|
2500
|
+
ReactCurrentDispatcher.current = previousDispatcher;
|
|
2501
|
+
reenableLogs();
|
|
2502
|
+
}
|
|
2503
|
+
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
2504
|
+
}
|
|
2505
|
+
var name = fn ? fn.displayName || fn.name : "";
|
|
2506
|
+
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
|
2507
|
+
{
|
|
2508
|
+
if (typeof fn === "function") {
|
|
2509
|
+
componentFrameCache.set(fn, syntheticFrame);
|
|
2510
|
+
}
|
|
2511
|
+
}
|
|
2512
|
+
return syntheticFrame;
|
|
2513
|
+
}
|
|
2514
|
+
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
2515
|
+
{
|
|
2516
|
+
return describeNativeComponentFrame(fn, false);
|
|
2517
|
+
}
|
|
2518
|
+
}
|
|
2519
|
+
function shouldConstruct(Component) {
|
|
2520
|
+
var prototype = Component.prototype;
|
|
2521
|
+
return !!(prototype && prototype.isReactComponent);
|
|
2522
|
+
}
|
|
2523
|
+
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
2524
|
+
if (type == null) {
|
|
2525
|
+
return "";
|
|
2526
|
+
}
|
|
2527
|
+
if (typeof type === "function") {
|
|
2528
|
+
{
|
|
2529
|
+
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
if (typeof type === "string") {
|
|
2533
|
+
return describeBuiltInComponentFrame(type);
|
|
2534
|
+
}
|
|
2535
|
+
switch (type) {
|
|
2536
|
+
case REACT_SUSPENSE_TYPE:
|
|
2537
|
+
return describeBuiltInComponentFrame("Suspense");
|
|
2538
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
2539
|
+
return describeBuiltInComponentFrame("SuspenseList");
|
|
2540
|
+
}
|
|
2541
|
+
if (typeof type === "object") {
|
|
2542
|
+
switch (type.$$typeof) {
|
|
2543
|
+
case REACT_FORWARD_REF_TYPE:
|
|
2544
|
+
return describeFunctionComponentFrame(type.render);
|
|
2545
|
+
case REACT_MEMO_TYPE:
|
|
2546
|
+
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
2547
|
+
case REACT_LAZY_TYPE: {
|
|
2548
|
+
var lazyComponent = type;
|
|
2549
|
+
var payload = lazyComponent._payload;
|
|
2550
|
+
var init = lazyComponent._init;
|
|
2551
|
+
try {
|
|
2552
|
+
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
2553
|
+
} catch (x) {
|
|
2554
|
+
}
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
}
|
|
2558
|
+
return "";
|
|
2559
|
+
}
|
|
2560
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2561
|
+
var loggedTypeFailures = {};
|
|
2562
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2563
|
+
function setCurrentlyValidatingElement(element) {
|
|
2564
|
+
{
|
|
2565
|
+
if (element) {
|
|
2566
|
+
var owner = element._owner;
|
|
2567
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
2568
|
+
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
2569
|
+
} else {
|
|
2570
|
+
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
2571
|
+
}
|
|
2572
|
+
}
|
|
2573
|
+
}
|
|
2574
|
+
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
2575
|
+
{
|
|
2576
|
+
var has = Function.call.bind(hasOwnProperty);
|
|
2577
|
+
for (var typeSpecName in typeSpecs) {
|
|
2578
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
2579
|
+
var error$1 = void 0;
|
|
2580
|
+
try {
|
|
2581
|
+
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
2582
|
+
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`.");
|
|
2583
|
+
err.name = "Invariant Violation";
|
|
2584
|
+
throw err;
|
|
2585
|
+
}
|
|
2586
|
+
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
2587
|
+
} catch (ex) {
|
|
2588
|
+
error$1 = ex;
|
|
2589
|
+
}
|
|
2590
|
+
if (error$1 && !(error$1 instanceof Error)) {
|
|
2591
|
+
setCurrentlyValidatingElement(element);
|
|
2592
|
+
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);
|
|
2593
|
+
setCurrentlyValidatingElement(null);
|
|
2594
|
+
}
|
|
2595
|
+
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
2596
|
+
loggedTypeFailures[error$1.message] = true;
|
|
2597
|
+
setCurrentlyValidatingElement(element);
|
|
2598
|
+
error("Failed %s type: %s", location, error$1.message);
|
|
2599
|
+
setCurrentlyValidatingElement(null);
|
|
2600
|
+
}
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
}
|
|
2604
|
+
}
|
|
2605
|
+
var isArrayImpl = Array.isArray;
|
|
2606
|
+
function isArray(a) {
|
|
2607
|
+
return isArrayImpl(a);
|
|
2608
|
+
}
|
|
2609
|
+
function typeName(value) {
|
|
2610
|
+
{
|
|
2611
|
+
var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
|
|
2612
|
+
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
2613
|
+
return type;
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2616
|
+
function willCoercionThrow(value) {
|
|
2617
|
+
{
|
|
2618
|
+
try {
|
|
2619
|
+
testStringCoercion(value);
|
|
2620
|
+
return false;
|
|
2621
|
+
} catch (e) {
|
|
2622
|
+
return true;
|
|
2623
|
+
}
|
|
2624
|
+
}
|
|
2625
|
+
}
|
|
2626
|
+
function testStringCoercion(value) {
|
|
2627
|
+
return "" + value;
|
|
2628
|
+
}
|
|
2629
|
+
function checkKeyStringCoercion(value) {
|
|
2630
|
+
{
|
|
2631
|
+
if (willCoercionThrow(value)) {
|
|
2632
|
+
error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
|
|
2633
|
+
return testStringCoercion(value);
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2636
|
+
}
|
|
2637
|
+
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
2638
|
+
var RESERVED_PROPS = {
|
|
2639
|
+
key: true,
|
|
2640
|
+
ref: true,
|
|
2641
|
+
__self: true,
|
|
2642
|
+
__source: true
|
|
2643
|
+
};
|
|
2644
|
+
var specialPropKeyWarningShown;
|
|
2645
|
+
var specialPropRefWarningShown;
|
|
2646
|
+
var didWarnAboutStringRefs;
|
|
2647
|
+
{
|
|
2648
|
+
didWarnAboutStringRefs = {};
|
|
2649
|
+
}
|
|
2650
|
+
function hasValidRef(config) {
|
|
2651
|
+
{
|
|
2652
|
+
if (hasOwnProperty.call(config, "ref")) {
|
|
2653
|
+
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
|
|
2654
|
+
if (getter && getter.isReactWarning) {
|
|
2655
|
+
return false;
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
}
|
|
2659
|
+
return config.ref !== void 0;
|
|
2660
|
+
}
|
|
2661
|
+
function hasValidKey(config) {
|
|
2662
|
+
{
|
|
2663
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
2664
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
2665
|
+
if (getter && getter.isReactWarning) {
|
|
2666
|
+
return false;
|
|
2667
|
+
}
|
|
2668
|
+
}
|
|
2669
|
+
}
|
|
2670
|
+
return config.key !== void 0;
|
|
2671
|
+
}
|
|
2672
|
+
function warnIfStringRefCannotBeAutoConverted(config, self2) {
|
|
2673
|
+
{
|
|
2674
|
+
if (typeof config.ref === "string" && ReactCurrentOwner.current && self2 && ReactCurrentOwner.current.stateNode !== self2) {
|
|
2675
|
+
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
2676
|
+
if (!didWarnAboutStringRefs[componentName]) {
|
|
2677
|
+
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);
|
|
2678
|
+
didWarnAboutStringRefs[componentName] = true;
|
|
2679
|
+
}
|
|
2680
|
+
}
|
|
2681
|
+
}
|
|
2682
|
+
}
|
|
2683
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
2684
|
+
{
|
|
2685
|
+
var warnAboutAccessingKey = function() {
|
|
2686
|
+
if (!specialPropKeyWarningShown) {
|
|
2687
|
+
specialPropKeyWarningShown = true;
|
|
2688
|
+
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);
|
|
2689
|
+
}
|
|
2690
|
+
};
|
|
2691
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
2692
|
+
Object.defineProperty(props, "key", {
|
|
2693
|
+
get: warnAboutAccessingKey,
|
|
2694
|
+
configurable: true
|
|
2695
|
+
});
|
|
2696
|
+
}
|
|
2697
|
+
}
|
|
2698
|
+
function defineRefPropWarningGetter(props, displayName) {
|
|
2699
|
+
{
|
|
2700
|
+
var warnAboutAccessingRef = function() {
|
|
2701
|
+
if (!specialPropRefWarningShown) {
|
|
2702
|
+
specialPropRefWarningShown = true;
|
|
2703
|
+
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);
|
|
2704
|
+
}
|
|
2705
|
+
};
|
|
2706
|
+
warnAboutAccessingRef.isReactWarning = true;
|
|
2707
|
+
Object.defineProperty(props, "ref", {
|
|
2708
|
+
get: warnAboutAccessingRef,
|
|
2709
|
+
configurable: true
|
|
2710
|
+
});
|
|
2711
|
+
}
|
|
2712
|
+
}
|
|
2713
|
+
var ReactElement = function(type, key, ref, self2, source, owner, props) {
|
|
2714
|
+
var element = {
|
|
2715
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
2716
|
+
type,
|
|
2717
|
+
key,
|
|
2718
|
+
ref,
|
|
2719
|
+
props,
|
|
2720
|
+
_owner: owner
|
|
2721
|
+
};
|
|
2722
|
+
{
|
|
2723
|
+
element._store = {};
|
|
2724
|
+
Object.defineProperty(element._store, "validated", {
|
|
2725
|
+
configurable: false,
|
|
2726
|
+
enumerable: false,
|
|
2727
|
+
writable: true,
|
|
2728
|
+
value: false
|
|
2729
|
+
});
|
|
2730
|
+
Object.defineProperty(element, "_self", {
|
|
2731
|
+
configurable: false,
|
|
2732
|
+
enumerable: false,
|
|
2733
|
+
writable: false,
|
|
2734
|
+
value: self2
|
|
2735
|
+
});
|
|
2736
|
+
Object.defineProperty(element, "_source", {
|
|
2737
|
+
configurable: false,
|
|
2738
|
+
enumerable: false,
|
|
2739
|
+
writable: false,
|
|
2740
|
+
value: source
|
|
2741
|
+
});
|
|
2742
|
+
if (Object.freeze) {
|
|
2743
|
+
Object.freeze(element.props);
|
|
2744
|
+
Object.freeze(element);
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
return element;
|
|
2748
|
+
};
|
|
2749
|
+
function jsxDEV(type, config, maybeKey, source, self2) {
|
|
2750
|
+
{
|
|
2751
|
+
var propName;
|
|
2752
|
+
var props = {};
|
|
2753
|
+
var key = null;
|
|
2754
|
+
var ref = null;
|
|
2755
|
+
if (maybeKey !== void 0) {
|
|
2756
|
+
{
|
|
2757
|
+
checkKeyStringCoercion(maybeKey);
|
|
2758
|
+
}
|
|
2759
|
+
key = "" + maybeKey;
|
|
2760
|
+
}
|
|
2761
|
+
if (hasValidKey(config)) {
|
|
2762
|
+
{
|
|
2763
|
+
checkKeyStringCoercion(config.key);
|
|
2764
|
+
}
|
|
2765
|
+
key = "" + config.key;
|
|
2766
|
+
}
|
|
2767
|
+
if (hasValidRef(config)) {
|
|
2768
|
+
ref = config.ref;
|
|
2769
|
+
warnIfStringRefCannotBeAutoConverted(config, self2);
|
|
2770
|
+
}
|
|
2771
|
+
for (propName in config) {
|
|
2772
|
+
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
2773
|
+
props[propName] = config[propName];
|
|
2774
|
+
}
|
|
2775
|
+
}
|
|
2776
|
+
if (type && type.defaultProps) {
|
|
2777
|
+
var defaultProps = type.defaultProps;
|
|
2778
|
+
for (propName in defaultProps) {
|
|
2779
|
+
if (props[propName] === void 0) {
|
|
2780
|
+
props[propName] = defaultProps[propName];
|
|
2781
|
+
}
|
|
2782
|
+
}
|
|
2783
|
+
}
|
|
2784
|
+
if (key || ref) {
|
|
2785
|
+
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
|
|
2786
|
+
if (key) {
|
|
2787
|
+
defineKeyPropWarningGetter(props, displayName);
|
|
2788
|
+
}
|
|
2789
|
+
if (ref) {
|
|
2790
|
+
defineRefPropWarningGetter(props, displayName);
|
|
2791
|
+
}
|
|
2792
|
+
}
|
|
2793
|
+
return ReactElement(type, key, ref, self2, source, ReactCurrentOwner.current, props);
|
|
2794
|
+
}
|
|
2795
|
+
}
|
|
2796
|
+
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
2797
|
+
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2798
|
+
function setCurrentlyValidatingElement$1(element) {
|
|
2799
|
+
{
|
|
2800
|
+
if (element) {
|
|
2801
|
+
var owner = element._owner;
|
|
2802
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
2803
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
2804
|
+
} else {
|
|
2805
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
2806
|
+
}
|
|
2807
|
+
}
|
|
2808
|
+
}
|
|
2809
|
+
var propTypesMisspellWarningShown;
|
|
2810
|
+
{
|
|
2811
|
+
propTypesMisspellWarningShown = false;
|
|
2812
|
+
}
|
|
2813
|
+
function isValidElement(object) {
|
|
2814
|
+
{
|
|
2815
|
+
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
2816
|
+
}
|
|
2817
|
+
}
|
|
2818
|
+
function getDeclarationErrorAddendum() {
|
|
2819
|
+
{
|
|
2820
|
+
if (ReactCurrentOwner$1.current) {
|
|
2821
|
+
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
2822
|
+
if (name) {
|
|
2823
|
+
return "\n\nCheck the render method of `" + name + "`.";
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
return "";
|
|
2827
|
+
}
|
|
2828
|
+
}
|
|
2829
|
+
function getSourceInfoErrorAddendum(source) {
|
|
2830
|
+
{
|
|
2831
|
+
if (source !== void 0) {
|
|
2832
|
+
var fileName = source.fileName.replace(/^.*[\\\/]/, "");
|
|
2833
|
+
var lineNumber = source.lineNumber;
|
|
2834
|
+
return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
|
|
2835
|
+
}
|
|
2836
|
+
return "";
|
|
2837
|
+
}
|
|
2838
|
+
}
|
|
2839
|
+
var ownerHasKeyUseWarning = {};
|
|
2840
|
+
function getCurrentComponentErrorInfo(parentType) {
|
|
2841
|
+
{
|
|
2842
|
+
var info = getDeclarationErrorAddendum();
|
|
2843
|
+
if (!info) {
|
|
2844
|
+
var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
|
|
2845
|
+
if (parentName) {
|
|
2846
|
+
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
2847
|
+
}
|
|
2848
|
+
}
|
|
2849
|
+
return info;
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2852
|
+
function validateExplicitKey(element, parentType) {
|
|
2853
|
+
{
|
|
2854
|
+
if (!element._store || element._store.validated || element.key != null) {
|
|
2855
|
+
return;
|
|
2856
|
+
}
|
|
2857
|
+
element._store.validated = true;
|
|
2858
|
+
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
2859
|
+
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
2860
|
+
return;
|
|
2861
|
+
}
|
|
2862
|
+
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
|
2863
|
+
var childOwner = "";
|
|
2864
|
+
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
2865
|
+
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
2866
|
+
}
|
|
2867
|
+
setCurrentlyValidatingElement$1(element);
|
|
2868
|
+
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);
|
|
2869
|
+
setCurrentlyValidatingElement$1(null);
|
|
2870
|
+
}
|
|
2871
|
+
}
|
|
2872
|
+
function validateChildKeys(node, parentType) {
|
|
2873
|
+
{
|
|
2874
|
+
if (typeof node !== "object") {
|
|
2875
|
+
return;
|
|
2876
|
+
}
|
|
2877
|
+
if (isArray(node)) {
|
|
2878
|
+
for (var i = 0; i < node.length; i++) {
|
|
2879
|
+
var child = node[i];
|
|
2880
|
+
if (isValidElement(child)) {
|
|
2881
|
+
validateExplicitKey(child, parentType);
|
|
2882
|
+
}
|
|
2883
|
+
}
|
|
2884
|
+
} else if (isValidElement(node)) {
|
|
2885
|
+
if (node._store) {
|
|
2886
|
+
node._store.validated = true;
|
|
2887
|
+
}
|
|
2888
|
+
} else if (node) {
|
|
2889
|
+
var iteratorFn = getIteratorFn(node);
|
|
2890
|
+
if (typeof iteratorFn === "function") {
|
|
2891
|
+
if (iteratorFn !== node.entries) {
|
|
2892
|
+
var iterator = iteratorFn.call(node);
|
|
2893
|
+
var step;
|
|
2894
|
+
while (!(step = iterator.next()).done) {
|
|
2895
|
+
if (isValidElement(step.value)) {
|
|
2896
|
+
validateExplicitKey(step.value, parentType);
|
|
2897
|
+
}
|
|
2898
|
+
}
|
|
2899
|
+
}
|
|
2900
|
+
}
|
|
2901
|
+
}
|
|
2902
|
+
}
|
|
2903
|
+
}
|
|
2904
|
+
function validatePropTypes(element) {
|
|
2905
|
+
{
|
|
2906
|
+
var type = element.type;
|
|
2907
|
+
if (type === null || type === void 0 || typeof type === "string") {
|
|
2908
|
+
return;
|
|
2909
|
+
}
|
|
2910
|
+
var propTypes;
|
|
2911
|
+
if (typeof type === "function") {
|
|
2912
|
+
propTypes = type.propTypes;
|
|
2913
|
+
} else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MEMO_TYPE)) {
|
|
2914
|
+
propTypes = type.propTypes;
|
|
2915
|
+
} else {
|
|
2916
|
+
return;
|
|
2917
|
+
}
|
|
2918
|
+
if (propTypes) {
|
|
2919
|
+
var name = getComponentNameFromType(type);
|
|
2920
|
+
checkPropTypes(propTypes, element.props, "prop", name, element);
|
|
2921
|
+
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
|
2922
|
+
propTypesMisspellWarningShown = true;
|
|
2923
|
+
var _name = getComponentNameFromType(type);
|
|
2924
|
+
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
|
2925
|
+
}
|
|
2926
|
+
if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
|
|
2927
|
+
error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
2928
|
+
}
|
|
2929
|
+
}
|
|
2930
|
+
}
|
|
2931
|
+
function validateFragmentProps(fragment) {
|
|
2932
|
+
{
|
|
2933
|
+
var keys = Object.keys(fragment.props);
|
|
2934
|
+
for (var i = 0; i < keys.length; i++) {
|
|
2935
|
+
var key = keys[i];
|
|
2936
|
+
if (key !== "children" && key !== "key") {
|
|
2937
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
2938
|
+
error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
|
|
2939
|
+
setCurrentlyValidatingElement$1(null);
|
|
2940
|
+
break;
|
|
2941
|
+
}
|
|
2942
|
+
}
|
|
2943
|
+
if (fragment.ref !== null) {
|
|
2944
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
2945
|
+
error("Invalid attribute `ref` supplied to `React.Fragment`.");
|
|
2946
|
+
setCurrentlyValidatingElement$1(null);
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
}
|
|
2950
|
+
function jsxWithValidation(type, props, key, isStaticChildren, source, self2) {
|
|
2951
|
+
{
|
|
2952
|
+
var validType = isValidElementType(type);
|
|
2953
|
+
if (!validType) {
|
|
2954
|
+
var info = "";
|
|
2955
|
+
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
|
2956
|
+
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.";
|
|
2957
|
+
}
|
|
2958
|
+
var sourceInfo = getSourceInfoErrorAddendum(source);
|
|
2959
|
+
if (sourceInfo) {
|
|
2960
|
+
info += sourceInfo;
|
|
2961
|
+
} else {
|
|
2962
|
+
info += getDeclarationErrorAddendum();
|
|
2963
|
+
}
|
|
2964
|
+
var typeString;
|
|
2965
|
+
if (type === null) {
|
|
2966
|
+
typeString = "null";
|
|
2967
|
+
} else if (isArray(type)) {
|
|
2968
|
+
typeString = "array";
|
|
2969
|
+
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
2970
|
+
typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
|
|
2971
|
+
info = " Did you accidentally export a JSX literal instead of a component?";
|
|
2972
|
+
} else {
|
|
2973
|
+
typeString = typeof type;
|
|
2974
|
+
}
|
|
2975
|
+
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);
|
|
2976
|
+
}
|
|
2977
|
+
var element = jsxDEV(type, props, key, source, self2);
|
|
2978
|
+
if (element == null) {
|
|
2979
|
+
return element;
|
|
2980
|
+
}
|
|
2981
|
+
if (validType) {
|
|
2982
|
+
var children = props.children;
|
|
2983
|
+
if (children !== void 0) {
|
|
2984
|
+
if (isStaticChildren) {
|
|
2985
|
+
if (isArray(children)) {
|
|
2986
|
+
for (var i = 0; i < children.length; i++) {
|
|
2987
|
+
validateChildKeys(children[i], type);
|
|
2988
|
+
}
|
|
2989
|
+
if (Object.freeze) {
|
|
2990
|
+
Object.freeze(children);
|
|
2991
|
+
}
|
|
2992
|
+
} else {
|
|
2993
|
+
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.");
|
|
2994
|
+
}
|
|
2995
|
+
} else {
|
|
2996
|
+
validateChildKeys(children, type);
|
|
2997
|
+
}
|
|
2998
|
+
}
|
|
2999
|
+
}
|
|
3000
|
+
if (type === REACT_FRAGMENT_TYPE) {
|
|
3001
|
+
validateFragmentProps(element);
|
|
3002
|
+
} else {
|
|
3003
|
+
validatePropTypes(element);
|
|
3004
|
+
}
|
|
3005
|
+
return element;
|
|
3006
|
+
}
|
|
3007
|
+
}
|
|
3008
|
+
function jsxWithValidationStatic(type, props, key) {
|
|
3009
|
+
{
|
|
3010
|
+
return jsxWithValidation(type, props, key, true);
|
|
3011
|
+
}
|
|
3012
|
+
}
|
|
3013
|
+
function jsxWithValidationDynamic(type, props, key) {
|
|
3014
|
+
{
|
|
3015
|
+
return jsxWithValidation(type, props, key, false);
|
|
3016
|
+
}
|
|
3017
|
+
}
|
|
3018
|
+
var jsx18 = jsxWithValidationDynamic;
|
|
3019
|
+
var jsxs3 = jsxWithValidationStatic;
|
|
3020
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
3021
|
+
exports.jsx = jsx18;
|
|
3022
|
+
exports.jsxs = jsxs3;
|
|
3023
|
+
})();
|
|
3024
|
+
}
|
|
3025
|
+
}
|
|
3026
|
+
});
|
|
3027
|
+
|
|
3028
|
+
// node_modules/react/jsx-runtime.js
|
|
3029
|
+
var require_jsx_runtime = __commonJS({
|
|
3030
|
+
"node_modules/react/jsx-runtime.js"(exports, module2) {
|
|
3031
|
+
"use strict";
|
|
3032
|
+
if (process.env.NODE_ENV === "production") {
|
|
3033
|
+
module2.exports = require_react_jsx_runtime_production_min();
|
|
3034
|
+
} else {
|
|
3035
|
+
module2.exports = require_react_jsx_runtime_development();
|
|
3036
|
+
}
|
|
3037
|
+
}
|
|
3038
|
+
});
|
|
3039
|
+
|
|
2131
3040
|
// node_modules/lodash._objecttypes/index.js
|
|
2132
3041
|
var require_lodash = __commonJS({
|
|
2133
3042
|
"node_modules/lodash._objecttypes/index.js"(exports, module2) {
|
|
@@ -8227,6 +9136,9 @@ var import_intrinsic_jsx = require("@tscircuit/react-fiber/dist/types/intrinsic-
|
|
|
8227
9136
|
// src/Schematic.tsx
|
|
8228
9137
|
var import_react2 = __toESM(require_react());
|
|
8229
9138
|
|
|
9139
|
+
// src/schematic-components/MovableGrid/index.tsx
|
|
9140
|
+
var import_jsx_runtime = __toESM(require_jsx_runtime());
|
|
9141
|
+
|
|
8230
9142
|
// src/lib/render-context/index.ts
|
|
8231
9143
|
var import_zustand = __toESM(require("zustand"));
|
|
8232
9144
|
var import_transformation_matrix = require("transformation-matrix");
|
|
@@ -8256,6 +9168,7 @@ var get_svg_path_bounds_default = getSVGPathBounds;
|
|
|
8256
9168
|
|
|
8257
9169
|
// src/schematic-components/SVGPathComponent.tsx
|
|
8258
9170
|
var import_transformation_matrix2 = require("transformation-matrix");
|
|
9171
|
+
var import_jsx_runtime2 = __toESM(require_jsx_runtime());
|
|
8259
9172
|
var SVGPathComponent = ({ size, center, rotation, paths }) => {
|
|
8260
9173
|
const ct = useCameraTransform();
|
|
8261
9174
|
const pathBounds = get_svg_path_bounds_default(paths.map((p) => p.d));
|
|
@@ -8272,36 +9185,60 @@ var SVGPathComponent = ({ size, center, rotation, paths }) => {
|
|
|
8272
9185
|
width: Math.max(1, size.width * ct.a),
|
|
8273
9186
|
height: Math.max(1, size.height * ct.d)
|
|
8274
9187
|
};
|
|
8275
|
-
return
|
|
8276
|
-
|
|
8277
|
-
|
|
8278
|
-
|
|
8279
|
-
|
|
8280
|
-
|
|
9188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", {
|
|
9189
|
+
style: {
|
|
9190
|
+
position: "absolute",
|
|
9191
|
+
transform: rotation === 0 ? "" : `rotate(${rotation}rad)`,
|
|
9192
|
+
left: absoluteCenter.x - absoluteSize.width / 2,
|
|
9193
|
+
top: absoluteCenter.y - absoluteSize.height / 2
|
|
9194
|
+
},
|
|
9195
|
+
overflow: "visible",
|
|
9196
|
+
width: absoluteSize.width,
|
|
9197
|
+
height: absoluteSize.height,
|
|
9198
|
+
viewBox: `${pathBounds.minX} ${pathBounds.minY} ${pathBounds.width} ${pathBounds.height}`,
|
|
9199
|
+
children: paths.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", {
|
|
9200
|
+
fill: "none",
|
|
9201
|
+
strokeWidth: 2 * (p.strokeWidth || 1),
|
|
9202
|
+
stroke: p.stroke || "red",
|
|
9203
|
+
d: p.d
|
|
9204
|
+
}, i))
|
|
9205
|
+
});
|
|
8281
9206
|
};
|
|
8282
9207
|
var SVGPathComponent_default = SVGPathComponent;
|
|
8283
9208
|
|
|
8284
9209
|
// src/schematic-components/SimpleResistor.tsx
|
|
9210
|
+
var import_jsx_runtime3 = __toESM(require_jsx_runtime());
|
|
8285
9211
|
var SimpleResistor = ({ component: { source, schematic } }) => {
|
|
8286
|
-
return
|
|
8287
|
-
|
|
8288
|
-
|
|
8289
|
-
|
|
8290
|
-
|
|
8291
|
-
|
|
8292
|
-
|
|
9212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SVGPathComponent_default, {
|
|
9213
|
+
rotation: schematic.rotation,
|
|
9214
|
+
center: schematic.center,
|
|
9215
|
+
size: schematic.size,
|
|
9216
|
+
paths: [
|
|
9217
|
+
{
|
|
9218
|
+
stroke: "red",
|
|
9219
|
+
strokeWidth: 1,
|
|
9220
|
+
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"
|
|
9221
|
+
}
|
|
9222
|
+
]
|
|
9223
|
+
});
|
|
8293
9224
|
};
|
|
8294
9225
|
|
|
8295
9226
|
// src/schematic-components/SimpleCapacitor.tsx
|
|
9227
|
+
var import_jsx_runtime4 = __toESM(require_jsx_runtime());
|
|
8296
9228
|
var SimpleCapacitor = ({
|
|
8297
9229
|
component: { source, schematic }
|
|
8298
9230
|
}) => {
|
|
8299
|
-
return
|
|
8300
|
-
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
9231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SVGPathComponent_default, {
|
|
9232
|
+
rotation: schematic.rotation,
|
|
9233
|
+
center: schematic.center,
|
|
9234
|
+
size: schematic.size,
|
|
9235
|
+
paths: [
|
|
9236
|
+
{ stroke: "red", strokeWidth: 1, d: "M 0 15 l 12 0" },
|
|
9237
|
+
{ stroke: "red", strokeWidth: 2, d: "M 12 0 l 0 30" },
|
|
9238
|
+
{ stroke: "red", strokeWidth: 2, d: "M 18 0 l 0 30" },
|
|
9239
|
+
{ stroke: "red", strokeWidth: 1, d: "M 18 15 l 12 0" }
|
|
9240
|
+
]
|
|
9241
|
+
});
|
|
8305
9242
|
};
|
|
8306
9243
|
|
|
8307
9244
|
// src/lib/hooks/use-maybe-promise.ts
|
|
@@ -8320,64 +9257,94 @@ var useMaybePromise = (promise) => {
|
|
|
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
|
|
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
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
|
|
8333
|
-
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
|
|
8338
|
-
),
|
|
8339
|
-
|
|
8340
|
-
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
|
|
8344
|
-
|
|
8345
|
-
|
|
8346
|
-
|
|
8347
|
-
|
|
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
|
|
9307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SimpleResistor, {
|
|
9308
|
+
component: { source, schematic }
|
|
9309
|
+
});
|
|
8357
9310
|
}
|
|
8358
9311
|
case "simple_capacitor": {
|
|
8359
|
-
return
|
|
9312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SimpleCapacitor, {
|
|
9313
|
+
component: { source, schematic }
|
|
9314
|
+
});
|
|
8360
9315
|
}
|
|
8361
9316
|
case "simple_power_source": {
|
|
8362
|
-
return
|
|
9317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SimplePowerSource, {
|
|
9318
|
+
component: { source, schematic }
|
|
9319
|
+
});
|
|
8363
9320
|
}
|
|
8364
9321
|
case "simple_ground": {
|
|
8365
|
-
return
|
|
9322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SimpleGround, {
|
|
9323
|
+
component: { source, schematic }
|
|
9324
|
+
});
|
|
8366
9325
|
}
|
|
8367
9326
|
case "simple_inductor": {
|
|
8368
|
-
return
|
|
9327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SimpleInductor, {
|
|
9328
|
+
component: { source, schematic }
|
|
9329
|
+
});
|
|
8369
9330
|
}
|
|
8370
9331
|
case "simple_bug": {
|
|
8371
|
-
return
|
|
9332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SchematicBug, {
|
|
9333
|
+
component: { source, schematic }
|
|
9334
|
+
});
|
|
8372
9335
|
}
|
|
8373
9336
|
case "simple_diode": {
|
|
8374
|
-
return
|
|
9337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SimpleDiode, {
|
|
9338
|
+
component: { source, schematic }
|
|
9339
|
+
});
|
|
8375
9340
|
}
|
|
8376
9341
|
default: {
|
|
8377
|
-
return
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
|
|
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
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
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
|
|
8432
|
-
|
|
8433
|
-
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
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
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
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
|
|
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
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
|
|
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
|
|
8495
|
-
|
|
8496
|
-
|
|
8497
|
-
|
|
8498
|
-
|
|
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 ${
|
|
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
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
|
|
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
|
|
8534
|
-
|
|
8535
|
-
|
|
8536
|
-
|
|
8537
|
-
|
|
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
|
|
8545
|
-
|
|
8546
|
-
|
|
8547
|
-
|
|
8548
|
-
|
|
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
|
|
8556
|
-
|
|
8557
|
-
|
|
8558
|
-
|
|
8559
|
-
|
|
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,15 +9606,41 @@ var Schematic = ({
|
|
|
8585
9606
|
}, [children]);
|
|
8586
9607
|
if (elements.length === 0)
|
|
8587
9608
|
return null;
|
|
8588
|
-
return
|
|
9609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ProjectComponent, {
|
|
9610
|
+
project
|
|
9611
|
+
});
|
|
8589
9612
|
};
|
|
8590
9613
|
|
|
8591
9614
|
// src/pages/index.tsx
|
|
9615
|
+
var import_jsx_runtime17 = __toESM(require_jsx_runtime());
|
|
8592
9616
|
var pages_default = () => {
|
|
8593
|
-
return
|
|
9617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Schematic, {
|
|
9618
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("resistor", {
|
|
9619
|
+
name: "R1",
|
|
9620
|
+
resistance: "10 ohm"
|
|
9621
|
+
})
|
|
9622
|
+
});
|
|
8594
9623
|
};
|
|
8595
9624
|
// Annotate the CommonJS export names for ESM import in node:
|
|
8596
9625
|
0 && (module.exports = {});
|
|
9626
|
+
/**
|
|
9627
|
+
* @license React
|
|
9628
|
+
* react-jsx-runtime.development.js
|
|
9629
|
+
*
|
|
9630
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9631
|
+
*
|
|
9632
|
+
* This source code is licensed under the MIT license found in the
|
|
9633
|
+
* LICENSE file in the root directory of this source tree.
|
|
9634
|
+
*/
|
|
9635
|
+
/**
|
|
9636
|
+
* @license React
|
|
9637
|
+
* react-jsx-runtime.production.min.js
|
|
9638
|
+
*
|
|
9639
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9640
|
+
*
|
|
9641
|
+
* This source code is licensed under the MIT license found in the
|
|
9642
|
+
* LICENSE file in the root directory of this source tree.
|
|
9643
|
+
*/
|
|
8597
9644
|
/**
|
|
8598
9645
|
* @license React
|
|
8599
9646
|
* react.development.js
|