@grafloria/element 0.3.3 → 0.3.4

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 (41) hide show
  1. package/esm/src/index.js +284 -0
  2. package/esm/src/index.js.map +1 -0
  3. package/esm/src/lib/dashboard-kit/dashboard.js +590 -0
  4. package/esm/src/lib/dashboard-kit/dashboard.js.map +1 -0
  5. package/esm/src/lib/dashboard-kit/grid-binder.js +1632 -0
  6. package/esm/src/lib/dashboard-kit/grid-binder.js.map +1 -0
  7. package/esm/src/lib/dashboard-kit/grid-mapping.js +164 -0
  8. package/esm/src/lib/dashboard-kit/grid-mapping.js.map +1 -0
  9. package/esm/src/lib/dashboard-kit/index.js +8 -0
  10. package/esm/src/lib/dashboard-kit/index.js.map +1 -0
  11. package/esm/src/lib/dashboard-kit/styles.js +199 -0
  12. package/esm/src/lib/dashboard-kit/styles.js.map +1 -0
  13. package/esm/src/lib/dashboard-kit/widgets.js +379 -0
  14. package/esm/src/lib/dashboard-kit/widgets.js.map +1 -0
  15. package/esm/src/lib/diagram-kit/card.js +199 -0
  16. package/esm/src/lib/diagram-kit/card.js.map +1 -0
  17. package/esm/src/lib/diagram-kit/editing.js +286 -0
  18. package/esm/src/lib/diagram-kit/editing.js.map +1 -0
  19. package/esm/src/lib/diagram-kit/er.js +160 -0
  20. package/esm/src/lib/diagram-kit/er.js.map +1 -0
  21. package/esm/src/lib/diagram-kit/handles.js +312 -0
  22. package/esm/src/lib/diagram-kit/handles.js.map +1 -0
  23. package/esm/src/lib/diagram-kit/index.js +9 -0
  24. package/esm/src/lib/diagram-kit/index.js.map +1 -0
  25. package/esm/src/lib/diagram-kit/rows.js +144 -0
  26. package/esm/src/lib/diagram-kit/rows.js.map +1 -0
  27. package/esm/src/lib/diagram-kit/styles.js +110 -0
  28. package/esm/src/lib/diagram-kit/styles.js.map +1 -0
  29. package/esm/src/lib/diagram-kit/uml.js +135 -0
  30. package/esm/src/lib/diagram-kit/uml.js.map +1 -0
  31. package/esm/src/lib/diagram-kit/update.js +244 -0
  32. package/esm/src/lib/diagram-kit/update.js.map +1 -0
  33. package/esm/src/lib/grafloria-flow-element.js +266 -0
  34. package/esm/src/lib/grafloria-flow-element.js.map +1 -0
  35. package/esm/src/lib/grafloria.js +69 -0
  36. package/esm/src/lib/grafloria.js.map +1 -0
  37. package/esm/src/lib/load.js +252 -0
  38. package/esm/src/lib/load.js.map +1 -0
  39. package/esm/src/lib/node-type-registry.js +42 -0
  40. package/esm/src/lib/node-type-registry.js.map +1 -0
  41. package/package.json +1 -1
