@erd-studio/renderer 0.3.0 → 0.4.0

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 (71) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +7 -3
  3. package/dist/{chunk-DUQ2TTQH.js → chunk-64BVOHOR.js} +4 -3
  4. package/dist/chunk-7VFJNN4P.js +10461 -0
  5. package/dist/{chunk-WOTSQZCQ.js → chunk-YLXBIRPE.js} +132 -2
  6. package/dist/editor.js +43 -3
  7. package/dist/index.js +14 -3
  8. package/dist/sizing.js +2 -2
  9. package/dist/store.js +1 -1
  10. package/dist/styles.css +912 -359
  11. package/dist/types/ErdCanvas.d.ts +29 -1
  12. package/dist/types/canvas/CanvasBackdrop.d.ts +3 -2
  13. package/dist/types/canvas/EdgeRouting.d.ts +56 -0
  14. package/dist/types/canvas/useCanvasGraph.d.ts +7 -1
  15. package/dist/types/canvas/useHoverFocus.d.ts +64 -0
  16. package/dist/types/components/DetailPanel/AliasEditor.d.ts +15 -1
  17. package/dist/types/components/DetailPanel/ColumnEditor.d.ts +18 -2
  18. package/dist/types/components/DetailPanel/DescriptionEditor.d.ts +1 -1
  19. package/dist/types/components/DetailPanel/DetailPanel.d.ts +31 -2
  20. package/dist/types/components/DetailPanel/FieldsSection.d.ts +68 -0
  21. package/dist/types/components/Graph/EdgeFlow.d.ts +55 -0
  22. package/dist/types/components/Graph/EdgeLabels.d.ts +18 -0
  23. package/dist/types/components/Graph/FkEdge.d.ts +8 -1
  24. package/dist/types/components/Graph/ModelNode.d.ts +1 -1
  25. package/dist/types/components/Legend/Legend.d.ts +34 -3
  26. package/dist/types/components/StatusBar/StatusBar.d.ts +45 -0
  27. package/dist/types/components/common/ColumnRowEditor.d.ts +18 -2
  28. package/dist/types/components/common/KeyBadgeGroup.d.ts +5 -1
  29. package/dist/types/editor.d.ts +8 -2
  30. package/dist/types/hooks/usePrefersReducedMotion.d.ts +13 -0
  31. package/dist/types/index.d.ts +2 -1
  32. package/dist/types/lib/badgeLabels.d.ts +6 -0
  33. package/dist/types/lib/canvasContext.d.ts +20 -0
  34. package/dist/types/lib/canvasFocus.d.ts +66 -0
  35. package/dist/types/lib/edgeFlow.d.ts +84 -0
  36. package/dist/types/lib/edgeRouting/index.d.ts +146 -0
  37. package/dist/types/lib/edgeRouting/input.d.ts +35 -0
  38. package/dist/types/lib/edgeRouting/lineStyle.d.ts +16 -0
  39. package/dist/types/lib/edgeRouting/render/corners.d.ts +52 -0
  40. package/dist/types/lib/edgeRouting/render/crossings.d.ts +27 -0
  41. package/dist/types/lib/edgeRouting/render/curveCrossings.d.ts +35 -0
  42. package/dist/types/lib/edgeRouting/render/pathRender.d.ts +74 -0
  43. package/dist/types/lib/edgeRouting/render/tunnels.d.ts +49 -0
  44. package/dist/types/lib/edgeRouting/routeAll.d.ts +20 -0
  45. package/dist/types/lib/edgeRouting/routers/orthogonal/geom.d.ts +58 -0
  46. package/dist/types/lib/edgeRouting/routers/orthogonal/grid.d.ts +77 -0
  47. package/dist/types/lib/edgeRouting/routers/orthogonal/nudge.d.ts +62 -0
  48. package/dist/types/lib/edgeRouting/routers/orthogonal/params.d.ts +152 -0
  49. package/dist/types/lib/edgeRouting/routers/orthogonal/router.d.ts +51 -0
  50. package/dist/types/lib/edgeRouting/routers/orthogonal/search.d.ts +81 -0
  51. package/dist/types/lib/edgeRouting/routers/orthogonalAvoid.d.ts +11 -0
  52. package/dist/types/lib/edgeRouting/types.d.ts +113 -0
  53. package/dist/types/lib/edgeRouting/worker/client.d.ts +23 -0
  54. package/dist/types/lib/edgeRouting/worker/entry.d.ts +1 -0
  55. package/dist/types/lib/edgeRouting/worker/protocol.d.ts +23 -0
  56. package/dist/types/lib/hoverIntent.d.ts +44 -0
  57. package/dist/types/lib/layerCues.d.ts +26 -0
  58. package/dist/types/lib/nodeOverlays.d.ts +6 -0
  59. package/dist/types/lib/nodeSizing.d.ts +1 -1
  60. package/dist/types/lib/pathGeometry.d.ts +45 -0
  61. package/dist/types/lib/reuseUnchanged.d.ts +28 -0
  62. package/dist/types/lib/roleOptions.d.ts +13 -0
  63. package/dist/types/store/editorStore.d.ts +58 -1
  64. package/dist/types/types/graph.d.ts +20 -1
  65. package/package.json +2 -2
  66. package/dist/chunk-HWA32XG5.js +0 -5652
  67. package/dist/types/components/DetailPanel/GrainEditor.d.ts +0 -16
  68. package/dist/types/components/DetailPanel/MetaEditor.d.ts +0 -21
  69. package/dist/types/components/DetailPanel/ModelRationale.d.ts +0 -27
  70. package/dist/types/components/DetailPanel/RationaleField.d.ts +0 -28
  71. package/dist/types/components/DetailPanel/RoleEditor.d.ts +0 -13
