schematex 0.6.0 → 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.
Files changed (87) hide show
  1. package/dist/ai/ai-sdk.cjs +9 -9
  2. package/dist/ai/ai-sdk.d.cts +4 -4
  3. package/dist/ai/ai-sdk.d.ts +4 -4
  4. package/dist/ai/ai-sdk.js +4 -4
  5. package/dist/ai/index.cjs +15 -15
  6. package/dist/ai/index.d.cts +3 -3
  7. package/dist/ai/index.d.ts +3 -3
  8. package/dist/ai/index.js +4 -4
  9. package/dist/{api-qVDutqXH.d.cts → api-BEJTXyBA.d.cts} +1 -1
  10. package/dist/{api-XWHHAhQI.d.ts → api-DFrSR3lw.d.ts} +1 -1
  11. package/dist/browser.cjs +10 -10
  12. package/dist/browser.d.cts +3 -3
  13. package/dist/browser.d.ts +3 -3
  14. package/dist/browser.js +4 -4
  15. package/dist/{chunk-25ZON47K.cjs → chunk-4XR7X7XW.cjs} +96 -26
  16. package/dist/chunk-4XR7X7XW.cjs.map +1 -0
  17. package/dist/{chunk-LGABFD3L.js → chunk-522WB2EH.js} +2 -2
  18. package/dist/{chunk-LGABFD3L.js.map → chunk-522WB2EH.js.map} +1 -1
  19. package/dist/{chunk-7AFW2J6J.js → chunk-I2GQYOZ5.js} +94 -24
  20. package/dist/chunk-I2GQYOZ5.js.map +1 -0
  21. package/dist/{chunk-EPKIJEH7.js → chunk-MFAMNFPA.js} +63 -6
  22. package/dist/chunk-MFAMNFPA.js.map +1 -0
  23. package/dist/{chunk-P63S7P6N.js → chunk-OTSVMKII.js} +116 -3
  24. package/dist/chunk-OTSVMKII.js.map +1 -0
  25. package/dist/{chunk-ECD5XHBM.cjs → chunk-R6VX5YTJ.cjs} +2 -2
  26. package/dist/{chunk-ECD5XHBM.cjs.map → chunk-R6VX5YTJ.cjs.map} +1 -1
  27. package/dist/{chunk-YVDUEUFV.cjs → chunk-SSLNPHCL.cjs} +118 -5
  28. package/dist/chunk-SSLNPHCL.cjs.map +1 -0
  29. package/dist/{chunk-SUIDD2C5.cjs → chunk-XNCOSVNG.cjs} +63 -6
  30. package/dist/chunk-XNCOSVNG.cjs.map +1 -0
  31. package/dist/{diagnostics-DRxhodP6.d.ts → diagnostics-B-ffSEhl.d.cts} +8 -0
  32. package/dist/{diagnostics-DRxhodP6.d.cts → diagnostics-B-ffSEhl.d.ts} +8 -0
  33. package/dist/diagrams/blockdiagram/index.cjs +5 -5
  34. package/dist/diagrams/blockdiagram/index.d.cts +1 -1
  35. package/dist/diagrams/blockdiagram/index.d.ts +1 -1
  36. package/dist/diagrams/blockdiagram/index.js +1 -1
  37. package/dist/diagrams/circuit/index.d.cts +1 -1
  38. package/dist/diagrams/circuit/index.d.ts +1 -1
  39. package/dist/diagrams/ecomap/index.d.cts +1 -1
  40. package/dist/diagrams/ecomap/index.d.ts +1 -1
  41. package/dist/diagrams/entity/index.d.cts +1 -1
  42. package/dist/diagrams/entity/index.d.ts +1 -1
  43. package/dist/diagrams/fishbone/index.d.cts +1 -1
  44. package/dist/diagrams/fishbone/index.d.ts +1 -1
  45. package/dist/diagrams/flowchart/index.d.cts +2 -2
  46. package/dist/diagrams/flowchart/index.d.ts +2 -2
  47. package/dist/diagrams/genogram/index.d.cts +1 -1
  48. package/dist/diagrams/genogram/index.d.ts +1 -1
  49. package/dist/diagrams/ladder/index.d.cts +1 -1
  50. package/dist/diagrams/ladder/index.d.ts +1 -1
  51. package/dist/diagrams/logic/index.d.cts +1 -1
  52. package/dist/diagrams/logic/index.d.ts +1 -1
  53. package/dist/diagrams/orgchart/index.d.cts +1 -1
  54. package/dist/diagrams/orgchart/index.d.ts +1 -1
  55. package/dist/diagrams/pedigree/index.d.cts +1 -1
  56. package/dist/diagrams/pedigree/index.d.ts +1 -1
  57. package/dist/diagrams/phylo/index.d.cts +1 -1
  58. package/dist/diagrams/phylo/index.d.ts +1 -1
  59. package/dist/diagrams/sld/index.cjs +7 -7
  60. package/dist/diagrams/sld/index.d.cts +1 -1
  61. package/dist/diagrams/sld/index.d.ts +1 -1
  62. package/dist/diagrams/sld/index.js +1 -1
  63. package/dist/diagrams/sociogram/index.d.cts +1 -1
  64. package/dist/diagrams/sociogram/index.d.ts +1 -1
  65. package/dist/diagrams/timing/index.d.cts +1 -1
  66. package/dist/diagrams/timing/index.d.ts +1 -1
  67. package/dist/diagrams/venn/index.d.cts +1 -1
  68. package/dist/diagrams/venn/index.d.ts +1 -1
  69. package/dist/{index-C7SN-FB3.d.ts → index-DPWdYfNx.d.ts} +1 -1
  70. package/dist/{index-BRIkOPnd.d.cts → index-S0njakQ2.d.cts} +1 -1
  71. package/dist/index.cjs +26 -26
  72. package/dist/index.d.cts +4 -4
  73. package/dist/index.d.ts +4 -4
  74. package/dist/index.js +5 -5
  75. package/dist/react.cjs +4 -4
  76. package/dist/react.d.cts +2 -2
  77. package/dist/react.d.ts +2 -2
  78. package/dist/react.js +3 -3
  79. package/dist/{tools-DdhP1kWY.d.cts → tools-CeGGMCs7.d.cts} +2 -2
  80. package/dist/{tools-BVeUNdsU.d.ts → tools-kK_enDwb.d.ts} +2 -2
  81. package/package.json +1 -1
  82. package/dist/chunk-25ZON47K.cjs.map +0 -1
  83. package/dist/chunk-7AFW2J6J.js.map +0 -1
  84. package/dist/chunk-EPKIJEH7.js.map +0 -1
  85. package/dist/chunk-P63S7P6N.js.map +0 -1
  86. package/dist/chunk-SUIDD2C5.cjs.map +0 -1
  87. package/dist/chunk-YVDUEUFV.cjs.map +0 -1
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkYVDUEUFV_cjs = require('../chunk-YVDUEUFV.cjs');
4
- require('../chunk-25ZON47K.cjs');
3
+ var chunkSSLNPHCL_cjs = require('../chunk-SSLNPHCL.cjs');
4
+ require('../chunk-4XR7X7XW.cjs');
5
5
  require('../chunk-FKJBXGWP.cjs');
