@sentropic/design-system-elements 0.2.0 → 0.3.2

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 (93) hide show
  1. package/LICENSE.THIRD-PARTY.md +44 -1
  2. package/README.md +81 -13
  3. package/catalog.json +401 -7
  4. package/dist/browser/chunks/{Modeler-BfAmwsmK.js → Modeler-D87tL_OJ.js} +4 -4
  5. package/dist/browser/chunks/Viewer-D9zjRrp2.js +4 -0
  6. package/dist/browser/chunks/bpmn-canvas-BevbP_6a.js +1 -0
  7. package/dist/browser/chunks/bpmn-mount-BhO_zb0S.js +2202 -0
  8. package/dist/browser/chunks/dist-DRauAwm2.js +6 -0
  9. package/dist/browser/chunks/{entropic-CM5BHERN.js → entropic-MwNVEq6w.js} +639 -0
  10. package/dist/browser/chunks/focus-renderer-BWm7DlQD.js +55 -0
  11. package/dist/browser/chunks/{forge-B8hrW4lA.js → forge-CzwO8Hbe.js} +639 -0
  12. package/dist/browser/chunks/layout-T3X333Za.js +1 -0
  13. package/dist/browser/elements.js +671 -6
  14. package/dist/browser/sri.json +52 -45
  15. package/dist/contracts/bar-chart.js +2 -2
  16. package/dist/contracts/decision-dossier.d.ts +4 -8
  17. package/dist/contracts/decision-dossier.js +8 -12
  18. package/dist/contracts/index.d.ts +1 -0
  19. package/dist/contracts/index.js +2 -0
  20. package/dist/contracts/time-series-chart.d.ts +49 -0
  21. package/dist/contracts/time-series-chart.js +37 -0
  22. package/dist/dossier/dossier-mount.js +845 -0
  23. package/dist/dossier/renderer/dossier.css +2 -0
  24. package/dist/element/bpmn-mount.d.ts +11 -0
  25. package/dist/element/bpmn-mount.js +56 -0
  26. package/dist/element/bpmn-types.d.ts +27 -0
  27. package/dist/element/bpmn-types.js +12 -0
  28. package/dist/element/bpmn.d.ts +10 -0
  29. package/dist/element/bpmn.js +39 -0
  30. package/dist/element/dom/dossier-mount.d.ts +25 -0
  31. package/dist/element/dom/dossier-review-mount.d.ts +25 -0
  32. package/dist/element/dom/dossier-review-state.svelte.d.ts +13 -0
  33. package/dist/element/dom/engines/bpmn-canvas.d.ts +11 -0
  34. package/dist/element/dom/engines/bpmn-canvas.js +11 -0
  35. package/dist/element/dom/engines/dossier-diagrams.d.ts +5 -0
  36. package/dist/element/dom/engines/dossier-evidence.d.ts +9 -0
  37. package/dist/element/dom/engines/dossier-styles.d.ts +21 -0
  38. package/dist/element/dom/engines/focus-renderer.d.ts +60 -0
  39. package/dist/element/dom/engines/focus-snapshot.d.ts +3 -0
  40. package/dist/element/dom/intents.d.ts +20 -0
  41. package/dist/element/markdown/minimal-markdown.d.ts +1 -2
  42. package/dist/element/markdown/minimal-markdown.js +19 -1
  43. package/dist/element/validator.d.ts +26 -0
  44. package/dist/element/validator.js +54 -0
  45. package/dist/focus-diagrams/diagram-layout.d.ts +140 -0
  46. package/dist/focus-diagrams/diagram-layout.js +190 -0
  47. package/dist/focus-diagrams/diagram-source.d.ts +11 -0
  48. package/dist/focus-diagrams/diagram-source.js +147 -0
  49. package/dist/focus-diagrams/dossier-views.d.ts +21 -0
  50. package/dist/focus-diagrams/dossier-views.js +57 -0
  51. package/dist/focus-diagrams/ecosystem.json +853 -0
  52. package/dist/focus-kit/index.html +13 -0
  53. package/dist/focus-kit/renderer/dossier.css +2 -0
  54. package/dist/focus-kit/renderer/dossier.js +845 -0
  55. package/dist/focus-kit-manifest.json +1 -0
  56. package/dist/focus-kit.d.ts +9 -0
  57. package/dist/focus-kit.js +30 -0
  58. package/dist/format-time-series-markdown.d.ts +5 -0
  59. package/dist/format-time-series-markdown.js +24 -0
  60. package/dist/generator/parity.js +6 -1
  61. package/dist/index.d.ts +2 -0
  62. package/dist/index.js +1 -0
  63. package/dist/ports/dossier-views.d.ts +3 -0
  64. package/dist/ports/dossier-views.js +3 -0
  65. package/dist/ports/focus.d.ts +0 -1
  66. package/dist/ports/types.d.ts +0 -1
  67. package/dist/shells/BarChart.html +8494 -0
  68. package/dist/shells/BarChart.js +8482 -0
  69. package/dist/shells/DecisionDossier.html +8502 -0
  70. package/dist/shells/DecisionDossier.js +8490 -0
  71. package/dist/shells/TimeSeriesChart.html +8475 -0
  72. package/dist/shells/TimeSeriesChart.js +8463 -0
  73. package/dist/shells/manifest.json +108 -0
  74. package/dist/structure/interpreter.d.ts +1 -1
  75. package/dist/structure/interpreter.js +14 -4
  76. package/dist/time-series.d.ts +13 -0
  77. package/dist/time-series.js +15 -0
  78. package/dist/validate/envelope.js +5 -1
  79. package/dist/validate/time-series.d.ts +5 -0
  80. package/dist/validate/time-series.js +28 -0
  81. package/fixtures/time-series-multi.json +46 -0
  82. package/fixtures/time-series-single.json +28 -0
  83. package/fixtures/time-series-thresholds.json +52 -0
  84. package/package.json +40 -6
  85. package/schemas/BarChart.v1.json +2 -2
  86. package/schemas/DecisionDossier.v1.json +155 -5
  87. package/schemas/TimeSeriesChart.v1.json +287 -0
  88. package/skill/SKILL.md +27 -0
  89. package/dist/browser/chunks/Viewer-eYLzc3fD.js +0 -4
  90. package/dist/browser/chunks/bpmn-canvas-DeAWdJFy.js +0 -2207
  91. package/dist/browser/chunks/dist-O6_2ByYB.js +0 -1
  92. package/dist/browser/chunks/focus-renderer-0elVToA2.js +0 -10
  93. package/dist/browser/chunks/layout-q0TR9-aY.js +0 -1
