@sentropic/design-system-svelte 0.40.0 → 0.41.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.
- package/LICENSE.THIRD-PARTY.md +3 -75
- package/README.md +7 -0
- package/dist/DiagramCard.svelte +25 -36
- package/dist/DiagramCard.svelte.d.ts +4 -8
- package/dist/DiagramCard.svelte.d.ts.map +1 -1
- package/dist/DiagramCardHeader.svelte +11 -10
- package/dist/DiagramCardHeader.svelte.d.ts.map +1 -1
- package/dist/DiagramSceneFigure.svelte +411 -39
- package/dist/DiagramSceneFigure.svelte.d.ts +24 -4
- package/dist/DiagramSceneFigure.svelte.d.ts.map +1 -1
- package/dist/DiagramZone.svelte +21 -47
- package/dist/DiagramZone.svelte.d.ts +2 -4
- package/dist/DiagramZone.svelte.d.ts.map +1 -1
- package/dist/DiagramZoneHeader.svelte +2 -1
- package/dist/DiagramZoneHeader.svelte.d.ts.map +1 -1
- package/dist/diagram-icons/PROVENANCE.md +4 -0
- package/dist/diagram-icons/registry.d.ts.map +1 -1
- package/dist/diagram-icons/registry.js +2 -1
- package/dist/diagram-render/renderCardSvg.d.ts +5 -15
- package/dist/diagram-render/renderCardSvg.d.ts.map +1 -1
- package/dist/diagram-render/renderCardSvg.js +9 -15
- package/dist/diagram-render/renderZoneSvg.d.ts +2 -11
- package/dist/diagram-render/renderZoneSvg.d.ts.map +1 -1
- package/dist/diagram-render/renderZoneSvg.js +5 -10
- package/dist/diagramCardModel.d.ts +2 -611
- package/dist/diagramCardModel.d.ts.map +1 -1
- package/dist/diagramCardModel.js +2 -1164
- package/dist/diagramFontMeasure.d.ts +5 -0
- package/dist/diagramFontMeasure.d.ts.map +1 -0
- package/dist/diagramFontMeasure.js +41 -0
- package/dist/diagramRenderedBounds.d.ts +6 -0
- package/dist/diagramRenderedBounds.d.ts.map +1 -0
- package/dist/diagramRenderedBounds.js +51 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +10 -7
- package/dist/Dc2bContentSizeFixture.svelte.d.ts +0 -10
- package/dist/Dc2bContentSizeFixture.svelte.d.ts.map +0 -1
- package/dist/PanelStackFixture.svelte.d.ts +0 -23
- package/dist/PanelStackFixture.svelte.d.ts.map +0 -1
- package/dist/rich-text-editor/RichTextEditorFixture.svelte.d.ts +0 -8
- package/dist/rich-text-editor/RichTextEditorFixture.svelte.d.ts.map +0 -1
- package/dist/rich-text-editor/RichTextEditorNestedFixture.svelte.d.ts +0 -13
- package/dist/rich-text-editor/RichTextEditorNestedFixture.svelte.d.ts.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type LayoutHints, type LayoutMetrics, type LayoutOptions, type LayoutResult, type LineMeasurer, type RowPackOptions } from "@sentropic/diagram-canvas";
|
|
2
|
+
import { type StepChange, type EffectiveTarget } from "@sentropic/diagram-canvas/flowModel";
|
|
2
3
|
import { type CardLineMeasure, type DiagramGlyphPaths } from "./diagramCardModel.js";
|
|
3
4
|
import { type DiagramSceneSize, type SceneLayoutCache, type SceneDocument, type SceneOccurrenceRef, type ScenePresentation, type SceneView } from "@sentropic/diagram-canvas/diagramSceneModel";
|
|
4
5
|
/**
|
|
@@ -13,10 +14,9 @@ import { type DiagramSceneSize, type SceneLayoutCache, type SceneDocument, type
|
|
|
13
14
|
* `diagramScene.maxDisplayScale`), never zoom 1: no input — buttons,
|
|
14
15
|
* keys, Ctrl + wheel, pinch, `setZoom` — goes above it. The fit frames
|
|
15
16
|
* the scene bounds plus the placed label boxes on both axes inside the
|
|
16
|
-
* fit box `viewW × min(viewW × 9/16, 0.85 × windowH)
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* still reaches the whole drawing. The camera is never seeded from the
|
|
17
|
+
* fit box `viewW × min(viewW × 9/16, 0.85 × windowH)`. Fit reaches the
|
|
18
|
+
* whole rendered drawing, including below the readability preference.
|
|
19
|
+
* Zooming in scrolls the overflowing axis from its start. The camera is never seeded from the
|
|
20
20
|
* layout fit report. Zoom is a transform: it re-runs no layout.
|
|
21
21
|
*
|
|
22
22
|
* Folds. A fold toggle re-runs the whole layout, feeding the previous
|
|
@@ -37,6 +37,14 @@ import { type DiagramSceneSize, type SceneLayoutCache, type SceneDocument, type
|
|
|
37
37
|
* nominal 16:9 box.
|
|
38
38
|
*/
|
|
39
39
|
export interface DiagramSceneFigureLabels {
|
|
40
|
+
navigator: string;
|
|
41
|
+
step: string;
|
|
42
|
+
scenario: string;
|
|
43
|
+
count: string;
|
|
44
|
+
node: string;
|
|
45
|
+
previous: string;
|
|
46
|
+
next: string;
|
|
47
|
+
allScenarios: string;
|
|
40
48
|
/** Accessible name of the camera control group. */
|
|
41
49
|
controls: string;
|
|
42
50
|
zoomIn: string;
|
|
@@ -61,6 +69,16 @@ export interface DiagramSceneCamera {
|
|
|
61
69
|
readonly pans: boolean;
|
|
62
70
|
}
|
|
63
71
|
export interface DiagramSceneFigureProps {
|
|
72
|
+
flows?: {
|
|
73
|
+
fanOutMax?: number;
|
|
74
|
+
};
|
|
75
|
+
scenario?: string | null;
|
|
76
|
+
defaultScenario?: string;
|
|
77
|
+
activeStep?: string | null;
|
|
78
|
+
defaultActiveStep?: string;
|
|
79
|
+
onStepChange?: (change: StepChange | null) => void;
|
|
80
|
+
onScenarioChange?: (scenario: string | null) => void;
|
|
81
|
+
onHighlightChange?: (target: EffectiveTarget | null) => void;
|
|
64
82
|
document: SceneDocument;
|
|
65
83
|
/** Retained source view (occurrences, fold groups). Optional: the engine synthesises one. */
|
|
66
84
|
view?: SceneView;
|
|
@@ -87,6 +105,8 @@ export interface DiagramSceneFigureProps {
|
|
|
87
105
|
label?: string;
|
|
88
106
|
compact?: boolean;
|
|
89
107
|
labels?: Partial<DiagramSceneFigureLabels>;
|
|
108
|
+
iconBindings?: import("@sentropic/diagram-canvas/diagramSceneModel").SceneIconBindings;
|
|
109
|
+
strictIcons?: boolean;
|
|
90
110
|
resolveGlyph?: (name: string) => DiagramGlyphPaths | undefined;
|
|
91
111
|
onFoldChange?: (collapsed: readonly SceneOccurrenceRef[], change: {
|
|
92
112
|
occurrence: SceneOccurrenceRef;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiagramSceneFigure.svelte.d.ts","sourceRoot":"","sources":["../src/lib/DiagramSceneFigure.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DiagramSceneFigure.svelte.d.ts","sourceRoot":"","sources":["../src/lib/DiagramSceneFigure.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,EAMH,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,YAAY,EAEjB,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AASrC,OAAO,EAAqN,KAAK,UAAU,EAAE,KAAK,eAAe,EAAoB,MAAM,qCAAqC,CAAC;AACjU,OAAO,EAMH,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AACjC,OAAO,EAGH,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAiBrB,KAAK,aAAa,EAGlB,KAAK,kBAAkB,EAEvB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACf,MAAM,6CAA6C,CAAC;AAGrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,6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E,YAAY,KAAK,IAAI,CAAC;IAC1C,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACtD,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACjD;AAk2BH,QAAA,MAAM,kBAAkB;oBA3XE,MAAM,KAAG,IAAI;kBAuBjB,IAAI;mBAIH,IAAI;sBAKD,IAAI;qBAaL,kBAAkB;iBA8UqB,CAAC;AACjE,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,eAAe,kBAAkB,CAAC"}
|
package/dist/DiagramZone.svelte
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { lineBoxHeight } from "./diagramCardModel.js";
|
|
3
|
+
const descriptionId = $props.id();
|
|
2
4
|
import type { Snippet } from "svelte";
|
|
3
5
|
import DiagramCard from "./DiagramCard.svelte";
|
|
4
6
|
import DiagramZoneHeader from "./DiagramZoneHeader.svelte";
|
|
5
7
|
import {
|
|
6
8
|
ZONE_GEOMETRY,
|
|
7
9
|
defaultCardMeasure,
|
|
8
|
-
|
|
10
|
+
zoneFullText,
|
|
9
11
|
layoutZone,
|
|
10
12
|
zoneCollapsedCardProps,
|
|
11
13
|
type CardLineMeasure,
|
|
@@ -27,10 +29,8 @@
|
|
|
27
29
|
*
|
|
28
30
|
* Both states render inside the SAME positioning wrapper
|
|
29
31
|
* (`.st-diagramZone-pos`, absolute at `x`/`y`): folding never moves the
|
|
30
|
-
* zone occurrence.
|
|
31
|
-
*
|
|
32
|
-
* state `data-zone-refused="<slot>"`, matching the pure renderer's refused
|
|
33
|
-
* result.
|
|
32
|
+
* zone occurrence. Owner A11 keeps all content visible and grows the zone;
|
|
33
|
+
* explicit hard-cap overflow remains diagnostic.
|
|
34
34
|
*
|
|
35
35
|
* The component owns no view state: `collapsed` is a prop (§4.3) and
|
|
36
36
|
* activating the toggle emits the §7.2 intent through `onToggle`.
|
|
@@ -50,6 +50,8 @@
|
|
|
50
50
|
|
|
51
51
|
let {
|
|
52
52
|
entityId,
|
|
53
|
+
containerPadding,
|
|
54
|
+
autoSize,
|
|
53
55
|
kicker,
|
|
54
56
|
title,
|
|
55
57
|
subtitle,
|
|
@@ -74,6 +76,8 @@
|
|
|
74
76
|
|
|
75
77
|
const zoneProps = $derived({
|
|
76
78
|
entityId,
|
|
79
|
+
...(containerPadding === undefined ? {} : { containerPadding }),
|
|
80
|
+
...(autoSize === undefined ? {} : { autoSize }),
|
|
77
81
|
...(kicker === undefined ? {} : { kicker }),
|
|
78
82
|
title,
|
|
79
83
|
...(subtitle === undefined ? {} : { subtitle }),
|
|
@@ -116,7 +120,7 @@
|
|
|
116
120
|
);
|
|
117
121
|
// Overflow = refusal: the same predicate as the pure renderer
|
|
118
122
|
// (`firstOverflowDiagnostic`), so both renderers refuse together.
|
|
119
|
-
|
|
123
|
+
|
|
120
124
|
|
|
121
125
|
const header = $derived(layout.header);
|
|
122
126
|
// Expanded subtitle measure: the layout's own `subtitleWidth`
|
|
@@ -143,7 +147,7 @@
|
|
|
143
147
|
const headerStyle = $derived(
|
|
144
148
|
header === undefined
|
|
145
149
|
? undefined
|
|
146
|
-
: `top:${frameTop(y + ZONE_GEOMETRY.headerInset)};left:${frameInset(ZONE_GEOMETRY.headerInset)};right:${frameInset(ZONE_GEOMETRY.contentInsetInline)};height:${header.ruleY - ZONE_GEOMETRY.headerRuleGap - y - ZONE_GEOMETRY.headerInset}px`,
|
|
150
|
+
: `top:${frameTop(y + ZONE_GEOMETRY.headerInset)};left:${frameInset(ZONE_GEOMETRY.headerInset)};right:${frameInset(containerPadding ?? ZONE_GEOMETRY.contentInsetInline)};height:${header.ruleY - ZONE_GEOMETRY.headerRuleGap - y - ZONE_GEOMETRY.headerInset}px`,
|
|
147
151
|
);
|
|
148
152
|
const ruleStyle = $derived(
|
|
149
153
|
header === undefined
|
|
@@ -153,7 +157,7 @@
|
|
|
153
157
|
const contentStyle = $derived(
|
|
154
158
|
header === undefined
|
|
155
159
|
? undefined
|
|
156
|
-
: `top:${frameTop(header.contentTop)};left:${frameInset(ZONE_GEOMETRY.contentInsetInline)};right:${frameInset(ZONE_GEOMETRY.contentInsetInline)};bottom:${frameInset(ZONE_GEOMETRY.contentInsetBottom)}`,
|
|
160
|
+
: `top:${frameTop(header.contentTop)};left:${frameInset(containerPadding ?? ZONE_GEOMETRY.contentInsetInline)};right:${frameInset(containerPadding ?? ZONE_GEOMETRY.contentInsetInline)};bottom:${frameInset(containerPadding ?? ZONE_GEOMETRY.contentInsetBottom)}`,
|
|
157
161
|
);
|
|
158
162
|
const footerRuleStyle = $derived(
|
|
159
163
|
header?.footerRuleY === undefined
|
|
@@ -163,7 +167,7 @@
|
|
|
163
167
|
const footerStyle = $derived(
|
|
164
168
|
header === undefined
|
|
165
169
|
? undefined
|
|
166
|
-
: `left:${frameInset(ZONE_GEOMETRY.contentInsetInline)};right:${frameInset(ZONE_GEOMETRY.contentInsetInline)};bottom:var(--st-component-diagramZone-footerBottomInset, var(--st-component-diagramCard-footerBottomInset, 9.25px))`,
|
|
170
|
+
: `left:${frameInset(containerPadding ?? ZONE_GEOMETRY.contentInsetInline)};right:${frameInset(containerPadding ?? ZONE_GEOMETRY.contentInsetInline)};bottom:var(--st-component-diagramZone-footerBottomInset, var(--st-component-diagramCard-footerBottomInset, 9.25px))`,
|
|
167
171
|
);
|
|
168
172
|
|
|
169
173
|
$effect(() => {
|
|
@@ -171,24 +175,6 @@
|
|
|
171
175
|
for (const diagnostic of layout.diagnostics) onDiagnostic(diagnostic);
|
|
172
176
|
});
|
|
173
177
|
|
|
174
|
-
function remapDiagnostic(diagnostic: {
|
|
175
|
-
code: string;
|
|
176
|
-
slot: string;
|
|
177
|
-
entityId: string;
|
|
178
|
-
neededPx: number;
|
|
179
|
-
allocatedPx: number;
|
|
180
|
-
text?: string;
|
|
181
|
-
}): void {
|
|
182
|
-
if (onDiagnostic === undefined) return;
|
|
183
|
-
onDiagnostic({
|
|
184
|
-
code: diagnostic.code === "card-icon-unknown" ? "zone-icon-unknown" : "zone-overflow",
|
|
185
|
-
slot: diagnostic.slot,
|
|
186
|
-
entityId: diagnostic.entityId,
|
|
187
|
-
neededPx: diagnostic.neededPx,
|
|
188
|
-
allocatedPx: diagnostic.allocatedPx,
|
|
189
|
-
...(diagnostic.text === undefined ? {} : { text: diagnostic.text }),
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
178
|
</script>
|
|
193
179
|
|
|
194
180
|
<!-- One positioning wrapper in BOTH states (second review, blocking): the
|
|
@@ -200,23 +186,14 @@
|
|
|
200
186
|
style={`left:${x}px;top:${y}px`}
|
|
201
187
|
data-entity={entityId}
|
|
202
188
|
data-collapsed={collapsed ? "true" : "false"}
|
|
203
|
-
data-zone-refused={refused === undefined ? undefined : refused.slot}
|
|
204
189
|
data-zone-overflow={overflowSlot}
|
|
205
190
|
data-zone-icon-unknown={unknownIcon ? "" : undefined}
|
|
206
191
|
>
|
|
207
|
-
{#if
|
|
208
|
-
<div
|
|
209
|
-
class="st-diagramZone st-diagramZone--refused"
|
|
210
|
-
style={`width:${layout.box.width}px;height:${layout.box.height}px`}
|
|
211
|
-
role="group"
|
|
212
|
-
aria-label={title}
|
|
213
|
-
></div>
|
|
214
|
-
{:else if collapsed}
|
|
192
|
+
{#if collapsed}
|
|
215
193
|
<DiagramCard
|
|
216
194
|
{...cardProps}
|
|
217
195
|
measure={measure}
|
|
218
196
|
onSelect={onSelect === undefined ? undefined : (event) => onSelect(event)}
|
|
219
|
-
onDiagnostic={onDiagnostic === undefined ? undefined : remapDiagnostic}
|
|
220
197
|
/>
|
|
221
198
|
{:else}
|
|
222
199
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
@@ -228,9 +205,12 @@
|
|
|
228
205
|
data-tone={tone}
|
|
229
206
|
data-proposed={proposed === true ? "true" : undefined}
|
|
230
207
|
role="group"
|
|
208
|
+
title={zoneFullText({ entityId, kicker, title, subtitle, footer, collapsed })}
|
|
231
209
|
aria-label={title}
|
|
210
|
+
aria-describedby={descriptionId}
|
|
232
211
|
onclick={() => onSelect?.({ entityId })}
|
|
233
212
|
>
|
|
213
|
+
<span id={descriptionId} hidden>{zoneFullText({ entityId, kicker, title, subtitle, footer, collapsed })}</span>
|
|
234
214
|
{#if header !== undefined}
|
|
235
215
|
<!-- Every part below is absolutely positioned from the shared
|
|
236
216
|
layout's inline offsets (review pass 4): the CSS border is
|
|
@@ -240,8 +220,8 @@
|
|
|
240
220
|
kicker={header.kicker}
|
|
241
221
|
title={header.title}
|
|
242
222
|
subtitle={header.subtitle}
|
|
243
|
-
iconName={icon}
|
|
244
|
-
iconGlyph={
|
|
223
|
+
iconName={layout.icon.name}
|
|
224
|
+
iconGlyph={layout.icon.glyph}
|
|
245
225
|
headerTextWidth={header.headerTextWidth}
|
|
246
226
|
headerBlockHeight={header.headerBlockHeight}
|
|
247
227
|
subtitleWidth={subtitleWidth}
|
|
@@ -272,7 +252,7 @@
|
|
|
272
252
|
{/if}
|
|
273
253
|
<div class="st-diagramZone-footer" style={footerStyle}>
|
|
274
254
|
{#each header.footer as line, footerIndex (footerIndex)}
|
|
275
|
-
<span class="st-diagramZone-footerLine">{line.text}</span>
|
|
255
|
+
<span class="st-diagramZone-footerLine" style={`line-height:${lineBoxHeight(line.size)}px;height:${lineBoxHeight(line.size)}px`}>{line.text}</span>
|
|
276
256
|
{/each}
|
|
277
257
|
</div>
|
|
278
258
|
{/if}
|
|
@@ -300,7 +280,7 @@
|
|
|
300
280
|
background: var(--st-component-diagramZone-surface, var(--st-semantic-surface-raised));
|
|
301
281
|
color: var(--st-component-diagramZone-text, var(--st-semantic-text-primary));
|
|
302
282
|
text-align: left;
|
|
303
|
-
font-family: var(--st-component-diagramCard-fontFamily, var(--st-font-sans));
|
|
283
|
+
font-family: var(--st-component-diagramCard-fontFamily, var(--st-font-sans, Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif));
|
|
304
284
|
}
|
|
305
285
|
.st-diagramZone--center {
|
|
306
286
|
/* Owner variant: every text slot centred inside its allocation. */
|
|
@@ -311,12 +291,6 @@
|
|
|
311
291
|
.st-diagramZone--proposed {
|
|
312
292
|
border-style: dashed;
|
|
313
293
|
}
|
|
314
|
-
/* Refusal state (overflow = refusal): no normal frame, a dashed
|
|
315
|
-
placeholder the host can see via data-zone-refused on the wrapper. */
|
|
316
|
-
.st-diagramZone--refused {
|
|
317
|
-
border-style: dashed;
|
|
318
|
-
background: transparent;
|
|
319
|
-
}
|
|
320
294
|
.st-diagramZone-header {
|
|
321
295
|
/* top/left/right/height come from the shared layout inline; the CSS
|
|
322
296
|
border is already accounted exactly once in those calc offsets
|
|
@@ -14,10 +14,8 @@ import { type CardLineMeasure, type DiagramZoneProps as DiagramZoneData, type Zo
|
|
|
14
14
|
*
|
|
15
15
|
* Both states render inside the SAME positioning wrapper
|
|
16
16
|
* (`.st-diagramZone-pos`, absolute at `x`/`y`): folding never moves the
|
|
17
|
-
* zone occurrence.
|
|
18
|
-
*
|
|
19
|
-
* state `data-zone-refused="<slot>"`, matching the pure renderer's refused
|
|
20
|
-
* result.
|
|
17
|
+
* zone occurrence. Owner A11 keeps all content visible and grows the zone;
|
|
18
|
+
* explicit hard-cap overflow remains diagnostic.
|
|
21
19
|
*
|
|
22
20
|
* The component owns no view state: `collapsed` is a prop (§4.3) and
|
|
23
21
|
* activating the toggle emits the §7.2 intent through `onToggle`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiagramZone.svelte.d.ts","sourceRoot":"","sources":["../src/lib/DiagramZone.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DiagramZone.svelte.d.ts","sourceRoot":"","sources":["../src/lib/DiagramZone.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGtC,OAAO,EAMH,KAAK,eAAe,EACpB,KAAK,gBAAgB,IAAI,eAAe,EACxC,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAG/B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,iEAAiE;IACjE,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,gEAAgE;IAChE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IACrE,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACjD,sDAAsD;IACtD,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,KAAK,IAAI,CAAC;IACpD,sEAAsE;IACtE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA0LH,QAAA,MAAM,WAAW,sDAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { lineBoxHeight } from "./diagramCardModel.js";
|
|
2
3
|
import DiagramCardHeader from "./DiagramCardHeader.svelte";
|
|
3
4
|
import { ZONE_GEOMETRY, type DiagramGlyphPaths, type LaidOutLine } from "./diagramCardModel.js";
|
|
4
5
|
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
{#if subtitle.length > 0}
|
|
65
66
|
<div class="st-diagramZoneHeader-subtitle" style={`width:${subtitleWidth}px`}>
|
|
66
67
|
{#each subtitle as line, subtitleIndex (subtitleIndex)}
|
|
67
|
-
<span class="st-diagramZone-subtitle">{line.text}</span>
|
|
68
|
+
<span class="st-diagramZone-subtitle" style={`line-height:${lineBoxHeight(line.size)}px;height:${lineBoxHeight(line.size)}px`}>{line.text}</span>
|
|
68
69
|
{/each}
|
|
69
70
|
</div>
|
|
70
71
|
{/if}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiagramZoneHeader.svelte.d.ts","sourceRoot":"","sources":["../src/lib/DiagramZoneHeader.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DiagramZoneHeader.svelte.d.ts","sourceRoot":"","sources":["../src/lib/DiagramZoneHeader.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,EAAiB,KAAK,iBAAiB,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAG9F;;;;;;GAMG;AACH,UAAU,sBAAsB;IAC9B,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/B,KAAK,EAAE,SAAS,WAAW,EAAE,CAAC;IAC9B,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;8DAC0D;IAC1D,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;IACtE;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAsCH,QAAA,MAAM,iBAAiB,4DAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}
|
|
@@ -70,3 +70,7 @@ Redraw: **no** (verbatim geometry — already on the canonical base).
|
|
|
70
70
|
|
|
71
71
|
The kit `groupIcons` zone→glyph table is scene content of those diagrams,
|
|
72
72
|
not part of the shipped set: the DS names the glyph per entity (§9.2, DH-11).
|
|
73
|
+
|
|
74
|
+
## Component role default
|
|
75
|
+
|
|
76
|
+
`base` is an original MIT component pictogram on the canonical diamond: a rectangular face and two horizontal lines. It supplies the closed `card` role introduced by the owner addendum.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/lib/diagram-icons/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,YAAY;IAC3B,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,6CAA6C;IAC7C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,iEAAiE;AACjE,eAAO,MAAM,kBAAkB,6BAA6B,CAAC;AAE7D,mDAAmD;AACnD,eAAO,MAAM,qBAAqB,cAAc,CAAC;AAejD;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/lib/diagram-icons/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,YAAY;IAC3B,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,6CAA6C;IAC7C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,iEAAiE;AACjE,eAAO,MAAM,kBAAkB,6BAA6B,CAAC;AAE7D,mDAAmD;AACnD,eAAO,MAAM,qBAAqB,cAAc,CAAC;AAejD;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CA0FjE,CAAC;AAEF,+CAA+C;AAC/C,eAAO,MAAM,mBAAmB,UAA8B,CAAC;AAE/D;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAEtE"}
|
|
@@ -29,6 +29,7 @@ function glyph(face, line, extra) {
|
|
|
29
29
|
* collisions across the two sources — no aliasing was needed.
|
|
30
30
|
*/
|
|
31
31
|
export const DIAGRAM_GLYPHS = {
|
|
32
|
+
base: glyph("M10 12H54V48H10Z", "M18 22H46M18 32H40"),
|
|
32
33
|
// --- radar-immobilier fa8133c2 (19): interiors preserved verbatim, base
|
|
33
34
|
// replaced by the canonical diamond (§9.1, DIF-12) ---
|
|
34
35
|
s3: glyph("M12 18Q32 6 52 18L47 47Q32 58 17 47Z", "M12 18Q32 30 52 18M18 29Q32 38 46 29", {
|
|
@@ -75,5 +76,5 @@ export const DIAGRAM_GLYPH_NAMES = Object.keys(DIAGRAM_GLYPHS);
|
|
|
75
76
|
* silent substitution).
|
|
76
77
|
*/
|
|
77
78
|
export function getDiagramGlyph(name) {
|
|
78
|
-
return DIAGRAM_GLYPHS[name];
|
|
79
|
+
return Object.hasOwn(DIAGRAM_GLYPHS, name) ? DIAGRAM_GLYPHS[name] : undefined;
|
|
79
80
|
}
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* `../diagramCardModel.js` (shared projection + line layout).
|
|
9
9
|
*
|
|
10
10
|
* Exactly one rule element, drawn non-scaling (§5.4, DIF-07, DH-04); fixed
|
|
11
|
-
* 460 × 200 box; square corners; footer pinned at 9.25
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* 460 × 200 box; square corners; footer pinned at 9.25. Long slots use
|
|
12
|
+
* measured ellipses (owner A14); title/description retain the complete text
|
|
13
|
+
* and informational diagnostics report the hidden length.
|
|
14
14
|
*/
|
|
15
15
|
import { layoutCard, projectCardProps, type CardDiagnostic, type CardLayout, type CardLineMeasure, type CardPresentationInput, type DiagramCardProps, type DiagramGlyphPaths } from "../diagramCardModel.js";
|
|
16
16
|
export type { CardDiagnostic, CardLayout, CardLineMeasure, CardPresentationInput, DiagramCardProps, DiagramGlyphPaths, };
|
|
@@ -36,16 +36,7 @@ export declare function toggleGlyph(toggle: {
|
|
|
36
36
|
y: number;
|
|
37
37
|
size: number;
|
|
38
38
|
}): string;
|
|
39
|
-
/**
|
|
40
|
-
* The card render result. Overflow = refusal (owner criterion): when the
|
|
41
|
-
* layout raises `card-overflow` — a too-wide line, a line-count overflow, or
|
|
42
|
-
* a header+body height that does not fit above the pinned rule — the result
|
|
43
|
-
* is `{ kind: "refused" }` with NO `svg`: no normal card is emitted until the
|
|
44
|
-
* content fits. The diagnostics carry the original slot text so the host
|
|
45
|
-
* knows what to shorten. The Svelte `DiagramCard` renders the matching
|
|
46
|
-
* refusal state (`data-card-refused`) on the same predicate — one contract,
|
|
47
|
-
* both renderers.
|
|
48
|
-
*/
|
|
39
|
+
/** Content is always rendered (owner A11). The legacy refused variant remains for source compatibility. */
|
|
49
40
|
export type CardSvgResult = {
|
|
50
41
|
readonly kind: "rendered";
|
|
51
42
|
readonly svg: string;
|
|
@@ -59,8 +50,7 @@ export type CardSvgResult = {
|
|
|
59
50
|
/**
|
|
60
51
|
* Render one atomic card as a standalone SVG string. `measure` defaults to
|
|
61
52
|
* the deterministic greedy wrapper; production hosts pass their measured
|
|
62
|
-
* `LineMeasurer` adapter. Returns
|
|
63
|
-
* content overflows its frozen allocation.
|
|
53
|
+
* `LineMeasurer` adapter. Returns all content and any hard-cap diagnostics (owner A11).
|
|
64
54
|
*/
|
|
65
55
|
export declare function renderCardSvg(props: DiagramCardProps, measure?: CardLineMeasure): CardSvgResult;
|
|
66
56
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderCardSvg.d.ts","sourceRoot":"","sources":["../../src/lib/diagram-render/renderCardSvg.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAIL,UAAU,EACV,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACvB,MAAM,wBAAwB,CAAC;AAMhC,YAAY,EACV,cAAc,EACd,UAAU,EACV,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,GAClB,CAAC;AACF,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAY5B,uEAAuE;AACvE,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,iBAAiB,GAAG,SAAS,EACpC,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,IAAI,EAAE,MAAM,GACX,MAAM,CAgBR;AAgBD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,gBAAgB,EACvB,OAAO,GAAE,eAAoC,GAC5C;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;CAAE,CAiF9E;AAED,qEAAqE;AACrE,wBAAgB,WAAW,CACzB,MAAM,EAAE;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAC7C,GAAG,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,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,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,WAAW,EAAE,SAAS,cAAc,EAAE,CAAC;IAChD,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;CAC7B,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,SAAS,cAAc,EAAE,CAAC;IAChD,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;CAC7B,CAAC;AAEN;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,gBAAgB,EACvB,OAAO,GAAE,eAAoC,GAC5C,aAAa,CAoBf;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,qBAAqB,GAAG,SAAS,EAC/C,IAAI,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,eAAe,CAAA;CAAE,GACzF;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAQ7D"}
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
* `../diagramCardModel.js` (shared projection + line layout).
|
|
9
9
|
*
|
|
10
10
|
* Exactly one rule element, drawn non-scaling (§5.4, DIF-07, DH-04); fixed
|
|
11
|
-
* 460 × 200 box; square corners; footer pinned at 9.25
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* 460 × 200 box; square corners; footer pinned at 9.25. Long slots use
|
|
12
|
+
* measured ellipses (owner A14); title/description retain the complete text
|
|
13
|
+
* and informational diagnostics report the hidden length.
|
|
14
14
|
*/
|
|
15
|
-
import { CARD_GEOMETRY, defaultCardMeasure,
|
|
15
|
+
import { cardFullText, CARD_GEOMETRY, defaultCardMeasure, layoutCard, projectCardProps, } from "../diagramCardModel.js";
|
|
16
16
|
import { DIAGRAM_GLYPH_BASE, getDiagramGlyph, } from "../diagram-icons/registry.js";
|
|
17
17
|
export { projectCardProps };
|
|
18
18
|
function escapeXml(value) {
|
|
@@ -54,9 +54,9 @@ function textLines(lines, className, fill, extra) {
|
|
|
54
54
|
* the collapsed zone, §6.2: the zone IS the card).
|
|
55
55
|
*/
|
|
56
56
|
export function renderCardContent(props, measure = defaultCardMeasure) {
|
|
57
|
-
const g = CARD_GEOMETRY;
|
|
58
57
|
const layout = layoutCard(props, measure);
|
|
59
|
-
const
|
|
58
|
+
const g = { ...CARD_GEOMETRY, height: layout.box.height };
|
|
59
|
+
const parts = [`<title>${escapeXml(cardFullText(props))}</title><desc>${escapeXml(cardFullText(props))}</desc>`];
|
|
60
60
|
// Border, then the accent bar over the left stroke (border-left look).
|
|
61
61
|
// A proposed card is always drawn dashed, independently of the tint
|
|
62
62
|
// (owner criterion 5); the dash pattern is the kit's `4 5`.
|
|
@@ -104,23 +104,17 @@ export function toggleGlyph(toggle, box) {
|
|
|
104
104
|
/**
|
|
105
105
|
* Render one atomic card as a standalone SVG string. `measure` defaults to
|
|
106
106
|
* the deterministic greedy wrapper; production hosts pass their measured
|
|
107
|
-
* `LineMeasurer` adapter. Returns
|
|
108
|
-
* content overflows its frozen allocation.
|
|
107
|
+
* `LineMeasurer` adapter. Returns all content and any hard-cap diagnostics (owner A11).
|
|
109
108
|
*/
|
|
110
109
|
export function renderCardSvg(props, measure = defaultCardMeasure) {
|
|
111
|
-
const g = CARD_GEOMETRY;
|
|
112
110
|
const { content, layout } = renderCardContent(props, measure);
|
|
113
|
-
const
|
|
114
|
-
if (refused !== undefined) {
|
|
115
|
-
return { kind: "refused", diagnostics: layout.diagnostics, layout };
|
|
116
|
-
}
|
|
111
|
+
const g = { ...CARD_GEOMETRY, height: layout.box.height };
|
|
117
112
|
const overflowSlots = layout.diagnostics
|
|
118
113
|
.filter((diagnostic) => diagnostic.code === "card-overflow")
|
|
119
114
|
.map((diagnostic) => diagnostic.slot);
|
|
120
115
|
const unknownIcon = layout.diagnostics.some((diagnostic) => diagnostic.code === "card-icon-unknown");
|
|
121
116
|
const firstOverflow = overflowSlots.length === 0 ? undefined : overflowSlots[0];
|
|
122
|
-
const svg = `<svg xmlns="http://www.w3.org/2000/svg" class="st-diagramCard" data-entity="${escapeXml(props.entityId)}"${props.tone === undefined ? "" : ` data-tone="${escapeXml(props.tone)}"`}${props.proposed === true ? ' data-proposed="true"' : ""}${firstOverflow === undefined ? "" : ` data-card-overflow="${firstOverflow}"`}${unknownIcon ? ` data-card-icon-unknown=""` : ""} width="${g.width}" height="${g.height}" viewBox="0 0 ${g.width} ${g.height}" role="img" aria-label="${escapeXml(props.title)}" style="font-family:${FONT_STACK}">` +
|
|
123
|
-
`<title>${escapeXml(props.title)}</title>` +
|
|
117
|
+
const svg = `<svg xmlns="http://www.w3.org/2000/svg" class="st-diagramCard" data-entity="${escapeXml(props.entityId)}"${props.tone === undefined ? "" : ` data-tone="${escapeXml(props.tone)}"`}${props.proposed === true ? ' data-proposed="true"' : ""}${firstOverflow === undefined ? "" : ` data-card-overflow="${firstOverflow}"`}${unknownIcon ? ` data-card-icon-unknown=""` : ""} width="${g.width}" height="${g.height}" viewBox="0 0 ${g.width} ${g.height}" role="img" aria-label="${escapeXml(props.title)}" aria-description="${escapeXml(cardFullText(props))}" style="font-family:${FONT_STACK}">` +
|
|
124
118
|
content +
|
|
125
119
|
`</svg>`;
|
|
126
120
|
return {
|
|
@@ -31,14 +31,7 @@ export declare function zoneContent(props: DiagramZoneProps, children: readonly
|
|
|
31
31
|
layout: ZoneLayout;
|
|
32
32
|
diagnostics: readonly ZoneDiagnostic[];
|
|
33
33
|
};
|
|
34
|
-
/**
|
|
35
|
-
* The zone render result. Overflow = refusal (owner criterion): when the
|
|
36
|
-
* zone's own layout or any descendant card/zone overflows, the result is
|
|
37
|
-
* `{ kind: "refused" }` with NO `svg` — the aggregated diagnostics carry each
|
|
38
|
-
* offender's `entityId` and original slot text. The Svelte `DiagramZone`
|
|
39
|
-
* renders the matching refusal state (`data-zone-refused`) on the same
|
|
40
|
-
* predicate — one contract, both renderers.
|
|
41
|
-
*/
|
|
34
|
+
/** Content is always rendered (owner A11). The legacy refused variant remains for source compatibility. */
|
|
42
35
|
export type ZoneSvgResult = {
|
|
43
36
|
readonly kind: "rendered";
|
|
44
37
|
readonly svg: string;
|
|
@@ -53,9 +46,7 @@ export type ZoneSvgResult = {
|
|
|
53
46
|
* Render one zone as a standalone SVG string. Collapsed: the atomic card
|
|
54
47
|
* at the zone occurrence (460 × 200, plus the "+" toggle slot). Expanded:
|
|
55
48
|
* the frame with header, rule and children. `measure` defaults to the
|
|
56
|
-
* deterministic greedy wrapper. Returns
|
|
57
|
-
* the zone or any descendant overflows; descendant diagnostics are
|
|
58
|
-
* aggregated with their entity ids.
|
|
49
|
+
* deterministic greedy wrapper. Returns all content and any hard-cap diagnostics (owner A11).
|
|
59
50
|
*/
|
|
60
51
|
export declare function renderZoneSvg(props: DiagramZoneProps, opts?: {
|
|
61
52
|
children?: readonly ZoneChildSpec[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderZoneSvg.d.ts","sourceRoot":"","sources":["../../src/lib/diagram-render/renderZoneSvg.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"renderZoneSvg.d.ts","sourceRoot":"","sources":["../../src/lib/diagram-render/renderZoneSvg.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAEL,aAAa,EAIb,gBAAgB,EAEhB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC3B,MAAM,wBAAw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,CAAC;IAC1B,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IACpC,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B,GACA;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAoB7D;AAID,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* function/detail re-roling (DH-08), no tint injection — the toggle is the
|
|
16
16
|
* same slot glyph as the card's and the subtitle is one body string.
|
|
17
17
|
*/
|
|
18
|
-
import { CARD_GEOMETRY, ZONE_GEOMETRY, defaultCardMeasure,
|
|
18
|
+
import { zoneFullText, CARD_GEOMETRY, ZONE_GEOMETRY, defaultCardMeasure, layoutZone, projectZoneProps, zoneCollapsedCardProps, } from "../diagramCardModel.js";
|
|
19
19
|
import { getDiagramGlyph } from "../diagram-icons/registry.js";
|
|
20
20
|
import { iconGroupFor, renderCardContent, toggleGlyph } from "./renderCardSvg.js";
|
|
21
21
|
export { projectZoneProps };
|
|
@@ -47,6 +47,7 @@ function childContent(child, measure) {
|
|
|
47
47
|
neededPx: diagnostic.neededPx,
|
|
48
48
|
allocatedPx: diagnostic.allocatedPx,
|
|
49
49
|
...(diagnostic.text === undefined ? {} : { text: diagnostic.text }),
|
|
50
|
+
...(diagnostic.hiddenLength === undefined ? {} : { hiddenLength: diagnostic.hiddenLength, severity: "info", reason: "truncated" }),
|
|
50
51
|
}));
|
|
51
52
|
return { content, diagnostics };
|
|
52
53
|
}
|
|
@@ -68,7 +69,7 @@ export function zoneContent(props, children, measure) {
|
|
|
68
69
|
const layout = layoutZone(props, measure, children);
|
|
69
70
|
const x = layout.box.x;
|
|
70
71
|
const y = layout.box.y;
|
|
71
|
-
const parts = [];
|
|
72
|
+
const parts = [`<title>${escapeXml(zoneFullText(props))}</title><desc>${escapeXml(zoneFullText(props))}</desc>`];
|
|
72
73
|
const descendantDiagnostics = [];
|
|
73
74
|
if (layout.collapsed) {
|
|
74
75
|
const cardProps = zoneCollapsedCardProps(props);
|
|
@@ -126,25 +127,19 @@ export function zoneContent(props, children, measure) {
|
|
|
126
127
|
* Render one zone as a standalone SVG string. Collapsed: the atomic card
|
|
127
128
|
* at the zone occurrence (460 × 200, plus the "+" toggle slot). Expanded:
|
|
128
129
|
* the frame with header, rule and children. `measure` defaults to the
|
|
129
|
-
* deterministic greedy wrapper. Returns
|
|
130
|
-
* the zone or any descendant overflows; descendant diagnostics are
|
|
131
|
-
* aggregated with their entity ids.
|
|
130
|
+
* deterministic greedy wrapper. Returns all content and any hard-cap diagnostics (owner A11).
|
|
132
131
|
*/
|
|
133
132
|
export function renderZoneSvg(props, opts = {}) {
|
|
134
133
|
const measure = opts.measure ?? defaultCardMeasure;
|
|
135
134
|
const children = opts.children ?? [];
|
|
136
135
|
const { content, layout, diagnostics } = zoneContent(props, children, measure);
|
|
137
|
-
if (firstOverflowDiagnostic(diagnostics) !== undefined) {
|
|
138
|
-
return { kind: "refused", diagnostics, layout };
|
|
139
|
-
}
|
|
140
136
|
const { x, y, width, height } = layout.box;
|
|
141
137
|
const overflowSlots = diagnostics
|
|
142
138
|
.filter((diagnostic) => diagnostic.code === "zone-overflow")
|
|
143
139
|
.map((diagnostic) => diagnostic.slot);
|
|
144
140
|
const unknownIcon = diagnostics.some((diagnostic) => diagnostic.code === "zone-icon-unknown");
|
|
145
141
|
const firstOverflow = overflowSlots.length === 0 ? undefined : overflowSlots[0];
|
|
146
|
-
const svg = `<svg xmlns="http://www.w3.org/2000/svg" class="st-diagramZoneSvg" width="${x + width}" height="${y + height}" viewBox="0 0 ${x + width} ${y + height}" role="img" aria-label="${escapeXml(props.title)}" style="font-family:${FONT_STACK}">` +
|
|
147
|
-
`<title>${escapeXml(props.title)}</title>` +
|
|
142
|
+
const svg = `<svg xmlns="http://www.w3.org/2000/svg" class="st-diagramZoneSvg" width="${x + width}" height="${y + height}" viewBox="0 0 ${x + width} ${y + height}" role="img" aria-label="${escapeXml(props.title)}" aria-description="${escapeXml(zoneFullText(props))}" style="font-family:${FONT_STACK}">` +
|
|
148
143
|
`<g class="st-diagramZone${layout.collapsed ? " st-diagramZone--collapsed" : " st-diagramZone--expanded"}" data-entity="${escapeXml(props.entityId)}" data-collapsed="${layout.collapsed ? "true" : "false"}"${props.tone === undefined ? "" : ` data-tone="${escapeXml(props.tone)}"`}${props.proposed === true ? ' data-proposed="true"' : ""}${firstOverflow === undefined ? "" : ` data-zone-overflow="${firstOverflow}"`}${unknownIcon ? ` data-zone-icon-unknown=""` : ""} transform="translate(${x} ${y})">` +
|
|
149
144
|
content +
|
|
150
145
|
`</g>` +
|