@@ -0,0 +1,284 @@
1
+ /**
2
+ * `@grafloria/element` — the universal embed.
3
+ *
4
+ * Two surfaces over the same headless core:
5
+ *
6
+ * 1. `<grafloria-flow>` — a custom element. Attributes/properties in, DOM events
7
+ * out, slotted `<template>`s for custom nodes. Works in Vue, Svelte, Solid,
8
+ * Lit, Alpine, plain HTML, a CMS, a notebook — with no wrapper library.
9
+ * 2. `Grafloria.render(spec, el)` — the Mermaid-shaped one-call API.
10
+ *
11
+ * Importing this module registers `<grafloria-flow>` automatically (and is a no-op
12
+ * on the server, where `customElements` does not exist). Call
13
+ * `Grafloria.define('my-flow')` yourself if you want a different tag name.
14
+ */
15
+ import { defineGrafloriaFlow } from './lib/grafloria-flow-element';
16
+ export { GrafloriaFlowElement, defineGrafloriaFlow, GRAFLORIA_EVENTS } from './lib/grafloria-flow-element';
17
+ export { Grafloria, render, renderStatic } from './lib/grafloria';
18
+ // The LOAD front door — the other half of `DiagramSerializer.serialize()`.
19
+ // `render(fromDocument(json), host)` is the one-liner; see lib/load.ts for why
20
+ // the loaded models go back in as models rather than being re-specced.
21
+ export { fromDocument } from './lib/load';
22
+ export { registerNodeType, unregisterNodeType, registeredNodeTypes, getNodeType, hasNodeType, renderFromTemplate, } from './lib/node-type-registry';
23
+ export { renderToStaticSVG, LIGHT_THEME, DARK_THEME } from '@grafloria/renderer';
24
+ // React Flow-parity helper surface (getIntersectingNodes & friends) — an embed
25
+ // gets the same convenience wrapper the frameworks get, from the same import.
26
+ export { createDiagramApi } from '@grafloria/renderer';
27
+ /* ==========================================================================
28
+ * WAVE 10 — THE REACHABILITY FIX.
29
+ *
30
+ * Everything below this line ALREADY EXISTED, was ALREADY unit-tested, and was
31
+ * ALREADY exported from `@grafloria/renderer` / `@grafloria/engine`. None of it was
32
+ * reachable by an actual embedder, because THIS file — the public package —
33
+ * re-exported exactly three runtime values (`renderToStaticSVG`, `LIGHT_THEME`,
34
+ * `DARK_THEME`) and nothing else.
35
+ *
36
+ * So: PNG/SVG/PDF export, the round-trip artifact, the Mermaid text format, the
37
+ * minimap, the perf HUD, the quality governor, the named-style registry, the
38
+ * WCAG contrast maths, `deriveTheme()`, `themeRef()`, the design-token bridges,
39
+ * cross-tab sync, the CRDT, presence, comments and presentation mode were all
40
+ * built, all green, and all WIRED TO NOTHING at the package boundary. The
41
+ * gallery is what caught it: not one of these demos could be written.
42
+ *
43
+ * The rule this file now follows: if the library claims a feature, this file
44
+ * exports the handle you drive it with. `libs/element/src/reachability.spec.ts`
45
+ * is the lock — it fails if any of these names stops being reachable.
46
+ * ========================================================================== */
47
+ // -- Theming ---------------------------------------------------------------
48
+ // The theme set + the OS-preference controller behind `colorMode: 'system'`.
49
+ export { HIGH_CONTRAST_LIGHT_THEME, HIGH_CONTRAST_DARK_THEME, DEFAULT_THEME_SET, ColorModeController, resolveThemeFromPrefs, readColorPreferences, MEDIA_PREFERS_DARK, MEDIA_PREFERS_CONTRAST, MEDIA_FORCED_COLORS, } from '@grafloria/renderer';
50
+ // Theme-bound properties: the CALLER's semantic colours follow a theme swap.
51
+ export { themeRef, isThemeRef, themeRefToken, themeRefVar, resolveThemeRef, themeRefCssValue, resolveBindableVars, } from '@grafloria/renderer';
52
+ // WCAG maths + a theme derivation that audits its own output.
53
+ export { WCAG, parseColor, toHex, relativeLuminance, contrastRatio, meetsContrast, rgbToHsl, hslToRgb, lightnessOf, withLightness, ensureContrast, auditThemeContrast, assertThemeContrast, deriveTheme, } from '@grafloria/renderer';
54
+ // The design-token bridge: drive Grafloria from shadcn / MUI / Tailwind variables.
55
+ export { shadcnBridge, muiBridge, tailwindBridge, BRIDGEABLE_TOKENS, generateTokenBridgeBlock, generateInstanceOverrideCSS, } from '@grafloria/renderer';
56
+ // Port data types — the registry the renderer reads for glyph colours and the
57
+ // validator reads for connection compatibility. Same reachability hole as the
58
+ // style classes below: read on every frame, and no embedder could WRITE to it —
59
+ // the typed-ports demo could not colour its own types through the public API
60
+ // (its glyphs silently fell back to direction colours, and the screenshot audit
61
+ // read them as such).
62
+ export { portTypeRegistry, arePortDataTypesCompatible, portTypeColor } from '@grafloria/engine';
63
+ // Named style classes — the `named-class` layer of the cascade. The cascade read
64
+ // this registry on every frame; nothing could WRITE to it.
65
+ export { defineStyle, defineStyles, getStyle, hasStyle, removeStyle, clearStyles, listStyles, resolveStyleClasses, resolveNodeStyle, resolveLinkStyle, CASCADE_ORDER, } from '@grafloria/renderer';
66
+ // Instance-scoped CSS variables — two diagrams, two themes, one page.
67
+ export { GRAFLORIA_INSTANCE_ATTR, GRAFLORIA_VAR_PREFIX, THEME_VARS, THEME_TOKENS, cssVarName, themeVar, themeVarValue, resolveThemeVars, instanceScopeSelector, } from '@grafloria/renderer';
68
+ // -- Export ----------------------------------------------------------------
69
+ // Deterministic, DOM-free SVG serialization; true vector PDF; the raster seam.
70
+ export { exportSvg, serializeVNode, vnodeBounds, exportPdf, paginate, buildPrintDocument, exportBatch, createDomRasterBackend, resolveRasterBackend, canRasterizeInThisEnvironment, svgToDataUri, mimeTypeForFormat, } from '@grafloria/renderer';
71
+ // The model rides INSIDE the artifact: SVG metadata + a real PNG iTXt chunk.
72
+ export { GRAFLORIA_NS, GRAFLORIA_MODEL_KEY, embedModelInSvg, extractModelFromSvg, embedModelInPng, extractModelFromPng, extractModel, isEditableArtifact, importDiagram, } from '@grafloria/renderer';
73
+ // -- Canvas furniture ------------------------------------------------------
74
+ // One call over a DiagramInstance. `gridEnabled` / `showMinimap` / `snapEnabled`
75
+ // are only live once this runs — which nothing could call.
76
+ export { attachCanvasPlugins, createMiniMap, createControls, createBackground, } from '@grafloria/renderer';
77
+ // -- Performance -----------------------------------------------------------
78
+ export { PerfHud, formatSnapshot, EMPTY_SNAPSHOT, QualityGovernor } from '@grafloria/renderer';
79
+ // -- Collaboration (renderer half) -----------------------------------------
80
+ // Presence is a SEPARATE DOM layer that never enters the VNode tree.
81
+ export { bindPresence, PresenceOverlay, PRESENCE_LAYER_CLASS, actorColor, actorInitials, contrastingTextColor, } from '@grafloria/renderer';
82
+ export { CommentOverlayController } from '@grafloria/renderer';
83
+ export { InMemoryViewportChannel, presentTo, followPresenter, lockDocument, isDocumentLocked, loadReadonlySnapshot, } from '@grafloria/renderer';
84
+ // -- Collaboration (engine half) -------------------------------------------
85
+ // Sync, the CRDT and comments live in the ENGINE, and this package did not
86
+ // re-export the engine AT ALL — its only reference was a type-only import,
87
+ // erased at build. Zero collaboration symbols survived into the bundle.
88
+ export { createSyncSession, SyncAdapter, MemoryHub, MemoryTransport, BroadcastChannelTransport, WebSocketTransport, UnreliableHub, Awareness, VersionVector, OpBatcher, CausalBuffer, } from '@grafloria/engine';
89
+ // The per-property CRDT. Whole-entity LWW would silently throw one edit away.
90
+ export { Replica, LwwRegistry, OpLog, UndoStack, ReferentialIntegrity, LamportClock, applyOp, replay, compareOps, opId, } from '@grafloria/engine';
91
+ // Threaded comments. A deleted node ORPHANS its thread; it never destroys it.
92
+ export { CommentStore } from '@grafloria/engine';
93
+ // The lossless Mermaid-compatible text format, with hand-edit detection.
94
+ export { exportDiagramText, importDiagramText, stripGrafloriaSidecar, GRAFLORIA_DOC_PREFIX, GRAFLORIA_HASH_PREFIX, } from '@grafloria/engine';
95
+ export { DiagramSerializer } from '@grafloria/engine';
96
+ // wave10/whiteboard: ink as a first-class model entity — authors seed and inspect strokes
97
+ // through this, the same class the draw tool commits.
98
+ export { StrokeModel, DEFAULT_STROKE_STYLE } from '@grafloria/engine';
99
+ // ===========================================================================
100
+ // wave10/gallery BUG FIX — the AUTHORING SEAMS were not on the public embed.
101
+ //
102
+ // This package's own doc calls itself "the universal embed … so an embed never
103
+ // needs a second import". It exported fifteen values, and every registry an
104
+ // author actually extends the engine THROUGH was missing from all of them:
105
+ //
106
+ // registerLinkTemplate / registerLabelTemplate — custom edges & labels
107
+ // registerMarker — named custom arrowheads
108
+ // registerConnector / registerAnchor /
109
+ // registerConnectionPoint — the wave-6 link pipeline
110
+ // registerConnectionValidator / isValidConnection — vetoing a connection
111
+ // registerTool — replacing a gesture
112
+ // createPortal / createViewportPortal — anchoring UI to geometry
113
+ // (an edge toolbar, a badge)
114
+ //
115
+ // Every one of them is a documented, semver'd, unit-tested extension point of
116
+ // `@grafloria/renderer`. None was reachable from `<grafloria-flow>` or `Grafloria.render()`
117
+ // — i.e. from the surface this package exists to BE. An embedder who took the
118
+ // package at its word ("no second import") could not write a custom edge.
119
+ //
120
+ // These are re-exports, not new API. The registries are process-wide singletons
121
+ // in @grafloria/renderer, so registering through here is the same registration the
122
+ // renderer's own consumers read.
123
+ // ===========================================================================
124
+ export {
125
+ // Custom edges, labels and named markers (Wave 4 — Card 5).
126
+ registerLinkTemplate, unregisterLinkTemplate, listLinkTemplates, registerLabelTemplate, unregisterLabelTemplate, listLabelTemplates, registerMarker, unregisterMarker, listMarkers, htmlLabelVNode,
127
+ // The link pipeline: anchors, connection points, connectors (Wave 6 — Card 2).
128
+ registerAnchor, listAnchors, registerConnectionPoint, listConnectionPoints, registerConnector, listConnectors,
129
+ // Connection validation + the tool registry (Wave 6 — Card 5).
130
+ registerConnectionValidator, isValidConnection, clearConnectionValidators, registerTool, listTools,
131
+ // wave10/whiteboard: the freehand-draw / rectangle / eraser tools + the in-progress
132
+ // ink overlay. Register them through `registerTool` — an embed draws on its diagram
133
+ // with no second import, which is the whole promise of this package.
134
+ createDrawTool, createRectangleTool, createEraserTool,
135
+ // wave13/stroke-edit: select + move committed ink (the drawn/erased/EDITED triad closes).
136
+ createStrokeEditTool, DrawTool, RectangleTool, EraserTool, StrokeEditTool, InkOverlay, INK_OVERLAY_CLASS,
137
+ // Anchoring your own DOM to diagram geometry — how an edge toolbar is built.
138
+ createPortal, createViewportPortal, createCounterScaledPortal, } from '@grafloria/renderer';
139
+ // ===========================================================================
140
+ // wave11/nodes GALLERY BUG FIX — the NODE authoring seams were not on the embed.
141
+ //
142
+ // Same finding shape as Wave 10, one layer down. This package re-exported the
143
+ // EDGE/PORT authoring registries (Wave 10) and the whole collaboration/export
144
+ // stack, but the NODE-shape and node-sizing seams — every one a documented,
145
+ // unit-tested, `@grafloria/renderer`-exported extension point — were missing from
146
+ // all fifteen-plus re-exports. An embedder taking the package at its word ("the
147
+ // universal embed … an embed never needs a second import") could NOT:
148
+ //
149
+ // - draw any of the 21 built-in figures' CUSTOM cousins, or register a custom
150
+ // silhouette: `registerShape` / `registerPathShape` / `listShapes` were
151
+ // reachable only past the package boundary. (The 21 built-ins render fine via
152
+ // `shape: { type }`, because the registry pre-registers them; a custom shape
153
+ // could not be added at all.)
154
+ // - read or reuse the per-node sizing contract the resizer AND the auto-sizer
155
+ // share (`getNodeSizing` / `clampSizeToConstraints` / `resolveAspectRatio`) —
156
+ // the min/max/aspect clamp math that a custom resize gesture (built on the
157
+ // public `registerTool` seam) needs to honour a node's declared limits.
158
+ // - measure a node from its content (`desiredNodeSize` / `measureLabelContent`
159
+ // / `autoSizeNode`), or build an in-node foreignObject / read its toolbar
160
+ // config, or drive proximity-connect from the shipped `SnapController`, or
161
+ // create SWIMLANES — `SwimlaneService`, a whole engine feature React Flow
162
+ // does not have, was reachable only via a second `@grafloria/engine` import.
163
+ //
164
+ // All re-exports, no new API. The registries are process-wide singletons in
165
+ // @grafloria/renderer / @grafloria/engine, so registering through here is the exact
166
+ // registration the renderer's own consumers read.
167
+ // ===========================================================================
168
+ export {
169
+ // The node figure registry (21 built-ins + custom silhouettes).
170
+ registerShape, registerPathShape, unregisterShape, getShape, hasShape, listShapes, getShapeDefinition, getShapeRegistryVersion, onShapeRegistryChange,
171
+ // Per-node sizing constraints — the min/max/aspect contract the resizer clamps
172
+ // to DURING a gesture and the auto-sizer floors/ceils to.
173
+ getNodeSizing, isAutoSized, resolveAspectRatio, clampSizeToConstraints, clampValue,
174
+ // Content-aware auto-sizing (a node grows to fit its label + panel).
175
+ measureLabelContent, desiredNodeSize, outerSizeForInner, autoSizeNode, autoSizeDiagram,
176
+ // Per-node toolbar config seam + in-node HTML (foreignObject) content.
177
+ getNodeToolbar, resolveToolbar, getHtmlContent, hasHtmlContent, buildHtmlForeignObject,
178
+ // Proximity-connect: the shipped reference implementation, addressable at last.
179
+ SnapController, DEFAULT_SNAP_CONFIG, } from '@grafloria/renderer';
180
+ // Swimlanes / pools / lanes — a whole containment model in the ENGINE that the
181
+ // package re-exported none of. React Flow has no equivalent.
182
+ export { SwimlaneService } from '@grafloria/engine';
183
+ export { GroupModel } from '@grafloria/engine';
184
+ export { GroupCollapseService, PROXY_NODE_GROUP_KEY, PROXY_LINK_GROUP_KEY } from '@grafloria/engine';
185
+ // serveLayout — the worker body for OFF-THREAD layout. `engine.setLayoutPort()`
186
+ // takes any port; an app runs the layout in a real Worker by importing this
187
+ // package inside the worker and calling `serveLayout(self)`. It was exported
188
+ // from @grafloria/engine and reachable by NOBODY through the embed, so the whole
189
+ // off-thread-layout capability (progress streaming + mid-run cancellation with
190
+ // a retained partial result) could not be wired from the public package.
191
+ export { serveLayout } from '@grafloria/engine';
192
+ // ===========================================================================
193
+ // DIAGRAM KIT — reusable ER / UML builders (wave16m).
194
+ //
195
+ // The diagrams/* demos proved Grafloria can draw database tables with crow's-foot
196
+ // cardinality (field-level FK→PK included) and full-vocabulary UML class
197
+ // diagrams — but every page hand-composed the HTML cards, the CSS, the
198
+ // selection overrides and the marker tables. That is a capability, not a
199
+ // feature. This kit is the feature: typed builders that emit a ready render()
200
+ // spec + one self-injected stylesheet, so an embedder writes DATA:
201
+ //
202
+ // const spec = erDiagram({ entities, relationships });
203
+ // render(spec, el);
204
+ //
205
+ // const uml = umlDiagram({ classes, relationships });
206
+ // const api = render(uml, el); uml.finalize(api);
207
+ // ===========================================================================
208
+ export { erDiagram, erRowCenterY, ER_ROW_H, ER_HEAD_H, umlDiagram, ensureDiagramKitStyles, DIAGRAM_KIT_STYLE_ID,
209
+ // In-canvas editing (P2–P4): live edits + the gesture binder.
210
+ updateEntity, updateClass, addColumnAt, removeColumnAt, renameColumnAt, bindCardEditing, matchColumns, rowIndexFromY, } from './lib/diagram-kit';
211
+ // Typed façade handles (domain-API decision, Option B): the OO surface —
212
+ // CardHandle → ErTable/UmlClass, ErField — over the data-first kit.
213
+ export { erTable, umlClass, erTables, umlClasses, CardHandle, ErTable, ErField, ErColumnList, UmlClass, UmlMemberList, } from './lib/diagram-kit';
214
+ // ===========================================================================
215
+ // THE DASHBOARD KIT — Phase 2 of the dashboard-grid plan.
216
+ //
217
+ // The dashboard demo proved Grafloria can host a dashboard-builder app — but its
218
+ // interaction (live push while you hover, truthful placeholder, cell-stepped
219
+ // resize, one undo step per gesture) was page JS. This kit is the feature:
220
+ // `bindDashboardGrid(api, group)` puts a GridPackEngine-driven pack grid on
221
+ // any group of widget nodes, with cells persisted in the EXISTING
222
+ // GridItemConfig. Element-local code, so the Phase-0 wholesale re-export
223
+ // below does NOT cover it — this curated block is its only door.
224
+ // ===========================================================================
225
+ export { bindDashboardGrid, rowHeightFor, boardHeightFor, columnUnitFor, cellToRect, pointToCell, sizeToSpan, gridItemFromCell, cellFromGridItem, buildCommitCommands, ensureDashboardKitStyles, DASHBOARD_KIT_STYLE_ID,
226
+ // The DATA-FIRST authoring API — the erDiagram()/umlDiagram() equivalent.
227
+ dashboard,
228
+ // …and the built-in renderers behind `kind`, so a dashboard is useful with
229
+ // no renderWidget at all. Composable: call defaultWidgetRenderer first, then
230
+ // decorate the host.
231
+ defaultWidgetRenderer, renderKpiWidget, renderLineWidget, renderBarWidget, renderDonutWidget, renderFunnelWidget, renderTableWidget, BUILT_IN_WIDGET_KINDS, } from './lib/dashboard-kit';
232
+ /* ==========================================================================
233
+ * PHASE 0 — THE INVERSION.
234
+ *
235
+ * Everything above this line is a CURATED re-export: a hand-written list, added
236
+ * to whenever someone noticed a capability was missing. That model made the
237
+ * front door default-DENY — a capability shipped in `@grafloria/engine` or
238
+ * `@grafloria/renderer` was invisible to embedders until a human remembered to add
239
+ * a line here. The Wave 10 comment above records what that cost the first time.
240
+ * It kept costing: an audit found 207 capability-level symbols (classes, and
241
+ * `register…` / `create…` / `define…` factories) built, tested, exported one
242
+ * layer down, and unreachable from this package — including `DiagramEngine`, `DiagramModel`,
243
+ * `NodeModel`, `Command`, `CommandManager`, `RoutingEngine`, `LayoutRegistry`,
244
+ * `EventBus`, `PluginManager` and every one of the 30 undoable commands. The
245
+ * repo's own flagship app (apps/renderer-demo, which contains a dashboard
246
+ * builder, a workflow builder and an ERD designer — exactly the apps this
247
+ * package is meant to enable) imports `@grafloria/engine` in 41 files and
248
+ * `@grafloria/element` in ZERO. It could not have used the front door.
249
+ *
250
+ * So the default flips: this package now re-exports the two lower packages
251
+ * WHOLESALE. Adding a capability downstairs makes it reachable here with no
252
+ * edit to this file, and `reachability.spec.ts` — now an INVERTED lock — fails
253
+ * the build if a capability is NOT reachable, rather than passing silently.
254
+ *
255
+ * The curated block above is kept deliberately: it is the DOCUMENTED surface
256
+ * (what the 15-line getting-started guide uses), and explicit exports take
257
+ * precedence over `export *`, so it also resolves the collisions below.
258
+ * ========================================================================== */
259
+ export * from '@grafloria/engine';
260
+ export * from '@grafloria/renderer';
261
+ /* -- Collision resolution (9 names are declared in BOTH lower packages) -----
262
+ * Under ES `export *` semantics an ambiguous name is silently OMITTED from the
263
+ * re-export — a silent hole, which is the exact failure mode this phase exists
264
+ * to kill. So every one is resolved explicitly. The ENGINE wins by default:
265
+ * its declarations are the document vocabulary an app manipulates. Nothing is
266
+ * dropped — each renderer counterpart keeps a qualified name below.
267
+ *
268
+ * (`NodeModel`, `PortModel`, `PortLayoutArgs` and `PortLayoutSpec` are NOT real
269
+ * collisions: `svg/port-layout.ts` re-exports the engine's own declarations.
270
+ * They are pinned here anyway — they are the most load-bearing names in the
271
+ * package, and pinning costs one line.)
272
+ */
273
+ export { NodeModel, PortModel, distanceToSegment, rotatePoint, coalesce, } from '@grafloria/engine';
274
+ // The three genuine VALUE collisions, kept reachable under qualified names.
275
+ // `coalesce` is the one that matters: the engine's coalesces op-log entries for
276
+ // batching, the renderer's merges dirty rectangles for partial redraw. Same
277
+ // name, unrelated jobs — losing either to an `export *` ambiguity would be a
278
+ // silent capability hole rather than a compile error.
279
+ export { distanceToSegment as distanceToSegmentCanvas, rotatePoint as rotatePointSelection, coalesce as coalesceRects, } from '@grafloria/renderer';
280
+ // Side effect: define the element on import. This is what makes
281
+ // `<script type="module" src="…/grafloria.js"></script>` + `<grafloria-flow>` in the
282
+ // markup Just Work, which is the entire point of the card.
283
+ defineGrafloriaFlow();
284
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/element/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAE3G,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGlE,2EAA2E;AAC3E,+EAA+E;AAC/E,uEAAuE;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1C,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAelC,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qBAAqB,CA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