@@ -0,0 +1 @@
1
+ {"capabilities":["decision-v1","decision-v2","deep-links","embedded-evidence","focus-views/1","report-v2"],"entrypoint":"index.html","files":[{"mimeType":"text/html","path":"index.html","sha256":"sha256:f4084f6731495493c425b82918b16fb3e00d906e280c47e157a6de4033b9a0a1","size":416},{"mimeType":"text/css","path":"renderer/dossier.css","sha256":"sha256:7f6dd74718542ac30143b1ee25096242005a2cb3a5418fd5b94cbb3f2c7aeda3","size":212480},{"mimeType":"text/javascript","path":"renderer/dossier.js","sha256":"sha256:c5bb3da114a1b16eb3c819f6f2a99cde9dcd01b55ec15b705b870285f1ffde56","size":681587}],"name":"@sentropic/design-system-elements","version":"0.3.2"}
@@ -0,0 +1,9 @@
1
+ export interface StandaloneDossier {
2
+ /** Canonical UTF-8 JSON as supplied by the publisher. */
3
+ readonly document: string;
4
+ readonly manifest?: string;
5
+ readonly views?: string;
6
+ }
7
+ /** Inline the packaged renderer and canonical input bytes for a file:// reader. */
8
+ export declare function assembleStandaloneDossier({ document, manifest, views }: StandaloneDossier): string;
9
+ //# sourceMappingURL=focus-kit.d.ts.map
@@ -0,0 +1,30 @@
1
+ import { createHash } from "node:crypto";
2
+ import { readFileSync } from "node:fs";
3
+ function readKit(path) {
4
+ return readFileSync(new URL(`./focus-kit/${path}`, import.meta.url), "utf8").replace(/\r\n?/g, "\n");
5
+ }
6
+ function cspHash(text) {
7
+ return `'sha256-${createHash("sha256").update(text).digest("base64")}'`;
8
+ }
9
+ /** Inline the packaged renderer and canonical input bytes for a file:// reader. */
10
+ export function assembleStandaloneDossier({ document, manifest, views }) {
11
+ const module = readKit("renderer/dossier.js").replace(/<\/script/gi, "<\\/script");
12
+ const css = readKit("renderer/dossier.css");
13
+ const csp = [
14
+ "default-src 'none'",
15
+ `script-src ${cspHash(module)}`,
16
+ `style-src ${cspHash(css)}`,
17
+ "img-src data:",
18
+ "worker-src 'none'",
19
+ "base-uri 'none'",
20
+ "form-action 'none'",
21
+ ].join("; ");
22
+ const islands = [["document", document], ["manifest", manifest], ["views", views]]
23
+ .flatMap(([name, value]) => value === undefined ? [] : [
24
+ `<script type="application/octet-stream" data-st-dossier-${name}>${Buffer.from(value).toString("base64")}</script>`,
25
+ ]);
26
+ return readKit("index.html")
27
+ .replace('<link rel="stylesheet" href="./renderer/dossier.css">', () => `<meta http-equiv="Content-Security-Policy" content="${csp}">\n <style>${css}</style>`)
28
+ .replace('<script type="module" src="./renderer/dossier.js"></script>', () => [...islands, `<script type="module">${module}</script>`].join("\n "));
29
+ }
30
+ //# sourceMappingURL=focus-kit.js.map
@@ -0,0 +1,5 @@
1
+ import type { TimeSeriesChartProps } from "./contracts/time-series-chart.js";
2
+ export declare const TIME_SERIES_FALLBACK_LIMIT_BYTES = 4096;
3
+ /** Markdown fallback for validated props. Fails if the complete table exceeds 4 KiB. */
4
+ export declare function formatTimeSeriesMarkdown(props: TimeSeriesChartProps): string;
5
+ //# sourceMappingURL=format-time-series-markdown.d.ts.map
@@ -0,0 +1,24 @@
1
+ import { formatTimeSeriesId, formatTimeSeriesInstant, timeSeriesRows } from "./time-series.js";
2
+ import { utf8ByteLength } from "./validate/envelope.js";
3
+ export const TIME_SERIES_FALLBACK_LIMIT_BYTES = 4096;
4
+ function markdownCell(value) {
5
+ return value
6
+ .replace(/[&<>|\\`*_\[\]~!]/g, (character) => `&#${character.charCodeAt(0)};`)
7
+ .replace(/\r\n|[\r\n]/g, "&#10;");
8
+ }
9
+ /** Markdown fallback for validated props. Fails if the complete table exceeds 4 KiB. */
10
+ export function formatTimeSeriesMarkdown(props) {
11
+ const header = "| Time (UTC) | Series | Series ID | Value |\n| --- | --- | --- | --- |";
12
+ const lines = [header];
13
+ let bytes = utf8ByteLength(header);
14
+ for (const { x, seriesId, seriesLabel, y } of timeSeriesRows(props)) {
15
+ const line = `| ${formatTimeSeriesInstant(x)} | ${markdownCell(seriesLabel)} | ${markdownCell(formatTimeSeriesId(seriesId))} | ${y} |`;
16
+ bytes += 1 + utf8ByteLength(line);
17
+ if (bytes > TIME_SERIES_FALLBACK_LIMIT_BYTES) {
18
+ throw new RangeError(`TimeSeriesChart Markdown table exceeds ${TIME_SERIES_FALLBACK_LIMIT_BYTES} UTF-8 bytes`);
19
+ }
20
+ lines.push(line);
21
+ }
22
+ return lines.join("\n");
23
+ }
24
+ //# sourceMappingURL=format-time-series-markdown.js.map
@@ -162,7 +162,12 @@ export function runParityGuard(contract, catalogProps, catalogRequired, repoRoot
162
162
  };
163
163
  continue;
164
164
  }
165
- const frameworkPath = `${repoRoot}/${source.file}`;
165
+ // SFC props are exported by vue-tsc's declarations; keep the recorded
166
+ // source path pointing at the component consumers and reviewers compare.
167
+ const schemaFile = source.framework === "vue" && source.file.endsWith(".vue")
168
+ ? source.file.replace("/src/", "/dist/") + ".d.ts"
169
+ : source.file;
170
+ const frameworkPath = `${repoRoot}/${schemaFile}`;
166
171
  if (source.role === "no-counterpart") {
167
172
  rows[source.framework] = {
168
173
  status: "no-counterpart",
package/dist/index.d.ts CHANGED
@@ -7,5 +7,7 @@
7
7
  */
8
8
  export { contracts, CATALOG_ID, ENVELOPE_ID, standaloneId, A2UI_COMMON_TYPES_ID, A2UI_PROTOCOL_VERSION, } from "./contracts/index.js";
9
9
  export type { ContractModule } from "./contracts/index.js";
10
+ export type { EpochMilliseconds, TimeSeries, TimeSeriesChartProps, TimeSeriesPoint } from "./contracts/index.js";
11
+ export { formatTimeSeriesMarkdown, TIME_SERIES_FALLBACK_LIMIT_BYTES } from "./format-time-series-markdown.js";
10
12
  export * from "./validate/index.js";
11
13
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -6,5 +6,6 @@
6
6
  * re-exported separately.
7
7
  */
8
8
  export { contracts, CATALOG_ID, ENVELOPE_ID, standaloneId, A2UI_COMMON_TYPES_ID, A2UI_PROTOCOL_VERSION, } from "./contracts/index.js";
9
+ export { formatTimeSeriesMarkdown, TIME_SERIES_FALLBACK_LIMIT_BYTES } from "./format-time-series-markdown.js";
9
10
  export * from "./validate/index.js";
10
11
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+ export { buildDossierViews, type DossierDiagramViews, type DossierViews } from "../focus-diagrams/dossier-views.js";
2
+ export { DossierDiagramError } from "../focus-diagrams/diagram-source.js";
3
+ //# sourceMappingURL=dossier-views.d.ts.map
@@ -0,0 +1,3 @@
1
+ export { buildDossierViews } from "../focus-diagrams/dossier-views.js";
2
+ export { DossierDiagramError } from "../focus-diagrams/diagram-source.js";
3
+ //# sourceMappingURL=dossier-views.js.map
@@ -37,4 +37,3 @@ export type FocusValidate = (value: unknown) => FocusValidationResult;
37
37
  export declare function focusPathToPointer(path: string): string;
38
38
  /** Wraps a focus validator as the injected `focus` semantic port. */
39
39
  export declare function createFocusPort(validate: FocusValidate): SemanticPort;
40
- //# sourceMappingURL=focus.d.ts.map
@@ -33,4 +33,3 @@ export interface SemanticPort {
33
33
  readonly source: EngineSource;
34
34
  validate(payload: unknown): readonly SemanticFinding[];
35
35
  }
36
- //# sourceMappingURL=types.d.ts.map