schematex 0.6.7 → 0.6.9
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/README.md +101 -6
- package/README.zh-CN.md +783 -0
- package/dist/ai/ai-sdk.cjs +8 -8
- package/dist/ai/ai-sdk.d.cts +1 -1
- package/dist/ai/ai-sdk.d.ts +1 -1
- package/dist/ai/ai-sdk.js +3 -3
- package/dist/ai/index.cjs +14 -14
- package/dist/ai/index.js +3 -3
- package/dist/browser.cjs +9 -9
- package/dist/browser.js +3 -3
- package/dist/{chunk-WK36Z63Y.cjs → chunk-25TO5A4F.cjs} +5 -5
- package/dist/{chunk-WK36Z63Y.cjs.map → chunk-25TO5A4F.cjs.map} +1 -1
- package/dist/{chunk-WAKRRGAV.js → chunk-2TUZ3QJA.js} +110 -2
- package/dist/chunk-2TUZ3QJA.js.map +1 -0
- package/dist/{chunk-TRUJ4Q6V.js → chunk-3DPWFWQU.js} +41 -12
- package/dist/{chunk-TRUJ4Q6V.js.map → chunk-3DPWFWQU.js.map} +1 -1
- package/dist/{chunk-LDONE225.cjs → chunk-5IZL57YJ.cjs} +42 -13
- package/dist/{chunk-LDONE225.cjs.map → chunk-5IZL57YJ.cjs.map} +1 -1
- package/dist/{chunk-QBS4F44Q.cjs → chunk-J3EPFZPX.cjs} +110 -2
- package/dist/chunk-J3EPFZPX.cjs.map +1 -0
- package/dist/{chunk-EVEPI423.js → chunk-Q5V4LUQR.js} +3 -3
- package/dist/{chunk-EVEPI423.js.map → chunk-Q5V4LUQR.js.map} +1 -1
- package/dist/diagrams/circuit/index.cjs +8 -8
- package/dist/diagrams/circuit/index.d.cts +0 -9
- package/dist/diagrams/circuit/index.d.ts +0 -9
- package/dist/diagrams/circuit/index.js +1 -1
- package/dist/index.cjs +27 -27
- package/dist/index.js +4 -4
- package/dist/react.cjs +3 -3
- package/dist/react.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-QBS4F44Q.cjs.map +0 -1
- package/dist/chunk-WAKRRGAV.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkJ3EPFZPX_cjs = require('../../chunk-J3EPFZPX.cjs');
|
|
4
4
|
require('../../chunk-NZT5P2XZ.cjs');
|
|
5
5
|
require('../../chunk-NAGUZFXX.cjs');
|
|
6
6
|
require('../../chunk-3WNW5Y7P.cjs');
|
|
@@ -9,31 +9,31 @@ require('../../chunk-3WNW5Y7P.cjs');
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "circuit", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkJ3EPFZPX_cjs.circuit; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "layoutCircuit", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkJ3EPFZPX_cjs.layoutCircuit; }
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "layoutCircuitNetlist", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkJ3EPFZPX_cjs.layoutCircuitNetlist; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "lintCircuit", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkJ3EPFZPX_cjs.lintCircuit; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "parseCircuit", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkJ3EPFZPX_cjs.parseCircuit; }
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "parseNetlist", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunkJ3EPFZPX_cjs.parseNetlist; }
|
|
33
33
|
});
|
|
34
34
|
Object.defineProperty(exports, "renderCircuit", {
|
|
35
35
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
36
|
+
get: function () { return chunkJ3EPFZPX_cjs.renderCircuit; }
|
|
37
37
|
});
|
|
38
38
|
//# sourceMappingURL=index.cjs.map
|
|
39
39
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -12,15 +12,6 @@ import { C as CircuitAST, S as SchematexDiagnostic, R as RenderConfig, j as Circ
|
|
|
12
12
|
*/
|
|
13
13
|
declare function parseCircuit(text: string): CircuitAST;
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
* Circuit recoverable-input lint.
|
|
17
|
-
*
|
|
18
|
-
* The netlist parser no longer throws when a multi-terminal component is given
|
|
19
|
-
* fewer nets than it has pins — it binds the missing pins to floating
|
|
20
|
-
* no-connect nets and draws the part anyway. This surfaces that recovery as a
|
|
21
|
-
* warning so the render reports `partial` and the author can wire the open
|
|
22
|
-
* terminals, without ever blanking a schematic that is otherwise complete.
|
|
23
|
-
*/
|
|
24
15
|
declare function lintCircuit(text: string): SchematexDiagnostic[];
|
|
25
16
|
|
|
26
17
|
/**
|
|
@@ -12,15 +12,6 @@ import { C as CircuitAST, S as SchematexDiagnostic, R as RenderConfig, j as Circ
|
|
|
12
12
|
*/
|
|
13
13
|
declare function parseCircuit(text: string): CircuitAST;
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
* Circuit recoverable-input lint.
|
|
17
|
-
*
|
|
18
|
-
* The netlist parser no longer throws when a multi-terminal component is given
|
|
19
|
-
* fewer nets than it has pins — it binds the missing pins to floating
|
|
20
|
-
* no-connect nets and draws the part anyway. This surfaces that recovery as a
|
|
21
|
-
* warning so the render reports `partial` and the author can wire the open
|
|
22
|
-
* terminals, without ever blanking a schematic that is otherwise complete.
|
|
23
|
-
*/
|
|
24
15
|
declare function lintCircuit(text: string): SchematexDiagnostic[];
|
|
25
16
|
|
|
26
17
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { circuit, layoutCircuit, layoutCircuitNetlist, lintCircuit, parseCircuit, parseNetlist, renderCircuit } from '../../chunk-
|
|
1
|
+
export { circuit, layoutCircuit, layoutCircuitNetlist, lintCircuit, parseCircuit, parseNetlist, renderCircuit } from '../../chunk-2TUZ3QJA.js';
|
|
2
2
|
import '../../chunk-UK6HF6PE.js';
|
|
3
3
|
import '../../chunk-5IKOLUWK.js';
|
|
4
4
|
import '../../chunk-SYYBKDL7.js';
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk5IZL57YJ_cjs = require('./chunk-5IZL57YJ.cjs');
|
|
4
4
|
var chunkUHPGWO77_cjs = require('./chunk-UHPGWO77.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkJ3EPFZPX_cjs = require('./chunk-J3EPFZPX.cjs');
|
|
6
6
|
var chunkSHMG7BVF_cjs = require('./chunk-SHMG7BVF.cjs');
|
|
7
7
|
var chunkTACTEF2N_cjs = require('./chunk-TACTEF2N.cjs');
|
|
8
8
|
var chunk34O3C6OC_cjs = require('./chunk-34O3C6OC.cjs');
|
|
@@ -34,8 +34,8 @@ function svgDoc(viewBox, css, inner) {
|
|
|
34
34
|
var CIRCUIT_CSS = ".schematex-circuit-body{stroke:#0f172a;stroke-width:1.75;fill:none;stroke-linejoin:round;stroke-linecap:round}.schematex-circuit-fill{stroke:#0f172a;stroke-width:1.5;fill:#0f172a}.schematex-circuit-wire{stroke:#0f172a;stroke-width:1.75;fill:none;stroke-linecap:square}";
|
|
35
35
|
function circuitCatalog() {
|
|
36
36
|
const merged = {
|
|
37
|
-
...
|
|
38
|
-
...
|
|
37
|
+
...chunkJ3EPFZPX_cjs.SYMBOLS,
|
|
38
|
+
...chunkJ3EPFZPX_cjs.EXTRA_SYMBOLS
|
|
39
39
|
};
|
|
40
40
|
const out = [];
|
|
41
41
|
for (const [id, def] of Object.entries(merged)) {
|
|
@@ -111,10 +111,10 @@ var PID_CSS = ".lt-pid-equip{fill:#ffffff;stroke:#1d1d1d;stroke-width:1.6}.lt-pi
|
|
|
111
111
|
function pidCatalog() {
|
|
112
112
|
const out = [];
|
|
113
113
|
const pad = 12;
|
|
114
|
-
for (const [id, g] of Object.entries(
|
|
114
|
+
for (const [id, g] of Object.entries(chunk5IZL57YJ_cjs.GEOMETRY)) {
|
|
115
115
|
let inner;
|
|
116
116
|
try {
|
|
117
|
-
inner =
|
|
117
|
+
inner = chunk5IZL57YJ_cjs.renderEquip(id, "");
|
|
118
118
|
} catch {
|
|
119
119
|
continue;
|
|
120
120
|
}
|
|
@@ -224,11 +224,11 @@ var NETWORK_KINDS = [
|
|
|
224
224
|
function networkCatalog() {
|
|
225
225
|
const out = [];
|
|
226
226
|
for (const kind of NETWORK_KINDS) {
|
|
227
|
-
const { w, h } =
|
|
227
|
+
const { w, h } = chunk5IZL57YJ_cjs.iconSize(kind);
|
|
228
228
|
const device = { id: kind, kind, label: humanize(kind), groups: [] };
|
|
229
229
|
let inner;
|
|
230
230
|
try {
|
|
231
|
-
inner =
|
|
231
|
+
inner = chunk5IZL57YJ_cjs.drawDeviceIcon(device, { x: 0, y: 0, w, h });
|
|
232
232
|
} catch {
|
|
233
233
|
continue;
|
|
234
234
|
}
|
|
@@ -286,75 +286,75 @@ function getSymbolCatalog(type) {
|
|
|
286
286
|
|
|
287
287
|
Object.defineProperty(exports, "bowtie", {
|
|
288
288
|
enumerable: true,
|
|
289
|
-
get: function () { return
|
|
289
|
+
get: function () { return chunk5IZL57YJ_cjs.bowtie; }
|
|
290
290
|
});
|
|
291
291
|
Object.defineProperty(exports, "decisiontree", {
|
|
292
292
|
enumerable: true,
|
|
293
|
-
get: function () { return
|
|
293
|
+
get: function () { return chunk5IZL57YJ_cjs.decisiontree; }
|
|
294
294
|
});
|
|
295
295
|
Object.defineProperty(exports, "faulttree", {
|
|
296
296
|
enumerable: true,
|
|
297
|
-
get: function () { return
|
|
297
|
+
get: function () { return chunk5IZL57YJ_cjs.faulttree; }
|
|
298
298
|
});
|
|
299
299
|
Object.defineProperty(exports, "network", {
|
|
300
300
|
enumerable: true,
|
|
301
|
-
get: function () { return
|
|
301
|
+
get: function () { return chunk5IZL57YJ_cjs.network; }
|
|
302
302
|
});
|
|
303
303
|
Object.defineProperty(exports, "parse", {
|
|
304
304
|
enumerable: true,
|
|
305
|
-
get: function () { return
|
|
305
|
+
get: function () { return chunk5IZL57YJ_cjs.parse; }
|
|
306
306
|
});
|
|
307
307
|
Object.defineProperty(exports, "parseResult", {
|
|
308
308
|
enumerable: true,
|
|
309
|
-
get: function () { return
|
|
309
|
+
get: function () { return chunk5IZL57YJ_cjs.parseResult; }
|
|
310
310
|
});
|
|
311
311
|
Object.defineProperty(exports, "pert", {
|
|
312
312
|
enumerable: true,
|
|
313
|
-
get: function () { return
|
|
313
|
+
get: function () { return chunk5IZL57YJ_cjs.pert; }
|
|
314
314
|
});
|
|
315
315
|
Object.defineProperty(exports, "petri", {
|
|
316
316
|
enumerable: true,
|
|
317
|
-
get: function () { return
|
|
317
|
+
get: function () { return chunk5IZL57YJ_cjs.petri; }
|
|
318
318
|
});
|
|
319
319
|
Object.defineProperty(exports, "pid", {
|
|
320
320
|
enumerable: true,
|
|
321
|
-
get: function () { return
|
|
321
|
+
get: function () { return chunk5IZL57YJ_cjs.pid; }
|
|
322
322
|
});
|
|
323
323
|
Object.defineProperty(exports, "prisma", {
|
|
324
324
|
enumerable: true,
|
|
325
|
-
get: function () { return
|
|
325
|
+
get: function () { return chunk5IZL57YJ_cjs.prisma; }
|
|
326
326
|
});
|
|
327
327
|
Object.defineProperty(exports, "render", {
|
|
328
328
|
enumerable: true,
|
|
329
|
-
get: function () { return
|
|
329
|
+
get: function () { return chunk5IZL57YJ_cjs.render; }
|
|
330
330
|
});
|
|
331
331
|
Object.defineProperty(exports, "renderPreview", {
|
|
332
332
|
enumerable: true,
|
|
333
|
-
get: function () { return
|
|
333
|
+
get: function () { return chunk5IZL57YJ_cjs.renderPreview; }
|
|
334
334
|
});
|
|
335
335
|
Object.defineProperty(exports, "renderResult", {
|
|
336
336
|
enumerable: true,
|
|
337
|
-
get: function () { return
|
|
337
|
+
get: function () { return chunk5IZL57YJ_cjs.renderResult; }
|
|
338
338
|
});
|
|
339
339
|
Object.defineProperty(exports, "sequence", {
|
|
340
340
|
enumerable: true,
|
|
341
|
-
get: function () { return
|
|
341
|
+
get: function () { return chunk5IZL57YJ_cjs.sequence; }
|
|
342
342
|
});
|
|
343
343
|
Object.defineProperty(exports, "state", {
|
|
344
344
|
enumerable: true,
|
|
345
|
-
get: function () { return
|
|
345
|
+
get: function () { return chunk5IZL57YJ_cjs.state; }
|
|
346
346
|
});
|
|
347
347
|
Object.defineProperty(exports, "timeline", {
|
|
348
348
|
enumerable: true,
|
|
349
|
-
get: function () { return
|
|
349
|
+
get: function () { return chunk5IZL57YJ_cjs.timeline; }
|
|
350
350
|
});
|
|
351
351
|
Object.defineProperty(exports, "umlclass", {
|
|
352
352
|
enumerable: true,
|
|
353
|
-
get: function () { return
|
|
353
|
+
get: function () { return chunk5IZL57YJ_cjs.umlclass; }
|
|
354
354
|
});
|
|
355
355
|
Object.defineProperty(exports, "usecase", {
|
|
356
356
|
enumerable: true,
|
|
357
|
-
get: function () { return
|
|
357
|
+
get: function () { return chunk5IZL57YJ_cjs.usecase; }
|
|
358
358
|
});
|
|
359
359
|
Object.defineProperty(exports, "orgchart", {
|
|
360
360
|
enumerable: true,
|
|
@@ -362,7 +362,7 @@ Object.defineProperty(exports, "orgchart", {
|
|
|
362
362
|
});
|
|
363
363
|
Object.defineProperty(exports, "circuit", {
|
|
364
364
|
enumerable: true,
|
|
365
|
-
get: function () { return
|
|
365
|
+
get: function () { return chunkJ3EPFZPX_cjs.circuit; }
|
|
366
366
|
});
|
|
367
367
|
Object.defineProperty(exports, "blockdiagram", {
|
|
368
368
|
enumerable: true,
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { iconSize, drawDeviceIcon, GEOMETRY, renderEquip } from './chunk-
|
|
2
|
-
export { bowtie, decisiontree, faulttree, network, parse, parseResult, pert, petri, pid, prisma, render, renderPreview, renderResult, sequence, state, timeline, umlclass, usecase } from './chunk-
|
|
1
|
+
import { iconSize, drawDeviceIcon, GEOMETRY, renderEquip } from './chunk-3DPWFWQU.js';
|
|
2
|
+
export { bowtie, decisiontree, faulttree, network, parse, parseResult, pert, petri, pid, prisma, render, renderPreview, renderResult, sequence, state, timeline, umlclass, usecase } from './chunk-3DPWFWQU.js';
|
|
3
3
|
export { orgchart } from './chunk-MPCSWRZC.js';
|
|
4
|
-
import { EXTRA_SYMBOLS, SYMBOLS } from './chunk-
|
|
5
|
-
export { circuit } from './chunk-
|
|
4
|
+
import { EXTRA_SYMBOLS, SYMBOLS } from './chunk-2TUZ3QJA.js';
|
|
5
|
+
export { circuit } from './chunk-2TUZ3QJA.js';
|
|
6
6
|
export { blockdiagram } from './chunk-C7V57V6O.js';
|
|
7
7
|
export { ladder } from './chunk-WU2N6ZVM.js';
|
|
8
8
|
import { renderSymbol, geometryFor } from './chunk-JTGTWBAD.js';
|
package/dist/react.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk5IZL57YJ_cjs = require('./chunk-5IZL57YJ.cjs');
|
|
4
4
|
require('./chunk-UHPGWO77.cjs');
|
|
5
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-J3EPFZPX.cjs');
|
|
6
6
|
require('./chunk-SHMG7BVF.cjs');
|
|
7
7
|
require('./chunk-TACTEF2N.cjs');
|
|
8
8
|
require('./chunk-34O3C6OC.cjs');
|
|
@@ -37,7 +37,7 @@ function SchematexDiagram({
|
|
|
37
37
|
onError
|
|
38
38
|
}) {
|
|
39
39
|
const svg = react.useMemo(() => {
|
|
40
|
-
const result =
|
|
40
|
+
const result = chunk5IZL57YJ_cjs.renderResult(dsl, { type, theme, fontFamily, padding });
|
|
41
41
|
if (!result.ok) {
|
|
42
42
|
onError?.(new Error(result.diagnostics[0]?.message ?? "Schematex render failed"));
|
|
43
43
|
}
|
package/dist/react.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { renderResult } from './chunk-
|
|
1
|
+
import { renderResult } from './chunk-3DPWFWQU.js';
|
|
2
2
|
import './chunk-MPCSWRZC.js';
|
|
3
|
-
import './chunk-
|
|
3
|
+
import './chunk-2TUZ3QJA.js';
|
|
4
4
|
import './chunk-C7V57V6O.js';
|
|
5
5
|
import './chunk-WU2N6ZVM.js';
|
|
6
6
|
import './chunk-JTGTWBAD.js';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "schematex",
|
|
3
|
-
"version": "0.6.
|
|
4
|
-
"description": "Every diagram a doctor, engineer, or lawyer would actually use.
|
|
3
|
+
"version": "0.6.9",
|
|
4
|
+
"description": "Every diagram a doctor, engineer, or lawyer would actually use. 36 industry-standard diagrams (genogram, pedigree, ladder logic, SLD, FBD, SFC, P&ID, UML class, UML use case, UML sequence, fault tree, bowtie, PRISMA, phylo, fishbone, entity structure, ...) from a text DSL. Free, fully open source, made for AI. Pure SVG, zero dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"lint": "eslint src/",
|
|
133
133
|
"typecheck": "npm run build:ai && tsc --noEmit",
|
|
134
134
|
"validate:examples": "npm run build && node scripts/validate-examples.mjs",
|
|
135
|
-
"prepublishOnly": "npm run build"
|
|
135
|
+
"prepublishOnly": "npm run build && npm run typecheck"
|
|
136
136
|
},
|
|
137
137
|
"keywords": [
|
|
138
138
|
"diagram",
|
|
@@ -172,11 +172,11 @@
|
|
|
172
172
|
"license": "AGPL-3.0-only",
|
|
173
173
|
"repository": {
|
|
174
174
|
"type": "git",
|
|
175
|
-
"url": "https://github.com/
|
|
175
|
+
"url": "https://github.com/SchemaTex/SchemaTex"
|
|
176
176
|
},
|
|
177
177
|
"homepage": "https://schematex.js.org",
|
|
178
178
|
"bugs": {
|
|
179
|
-
"url": "https://github.com/
|
|
179
|
+
"url": "https://github.com/SchemaTex/SchemaTex/issues"
|
|
180
180
|
},
|
|
181
181
|
"peerDependencies": {
|
|
182
182
|
"ai": ">=5.0.0",
|