6
6
  require('../chunk-V4RO5KYY.cjs');
7
- require('../chunk-SUIDD2C5.cjs');
7
+ require('../chunk-XNCOSVNG.cjs');
8
8
  require('../chunk-2L4YXZAZ.cjs');
9
- require('../chunk-ECD5XHBM.cjs');
9
+ require('../chunk-R6VX5YTJ.cjs');
10
10
  require('../chunk-SBB6C4OP.cjs');
11
11
  require('../chunk-V4GILQR6.cjs');
12
12
  require('../chunk-HWVBHU3O.cjs');
@@ -31,7 +31,7 @@ var schematexTools = {
31
31
  listDiagrams: ai.tool({
32
32
  description: "List every Schematex diagram type with a tagline, 'use when' hint, domain cluster, and authoritative standard. Call this first to discover what's available.",
33
33
  inputSchema: zod.z.object({}),
34
- execute: async () => chunkYVDUEUFV_cjs.listDiagrams()
34
+ execute: async () => chunkSSLNPHCL_cjs.listDiagrams()
35
35
  }),
36
36
  getSyntax: ai.tool({
37
37
  description: "Return syntax for one diagram type. Default `detail: canonical` is the compact first-shot generation path: canonical header, preferred forms, rules, and repair checks. Request `detail: reference` only for advanced forms or imported adapters after choosing a type.",
@@ -46,7 +46,7 @@ var schematexTools = {
46
46
  execute: async ({
47
47
  type,
48
48
  detail
49
- }) => chunkYVDUEUFV_cjs.getSyntax(type, { detail })
49
+ }) => chunkSSLNPHCL_cjs.getSyntax(type, { detail })
50
50
  }),
51
51
  getExamples: ai.tool({
52
52
  description: "Return curated real-world DSL examples for a diagram type, each with scenario notes and tags. Use as few-shot context before generating DSL.",
@@ -56,7 +56,7 @@ var schematexTools = {
56
56
  preferFeatured: zod.z.boolean().optional().describe("Rank featured examples first."),
57
57
  maxComplexity: zod.z.number().int().min(1).max(5).optional().describe("Only return examples with complexity <= this value (1=simplest).")
58
58
  }),
59
- execute: async (args) => chunkYVDUEUFV_cjs.getExamples(args.type, {
59
+ execute: async (args) => chunkSSLNPHCL_cjs.getExamples(args.type, {
60
60
  limit: args.limit,
61
61
  preferFeatured: args.preferFeatured,
62
62
  maxComplexity: args.maxComplexity
@@ -70,7 +70,7 @@ var schematexTools = {
70
70
  ),
71
71
  dsl: zod.z.string().describe("The DSL source text to validate.")
72
72
  }),
73
- execute: async ({ type, dsl }) => chunkYVDUEUFV_cjs.validateDsl(type, dsl)
73
+ execute: async ({ type, dsl }) => chunkSSLNPHCL_cjs.validateDsl(type, dsl)
74
74
  }),
75
75
  renderDsl: ai.tool({
76
76
  description: "Render Schematex DSL to an SVG string. Returns { ok: true, svg } or { ok: false, errors }. Use when the caller needs the actual diagram output, not just validation.",
@@ -85,7 +85,7 @@ var schematexTools = {
85
85
  dsl,
86
86
  theme,
87
87
  padding
88
- }) => chunkYVDUEUFV_cjs.renderDsl(type, dsl, { theme, padding })
88
+ }) => chunkSSLNPHCL_cjs.renderDsl(type, dsl, { theme, padding })
89
89
  })
90
90
  };
91
91
 
@@ -1,13 +1,13 @@
1
1
  import * as ai from 'ai';
2
- import { c as DiagramListItem, g as GetSyntaxResult, e as GetExamplesResult, V as ValidateDslResult, R as RenderDslResult } from '../tools-DdhP1kWY.cjs';
3
- import '../api-qVDutqXH.cjs';
4
- import '../diagnostics-DRxhodP6.cjs';
2
+ import { c as DiagramListItem, g as GetSyntaxResult, e as GetExamplesResult, V as ValidateDslResult, R as RenderDslResult } from '../tools-CeGGMCs7.cjs';
3
+ import '../api-BEJTXyBA.cjs';
4
+ import '../diagnostics-B-ffSEhl.cjs';
5
5
 