@@ -1,16 +0,0 @@
1
- /**
2
- * GrainEditor — displays and edits the grain statement for a model.
3
- *
4
- * Three states:
5
- * 1. Empty — dashed "Add Grain" button when no content exists
6
- * 2. Read — shows grain text with pencil edit button on hover
7
- * 3. Edit — textarea with Save/Cancel buttons
8
- *
9
- * Follows the same pattern as ModelRationale.tsx.
10
- */
11
- interface GrainEditorProps {
12
- modelName: string;
13
- grain?: string;
14
- }
15
- export declare function GrainEditor({ modelName, grain }: GrainEditorProps): import("react/jsx-runtime").JSX.Element;
16
- export {};
@@ -1,21 +0,0 @@
1
- /**
2
- * MetaEditor — the structured metadata (`meta:`) of a model or a column.
3
- *
4
- * Top-level text values are edited in place; a nested map, a list, `true` /
5
- * `false` or an empty value is shown as it is and edited in the model file,
6
- * so the canvas never rewrites a value it cannot represent. Every change is
7
- * posted as an `updateMeta` patch (set or remove one key), never the whole map.
8
- */
9
- import type { Meta } from '@erd-studio/core';
10
- import { formatMetaValue } from '../../lib/metaFormat.js';
11
- export { formatMetaValue };
12
- interface MetaEditorProps {
13
- modelName: string;
14
- /** Edit this column's `meta` instead of the model's. */
15
- columnName?: string;
16
- meta?: Meta;
17
- readOnly?: boolean;
18
- /** Smaller layout for a column row. */
19
- compact?: boolean;
20
- }
21
- export declare function MetaEditor({ modelName, columnName, meta, readOnly, compact }: MetaEditorProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,27 +0,0 @@
1
- /**
2
- * TableRationale — collapsible section for all design rationale fields.
3
- *
4
- * Renders a clickable "Design Rationale" heading that toggles the body.
5
- * Each field has its own add/edit/read lifecycle and sends independent
6
- * field-patch messages via RationaleField.
7
- *
8
- * Conditional fields:
9
- * - roleChoice: shown when model has a modelRole
10
- * - grainChoice: shown when model has a grain
11
- * - scdStrategy: shown when model has a modelRole
12
- * - measures: shown when model has a grain
13
- *
14
- * When no rationale exists and no conditional fields are visible,
15
- * shows a dashed "Add Rationale" button that opens the section.
16
- */
17
- import type { Rationale, TableRole } from '@erd-studio/core';
18
- /** Whether any rationale field has text. */
19
- export declare function hasRationaleContent(rationale: Rationale | undefined): boolean;
20
- interface TableRationaleProps {
21
- modelName: string;
22
- rationale?: Rationale;
23
- modelRole?: TableRole;
24
- grain?: string;
25
- }
26
- export declare function TableRationale({ modelName, rationale, modelRole, grain }: TableRationaleProps): import("react/jsx-runtime").JSX.Element | null;
27
- export {};
@@ -1,28 +0,0 @@
1
- /**
2
- * RationaleField — displays and edits a single design rationale field.
3
- *
4
- * Reusable component for contextual reasoning (e.g. grain reasoning below
5
- * the grain section, classification reasoning below the role section).
6
- *
7
- * Three states:
8
- * 1. Empty — dashed "Add {label}" button when no content exists
9
- * 2. Read — shows label with text, pencil edit button on hover
10
- * 3. Edit — textarea with Save/Cancel buttons
11
- *
12
- * On save, sends only the single edited field as a partial patch.
13
- * The extension host merges it into the on-disk rationale object, avoiding
14
- * stale-closure races when multiple fields are edited in quick succession.
15
- */
16
- import type { Rationale } from '@erd-studio/core';
17
- type RationaleKey = 'purpose' | 'design' | 'grainChoice' | 'roleChoice' | 'scdStrategy' | 'measures';
18
- interface RationaleFieldProps {
19
- modelName: string;
20
- rationale?: Rationale;
21
- fieldKey: RationaleKey;
22
- label: string;
23
- placeholder: string;
24
- /** When true, opens in edit mode immediately (used when parent triggers "Add Rationale"). */
25
- autoEdit?: boolean;
26
- }
27
- export declare function RationaleField({ modelName, rationale, fieldKey, label, placeholder, autoEdit }: RationaleFieldProps): import("react/jsx-runtime").JSX.Element | null;
28
- export {};
@@ -1,13 +0,0 @@
1
- /**
2
- * RoleEditor — always-visible dropdown for setting a model's role.
3
- *
4
- * Displays a native <select> element with all TableRole options.
5
- * When "No role" is selected, the modelRole key is removed from JSON.
6
- */
7
- import type { TableRole } from '@erd-studio/core';
8
- interface RoleEditorProps {
9
- modelName: string;
10
- modelRole?: TableRole;
11
- }
12
- export declare function RoleEditor({ modelName, modelRole }: RoleEditorProps): import("react/jsx-runtime").JSX.Element;
13
- export {};