schematex 0.5.2 → 0.6.1
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 +75 -1
- package/dist/ai/ai-sdk.cjs +23 -23
- package/dist/ai/ai-sdk.d.cts +4 -4
- package/dist/ai/ai-sdk.d.ts +4 -4
- package/dist/ai/ai-sdk.js +18 -18
- package/dist/ai/index.cjs +35 -27
- package/dist/ai/index.d.cts +4 -4
- package/dist/ai/index.d.ts +4 -4
- package/dist/ai/index.js +18 -18
- package/dist/{api-Cr_MxttI.d.ts → api-BEJTXyBA.d.cts} +3 -40
- package/dist/{api-C5SECOxZ.d.cts → api-DFrSR3lw.d.ts} +3 -40
- package/dist/browser.cjs +24 -24
- package/dist/browser.d.cts +3 -3
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +18 -18
- package/dist/{chunk-N7W5KZK7.cjs → chunk-2L4YXZAZ.cjs} +4 -4
- package/dist/{chunk-N7W5KZK7.cjs.map → chunk-2L4YXZAZ.cjs.map} +1 -1
- package/dist/{chunk-ZYRCPSBU.js → chunk-3IE7KZY4.js} +4 -4
- package/dist/{chunk-ZYRCPSBU.js.map → chunk-3IE7KZY4.js.map} +1 -1
- package/dist/{chunk-ZX74KJPM.js → chunk-3VB5AT4R.js} +3 -3
- package/dist/{chunk-ZX74KJPM.js.map → chunk-3VB5AT4R.js.map} +1 -1
- package/dist/{chunk-S2KJRHDZ.cjs → chunk-4UFR2LB6.cjs} +13 -13
- package/dist/{chunk-S2KJRHDZ.cjs.map → chunk-4UFR2LB6.cjs.map} +1 -1
- package/dist/{chunk-4QPDZJAL.cjs → chunk-4XR7X7XW.cjs} +11569 -9045
- package/dist/chunk-4XR7X7XW.cjs.map +1 -0
- package/dist/{chunk-6OSUNBZY.js → chunk-522WB2EH.js} +135 -7
- package/dist/chunk-522WB2EH.js.map +1 -0
- package/dist/{chunk-QTNPMIO2.cjs → chunk-6JI6FWLZ.cjs} +341 -35
- package/dist/chunk-6JI6FWLZ.cjs.map +1 -0
- package/dist/{chunk-UFTYX73U.js → chunk-7F76AWOI.js} +339 -35
- package/dist/chunk-7F76AWOI.js.map +1 -0
- package/dist/{chunk-BW4KGTV7.cjs → chunk-C5C5EF3W.cjs} +4 -4
- package/dist/{chunk-BW4KGTV7.cjs.map → chunk-C5C5EF3W.cjs.map} +1 -1
- package/dist/{chunk-VJGMEGMR.js → chunk-DOK7LKLO.js} +125 -13
- package/dist/chunk-DOK7LKLO.js.map +1 -0
- package/dist/{chunk-L3CTXXVZ.js → chunk-FBS3PACU.js} +3 -3
- package/dist/{chunk-L3CTXXVZ.js.map → chunk-FBS3PACU.js.map} +1 -1
- package/dist/{chunk-QUKVGHN4.cjs → chunk-FKJBXGWP.cjs} +4 -4
- package/dist/{chunk-QUKVGHN4.cjs.map → chunk-FKJBXGWP.cjs.map} +1 -1
- package/dist/{chunk-SZK376QB.js → chunk-H4MT5TJP.js} +3 -3
- package/dist/{chunk-SZK376QB.js.map → chunk-H4MT5TJP.js.map} +1 -1
- package/dist/{chunk-3M6T7KB4.js → chunk-HAZALB7U.js} +3 -3
- package/dist/{chunk-3M6T7KB4.js.map → chunk-HAZALB7U.js.map} +1 -1
- package/dist/{chunk-VFZOPRQP.cjs → chunk-HWVBHU3O.cjs} +5 -5
- package/dist/{chunk-VFZOPRQP.cjs.map → chunk-HWVBHU3O.cjs.map} +1 -1
- package/dist/{chunk-OK5ZS3LU.js → chunk-I2GQYOZ5.js} +11586 -9069
- package/dist/chunk-I2GQYOZ5.js.map +1 -0
- package/dist/{chunk-D7EHZFK4.cjs → chunk-L7POWM5B.cjs} +138 -2
- package/dist/chunk-L7POWM5B.cjs.map +1 -0
- package/dist/{chunk-2VNMKOUO.js → chunk-LRI4RH2N.js} +135 -3
- package/dist/chunk-LRI4RH2N.js.map +1 -0
- package/dist/{chunk-EPKIJEH7.js → chunk-MFAMNFPA.js} +63 -6
- package/dist/chunk-MFAMNFPA.js.map +1 -0
- package/dist/{chunk-VDSYMSUY.js → chunk-MVIEIKOI.js} +3 -3
- package/dist/{chunk-VDSYMSUY.js.map → chunk-MVIEIKOI.js.map} +1 -1
- package/dist/{chunk-ZL5RB4UV.js → chunk-N5B242WY.js} +3 -3
- package/dist/{chunk-ZL5RB4UV.js.map → chunk-N5B242WY.js.map} +1 -1
- package/dist/{chunk-VKPCR7BG.js → chunk-OTSVMKII.js} +883 -12
- package/dist/chunk-OTSVMKII.js.map +1 -0
- package/dist/{chunk-YLEVMOK2.cjs → chunk-R66QG3XT.cjs} +5 -4
- package/dist/{chunk-YLEVMOK2.cjs.map → chunk-R66QG3XT.cjs.map} +1 -1
- package/dist/{chunk-3M6WB62Y.cjs → chunk-R6VX5YTJ.cjs} +139 -7
- package/dist/chunk-R6VX5YTJ.cjs.map +1 -0
- package/dist/{chunk-I55HO32M.js → chunk-RJMCWT7Z.js} +3 -3
- package/dist/{chunk-I55HO32M.js.map → chunk-RJMCWT7Z.js.map} +1 -1
- package/dist/{chunk-TZTCIAYW.cjs → chunk-S3RMAXH5.cjs} +137 -25
- package/dist/chunk-S3RMAXH5.cjs.map +1 -0
- package/dist/{chunk-HK56GQQP.cjs → chunk-SSLNPHCL.cjs} +886 -13
- package/dist/chunk-SSLNPHCL.cjs.map +1 -0
- package/dist/{chunk-IBRW3UOA.js → chunk-TWLKXV2O.js} +3 -3
- package/dist/{chunk-IBRW3UOA.js.map → chunk-TWLKXV2O.js.map} +1 -1
- package/dist/{chunk-VCH7RI5H.js → chunk-UWA5MWCI.js} +4 -4
- package/dist/chunk-UWA5MWCI.js.map +1 -0
- package/dist/{chunk-RYVV5UVI.cjs → chunk-V4GILQR6.cjs} +4 -4
- package/dist/{chunk-RYVV5UVI.cjs.map → chunk-V4GILQR6.cjs.map} +1 -1
- package/dist/{chunk-QMTWG6JL.cjs → chunk-V4RO5KYY.cjs} +6 -4
- package/dist/chunk-V4RO5KYY.cjs.map +1 -0
- package/dist/{chunk-VZ5LDNHK.cjs → chunk-VTSH4YPT.cjs} +12 -12
- package/dist/{chunk-VZ5LDNHK.cjs.map → chunk-VTSH4YPT.cjs.map} +1 -1
- package/dist/{chunk-UUBNQV2T.cjs → chunk-WQDIZH2Z.cjs} +12 -12
- package/dist/{chunk-UUBNQV2T.cjs.map → chunk-WQDIZH2Z.cjs.map} +1 -1
- package/dist/{chunk-SUIDD2C5.cjs → chunk-XNCOSVNG.cjs} +63 -6
- package/dist/chunk-XNCOSVNG.cjs.map +1 -0
- package/dist/{chunk-EGSUMHCS.cjs → chunk-YB4XJY5L.cjs} +12 -12
- package/dist/{chunk-EGSUMHCS.cjs.map → chunk-YB4XJY5L.cjs.map} +1 -1
- package/dist/{chunk-JHDR56XO.js → chunk-YS6CGUNH.js} +3 -3
- package/dist/{chunk-JHDR56XO.js.map → chunk-YS6CGUNH.js.map} +1 -1
- package/dist/{types-WTr9W5Ud.d.ts → diagnostics-B-ffSEhl.d.cts} +82 -2
- package/dist/{types-WTr9W5Ud.d.cts → diagnostics-B-ffSEhl.d.ts} +82 -2
- package/dist/diagrams/blockdiagram/index.cjs +5 -5
- package/dist/diagrams/blockdiagram/index.d.cts +1 -1
- package/dist/diagrams/blockdiagram/index.d.ts +1 -1
- package/dist/diagrams/blockdiagram/index.js +1 -1
- package/dist/diagrams/circuit/index.cjs +8 -8
- package/dist/diagrams/circuit/index.d.cts +1 -1
- package/dist/diagrams/circuit/index.d.ts +1 -1
- package/dist/diagrams/circuit/index.js +2 -2
- package/dist/diagrams/ecomap/index.cjs +7 -7
- package/dist/diagrams/ecomap/index.d.cts +1 -1
- package/dist/diagrams/ecomap/index.d.ts +1 -1
- package/dist/diagrams/ecomap/index.js +2 -2
- package/dist/diagrams/entity/index.cjs +6 -6
- package/dist/diagrams/entity/index.d.cts +1 -1
- package/dist/diagrams/entity/index.d.ts +1 -1
- package/dist/diagrams/entity/index.js +2 -2
- package/dist/diagrams/fishbone/index.cjs +8 -8
- package/dist/diagrams/fishbone/index.d.cts +1 -1
- package/dist/diagrams/fishbone/index.d.ts +1 -1
- package/dist/diagrams/fishbone/index.js +2 -2
- package/dist/diagrams/flowchart/index.cjs +8 -8
- package/dist/diagrams/flowchart/index.d.cts +2 -2
- package/dist/diagrams/flowchart/index.d.ts +2 -2
- package/dist/diagrams/flowchart/index.js +2 -2
- package/dist/diagrams/genogram/index.cjs +9 -9
- package/dist/diagrams/genogram/index.d.cts +1 -1
- package/dist/diagrams/genogram/index.d.ts +1 -1
- package/dist/diagrams/genogram/index.js +2 -2
- package/dist/diagrams/ladder/index.cjs +6 -6
- package/dist/diagrams/ladder/index.d.cts +1 -1
- package/dist/diagrams/ladder/index.d.ts +1 -1
- package/dist/diagrams/ladder/index.js +2 -2
- package/dist/diagrams/logic/index.cjs +6 -6
- package/dist/diagrams/logic/index.d.cts +1 -1
- package/dist/diagrams/logic/index.d.ts +1 -1
- package/dist/diagrams/logic/index.js +2 -2
- package/dist/diagrams/orgchart/index.cjs +7 -7
- package/dist/diagrams/orgchart/index.d.cts +1 -1
- package/dist/diagrams/orgchart/index.d.ts +1 -1
- package/dist/diagrams/orgchart/index.js +2 -2
- package/dist/diagrams/pedigree/index.cjs +7 -7
- package/dist/diagrams/pedigree/index.d.cts +1 -1
- package/dist/diagrams/pedigree/index.d.ts +1 -1
- package/dist/diagrams/pedigree/index.js +2 -2
- package/dist/diagrams/phylo/index.cjs +7 -7
- package/dist/diagrams/phylo/index.d.cts +1 -1
- package/dist/diagrams/phylo/index.d.ts +1 -1
- package/dist/diagrams/phylo/index.js +2 -2
- package/dist/diagrams/sld/index.cjs +14 -6
- package/dist/diagrams/sld/index.d.cts +14 -2
- package/dist/diagrams/sld/index.d.ts +14 -2
- package/dist/diagrams/sld/index.js +2 -2
- package/dist/diagrams/sociogram/index.cjs +6 -6
- package/dist/diagrams/sociogram/index.d.cts +1 -1
- package/dist/diagrams/sociogram/index.d.ts +1 -1
- package/dist/diagrams/sociogram/index.js +2 -2
- package/dist/diagrams/timing/index.d.cts +1 -1
- package/dist/diagrams/timing/index.d.ts +1 -1
- package/dist/diagrams/venn/index.cjs +9 -9
- package/dist/diagrams/venn/index.d.cts +1 -1
- package/dist/diagrams/venn/index.d.ts +1 -1
- package/dist/diagrams/venn/index.js +2 -2
- package/dist/{index-BD2yDfQM.d.cts → index-DPWdYfNx.d.ts} +60 -2
- package/dist/{index-C30zQWZI.d.ts → index-S0njakQ2.d.cts} +60 -2
- package/dist/index.cjs +344 -56
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -4
- package/dist/index.d.ts +38 -4
- package/dist/index.js +284 -17
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +18 -18
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +17 -17
- package/dist/{tools-DlpuE76u.d.cts → tools-CeGGMCs7.d.cts} +12 -4
- package/dist/{tools-BHWaJPOl.d.ts → tools-kK_enDwb.d.ts} +12 -4
- package/package.json +1 -1
- package/dist/chunk-2VNMKOUO.js.map +0 -1
- package/dist/chunk-3M6WB62Y.cjs.map +0 -1
- package/dist/chunk-4QPDZJAL.cjs.map +0 -1
- package/dist/chunk-6OSUNBZY.js.map +0 -1
- package/dist/chunk-D7EHZFK4.cjs.map +0 -1
- package/dist/chunk-EPKIJEH7.js.map +0 -1
- package/dist/chunk-HK56GQQP.cjs.map +0 -1
- package/dist/chunk-OK5ZS3LU.js.map +0 -1
- package/dist/chunk-QMTWG6JL.cjs.map +0 -1
- package/dist/chunk-QTNPMIO2.cjs.map +0 -1
- package/dist/chunk-SUIDD2C5.cjs.map +0 -1
- package/dist/chunk-TZTCIAYW.cjs.map +0 -1
- package/dist/chunk-UFTYX73U.js.map +0 -1
- package/dist/chunk-VCH7RI5H.js.map +0 -1
- package/dist/chunk-VJGMEGMR.js.map +0 -1
- package/dist/chunk-VKPCR7BG.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export { S as SchematexConfig,
|
|
1
|
+
export { S as SchematexConfig, p as parse, a as parseResult, r as render, b as renderPreview, c as renderResult } from './api-DFrSR3lw.js';
|
|
2
|
+
import { D as DiagramPlugin, a as DiagramType } from './diagnostics-B-ffSEhl.js';
|
|
3
|
+
export { S as SchematexDiagnostic, b as SchematexParseResult, c as SchematexRenderResult, d as SchematexResultStatus } from './diagnostics-B-ffSEhl.js';
|
|
2
4
|
export { genogram } from './diagrams/genogram/index.js';
|
|
3
5
|
export { ecomap } from './diagrams/ecomap/index.js';
|
|
4
6
|
export { pedigree } from './diagrams/pedigree/index.js';
|
|
@@ -13,9 +15,8 @@ export { sld } from './diagrams/sld/index.js';
|
|
|
13
15
|
export { entity } from './diagrams/entity/index.js';
|
|
14
16
|
export { fishbone } from './diagrams/fishbone/index.js';
|
|
15
17
|
export { venn } from './diagrams/venn/index.js';
|
|
16
|
-
export { B as BASE_THEMES, a as BIOLOGY_TOKENS, b as BaseTheme, c as BiologyTokens, P as PERSON_TOKENS,
|
|
18
|
+
export { B as BASE_THEMES, a as BIOLOGY_TOKENS, b as BaseTheme, c as BiologyTokens, N as NETWORK_TOKENS, d as NetworkTokens, P as PERSON_TOKENS, e as PETRI_TOKENS, f as PersonTokens, g as PetriTokens, R as ResolvedTheme, T as ThemeName, h as TimelineTokens, V as VENN_TOKENS, i as VennTokens, j as flowchart, r as resolveBaseTheme, k as resolveBiologyTheme, l as resolveFishboneTheme, m as resolveGenogramTheme, n as resolveNetworkTheme, o as resolvePersonTheme, p as resolvePetriTheme, q as resolveTimelineTheme, s as resolveVennTheme } from './index-DPWdYfNx.js';
|
|
17
19
|
export { orgchart } from './diagrams/orgchart/index.js';
|
|
18
|
-
import { D as DiagramPlugin } from './types-WTr9W5Ud.js';
|
|
19
20
|
|
|
20
21
|
declare const decisiontree: DiagramPlugin;
|
|
21
22
|
|
|
@@ -31,4 +32,37 @@ declare const usecase: DiagramPlugin;
|
|
|
31
32
|
|
|
32
33
|
declare const pert: DiagramPlugin;
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
declare const sequence: DiagramPlugin;
|
|
36
|
+
|
|
37
|
+
declare const petri: DiagramPlugin;
|
|
38
|
+
|
|
39
|
+
declare const network: DiagramPlugin;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Domain symbol catalogs — the real symbols an engine uses *inside* a diagram
|
|
43
|
+
* (circuit components, SLD apparatus, P&ID equipment, flowchart node icons),
|
|
44
|
+
* each rendered standalone for the /icons showcase. This is distinct from the
|
|
45
|
+
* per-type representative glyph (assets/icons/*.svg).
|
|
46
|
+
*
|
|
47
|
+
* Each entry's `svg` is a complete, self-styled <svg> so consumers can drop it
|
|
48
|
+
* straight into the page.
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
interface SymbolCatalogEntry {
|
|
52
|
+
id: string;
|
|
53
|
+
label: string;
|
|
54
|
+
svg: string;
|
|
55
|
+
}
|
|
56
|
+
interface SymbolCatalog {
|
|
57
|
+
type: DiagramType;
|
|
58
|
+
/** Human label for the catalog section, e.g. "Circuit components". */
|
|
59
|
+
label: string;
|
|
60
|
+
/** Short description of what the symbols are. */
|
|
61
|
+
note: string;
|
|
62
|
+
entries: SymbolCatalogEntry[];
|
|
63
|
+
}
|
|
64
|
+
/** Diagram types that ship a renderable domain symbol catalog. */
|
|
65
|
+
declare const SYMBOL_CATALOG_TYPES: DiagramType[];
|
|
66
|
+
declare function getSymbolCatalog(type: string): SymbolCatalog | null;
|
|
67
|
+
|
|
68
|
+
export { SYMBOL_CATALOG_TYPES, type SymbolCatalog, type SymbolCatalogEntry, decisiontree, getSymbolCatalog, network, pert, petri, pid, prisma, sequence, state, timeline, usecase };
|
package/dist/index.js
CHANGED
|
@@ -1,25 +1,292 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
1
|
+
import { iconSize, drawDeviceIcon, GEOMETRY, renderEquip } from './chunk-I2GQYOZ5.js';
|
|
2
|
+
export { decisiontree, network, parse, parseResult, pert, petri, pid, prisma, render, renderPreview, renderResult, sequence, state, timeline, usecase } from './chunk-I2GQYOZ5.js';
|
|
3
|
+
export { orgchart } from './chunk-RJMCWT7Z.js';
|
|
4
|
+
import { EXTRA_SYMBOLS, SYMBOLS } from './chunk-UWA5MWCI.js';
|
|
5
|
+
export { circuit } from './chunk-UWA5MWCI.js';
|
|
6
|
+
export { blockdiagram } from './chunk-MFAMNFPA.js';
|
|
7
|
+
export { ladder } from './chunk-TWLKXV2O.js';
|
|
8
|
+
import { renderSymbol, geometryFor } from './chunk-522WB2EH.js';
|
|
9
|
+
export { sld } from './chunk-522WB2EH.js';
|
|
7
10
|
import './chunk-PIV2A3HG.js';
|
|
8
|
-
export { entity } from './chunk-
|
|
9
|
-
export { fishbone } from './chunk-
|
|
10
|
-
export { venn } from './chunk-
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
11
|
+
export { entity } from './chunk-H4MT5TJP.js';
|
|
12
|
+
export { fishbone } from './chunk-HAZALB7U.js';
|
|
13
|
+
export { venn } from './chunk-FBS3PACU.js';
|
|
14
|
+
import { iconNames, renderIcon } from './chunk-7F76AWOI.js';
|
|
15
|
+
export { flowchart } from './chunk-7F76AWOI.js';
|
|
16
|
+
export { genogram } from './chunk-DOK7LKLO.js';
|
|
17
|
+
export { ecomap } from './chunk-YS6CGUNH.js';
|
|
18
|
+
export { pedigree } from './chunk-N5B242WY.js';
|
|
15
19
|
import './chunk-2KTQ75LN.js';
|
|
16
|
-
export { phylo } from './chunk-
|
|
17
|
-
export { sociogram } from './chunk-
|
|
20
|
+
export { phylo } from './chunk-MVIEIKOI.js';
|
|
21
|
+
export { sociogram } from './chunk-3VB5AT4R.js';
|
|
18
22
|
import './chunk-FO7BLCEW.js';
|
|
19
23
|
export { timing } from './chunk-6URNSB6G.js';
|
|
20
|
-
|
|
21
|
-
export {
|
|
24
|
+
import { getGateGeometry } from './chunk-3IE7KZY4.js';
|
|
25
|
+
export { logic } from './chunk-3IE7KZY4.js';
|
|
26
|
+
export { BASE_THEMES, BIOLOGY_TOKENS, NETWORK_TOKENS, PERSON_TOKENS, PETRI_TOKENS, VENN_TOKENS, resolveBaseTheme, resolveBiologyTheme, resolveFishboneTheme, resolveGenogramTheme, resolveNetworkTheme, resolvePersonTheme, resolvePetriTheme, resolveTimelineTheme, resolveVennTheme } from './chunk-LRI4RH2N.js';
|
|
22
27
|
import './chunk-5IKOLUWK.js';
|
|
23
28
|
import './chunk-SYYBKDL7.js';
|
|
29
|
+
|
|
30
|
+
// src/symbols-catalog.ts
|
|
31
|
+
function humanize(id) {
|
|
32
|
+
return id.replace(/[_-]+/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
33
|
+
}
|
|
34
|
+
function svgDoc(viewBox, css, inner) {
|
|
35
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="${viewBox}" class="lt-symbol"><style>${css}</style>${inner}</svg>`;
|
|
36
|
+
}
|
|
37
|
+
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}";
|
|
38
|
+
function circuitCatalog() {
|
|
39
|
+
const merged = {
|
|
40
|
+
...SYMBOLS,
|
|
41
|
+
...EXTRA_SYMBOLS
|
|
42
|
+
};
|
|
43
|
+
const out = [];
|
|
44
|
+
for (const [id, def] of Object.entries(merged)) {
|
|
45
|
+
if (!def) continue;
|
|
46
|
+
const L = def.length || 40;
|
|
47
|
+
const inner = def.svg();
|
|
48
|
+
out.push({ id, label: humanize(id), svg: svgDoc(`-10 -24 ${L + 20} 48`, CIRCUIT_CSS, inner) });
|
|
49
|
+
}
|
|
50
|
+
return out.sort((a, b) => a.label.localeCompare(b.label));
|
|
51
|
+
}
|
|
52
|
+
var SLD_CSS = ".lt-sld-stroke{stroke:#0f172a;stroke-width:1.8;fill:none}.lt-sld-stroke-thick{stroke:#0f172a;stroke-width:2.4;fill:none;stroke-linecap:round}.lt-sld-fill{fill:#ffffff;stroke:#0f172a;stroke-width:2}.lt-sld-fill-dark{fill:#0f172a;stroke:#0f172a;stroke-width:1}.lt-sld-dot{fill:#0f172a;stroke:none}.lt-sld-wire{stroke:#0f172a;stroke-width:2;fill:none}.lt-sld-bus{stroke:#0f172a;stroke-width:6;stroke-linecap:square}.lt-sld-symbol-text{font:11px sans-serif;fill:#0f172a;dominant-baseline:middle}.lt-sld-wdg{font:bold 10px sans-serif;fill:#0f172a;dominant-baseline:middle}";
|
|
53
|
+
var SLD_TYPES = [
|
|
54
|
+
"utility",
|
|
55
|
+
"generator",
|
|
56
|
+
"solar",
|
|
57
|
+
"wind",
|
|
58
|
+
"ups",
|
|
59
|
+
"transformer",
|
|
60
|
+
"transformer_dy",
|
|
61
|
+
"transformer_yd",
|
|
62
|
+
"transformer_yy",
|
|
63
|
+
"transformer_dd",
|
|
64
|
+
"autotransformer",
|
|
65
|
+
"transformer_3winding",
|
|
66
|
+
"breaker",
|
|
67
|
+
"breaker_vacuum",
|
|
68
|
+
"recloser",
|
|
69
|
+
"switch",
|
|
70
|
+
"switch_load",
|
|
71
|
+
"ground_switch",
|
|
72
|
+
"sectionalizer",
|
|
73
|
+
"fuse",
|
|
74
|
+
"fuse_cl",
|
|
75
|
+
"motor",
|
|
76
|
+
"load",
|
|
77
|
+
"capacitor_bank",
|
|
78
|
+
"harmonic_filter",
|
|
79
|
+
"vfd",
|
|
80
|
+
"ats",
|
|
81
|
+
"ct",
|
|
82
|
+
"pt",
|
|
83
|
+
"relay",
|
|
84
|
+
"surge_arrester",
|
|
85
|
+
"watthour_meter",
|
|
86
|
+
"demand_meter",
|
|
87
|
+
"ground_fault",
|
|
88
|
+
"bus",
|
|
89
|
+
"bus_tie",
|
|
90
|
+
"hub"
|
|
91
|
+
];
|
|
92
|
+
function sldCatalog() {
|
|
93
|
+
const out = [];
|
|
94
|
+
for (const type of SLD_TYPES) {
|
|
95
|
+
let inner;
|
|
96
|
+
try {
|
|
97
|
+
inner = renderSymbol(type);
|
|
98
|
+
} catch {
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
const g = geometryFor(type);
|
|
102
|
+
const w = Math.max(g.halfWidth, 18) + 12;
|
|
103
|
+
const top = Math.min(g.topY, -22) - 8;
|
|
104
|
+
const bot = Math.max(g.bottomY, 22) + 8;
|
|
105
|
+
out.push({
|
|
106
|
+
id: type,
|
|
107
|
+
label: humanize(type),
|
|
108
|
+
svg: svgDoc(`${-w} ${top} ${2 * w} ${bot - top}`, SLD_CSS, inner)
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return out.sort((a, b) => a.label.localeCompare(b.label));
|
|
112
|
+
}
|
|
113
|
+
var PID_CSS = ".lt-pid-equip{fill:#ffffff;stroke:#1d1d1d;stroke-width:1.6}.lt-pid-equip-tag{font:600 11px system-ui,sans-serif;fill:#1d1d1d}.lt-pid-process{stroke:#1d1d1d;stroke-width:2.6;fill:none}.lt-pid-process-min{stroke:#1d1d1d;stroke-width:1.5;fill:none}";
|
|
114
|
+
function pidCatalog() {
|
|
115
|
+
const out = [];
|
|
116
|
+
const pad = 12;
|
|
117
|
+
for (const [id, g] of Object.entries(GEOMETRY)) {
|
|
118
|
+
let inner;
|
|
119
|
+
try {
|
|
120
|
+
inner = renderEquip(id, "");
|
|
121
|
+
} catch {
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
out.push({
|
|
125
|
+
id,
|
|
126
|
+
label: humanize(id),
|
|
127
|
+
svg: svgDoc(
|
|
128
|
+
`${-g.width / 2 - pad} ${-g.height / 2 - pad} ${g.width + 2 * pad} ${g.height + 2 * pad}`,
|
|
129
|
+
PID_CSS,
|
|
130
|
+
inner
|
|
131
|
+
)
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
return out.sort((a, b) => a.label.localeCompare(b.label));
|
|
135
|
+
}
|
|
136
|
+
var FC_ICON_CSS = ".sx-fc-icon{stroke:#0f172a;fill:none}.sx-fc-icon-fill{fill:#0f172a}";
|
|
137
|
+
function flowchartIconCatalog() {
|
|
138
|
+
return iconNames().map((name) => ({
|
|
139
|
+
id: name,
|
|
140
|
+
label: humanize(name),
|
|
141
|
+
svg: svgDoc("-13 -13 26 26", FC_ICON_CSS, renderIcon(name))
|
|
142
|
+
})).sort((a, b) => a.label.localeCompare(b.label));
|
|
143
|
+
}
|
|
144
|
+
var LOGIC_CSS = ".schematex-logic-gate-body{fill:none;stroke:#0f172a;stroke-width:1.75;stroke-linejoin:round}.schematex-logic-bubble{fill:#ffffff;stroke:#0f172a;stroke-width:1.5}.schematex-logic-wire{stroke:#0f172a;stroke-width:1.5;fill:none;stroke-linecap:square}.schematex-logic-gate-iec-label{font:bold 13px sans-serif;fill:#0f172a}";
|
|
145
|
+
var LOGIC_TYPES = [
|
|
146
|
+
"AND",
|
|
147
|
+
"OR",
|
|
148
|
+
"NOT",
|
|
149
|
+
"NAND",
|
|
150
|
+
"NOR",
|
|
151
|
+
"XOR",
|
|
152
|
+
"XNOR",
|
|
153
|
+
"BUF",
|
|
154
|
+
"TRISTATE_BUF",
|
|
155
|
+
"OPEN_DRAIN",
|
|
156
|
+
"SCHMITT",
|
|
157
|
+
"DFF",
|
|
158
|
+
"JKFF",
|
|
159
|
+
"SRFF",
|
|
160
|
+
"TFF",
|
|
161
|
+
"LATCH_D",
|
|
162
|
+
"LATCH_SR",
|
|
163
|
+
"MUX",
|
|
164
|
+
"DEMUX",
|
|
165
|
+
"DECODER",
|
|
166
|
+
"ENCODER",
|
|
167
|
+
"COUNTER",
|
|
168
|
+
"SHIFT_REG"
|
|
169
|
+
];
|
|
170
|
+
var SINGLE_INPUT = /* @__PURE__ */ new Set(["NOT", "BUF", "SCHMITT", "TRISTATE_BUF", "TRISTATE_INV", "OPEN_DRAIN", "DFF", "TFF"]);
|
|
171
|
+
function logicCatalog() {
|
|
172
|
+
const out = [];
|
|
173
|
+
for (const type of LOGIC_TYPES) {
|
|
174
|
+
let g;
|
|
175
|
+
try {
|
|
176
|
+
g = getGateGeometry(type, SINGLE_INPUT.has(type) ? 1 : 2);
|
|
177
|
+
} catch {
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
const parts = [`<path d="${g.ansiPath}" class="schematex-logic-gate-body"/>`];
|
|
181
|
+
for (const p of g.inputPins) parts.push(`<line x1="${p.x - 10}" y1="${p.y}" x2="${p.x}" y2="${p.y}" class="schematex-logic-wire"/>`);
|
|
182
|
+
for (const p of g.outputPins) {
|
|
183
|
+
const bub = p.bubble || g.outputBubble;
|
|
184
|
+
const ox = bub ? p.x + 6 : p.x;
|
|
185
|
+
if (bub) parts.push(`<circle cx="${p.x + 3}" cy="${p.y}" r="3" class="schematex-logic-bubble"/>`);
|
|
186
|
+
parts.push(`<line x1="${ox}" y1="${p.y}" x2="${ox + 10}" y2="${p.y}" class="schematex-logic-wire"/>`);
|
|
187
|
+
}
|
|
188
|
+
out.push({
|
|
189
|
+
id: type,
|
|
190
|
+
label: humanize(type),
|
|
191
|
+
svg: svgDoc(`-14 -6 ${g.width + 28} ${g.height + 12}`, LOGIC_CSS, parts.join(""))
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
return out.sort((a, b) => a.label.localeCompare(b.label));
|
|
195
|
+
}
|
|
196
|
+
var NETWORK_CSS = ".sx-net-body{fill:#ffffff;stroke:#0f172a;stroke-width:2}.sx-net-detail{fill:none;stroke:#0f172a;stroke-width:1}.sx-net-glyph{fill:#2563eb;stroke:none}.sx-net-glyph-line{fill:none;stroke:#2563eb;stroke-width:1.4}.sx-net-icontext{font:700 8px sans-serif;fill:#2563eb}.sx-net-cloud-body{fill:#f1f5f9;stroke:#0f172a;stroke-width:2}.sx-net-cloudtext{font:600 13px sans-serif;fill:#0f172a}.sx-net-bus{stroke:#0f172a;stroke-width:4;stroke-linecap:round}";
|
|
197
|
+
var NETWORK_KINDS = [
|
|
198
|
+
"router",
|
|
199
|
+
"switch",
|
|
200
|
+
"l3switch",
|
|
201
|
+
"poeswitch",
|
|
202
|
+
"firewall",
|
|
203
|
+
"loadbalancer",
|
|
204
|
+
"ap",
|
|
205
|
+
"wlc",
|
|
206
|
+
"gateway",
|
|
207
|
+
"modem",
|
|
208
|
+
"ids",
|
|
209
|
+
"proxy",
|
|
210
|
+
"vpngw",
|
|
211
|
+
"server",
|
|
212
|
+
"serverfarm",
|
|
213
|
+
"pc",
|
|
214
|
+
"laptop",
|
|
215
|
+
"mobile",
|
|
216
|
+
"ipphone",
|
|
217
|
+
"printer",
|
|
218
|
+
"storage",
|
|
219
|
+
"camera",
|
|
220
|
+
"nvr",
|
|
221
|
+
"dvr",
|
|
222
|
+
"encoder",
|
|
223
|
+
"monitor",
|
|
224
|
+
"internet",
|
|
225
|
+
"cloud"
|
|
226
|
+
];
|
|
227
|
+
function networkCatalog() {
|
|
228
|
+
const out = [];
|
|
229
|
+
for (const kind of NETWORK_KINDS) {
|
|
230
|
+
const { w, h } = iconSize(kind);
|
|
231
|
+
const device = { id: kind, kind, label: humanize(kind), groups: [] };
|
|
232
|
+
let inner;
|
|
233
|
+
try {
|
|
234
|
+
inner = drawDeviceIcon(device, { x: 0, y: 0, w, h });
|
|
235
|
+
} catch {
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
out.push({
|
|
239
|
+
id: kind,
|
|
240
|
+
label: humanize(kind),
|
|
241
|
+
svg: svgDoc(`-6 -6 ${w + 12} ${h + 12}`, NETWORK_CSS, inner)
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
return out.sort((a, b) => a.label.localeCompare(b.label));
|
|
245
|
+
}
|
|
246
|
+
var CATALOGS = {
|
|
247
|
+
circuit: () => ({
|
|
248
|
+
type: "circuit",
|
|
249
|
+
label: "Circuit components",
|
|
250
|
+
note: "IEEE 315 / ANSI Y32.2 schematic symbols the netlist/positional engine draws.",
|
|
251
|
+
entries: circuitCatalog()
|
|
252
|
+
}),
|
|
253
|
+
sld: () => ({
|
|
254
|
+
type: "sld",
|
|
255
|
+
label: "Single-line apparatus",
|
|
256
|
+
note: "IEEE 315 power-apparatus symbols \u2014 sources, transformers, switching, protection, loads.",
|
|
257
|
+
entries: sldCatalog()
|
|
258
|
+
}),
|
|
259
|
+
pid: () => ({
|
|
260
|
+
type: "pid",
|
|
261
|
+
label: "P&ID equipment",
|
|
262
|
+
note: "ANSI/ISA-5.1 process equipment \u2014 tanks, columns, exchangers, pumps, and more.",
|
|
263
|
+
entries: pidCatalog()
|
|
264
|
+
}),
|
|
265
|
+
logic: () => ({
|
|
266
|
+
type: "logic",
|
|
267
|
+
label: "Logic gates",
|
|
268
|
+
note: "IEEE 91 ANSI gate bodies \u2014 combinational gates, flip-flops, latches, MUX/decoder, counters.",
|
|
269
|
+
entries: logicCatalog()
|
|
270
|
+
}),
|
|
271
|
+
network: () => ({
|
|
272
|
+
type: "network",
|
|
273
|
+
label: "Network devices",
|
|
274
|
+
note: "Cisco-convention topology icons \u2014 routers, switches, firewalls, servers, cameras, clouds.",
|
|
275
|
+
entries: networkCatalog()
|
|
276
|
+
}),
|
|
277
|
+
flowchart: () => ({
|
|
278
|
+
type: "flowchart",
|
|
279
|
+
label: "Node icons",
|
|
280
|
+
note: "Inline node icons (servers, databases, cloud, gear\u2026) usable on any flowchart node.",
|
|
281
|
+
entries: flowchartIconCatalog()
|
|
282
|
+
})
|
|
283
|
+
};
|
|
284
|
+
var SYMBOL_CATALOG_TYPES = Object.keys(CATALOGS);
|
|
285
|
+
function getSymbolCatalog(type) {
|
|
286
|
+
const factory = CATALOGS[type];
|
|
287
|
+
return factory ? factory() : null;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export { SYMBOL_CATALOG_TYPES, getSymbolCatalog };
|
|
24
291
|
//# sourceMappingURL=index.js.map
|
|
25
292
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -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KAAK,OAAO;AAAA,IACV,IAAA,EAAM,KAAA;AAAA,IACN,KAAA,EAAO,gBAAA;AAAA,IACP,IAAA,EAAM,oFAAA;AAAA,IACN,SAAS,UAAA;AAAW,GACtB,CAAA;AAAA,EACA,OAAO,OAAO;AAAA,IACZ,IAAA,EAAM,OAAA;AAAA,IACN,KAAA,EAAO,aAAA;AAAA,IACP,IAAA,EAAM,kGAAA;AAAA,IACN,SAAS,YAAA;AAAa,GACxB,CAAA;AAAA,EACA,SAAS,OAAO;AAAA,IACd,IAAA,EAAM,SAAA;AAAA,IACN,KAAA,EAAO,iBAAA;AAAA,IACP,IAAA,EAAM,gGAAA;AAAA,IACN,SAAS,cAAA;AAAe,GAC1B,CAAA;AAAA,EACA,WAAW,OAAO;AAAA,IAChB,IAAA,EAAM,WAAA;AAAA,IACN,KAAA,EAAO,YAAA;AAAA,IACP,IAAA,EAAM,yFAAA;AAAA,IACN,SAAS,oBAAA;AAAqB,GAChC;AACF,CAAA;AAGO,IAAM,oBAAA,GAAuB,MAAA,CAAO,IAAA,CAAK,QAAQ;AAEjD,SAAS,iBAAiB,IAAA,EAAoC;AACnE,EAAA,MAAM,OAAA,GAAU,SAAS,IAAmB,CAAA;AAC5C,EAAA,OAAO,OAAA,GAAU,SAAQ,GAAI,IAAA;AAC/B","file":"index.js","sourcesContent":["/**\n * Domain symbol catalogs — the real symbols an engine uses *inside* a diagram\n * (circuit components, SLD apparatus, P&ID equipment, flowchart node icons),\n * each rendered standalone for the /icons showcase. This is distinct from the\n * per-type representative glyph (assets/icons/*.svg).\n *\n * Each entry's `svg` is a complete, self-styled <svg> so consumers can drop it\n * straight into the page.\n */\nimport type { DiagramType, SLDNodeType, LogicGateType } from \"./core/types\";\nimport { SYMBOLS, EXTRA_SYMBOLS } from \"./diagrams/circuit/symbols\";\nimport { renderSymbol as sldRenderSymbol, geometryFor } from \"./diagrams/sld/symbols\";\nimport { renderEquip, GEOMETRY as PID_GEOMETRY } from \"./diagrams/pid/symbols\";\nimport { iconNames, renderIcon } from \"./diagrams/flowchart/icons\";\nimport { getGateGeometry } from \"./diagrams/logic/symbols\";\nimport { drawDeviceIcon, iconSize } from \"./diagrams/network/symbols\";\n\nexport interface SymbolCatalogEntry {\n id: string;\n label: string;\n svg: string;\n}\n\nexport interface SymbolCatalog {\n type: DiagramType;\n /** Human label for the catalog section, e.g. \"Circuit components\". */\n label: string;\n /** Short description of what the symbols are. */\n note: string;\n entries: SymbolCatalogEntry[];\n}\n\nfunction humanize(id: string): string {\n return id\n .replace(/[_-]+/g, \" \")\n .replace(/\\b\\w/g, (c) => c.toUpperCase());\n}\n\nfunction svgDoc(viewBox: string, css: string, inner: string): string {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"${viewBox}\" class=\"lt-symbol\">` +\n `<style>${css}</style>${inner}</svg>`;\n}\n\n// ── Circuit (IEEE 315) ─────────────────────────────────────────────\nconst CIRCUIT_CSS =\n \".schematex-circuit-body{stroke:#0f172a;stroke-width:1.75;fill:none;stroke-linejoin:round;stroke-linecap:round}\" +\n \".schematex-circuit-fill{stroke:#0f172a;stroke-width:1.5;fill:#0f172a}\" +\n \".schematex-circuit-wire{stroke:#0f172a;stroke-width:1.75;fill:none;stroke-linecap:square}\";\n\nfunction circuitCatalog(): SymbolCatalogEntry[] {\n const merged: Record<string, { length: number; svg: () => string }> = {\n ...(SYMBOLS as Record<string, { length: number; svg: () => string }>),\n ...(EXTRA_SYMBOLS as Record<string, { length: number; svg: () => string }>),\n };\n const out: SymbolCatalogEntry[] = [];\n for (const [id, def] of Object.entries(merged)) {\n if (!def) continue;\n const L = def.length || 40;\n const inner = def.svg();\n out.push({ id, label: humanize(id), svg: svgDoc(`-10 -24 ${L + 20} 48`, CIRCUIT_CSS, inner) });\n }\n return out.sort((a, b) => a.label.localeCompare(b.label));\n}\n\n// ── SLD (IEEE 315 / IEC 60617) ─────────────────────────────────────\nconst SLD_CSS =\n \".lt-sld-stroke{stroke:#0f172a;stroke-width:1.8;fill:none}\" +\n \".lt-sld-stroke-thick{stroke:#0f172a;stroke-width:2.4;fill:none;stroke-linecap:round}\" +\n \".lt-sld-fill{fill:#ffffff;stroke:#0f172a;stroke-width:2}\" +\n \".lt-sld-fill-dark{fill:#0f172a;stroke:#0f172a;stroke-width:1}\" +\n \".lt-sld-dot{fill:#0f172a;stroke:none}\" +\n \".lt-sld-wire{stroke:#0f172a;stroke-width:2;fill:none}\" +\n \".lt-sld-bus{stroke:#0f172a;stroke-width:6;stroke-linecap:square}\" +\n \".lt-sld-symbol-text{font:11px sans-serif;fill:#0f172a;dominant-baseline:middle}\" +\n \".lt-sld-wdg{font:bold 10px sans-serif;fill:#0f172a;dominant-baseline:middle}\";\n\nconst SLD_TYPES: SLDNodeType[] = [\n \"utility\", \"generator\", \"solar\", \"wind\", \"ups\", \"transformer\", \"transformer_dy\",\n \"transformer_yd\", \"transformer_yy\", \"transformer_dd\", \"autotransformer\",\n \"transformer_3winding\", \"breaker\", \"breaker_vacuum\", \"recloser\", \"switch\",\n \"switch_load\", \"ground_switch\", \"sectionalizer\", \"fuse\", \"fuse_cl\", \"motor\",\n \"load\", \"capacitor_bank\", \"harmonic_filter\", \"vfd\", \"ats\", \"ct\", \"pt\", \"relay\",\n \"surge_arrester\", \"watthour_meter\", \"demand_meter\", \"ground_fault\", \"bus\",\n \"bus_tie\", \"hub\",\n];\n\nfunction sldCatalog(): SymbolCatalogEntry[] {\n const out: SymbolCatalogEntry[] = [];\n for (const type of SLD_TYPES) {\n let inner: string;\n try {\n inner = sldRenderSymbol(type);\n } catch {\n continue;\n }\n const g = geometryFor(type);\n const w = Math.max(g.halfWidth, 18) + 12;\n const top = Math.min(g.topY, -22) - 8;\n const bot = Math.max(g.bottomY, 22) + 8;\n out.push({\n id: type,\n label: humanize(type),\n svg: svgDoc(`${-w} ${top} ${2 * w} ${bot - top}`, SLD_CSS, inner),\n });\n }\n return out.sort((a, b) => a.label.localeCompare(b.label));\n}\n\n// ── P&ID (ISA-5.1) equipment ───────────────────────────────────────\nconst PID_CSS =\n \".lt-pid-equip{fill:#ffffff;stroke:#1d1d1d;stroke-width:1.6}\" +\n \".lt-pid-equip-tag{font:600 11px system-ui,sans-serif;fill:#1d1d1d}\" +\n \".lt-pid-process{stroke:#1d1d1d;stroke-width:2.6;fill:none}\" +\n \".lt-pid-process-min{stroke:#1d1d1d;stroke-width:1.5;fill:none}\";\n\nfunction pidCatalog(): SymbolCatalogEntry[] {\n const out: SymbolCatalogEntry[] = [];\n const pad = 12;\n for (const [id, g] of Object.entries(PID_GEOMETRY)) {\n let inner: string;\n try {\n inner = renderEquip(id as Parameters<typeof renderEquip>[0], \"\");\n } catch {\n continue;\n }\n out.push({\n id,\n label: humanize(id),\n svg: svgDoc(\n `${-g.width / 2 - pad} ${-g.height / 2 - pad} ${g.width + 2 * pad} ${g.height + 2 * pad}`,\n PID_CSS,\n inner,\n ),\n });\n }\n return out.sort((a, b) => a.label.localeCompare(b.label));\n}\n\n// ── Flowchart node icons ───────────────────────────────────────────\nconst FC_ICON_CSS =\n \".sx-fc-icon{stroke:#0f172a;fill:none}.sx-fc-icon-fill{fill:#0f172a}\";\n\nfunction flowchartIconCatalog(): SymbolCatalogEntry[] {\n return iconNames()\n .map((name) => ({\n id: name,\n label: humanize(name),\n svg: svgDoc(\"-13 -13 26 26\", FC_ICON_CSS, renderIcon(name)),\n }))\n .sort((a, b) => a.label.localeCompare(b.label));\n}\n\n// ── Logic gates (IEEE 91) ──────────────────────────────────────────\nconst LOGIC_CSS =\n \".schematex-logic-gate-body{fill:none;stroke:#0f172a;stroke-width:1.75;stroke-linejoin:round}\" +\n \".schematex-logic-bubble{fill:#ffffff;stroke:#0f172a;stroke-width:1.5}\" +\n \".schematex-logic-wire{stroke:#0f172a;stroke-width:1.5;fill:none;stroke-linecap:square}\" +\n \".schematex-logic-gate-iec-label{font:bold 13px sans-serif;fill:#0f172a}\";\n\nconst LOGIC_TYPES: LogicGateType[] = [\n \"AND\", \"OR\", \"NOT\", \"NAND\", \"NOR\", \"XOR\", \"XNOR\", \"BUF\", \"TRISTATE_BUF\",\n \"OPEN_DRAIN\", \"SCHMITT\", \"DFF\", \"JKFF\", \"SRFF\", \"TFF\", \"LATCH_D\", \"LATCH_SR\",\n \"MUX\", \"DEMUX\", \"DECODER\", \"ENCODER\", \"COUNTER\", \"SHIFT_REG\",\n];\nconst SINGLE_INPUT = new Set<LogicGateType>([\"NOT\", \"BUF\", \"SCHMITT\", \"TRISTATE_BUF\", \"TRISTATE_INV\", \"OPEN_DRAIN\", \"DFF\", \"TFF\"]);\n\nfunction logicCatalog(): SymbolCatalogEntry[] {\n const out: SymbolCatalogEntry[] = [];\n for (const type of LOGIC_TYPES) {\n let g;\n try {\n g = getGateGeometry(type, SINGLE_INPUT.has(type) ? 1 : 2);\n } catch {\n continue;\n }\n const parts = [`<path d=\"${g.ansiPath}\" class=\"schematex-logic-gate-body\"/>`];\n for (const p of g.inputPins) parts.push(`<line x1=\"${p.x - 10}\" y1=\"${p.y}\" x2=\"${p.x}\" y2=\"${p.y}\" class=\"schematex-logic-wire\"/>`);\n for (const p of g.outputPins) {\n const bub = p.bubble || g.outputBubble;\n const ox = bub ? p.x + 6 : p.x;\n if (bub) parts.push(`<circle cx=\"${p.x + 3}\" cy=\"${p.y}\" r=\"3\" class=\"schematex-logic-bubble\"/>`);\n parts.push(`<line x1=\"${ox}\" y1=\"${p.y}\" x2=\"${ox + 10}\" y2=\"${p.y}\" class=\"schematex-logic-wire\"/>`);\n }\n out.push({\n id: type,\n label: humanize(type),\n svg: svgDoc(`-14 -6 ${g.width + 28} ${g.height + 12}`, LOGIC_CSS, parts.join(\"\")),\n });\n }\n return out.sort((a, b) => a.label.localeCompare(b.label));\n}\n\n// ── Network devices (Cisco-convention icons) ───────────────────────\nconst NETWORK_CSS =\n \".sx-net-body{fill:#ffffff;stroke:#0f172a;stroke-width:2}\" +\n \".sx-net-detail{fill:none;stroke:#0f172a;stroke-width:1}\" +\n \".sx-net-glyph{fill:#2563eb;stroke:none}\" +\n \".sx-net-glyph-line{fill:none;stroke:#2563eb;stroke-width:1.4}\" +\n \".sx-net-icontext{font:700 8px sans-serif;fill:#2563eb}\" +\n \".sx-net-cloud-body{fill:#f1f5f9;stroke:#0f172a;stroke-width:2}\" +\n \".sx-net-cloudtext{font:600 13px sans-serif;fill:#0f172a}\" +\n \".sx-net-bus{stroke:#0f172a;stroke-width:4;stroke-linecap:round}\";\n\nconst NETWORK_KINDS = [\n \"router\", \"switch\", \"l3switch\", \"poeswitch\", \"firewall\", \"loadbalancer\", \"ap\",\n \"wlc\", \"gateway\", \"modem\", \"ids\", \"proxy\", \"vpngw\", \"server\", \"serverfarm\",\n \"pc\", \"laptop\", \"mobile\", \"ipphone\", \"printer\", \"storage\", \"camera\", \"nvr\",\n \"dvr\", \"encoder\", \"monitor\", \"internet\", \"cloud\",\n] as const;\n\nfunction networkCatalog(): SymbolCatalogEntry[] {\n const out: SymbolCatalogEntry[] = [];\n for (const kind of NETWORK_KINDS) {\n const { w, h } = iconSize(kind as Parameters<typeof iconSize>[0]);\n const device = { id: kind, kind, label: humanize(kind), groups: [] } as Parameters<typeof drawDeviceIcon>[0];\n let inner: string;\n try {\n inner = drawDeviceIcon(device, { x: 0, y: 0, w, h });\n } catch {\n continue;\n }\n out.push({\n id: kind,\n label: humanize(kind),\n svg: svgDoc(`-6 -6 ${w + 12} ${h + 12}`, NETWORK_CSS, inner),\n });\n }\n return out.sort((a, b) => a.label.localeCompare(b.label));\n}\n\nconst CATALOGS: Partial<Record<DiagramType, () => SymbolCatalog>> = {\n circuit: () => ({\n type: \"circuit\",\n label: \"Circuit components\",\n note: \"IEEE 315 / ANSI Y32.2 schematic symbols the netlist/positional engine draws.\",\n entries: circuitCatalog(),\n }),\n sld: () => ({\n type: \"sld\",\n label: \"Single-line apparatus\",\n note: \"IEEE 315 power-apparatus symbols — sources, transformers, switching, protection, loads.\",\n entries: sldCatalog(),\n }),\n pid: () => ({\n type: \"pid\",\n label: \"P&ID equipment\",\n note: \"ANSI/ISA-5.1 process equipment — tanks, columns, exchangers, pumps, and more.\",\n entries: pidCatalog(),\n }),\n logic: () => ({\n type: \"logic\",\n label: \"Logic gates\",\n note: \"IEEE 91 ANSI gate bodies — combinational gates, flip-flops, latches, MUX/decoder, counters.\",\n entries: logicCatalog(),\n }),\n network: () => ({\n type: \"network\",\n label: \"Network devices\",\n note: \"Cisco-convention topology icons — routers, switches, firewalls, servers, cameras, clouds.\",\n entries: networkCatalog(),\n }),\n flowchart: () => ({\n type: \"flowchart\",\n label: \"Node icons\",\n note: \"Inline node icons (servers, databases, cloud, gear…) usable on any flowchart node.\",\n entries: flowchartIconCatalog(),\n }),\n};\n\n/** Diagram types that ship a renderable domain symbol catalog. */\nexport const SYMBOL_CATALOG_TYPES = Object.keys(CATALOGS) as DiagramType[];\n\nexport function getSymbolCatalog(type: string): SymbolCatalog | null {\n const factory = CATALOGS[type as DiagramType];\n return factory ? factory() : null;\n}\n"]}
|
package/dist/react.cjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
3
|
+
var chunk4XR7X7XW_cjs = require('./chunk-4XR7X7XW.cjs');
|
|
4
|
+
require('./chunk-FKJBXGWP.cjs');
|
|
5
|
+
require('./chunk-V4RO5KYY.cjs');
|
|
6
|
+
require('./chunk-XNCOSVNG.cjs');
|
|
7
|
+
require('./chunk-2L4YXZAZ.cjs');
|
|
8
|
+
require('./chunk-R6VX5YTJ.cjs');
|
|
9
9
|
require('./chunk-SBB6C4OP.cjs');
|
|
10
|
-
require('./chunk-
|
|
11
|
-
require('./chunk-
|
|
12
|
-
require('./chunk-
|
|
13
|
-
require('./chunk-
|
|
14
|
-
require('./chunk-
|
|
15
|
-
require('./chunk-
|
|
16
|
-
require('./chunk-
|
|
10
|
+
require('./chunk-V4GILQR6.cjs');
|
|
11
|
+
require('./chunk-HWVBHU3O.cjs');
|
|
12
|
+
require('./chunk-C5C5EF3W.cjs');
|
|
13
|
+
require('./chunk-6JI6FWLZ.cjs');
|
|
14
|
+
require('./chunk-S3RMAXH5.cjs');
|
|
15
|
+
require('./chunk-VTSH4YPT.cjs');
|
|
16
|
+
require('./chunk-YB4XJY5L.cjs');
|
|
17
17
|
require('./chunk-3KRL2EGN.cjs');
|
|
18
|
-
require('./chunk-
|
|
19
|
-
require('./chunk-
|
|
18
|
+
require('./chunk-4UFR2LB6.cjs');
|
|
19
|
+
require('./chunk-WQDIZH2Z.cjs');
|
|
20
20
|
require('./chunk-5UCXMYE7.cjs');
|
|
21
21
|
require('./chunk-ST5YRTTV.cjs');
|
|
22
|
-
require('./chunk-
|
|
23
|
-
require('./chunk-
|
|
22
|
+
require('./chunk-R66QG3XT.cjs');
|
|
23
|
+
require('./chunk-L7POWM5B.cjs');
|
|
24
24
|
require('./chunk-NAGUZFXX.cjs');
|
|
25
25
|
require('./chunk-3WNW5Y7P.cjs');
|
|
26
26
|
var react = require('react');
|
|
@@ -37,7 +37,7 @@ function SchematexDiagram({
|
|
|
37
37
|
onError
|
|
38
38
|
}) {
|
|
39
39
|
const svg = react.useMemo(() => {
|
|
40
|
-
const result =
|
|
40
|
+
const result = chunk4XR7X7XW_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.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { S as SchematexConfig } from './api-
|
|
3
|
-
import './
|
|
2
|
+
import { S as SchematexConfig } from './api-BEJTXyBA.cjs';
|
|
3
|
+
import './diagnostics-B-ffSEhl.cjs';
|
|
4
4
|
|
|
5
5
|
interface SchematexDiagramProps {
|
|
6
6
|
/** DSL text to render */
|
package/dist/react.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { S as SchematexConfig } from './api-
|
|
3
|
-
import './
|
|
2
|
+
import { S as SchematexConfig } from './api-DFrSR3lw.js';
|
|
3
|
+
import './diagnostics-B-ffSEhl.js';
|
|
4
4
|
|
|
5
5
|
interface SchematexDiagramProps {
|
|
6
6
|
/** DSL text to render */
|
package/dist/react.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { renderResult } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
6
|
-
import './chunk-
|
|
1
|
+
import { renderResult } from './chunk-I2GQYOZ5.js';
|
|
2
|
+
import './chunk-RJMCWT7Z.js';
|
|
3
|
+
import './chunk-UWA5MWCI.js';
|
|
4
|
+
import './chunk-MFAMNFPA.js';
|
|
5
|
+
import './chunk-TWLKXV2O.js';
|
|
6
|
+
import './chunk-522WB2EH.js';
|
|
7
7
|
import './chunk-PIV2A3HG.js';
|
|
8
|
-
import './chunk-
|
|
9
|
-
import './chunk-
|
|
10
|
-
import './chunk-
|
|
11
|
-
import './chunk-
|
|
12
|
-
import './chunk-
|
|
13
|
-
import './chunk-
|
|
14
|
-
import './chunk-
|
|
8
|
+
import './chunk-H4MT5TJP.js';
|
|
9
|
+
import './chunk-HAZALB7U.js';
|
|
10
|
+
import './chunk-FBS3PACU.js';
|
|
11
|
+
import './chunk-7F76AWOI.js';
|
|
12
|
+
import './chunk-DOK7LKLO.js';
|
|
13
|
+
import './chunk-YS6CGUNH.js';
|
|
14
|
+
import './chunk-N5B242WY.js';
|
|
15
15
|
import './chunk-2KTQ75LN.js';
|
|
16
|
-
import './chunk-
|
|
17
|
-
import './chunk-
|
|
16
|
+
import './chunk-MVIEIKOI.js';
|
|
17
|
+
import './chunk-3VB5AT4R.js';
|
|
18
18
|
import './chunk-FO7BLCEW.js';
|
|
19
19
|
import './chunk-6URNSB6G.js';
|
|
20
|
-
import './chunk-
|
|
21
|
-
import './chunk-
|
|
20
|
+
import './chunk-3IE7KZY4.js';
|
|
21
|
+
import './chunk-LRI4RH2N.js';
|
|
22
22
|
import './chunk-5IKOLUWK.js';
|
|
23
23
|
import './chunk-SYYBKDL7.js';
|
|
24
24
|
import { useMemo } from 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SchematexConfig } from './api-
|
|
2
|
-
import {
|
|
1
|
+
import { S as SchematexConfig } from './api-BEJTXyBA.cjs';
|
|
2
|
+
import { a as DiagramType } from './diagnostics-B-ffSEhl.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Diagram registry — metadata for every diagram type Schematex supports.
|
|
@@ -8,7 +8,7 @@ import { q as DiagramType } from './types-WTr9W5Ud.cjs';
|
|
|
8
8
|
* are tuned to help the model pick the right type for a user request.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
type DiagramCluster = "relationships" | "electrical-industrial" | "corporate-legal" | "causality-analysis" | "generic" | "strategy" | "knowledge" | "behavior-modeling" | "research" | "project-management";
|
|
11
|
+
type DiagramCluster = "relationships" | "electrical-industrial" | "corporate-legal" | "causality-analysis" | "generic" | "strategy" | "knowledge" | "behavior-modeling" | "concurrency" | "research" | "project-management" | "network-infrastructure";
|
|
12
12
|
interface DiagramMeta {
|
|
13
13
|
/** Canonical type id — matches `DiagramType` and plugin keys. */
|
|
14
14
|
type: DiagramType;
|
|
@@ -26,6 +26,14 @@ interface DiagramMeta {
|
|
|
26
26
|
syntaxKey: string;
|
|
27
27
|
}
|
|
28
28
|
declare const DIAGRAM_REGISTRY: readonly DiagramMeta[];
|
|
29
|
+
/**
|
|
30
|
+
* The library version that first shipped each diagram type, sourced from
|
|
31
|
+
* CHANGELOG.md "Added" entries. Kept as a companion map (rather than a field on
|
|
32
|
+
* the big registry literal) so the literal stays stable. `since` powers the
|
|
33
|
+
* version badge on /diagrams and the cross-link to /changelog.
|
|
34
|
+
*/
|
|
35
|
+
declare const DIAGRAM_SINCE: Readonly<Record<DiagramType, string>>;
|
|
36
|
+
declare function getDiagramSince(type: string): string | undefined;
|
|
29
37
|
declare function resolveDiagramType(type: string): DiagramType | undefined;
|
|
30
38
|
declare function getDiagramMeta(type: string): DiagramMeta | undefined;
|
|
31
39
|
declare function getAllDiagramTypes(): DiagramType[];
|
|
@@ -150,4 +158,4 @@ type RenderDslResult = {
|
|
|
150
158
|
};
|
|
151
159
|
declare function renderDsl(type: string | undefined, dsl: string, options?: Omit<SchematexConfig, "type">): RenderDslResult;
|
|
152
160
|
|
|
153
|
-
export { DIAGRAM_REGISTRY as D, type Example as E, type GetExamplesOptions as G, type RenderDslResult as R, type SchematexValidationError as S, type ValidateDslResult as V, type DiagramCluster as
|
|
161
|
+
export { DIAGRAM_REGISTRY as D, type Example as E, type GetExamplesOptions as G, type RenderDslResult as R, type SchematexValidationError as S, type ValidateDslResult as V, DIAGRAM_SINCE as a, type DiagramCluster as b, type DiagramListItem as c, type DiagramMeta as d, type GetExamplesResult as e, type GetSyntaxOptions as f, type GetSyntaxResult as g, type SyntaxDetail as h, type SyntaxDoc as i, getAllDiagramTypes as j, getDiagramMeta as k, getDiagramSince as l, getExamples as m, getSyntax as n, listDiagrams as o, resolveDiagramType as p, renderDsl as r, validateDsl as v };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SchematexConfig } from './api-
|
|
2
|
-
import {
|
|
1
|
+
import { S as SchematexConfig } from './api-DFrSR3lw.js';
|
|
2
|
+
import { a as DiagramType } from './diagnostics-B-ffSEhl.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Diagram registry — metadata for every diagram type Schematex supports.
|
|
@@ -8,7 +8,7 @@ import { q as DiagramType } from './types-WTr9W5Ud.js';
|
|
|
8
8
|
* are tuned to help the model pick the right type for a user request.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
type DiagramCluster = "relationships" | "electrical-industrial" | "corporate-legal" | "causality-analysis" | "generic" | "strategy" | "knowledge" | "behavior-modeling" | "research" | "project-management";
|
|
11
|
+
type DiagramCluster = "relationships" | "electrical-industrial" | "corporate-legal" | "causality-analysis" | "generic" | "strategy" | "knowledge" | "behavior-modeling" | "concurrency" | "research" | "project-management" | "network-infrastructure";
|
|
12
12
|
interface DiagramMeta {
|
|
13
13
|
/** Canonical type id — matches `DiagramType` and plugin keys. */
|
|
14
14
|
type: DiagramType;
|
|
@@ -26,6 +26,14 @@ interface DiagramMeta {
|
|
|
26
26
|
syntaxKey: string;
|
|
27
27
|
}
|
|
28
28
|
declare const DIAGRAM_REGISTRY: readonly DiagramMeta[];
|
|
29
|
+
/**
|
|
30
|
+
* The library version that first shipped each diagram type, sourced from
|
|
31
|
+
* CHANGELOG.md "Added" entries. Kept as a companion map (rather than a field on
|
|
32
|
+
* the big registry literal) so the literal stays stable. `since` powers the
|
|
33
|
+
* version badge on /diagrams and the cross-link to /changelog.
|
|
34
|
+
*/
|
|
35
|
+
declare const DIAGRAM_SINCE: Readonly<Record<DiagramType, string>>;
|
|
36
|
+
declare function getDiagramSince(type: string): string | undefined;
|
|
29
37
|
declare function resolveDiagramType(type: string): DiagramType | undefined;
|
|
30
38
|
declare function getDiagramMeta(type: string): DiagramMeta | undefined;
|
|
31
39
|
declare function getAllDiagramTypes(): DiagramType[];
|
|
@@ -150,4 +158,4 @@ type RenderDslResult = {
|
|
|
150
158
|
};
|
|
151
159
|
declare function renderDsl(type: string | undefined, dsl: string, options?: Omit<SchematexConfig, "type">): RenderDslResult;
|
|
152
160
|
|
|
153
|
-
export { DIAGRAM_REGISTRY as D, type Example as E, type GetExamplesOptions as G, type RenderDslResult as R, type SchematexValidationError as S, type ValidateDslResult as V, type DiagramCluster as
|
|
161
|
+
export { DIAGRAM_REGISTRY as D, type Example as E, type GetExamplesOptions as G, type RenderDslResult as R, type SchematexValidationError as S, type ValidateDslResult as V, DIAGRAM_SINCE as a, type DiagramCluster as b, type DiagramListItem as c, type DiagramMeta as d, type GetExamplesResult as e, type GetSyntaxOptions as f, type GetSyntaxResult as g, type SyntaxDetail as h, type SyntaxDoc as i, getAllDiagramTypes as j, getDiagramMeta as k, getDiagramSince as l, getExamples as m, getSyntax as n, listDiagrams as o, resolveDiagramType as p, renderDsl as r, validateDsl as v };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "schematex",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Every diagram a doctor, engineer, or lawyer would actually use. 31 industry-standard diagrams (genogram, pedigree, ladder logic, SLD, FBD, SFC, P&ID, UML use case, UML sequence, 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",
|