6
6
  declare const schematexTools: {
7
7
  readonly listDiagrams: ai.Tool<{}, DiagramListItem[]>;
8
8
  readonly getSyntax: ai.Tool<{
9
9
  type: string;
10
- detail?: "canonical" | "reference" | undefined;
10
+ detail?: "reference" | "canonical" | undefined;
11
11
  }, GetSyntaxResult>;
12
12
  readonly getExamples: ai.Tool<{
13
13
  type: string;
@@ -1,13 +1,13 @@
1
1
  import * as ai from 'ai';
2
- import { c as DiagramListItem, g as GetSyntaxResult, e as GetExamplesResult, V as ValidateDslResult, R as RenderDslResult } from '../tools-BVeUNdsU.js';
3
- import '../api-XWHHAhQI.js';
4
- import '../diagnostics-DRxhodP6.js';
2
+ import { c as DiagramListItem, g as GetSyntaxResult, e as GetExamplesResult, V as ValidateDslResult, R as RenderDslResult } from '../tools-kK_enDwb.js';
3
+ import '../api-DFrSR3lw.js';
4
+ import '../diagnostics-B-ffSEhl.js';
5
5
 
6
6
  declare const schematexTools: {
7
7
  readonly listDiagrams: ai.Tool<{}, DiagramListItem[]>;
8
8
  readonly getSyntax: ai.Tool<{
9
9
  type: string;
10
- detail?: "canonical" | "reference" | undefined;
10
+ detail?: "reference" | "canonical" | undefined;
11
11
  }, GetSyntaxResult>;
12
12
  readonly getExamples: ai.Tool<{
13
13
  type: string;
package/dist/ai/ai-sdk.js CHANGED
@@ -1,10 +1,10 @@
1
- import { renderDsl, validateDsl, getExamples, getSyntax, listDiagrams } from '../chunk-P63S7P6N.js';
2
- import '../chunk-7AFW2J6J.js';
1
+ import { renderDsl, validateDsl, getExamples, getSyntax, listDiagrams } from '../chunk-OTSVMKII.js';
2
+ import '../chunk-I2GQYOZ5.js';
3
3
  import '../chunk-RJMCWT7Z.js';
4
4
  import '../chunk-UWA5MWCI.js';
5
- import '../chunk-EPKIJEH7.js';
5
+ import '../chunk-MFAMNFPA.js';
6
6
  import '../chunk-TWLKXV2O.js';
7
- import '../chunk-LGABFD3L.js';
7
+ import '../chunk-522WB2EH.js';
8
8
  import '../chunk-PIV2A3HG.js';
9
9
  import '../chunk-H4MT5TJP.js';
10
10
  import '../chunk-HAZALB7U.js';
package/dist/ai/index.cjs CHANGED
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkYVDUEUFV_cjs = require('../chunk-YVDUEUFV.cjs');
4
- require('../chunk-25ZON47K.cjs');
3
+ var chunkSSLNPHCL_cjs = require('../chunk-SSLNPHCL.cjs');
4
+ require('../chunk-4XR7X7XW.cjs');
5
5
  require('../chunk-FKJBXGWP.cjs');
6
6
  require('../chunk-V4RO5KYY.cjs');
7
- require('../chunk-SUIDD2C5.cjs');
7
+ require('../chunk-XNCOSVNG.cjs');
8
8
  require('../chunk-2L4YXZAZ.cjs');
9
- require('../chunk-ECD5XHBM.cjs');
9
+ require('../chunk-R6VX5YTJ.cjs');
10
10
  require('../chunk-SBB6C4OP.cjs');
11
11
  require('../chunk-V4GILQR6.cjs');
12
12
  require('../chunk-HWVBHU3O.cjs');
@@ -29,47 +29,47 @@ require('../chunk-3WNW5Y7P.cjs');
29
29
 
30
30
  Object.defineProperty(exports, "DIAGRAM_REGISTRY", {
31
31
  enumerable: true,
32
- get: function () { return chunkYVDUEUFV_cjs.DIAGRAM_REGISTRY; }
32
+ get: function () { return chunkSSLNPHCL_cjs.DIAGRAM_REGISTRY; }
33
33
  });
34
34
  Object.defineProperty(exports, "DIAGRAM_SINCE", {
35
35
  enumerable: true,
36
- get: function () { return chunkYVDUEUFV_cjs.DIAGRAM_SINCE; }
36
+ get: function () { return chunkSSLNPHCL_cjs.DIAGRAM_SINCE; }
37
37
  });
38
38
  Object.defineProperty(exports, "getAllDiagramTypes", {
39
39
  enumerable: true,
40
- get: function () { return chunkYVDUEUFV_cjs.getAllDiagramTypes; }
40
+ get: function () { return chunkSSLNPHCL_cjs.getAllDiagramTypes; }
41
41
  });
42
42
  Object.defineProperty(exports, "getDiagramMeta", {
43
43
  enumerable: true,
44
- get: function () { return chunkYVDUEUFV_cjs.getDiagramMeta; }
44
+ get: function () { return chunkSSLNPHCL_cjs.getDiagramMeta; }
45
45
  });
46
46
  Object.defineProperty(exports, "getDiagramSince", {
47
47
  enumerable: true,
48
- get: function () { return chunkYVDUEUFV_cjs.getDiagramSince; }
48
+ get: function () { return chunkSSLNPHCL_cjs.getDiagramSince; }
49
49
  });
50
50
  Object.defineProperty(exports, "getExamples", {
51
51
  enumerable: true,
52
- get: function () { return chunkYVDUEUFV_cjs.getExamples; }
52
+ get: function () { return chunkSSLNPHCL_cjs.getExamples; }
53
53
  });
54
54
  Object.defineProperty(exports, "getSyntax", {
55
55
  enumerable: true,
56
- get: function () { return chunkYVDUEUFV_cjs.getSyntax; }
56
+ get: function () { return chunkSSLNPHCL_cjs.getSyntax; }
57
57
  });
58
58
  Object.defineProperty(exports, "listDiagrams", {
59
59
  enumerable: true,
60
- get: function () { return chunkYVDUEUFV_cjs.listDiagrams; }
60
+ get: function () { return chunkSSLNPHCL_cjs.listDiagrams; }
61
61
  });
62
62
  Object.defineProperty(exports, "renderDsl", {
63
63
  enumerable: true,
64
- get: function () { return chunkYVDUEUFV_cjs.renderDsl; }
64
+ get: function () { return chunkSSLNPHCL_cjs.renderDsl; }
65
65
  });
66
66
  Object.defineProperty(exports, "resolveDiagramType", {
67
67
  enumerable: true,
68
- get: function () { return chunkYVDUEUFV_cjs.resolveDiagramType; }
68
+ get: function () { return chunkSSLNPHCL_cjs.resolveDiagramType; }
69
69
  });
70
70
  Object.defineProperty(exports, "validateDsl", {
71
71
  enumerable: true,
72
- get: function () { return chunkYVDUEUFV_cjs.validateDsl; }
72
+ get: function () { return chunkSSLNPHCL_cjs.validateDsl; }
73
73
  });
74
74
  //# sourceMappingURL=index.cjs.map
75
75
  //# sourceMappingURL=index.cjs.map
@@ -1,6 +1,6 @@
1
- export { D as DIAGRAM_REGISTRY, a as DIAGRAM_SINCE, b as DiagramCluster, c as DiagramListItem, d as DiagramMeta, E as Example, G as GetExamplesOptions, e as GetExamplesResult, f as GetSyntaxOptions, g as GetSyntaxResult, R as RenderDslResult, S as SchematexValidationError, h as SyntaxDetail, i as SyntaxDoc, V as ValidateDslResult, j as getAllDiagramTypes, k as getDiagramMeta, l as getDiagramSince, m as getExamples, n as getSyntax, o as listDiagrams, r as renderDsl, p as resolveDiagramType, v as validateDsl } from '../tools-DdhP1kWY.cjs';
2
- import { a as DiagramType } from '../diagnostics-DRxhodP6.cjs';
3
- import '../api-qVDutqXH.cjs';
1
+ export { D as DIAGRAM_REGISTRY, a as DIAGRAM_SINCE, b as DiagramCluster, c as DiagramListItem, d as DiagramMeta, E as Example, G as GetExamplesOptions, e as GetExamplesResult, f as GetSyntaxOptions, g as GetSyntaxResult, R as RenderDslResult, S as SchematexValidationError, h as SyntaxDetail, i as SyntaxDoc, V as ValidateDslResult, j as getAllDiagramTypes, k as getDiagramMeta, l as getDiagramSince, m as getExamples, n as getSyntax, o as listDiagrams, r as renderDsl, p as resolveDiagramType, v as validateDsl } from '../tools-CeGGMCs7.cjs';
2
+ import { a as DiagramType } from '../diagnostics-B-ffSEhl.cjs';
3
+ import '../api-BEJTXyBA.cjs';
4
4
 
5
5
  interface GenerationProfile {
6
6
  /** Canonical type id from `listDiagrams()`. */
@@ -1,6 +1,6 @@
1
- export { D as DIAGRAM_REGISTRY, a as DIAGRAM_SINCE, b as DiagramCluster, c as DiagramListItem, d as DiagramMeta, E as Example, G as GetExamplesOptions, e as GetExamplesResult, f as GetSyntaxOptions, g as GetSyntaxResult, R as RenderDslResult, S as SchematexValidationError, h as SyntaxDetail, i as SyntaxDoc, V as ValidateDslResult, j as getAllDiagramTypes, k as getDiagramMeta, l as getDiagramSince, m as getExamples, n as getSyntax, o as listDiagrams, r as renderDsl, p as resolveDiagramType, v as validateDsl } from '../tools-BVeUNdsU.js';
2
- import { a as DiagramType } from '../diagnostics-DRxhodP6.js';
3
- import '../api-XWHHAhQI.js';
1
+ export { D as DIAGRAM_REGISTRY, a as DIAGRAM_SINCE, b as DiagramCluster, c as DiagramListItem, d as DiagramMeta, E as Example, G as GetExamplesOptions, e as GetExamplesResult, f as GetSyntaxOptions, g as GetSyntaxResult, R as RenderDslResult, S as SchematexValidationError, h as SyntaxDetail, i as SyntaxDoc, V as ValidateDslResult, j as getAllDiagramTypes, k as getDiagramMeta, l as getDiagramSince, m as getExamples, n as getSyntax, o as listDiagrams, r as renderDsl, p as resolveDiagramType, v as validateDsl } from '../tools-kK_enDwb.js';
2
+ import { a as DiagramType } from '../diagnostics-B-ffSEhl.js';
3
+ import '../api-DFrSR3lw.js';
4
4
 
5
5
  interface GenerationProfile {
6
6
  /** Canonical type id from `listDiagrams()`. */
package/dist/ai/index.js CHANGED
@@ -1,10 +1,10 @@
1
- export { DIAGRAM_REGISTRY, DIAGRAM_SINCE, getAllDiagramTypes, getDiagramMeta, getDiagramSince, getExamples, getSyntax, listDiagrams, renderDsl, resolveDiagramType, validateDsl } from '../chunk-P63S7P6N.js';
2
- import '../chunk-7AFW2J6J.js';
1
+ export { DIAGRAM_REGISTRY, DIAGRAM_SINCE, getAllDiagramTypes, getDiagramMeta, getDiagramSince, getExamples, getSyntax, listDiagrams, renderDsl, resolveDiagramType, validateDsl } from '../chunk-OTSVMKII.js';
2
+ import '../chunk-I2GQYOZ5.js';
3
3
  import '../chunk-RJMCWT7Z.js';
4
4
  import '../chunk-UWA5MWCI.js';
5
- import '../chunk-EPKIJEH7.js';
5
+ import '../chunk-MFAMNFPA.js';
6
6
  import '../chunk-TWLKXV2O.js';
7
- import '../chunk-LGABFD3L.js';
7
+ import '../chunk-522WB2EH.js';
8
8
  import '../chunk-PIV2A3HG.js';
9
9
  import '../chunk-H4MT5TJP.js';
10
10
  import '../chunk-HAZALB7U.js';
@@ -1,4 +1,4 @@
1
- import { b as SchematexParseResult, c as SchematexRenderResult } from './diagnostics-DRxhodP6.cjs';
1
+ import { b as SchematexParseResult, c as SchematexRenderResult } from './diagnostics-B-ffSEhl.cjs';
2
2
 
3
3
  interface SchematexConfig {
4
4
  type?: "genogram" | "ecomap" | "pedigree" | "phylo" | "sociogram" | "timing" | "logic" | "circuit" | "blockdiagram" | "ladder" | "sld" | "entity" | "fishbone" | "venn" | "flowchart" | "mindmap" | "matrix" | "orgchart" | "decisiontree" | "timeline" | "state" | "pid" | "erd" | "breadboard" | "bpmn" | "fbd" | "sfc" | "prisma" | "usecase" | "pert" | "sequence" | "petri" | "network";
@@ -1,4 +1,4 @@
1
- import { b as SchematexParseResult, c as SchematexRenderResult } from './diagnostics-DRxhodP6.js';
1
+ import { b as SchematexParseResult, c as SchematexRenderResult } from './diagnostics-B-ffSEhl.js';
2
2
 
3
3
  interface SchematexConfig {
4
4
  type?: "genogram" | "ecomap" | "pedigree" | "phylo" | "sociogram" | "timing" | "logic" | "circuit" | "blockdiagram" | "ladder" | "sld" | "entity" | "fishbone" | "venn" | "flowchart" | "mindmap" | "matrix" | "orgchart" | "decisiontree" | "timeline" | "state" | "pid" | "erd" | "breadboard" | "bpmn" | "fbd" | "sfc" | "prisma" | "usecase" | "pert" | "sequence" | "petri" | "network";
package/dist/browser.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var chunk25ZON47K_cjs = require('./chunk-25ZON47K.cjs');
3
+ var chunk4XR7X7XW_cjs = require('./chunk-4XR7X7XW.cjs');
4
4
  require('./chunk-FKJBXGWP.cjs');
5
5
  require('./chunk-V4RO5KYY.cjs');
6
- require('./chunk-SUIDD2C5.cjs');
6
+ require('./chunk-XNCOSVNG.cjs');
7
7
  require('./chunk-2L4YXZAZ.cjs');
8
- require('./chunk-ECD5XHBM.cjs');
8
+ require('./chunk-R6VX5YTJ.cjs');
9
9
  require('./chunk-SBB6C4OP.cjs');
10
10
  require('./chunk-V4GILQR6.cjs');
11
11
  require('./chunk-HWVBHU3O.cjs');
@@ -26,10 +26,10 @@ require('./chunk-3WNW5Y7P.cjs');
26
26
 
27
27
  // src/browser.ts
28
28
  function renderToElement(text, config) {
29
- return svgStringToElement(chunk25ZON47K_cjs.render(text, config));
29
+ return svgStringToElement(chunk4XR7X7XW_cjs.render(text, config));
30
30
  }
31
31
  function renderPreviewToElement(text, config) {
32
- return svgStringToElement(chunk25ZON47K_cjs.renderPreview(text, config));
32
+ return svgStringToElement(chunk4XR7X7XW_cjs.renderPreview(text, config));
33
33
  }
34
34
  function svgStringToElement(svgString) {
35
35
  const parser = new DOMParser();
@@ -42,23 +42,23 @@ function svgStringToElement(svgString) {
42
42
  return el;
43
43
  }
44
44
  function renderToContainer(text, container, config) {
45
- container.innerHTML = chunk25ZON47K_cjs.render(text, config);
45
+ container.innerHTML = chunk4XR7X7XW_cjs.render(text, config);
46
46
  }
47
47
  function renderPreviewToContainer(text, container, config) {
48
- container.innerHTML = chunk25ZON47K_cjs.renderPreview(text, config);
48
+ container.innerHTML = chunk4XR7X7XW_cjs.renderPreview(text, config);
49
49
  }
50
50
 
51
51
  Object.defineProperty(exports, "render", {
52
52
  enumerable: true,
53
- get: function () { return chunk25ZON47K_cjs.render; }
53
+ get: function () { return chunk4XR7X7XW_cjs.render; }
54
54
  });
55
55
  Object.defineProperty(exports, "renderPreview", {
56
56
  enumerable: true,
57
- get: function () { return chunk25ZON47K_cjs.renderPreview; }
57
+ get: function () { return chunk4XR7X7XW_cjs.renderPreview; }
58
58
  });
59
59
  Object.defineProperty(exports, "renderResult", {
60
60
  enumerable: true,
61
- get: function () { return chunk25ZON47K_cjs.renderResult; }
61
+ get: function () { return chunk4XR7X7XW_cjs.renderResult; }
62
62
  });
63
63
  exports.renderPreviewToContainer = renderPreviewToContainer;
64
64
  exports.renderPreviewToElement = renderPreviewToElement;
@@ -1,6 +1,6 @@
1
- import { S as SchematexConfig } from './api-qVDutqXH.cjs';
2
- export { r as render, b as renderPreview, c as renderResult } from './api-qVDutqXH.cjs';
3
- import './diagnostics-DRxhodP6.cjs';
1
+ import { S as SchematexConfig } from './api-BEJTXyBA.cjs';
2
+ export { r as render, b as renderPreview, c as renderResult } from './api-BEJTXyBA.cjs';
3
+ import './diagnostics-B-ffSEhl.cjs';
4
4
 
5
5
  /**
6
6
  * Browser-specific utilities for Schematex.
package/dist/browser.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { S as SchematexConfig } from './api-XWHHAhQI.js';
2
- export { r as render, b as renderPreview, c as renderResult } from './api-XWHHAhQI.js';
3
- import './diagnostics-DRxhodP6.js';
1
+ import { S as SchematexConfig } from './api-DFrSR3lw.js';
2
+ export { r as render, b as renderPreview, c as renderResult } from './api-DFrSR3lw.js';
3
+ import './diagnostics-B-ffSEhl.js';
4
4
 
5
5
  /**
6
6
  * Browser-specific utilities for Schematex.
package/dist/browser.js CHANGED
@@ -1,10 +1,10 @@
1
- import { render, renderPreview } from './chunk-7AFW2J6J.js';
2
- export { render, renderPreview, renderResult } from './chunk-7AFW2J6J.js';
1
+ import { render, renderPreview } from './chunk-I2GQYOZ5.js';
2
+ export { render, renderPreview, renderResult } from './chunk-I2GQYOZ5.js';
3
3
  import './chunk-RJMCWT7Z.js';
4
4
  import './chunk-UWA5MWCI.js';
5
- import './chunk-EPKIJEH7.js';
5
+ import './chunk-MFAMNFPA.js';
6
6
  import './chunk-TWLKXV2O.js';
7
- import './chunk-LGABFD3L.js';
7
+ import './chunk-522WB2EH.js';
8
8
  import './chunk-PIV2A3HG.js';
9
9
  import './chunk-H4MT5TJP.js';
10
10
  import './chunk-HAZALB7U.js';
@@ -2,9 +2,9 @@
2
2
 
3
3
  var chunkFKJBXGWP_cjs = require('./chunk-FKJBXGWP.cjs');
4
4
  var chunkV4RO5KYY_cjs = require('./chunk-V4RO5KYY.cjs');
5
- var chunkSUIDD2C5_cjs = require('./chunk-SUIDD2C5.cjs');
5
+ var chunkXNCOSVNG_cjs = require('./chunk-XNCOSVNG.cjs');
6
6
  var chunk2L4YXZAZ_cjs = require('./chunk-2L4YXZAZ.cjs');
7
- var chunkECD5XHBM_cjs = require('./chunk-ECD5XHBM.cjs');
7
+ var chunkR6VX5YTJ_cjs = require('./chunk-R6VX5YTJ.cjs');
8
8
  var chunkV4GILQR6_cjs = require('./chunk-V4GILQR6.cjs');
9
9
  var chunkHWVBHU3O_cjs = require('./chunk-HWVBHU3O.cjs');
10
10
  var chunkC5C5EF3W_cjs = require('./chunk-C5C5EF3W.cjs');
@@ -4357,7 +4357,8 @@ var GEOMETRY = {
4357
4357
  top: { x: 0, y: -55 },
4358
4358
  bottom: { x: 0, y: 55 },
4359
4359
  in: { x: -45, y: -10 },
4360
- out: { x: 0, y: 55 }
4360
+ out: { x: 45, y: 10 },
4361
+ right: { x: 45, y: 10 }
4361
4362
  }
4362
4363
  },
4363
4364
  reactor_pfr: {
@@ -5052,9 +5053,10 @@ function renderInstrument(category, letterCode, loopNumber) {
5052
5053
  // src/diagrams/pid/layout.ts
5053
5054
  var PADDING = 30;
5054
5055
  var TITLE_AREA = 26;
5055
- var EQUIP_GAP_X = 70;
5056
+ var EQUIP_GAP_X = 92;
5056
5057
  var INST_RADIUS = 14;
5057
- var INST_OFFSET = 38;
5058
+ var INST_OFFSET = 52;
5059
+ var PORT_CLEARANCE = 18;
5058
5060
  function defaultPort(direction, equip) {
5059
5061
  if (equip.equipType === "tank_atm" || equip.equipType === "tank_cone_roof") {
5060
5062
  return direction === "out" ? "bottom" : "top";
@@ -5066,8 +5068,9 @@ function defaultPort(direction, equip) {
5066
5068
  }
5067
5069
  function resolveSide(port) {
5068
5070
  if (port === "top" || port === "vapor_out" || port === "reflux") return "top";
5069
- if (port === "bottom" || port === "liquid_out" || port === "bottom_return") return "bottom";
5070
- if (port === "left" || port === "in" || port === "feed" || port === "tube_in" || port === "shell_in") return "left";
5071
+ if (port === "bottom" || port === "liquid_out" || port === "bottom_return" || port === "shell_out") return "bottom";
5072
+ if (port === "left" || port === "in" || port === "feed" || port === "tube_in") return "left";
5073
+ if (port === "shell_in") return "top";
5071
5074
  return "right";
5072
5075
  }
5073
5076
  function getAnchor(layoutEq, port, fallback) {
@@ -5112,12 +5115,53 @@ function manhattanPath(fromX, fromY, fromSide, toX, toY, toSide) {
5112
5115
  midY: toY
5113
5116
  };
5114
5117
  }
5118
+ function sideVector(side) {
5119
+ switch (side) {
5120
+ case "left":
5121
+ return { x: -1, y: 0 };
5122
+ case "right":
5123
+ return { x: 1, y: 0 };
5124
+ case "top":
5125
+ return { x: 0, y: -1 };
5126
+ case "bottom":
5127
+ return { x: 0, y: 1 };
5128
+ }
5129
+ }
5130
+ function portStubPath(from, to, clearance = PORT_CLEARANCE) {
5131
+ const fv = sideVector(from.side);
5132
+ const tv = sideVector(to.side);
5133
+ const fromStub = {
5134
+ x: from.x + fv.x * clearance,
5135
+ y: from.y + fv.y * clearance,
5136
+ side: from.side
5137
+ };
5138
+ const toStub = {
5139
+ x: to.x + tv.x * clearance,
5140
+ y: to.y + tv.y * clearance,
5141
+ side: to.side
5142
+ };
5143
+ const routed = manhattanPath(fromStub.x, fromStub.y, fromStub.side, toStub.x, toStub.y, toStub.side);
5144
+ return {
5145
+ d: `M ${from.x} ${from.y} L ${fromStub.x} ${fromStub.y} ${routed.d.replace(/^M\s+[-\d.]+\s+[-\d.]+\s*/, "")} L ${to.x} ${to.y}`,
5146
+ midX: routed.midX,
5147
+ midY: routed.midY
5148
+ };
5149
+ }
5150
+ function lineMidpoint(ln, equipById) {
5151
+ const fromEq = equipById.get(ln.from.id);
5152
+ const toEq = equipById.get(ln.to.id);
5153
+ if (!fromEq || !toEq) return void 0;
5154
+ const from = getAnchor(fromEq, ln.from.port, "out");
5155
+ const to = getAnchor(toEq, ln.to.port, "in");
5156
+ const routed = portStubPath(from, to);
5157
+ return { x: routed.midX, y: routed.midY };
5158
+ }
5115
5159
  function layoutPid(ast) {
5116
5160
  const equipment = [];
5117
5161
  const equipById = /* @__PURE__ */ new Map();
5118
5162
  const heights = ast.equipment.map((e) => GEOMETRY[e.equipType]?.height ?? 60);
5119
5163
  const maxH = Math.max(...heights, 0);
5120
- const rowY = PADDING + TITLE_AREA + maxH / 2 + 30;
5164
+ const rowY = PADDING + TITLE_AREA + maxH / 2 + 50;
5121
5165
  let cursorX = PADDING + 40;
5122
5166
  for (const equip of ast.equipment) {
5123
5167
  const geo = GEOMETRY[equip.equipType] ?? { width: 60, height: 40, ports: {} };
@@ -5145,7 +5189,7 @@ function layoutPid(ast) {
5145
5189
  }
5146
5190
  const instruments = [];
5147
5191
  const instById = /* @__PURE__ */ new Map();
5148
- const crBandY = PADDING + TITLE_AREA + 40;
5192
+ const crBandY = PADDING + TITLE_AREA + 28;
5149
5193
  let crSlot = 0;
5150
5194
  for (const inst of ast.instruments) {
5151
5195
  let cx = 0;
@@ -5160,12 +5204,16 @@ function layoutPid(ast) {
5160
5204
  cy = rowY + maxH / 2 + INST_OFFSET + INST_RADIUS;
5161
5205
  const tgt = inst.measures ?? inst.controls ?? "";
5162
5206
  const tgtEq = equipById.get(tgt);
5163
- cx = tgtEq ? tgtEq.cx : PADDING + 80;
5207
+ const tgtLine = ast.lines.find((line2) => line2.id === tgt);
5208
+ const lineMid = tgtLine ? lineMidpoint(tgtLine, equipById) : void 0;
5209
+ cx = tgtEq ? tgtEq.cx : lineMid ? lineMid.x : PADDING + 80;
5164
5210
  } else {
5165
5211
  cy = rowY + maxH / 2 + INST_OFFSET;
5166
5212
  const tgt = inst.measures ?? inst.controls ?? "";
5167
5213
  const tgtEq = equipById.get(tgt);
5168
- cx = tgtEq ? tgtEq.cx : PADDING + 80;
5214
+ const tgtLine = ast.lines.find((line2) => line2.id === tgt);
5215
+ const lineMid = tgtLine ? lineMidpoint(tgtLine, equipById) : void 0;
5216
+ cx = tgtEq ? tgtEq.cx : lineMid ? lineMid.x : PADDING + 80;
5169
5217
  }
5170
5218
  const lay = {
5171
5219
  inst,
@@ -5176,6 +5224,22 @@ function layoutPid(ast) {
5176
5224
  instruments.push(lay);
5177
5225
  instById.set(inst.tag, lay);
5178
5226
  }
5227
+ const targetOf = (inst) => inst.inst.measures ?? inst.inst.controls ?? "";
5228
+ const fieldGroups = /* @__PURE__ */ new Map();
5229
+ for (const inst of instruments) {
5230
+ if (inst.inst.category.startsWith("cr_")) continue;
5231
+ const target = targetOf(inst);
5232
+ if (!target) continue;
5233
+ const group2 = fieldGroups.get(target) ?? [];
5234
+ group2.push(inst);
5235
+ fieldGroups.set(target, group2);
5236
+ }
5237
+ for (const group2 of fieldGroups.values()) {
5238
+ if (group2.length < 2) continue;
5239
+ group2.forEach((inst, idx) => {
5240
+ inst.cx += (idx - (group2.length - 1) / 2) * (INST_RADIUS * 2 + 12);
5241
+ });
5242
+ }
5179
5243
  const sameRow = (a, b) => Math.abs(a.cy - b.cy) < INST_RADIUS && Math.abs(a.cx - b.cx) < INST_RADIUS * 2 + 8;
5180
5244
  const sortedByX = [...instruments].sort((a, b) => a.cx - b.cx);
5181
5245
  for (let i = 1; i < sortedByX.length; i++) {
@@ -5220,14 +5284,7 @@ function routeLine(ln, equipById, instById) {
5220
5284
  const fromAnchor = resolveAnchor(ln.from.id, ln.from.port, "out", equipById, instById);
5221
5285
  const toAnchor = resolveAnchor(ln.to.id, ln.to.port, "in", equipById, instById);
5222
5286
  if (!fromAnchor || !toAnchor) return void 0;
5223
- const { d, midX, midY } = manhattanPath(
5224
- fromAnchor.x,
5225
- fromAnchor.y,
5226
- fromAnchor.side,
5227
- toAnchor.x,
5228
- toAnchor.y,
5229
- toAnchor.side
5230
- );
5287
+ const { d, midX, midY } = portStubPath(fromAnchor, toAnchor);
5231
5288
  return {
5232
5289
  line: ln,
5233
5290
  path: d,
@@ -5263,6 +5320,7 @@ var STYLE2 = `
5263
5320
  .lt-pid-capillary { stroke: #1d1d1d; stroke-width: 1.4; fill: none; stroke-dasharray: 1 5; stroke-linecap: round; }
5264
5321
  .lt-pid-software { stroke: #6a6a6a; stroke-width: 1.3; fill: none; stroke-dasharray: 2 4; }
5265
5322
  .lt-pid-mechanical { stroke: #1d1d1d; stroke-width: 1.4; fill: none; stroke-dasharray: 3 2 1 2; }
5323
+ .lt-pid-line-path { fill: none; }
5266
5324
 
5267
5325
  .lt-pid-pneumatic-tick { stroke: #1d1d1d; stroke-width: 1.2; }
5268
5326
 
@@ -5279,14 +5337,19 @@ var STYLE2 = `
5279
5337
  `;
5280
5338
  var ARROW_ID = "lt-pid-arrow";
5281
5339
  function lineClass(t) {
5282
- return `lt-pid-${t.replace("_", "-")}`;
5340
+ switch (t) {
5341
+ case "process_minor":
5342
+ return "lt-pid-process-min";
5343
+ default:
5344
+ return `lt-pid-${t.replaceAll("_", "-")}`;
5345
+ }
5283
5346
  }
5284
5347
  function renderLine(l) {
5285
5348
  const cls = lineClass(l.line.lineType);
5286
5349
  const parts = [
5287
5350
  chunk3WNW5Y7P_cjs.path({
5288
5351
  d: l.path,
5289
- class: cls,
5352
+ class: `${cls} lt-pid-line-path`,
5290
5353
  "data-line-id": l.line.id,
5291
5354
  "data-service": l.line.service ?? ""
5292
5355
  })
@@ -5362,6 +5425,12 @@ function renderPidAST(ast, _config) {
5362
5425
  return renderLayout2(layout);
5363
5426
  }
5364
5427
  function renderLayout2(layout) {
5428
+ const processLines = layout.lines.filter(
5429
+ (line2) => line2.line.lineType === "process" || line2.line.lineType === "process_minor"
5430
+ );
5431
+ const signalLines = layout.lines.filter(
5432
+ (line2) => line2.line.lineType !== "process" && line2.line.lineType !== "process_minor"
5433
+ );
5365
5434
  const equipNodes = layout.equipment.map((eq) => {
5366
5435
  const symbol = renderEquip(eq.equip.equipType, eq.equip.tag ?? eq.equip.id);
5367
5436
  return chunk3WNW5Y7P_cjs.group(
@@ -5448,8 +5517,9 @@ function renderLayout2(layout) {
5448
5517
  chunk3WNW5Y7P_cjs.el("style", {}, STYLE2)
5449
5518
  ]),
5450
5519
  titleNode,
5520
+ chunk3WNW5Y7P_cjs.group({ class: "lt-pid-lines lt-pid-process-lines" }, processLines.map(renderLine)),
5451
5521
  chunk3WNW5Y7P_cjs.group({ class: "lt-pid-equipment" }, equipNodes),
5452
- chunk3WNW5Y7P_cjs.group({ class: "lt-pid-lines" }, layout.lines.map(renderLine)),
5522
+ chunk3WNW5Y7P_cjs.group({ class: "lt-pid-lines lt-pid-signal-lines" }, signalLines.map(renderLine)),
5453
5523
  chunk3WNW5Y7P_cjs.group({ class: "lt-pid-signals" }, autoSignals),
5454
5524
  chunk3WNW5Y7P_cjs.group({ class: "lt-pid-instruments" }, instNodes)
5455
5525
  ]
@@ -22379,9 +22449,9 @@ var plugins = [
22379
22449
  chunkST5YRTTV_cjs.timing,
22380
22450
  chunkR66QG3XT_cjs.logic,
22381
22451
  chunkV4RO5KYY_cjs.circuit,
22382
- chunkSUIDD2C5_cjs.blockdiagram,
22452
+ chunkXNCOSVNG_cjs.blockdiagram,
22383
22453
  chunk2L4YXZAZ_cjs.ladder,
22384
- chunkECD5XHBM_cjs.sld,
22454
+ chunkR6VX5YTJ_cjs.sld,
22385
22455
  chunkV4GILQR6_cjs.entity,
22386
22456
  chunkHWVBHU3O_cjs.fishbone,
22387
22457
  chunkC5C5EF3W_cjs.venn,
@@ -22541,5 +22611,5 @@ exports.sequence = sequence;
22541
22611
  exports.state = state;
22542
22612
  exports.timeline = timeline;
22543
22613
  exports.usecase = usecase;
22544
- //# sourceMappingURL=chunk-25ZON47K.cjs.map
22545
- //# sourceMappingURL=chunk-25ZON47K.cjs.map
22614
+ //# sourceMappingURL=chunk-4XR7X7XW.cjs.map
22615
+ //# sourceMappingURL=chunk-4XR7X7XW.cjs.map