@sentropic/design-system-svelte 0.41.4 → 0.42.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.
- package/dist/DiagramCard.svelte +33 -13
- package/dist/DiagramCard.svelte.d.ts.map +1 -1
- package/dist/DiagramCardHeader.svelte +5 -2
- package/dist/DiagramCardHeader.svelte.d.ts +2 -0
- package/dist/DiagramCardHeader.svelte.d.ts.map +1 -1
- package/dist/DiagramSceneFigure.svelte +11 -13
- package/dist/DiagramSceneFigure.svelte.d.ts +4 -0
- package/dist/DiagramSceneFigure.svelte.d.ts.map +1 -1
- package/dist/DiagramZone.svelte +37 -11
- package/dist/DiagramZone.svelte.d.ts.map +1 -1
- package/dist/DiagramZoneHeader.svelte +9 -2
- package/dist/DiagramZoneHeader.svelte.d.ts +4 -0
- package/dist/DiagramZoneHeader.svelte.d.ts.map +1 -1
- package/dist/diagram-render/renderCardSvg.d.ts.map +1 -1
- package/dist/diagram-render/renderCardSvg.js +9 -4
- package/dist/diagram-render/renderZoneSvg.d.ts.map +1 -1
- package/dist/diagram-render/renderZoneSvg.js +8 -3
- package/package.json +4 -4
package/dist/DiagramCard.svelte
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { lineBoxHeight } from "./diagramCardModel.js";
|
|
2
|
+
import { anatomyCardGeometry, lineBoxHeight } from "./diagramCardModel.js";
|
|
3
3
|
const descriptionId = $props.id();
|
|
4
4
|
import DiagramCardHeader from "./DiagramCardHeader.svelte";
|
|
5
5
|
import { cardFullText, defaultCardMeasure, layoutCard } from "./diagramCardModel.js";
|
|
@@ -59,6 +59,8 @@
|
|
|
59
59
|
toggle,
|
|
60
60
|
align,
|
|
61
61
|
bodyMode,
|
|
62
|
+
anatomy,
|
|
63
|
+
surface,
|
|
62
64
|
measure = defaultCardMeasure,
|
|
63
65
|
onSelect,
|
|
64
66
|
onDiagnostic,
|
|
@@ -82,11 +84,26 @@
|
|
|
82
84
|
...(toggle === undefined ? {} : { toggle }),
|
|
83
85
|
...(align === undefined ? {} : { align }),
|
|
84
86
|
...(bodyMode === undefined ? {} : { bodyMode }),
|
|
87
|
+
...(anatomy === undefined ? {} : { anatomy }),
|
|
85
88
|
},
|
|
86
89
|
measure,
|
|
87
90
|
),
|
|
88
91
|
);
|
|
89
92
|
|
|
93
|
+
const effectiveAnatomy = $derived(layout.anatomyFallback ?? anatomy);
|
|
94
|
+
const effectiveAlign = $derived(align ?? (anatomy === "v2" ? "center" : "left"));
|
|
95
|
+
const cardGeometry = $derived(anatomyCardGeometry(effectiveAnatomy));
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Owner addendum 1: a folded zone keeps its depth background. Only
|
|
99
|
+
* zone-collapsed cards carry `surface`, so leaf cards never change.
|
|
100
|
+
*/
|
|
101
|
+
const surfaceStyle = $derived(
|
|
102
|
+
surface === undefined
|
|
103
|
+
? ""
|
|
104
|
+
: `;--st-component-diagramCard-surface:var(--st-component-diagramZone-${surface}, var(--st-semantic-surface-${surface === "surface1" ? "raised" : "subtle"}))`,
|
|
105
|
+
);
|
|
106
|
+
|
|
90
107
|
const overflowSlot = $derived(
|
|
91
108
|
layout.diagnostics.find((diagnostic) => diagnostic.code === "card-overflow")?.slot,
|
|
92
109
|
);
|
|
@@ -108,11 +125,13 @@
|
|
|
108
125
|
<!-- Click selects (the §4.6 select intent), like BarChart's point select:
|
|
109
126
|
keyboard activation of a card is the host figure's concern (DC-2). -->
|
|
110
127
|
<div
|
|
111
|
-
class="st-diagramCard{bodyMode === "subtitle" ? " st-diagramCard--subtitle" : ""}{
|
|
128
|
+
class="st-diagramCard{bodyMode === "subtitle" ? " st-diagramCard--subtitle" : ""}{effectiveAlign === "center" ? " st-diagramCard--center" : ""}{proposed === true ? " st-diagramCard--proposed" : ""}{effectiveAnatomy === "v2" ? " st-diagramCard--v2" : ""}"
|
|
112
129
|
data-entity={entityId}
|
|
113
130
|
data-tone={tone}
|
|
114
131
|
data-proposed={proposed === true ? "true" : undefined}
|
|
115
|
-
style={
|
|
132
|
+
style={effectiveAnatomy === "v2"
|
|
133
|
+
? `height:${layout.box.height}px;--st-component-diagramCard-width:var(--st-component-diagramCardCompact-width, 352px);--st-component-diagramCard-padding:var(--st-component-diagramCardCompact-padding, 6px);--st-component-diagramCard-accentWidth:var(--st-component-diagramCardCompact-accentWidth, 6px);--st-component-diagramCard-iconSize:var(--st-component-diagramCardCompact-iconSize, 52px);--st-component-diagramCard-iconTextGap:var(--st-component-diagramCardCompact-iconTextGap, 4px)${surfaceStyle}`
|
|
134
|
+
: `height:${layout.box.height}px${surfaceStyle}`}
|
|
116
135
|
data-card-overflow={overflowSlot}
|
|
117
136
|
data-card-icon-unknown={unknownIcon ? "" : undefined}
|
|
118
137
|
role="group"
|
|
@@ -127,6 +146,7 @@
|
|
|
127
146
|
title={layout.title}
|
|
128
147
|
iconName={layout.icon.name}
|
|
129
148
|
iconGlyph={layout.icon.glyph}
|
|
149
|
+
iconSize={layout.iconBox?.size}
|
|
130
150
|
headerTextWidth={layout.headerTextWidth}
|
|
131
151
|
headerBlockHeight={layout.headerBlockHeight}
|
|
132
152
|
toggle={toggle}
|
|
@@ -134,7 +154,7 @@
|
|
|
134
154
|
<div class="st-diagramCard-gap" aria-hidden="true"></div>
|
|
135
155
|
<div
|
|
136
156
|
class="st-diagramCard-body"
|
|
137
|
-
style={`margin-left:${layout.bodyX -
|
|
157
|
+
style={`margin-left:${layout.bodyX - cardGeometry.headerInset}px;width:${layout.bodyWidth}px`}
|
|
138
158
|
>
|
|
139
159
|
{#each layout.body as line, bodyIndex (bodyIndex)}
|
|
140
160
|
<span class={line.secondary ? "st-diagramCard-detail" : "st-diagramCard-line"} style={`line-height:${lineBoxHeight(line.size)}px;height:${lineBoxHeight(line.size)}px`}>{line.text}</span>
|
|
@@ -197,21 +217,21 @@
|
|
|
197
217
|
is exactly layout.bodyWidth wide at layout.bodyX — −2 px / 436 px for
|
|
198
218
|
leaf bodies (bodyInsetFromBar 14 vs headerInset 16), 16 px / 396 px
|
|
199
219
|
for the centred collapsed-subtitle measure (§6.2.1: the subtitle is
|
|
200
|
-
centred at 32 + 396/2 = 230, not over the wider content box).
|
|
220
|
+
centred at 32 + 396/2 = 230, not over the wider content box).
|
|
221
|
+
Owner card-body-centring: the body block is centred horizontally
|
|
222
|
+
and vertically inside the remaining body box on every card — the
|
|
223
|
+
block grows into the spare space (flex: 1) and its lines centre
|
|
224
|
+
within it, mirroring the layoutCard bodyBlockTop/bodyLineX
|
|
225
|
+
geometry the SVG renderer paints. */
|
|
201
226
|
min-width: 0;
|
|
202
|
-
flex: 0 0 auto;
|
|
203
|
-
font-size: var(--st-component-diagramCard-bodyFontSize, 24px);
|
|
204
|
-
font-weight: var(--st-component-diagramCard-bodyFontWeight, 400);
|
|
205
|
-
line-height: var(--st-component-diagramCard-bodyLineHeight, 1.3);
|
|
206
|
-
}
|
|
207
|
-
.st-diagramCard--subtitle .st-diagramCard-body {
|
|
208
|
-
/* §6.2.1: the collapsed-zone subtitle block is centred horizontally
|
|
209
|
-
and vertically inside the card body area. */
|
|
210
227
|
flex: 1 1 auto;
|
|
211
228
|
display: flex;
|
|
212
229
|
flex-direction: column;
|
|
213
230
|
justify-content: center;
|
|
214
231
|
text-align: center;
|
|
232
|
+
font-size: var(--st-component-diagramCard-bodyFontSize, 24px);
|
|
233
|
+
font-weight: var(--st-component-diagramCard-bodyFontWeight, 400);
|
|
234
|
+
line-height: var(--st-component-diagramCard-bodyLineHeight, 1.3);
|
|
215
235
|
}
|
|
216
236
|
.st-diagramCard-line,
|
|
217
237
|
.st-diagramCard-detail {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiagramCard.svelte.d.ts","sourceRoot":"","sources":["../src/lib/DiagramCard.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACR,cAAc,EACd,eAAe,EACf,gBAAgB,IAAI,eAAe,EACpC,MAAM,uBAAuB,CAAC;AAG/B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD;;;;OAIG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACjD,iDAAiD;IACjD,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,KAAK,IAAI,CAAC;CACrD;
|
|
1
|
+
{"version":3,"file":"DiagramCard.svelte.d.ts","sourceRoot":"","sources":["../src/lib/DiagramCard.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACR,cAAc,EACd,eAAe,EACf,gBAAgB,IAAI,eAAe,EACpC,MAAM,uBAAuB,CAAC;AAG/B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD;;;;OAIG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACjD,iDAAiD;IACjD,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,KAAK,IAAI,CAAC;CACrD;AAuHH,QAAA,MAAM,WAAW,sDAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
title: readonly LaidOutLine[];
|
|
17
17
|
iconName?: string;
|
|
18
18
|
iconGlyph?: DiagramGlyphPaths;
|
|
19
|
+
/** Pictogram box edge; defaults to the v1 `70` (v2: `52`). */
|
|
20
|
+
iconSize?: number;
|
|
19
21
|
/** Width the title/kicker block may take (toggle-aware). */
|
|
20
22
|
headerTextWidth: number;
|
|
21
23
|
/**
|
|
@@ -39,6 +41,7 @@
|
|
|
39
41
|
title,
|
|
40
42
|
iconName,
|
|
41
43
|
iconGlyph = iconName === undefined || iconName === "none" ? undefined : getDiagramGlyph(iconName) ?? getDiagramGlyph("unknown"),
|
|
44
|
+
iconSize = 70,
|
|
42
45
|
headerTextWidth,
|
|
43
46
|
headerBlockHeight,
|
|
44
47
|
toggle,
|
|
@@ -52,8 +55,8 @@
|
|
|
52
55
|
class="st-diagramCardHeader-icon"
|
|
53
56
|
data-diagram-icon={iconName}
|
|
54
57
|
viewBox="0 0 64 64"
|
|
55
|
-
width=
|
|
56
|
-
height=
|
|
58
|
+
width={iconSize}
|
|
59
|
+
height={iconSize}
|
|
57
60
|
aria-hidden="true"
|
|
58
61
|
focusable="false"
|
|
59
62
|
>
|
|
@@ -10,6 +10,8 @@ interface DiagramCardHeaderProps {
|
|
|
10
10
|
title: readonly LaidOutLine[];
|
|
11
11
|
iconName?: string;
|
|
12
12
|
iconGlyph?: DiagramGlyphPaths;
|
|
13
|
+
/** Pictogram box edge; defaults to the v1 `70` (v2: `52`). */
|
|
14
|
+
iconSize?: number;
|
|
13
15
|
/** Width the title/kicker block may take (toggle-aware). */
|
|
14
16
|
headerTextWidth: number;
|
|
15
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiagramCardHeader.svelte.d.ts","sourceRoot":"","sources":["../src/lib/DiagramCardHeader.svelte.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAG1E;;;;;GAKG;AACH,UAAU,sBAAsB;IAC9B,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/B,KAAK,EAAE,SAAS,WAAW,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,4DAA4D;IAC5D,eAAe,EAAE,MAAM,CAAC;IACxB;;;;;;OAMG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;IACtE;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;
|
|
1
|
+
{"version":3,"file":"DiagramCardHeader.svelte.d.ts","sourceRoot":"","sources":["../src/lib/DiagramCardHeader.svelte.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAG1E;;;;;GAKG;AACH,UAAU,sBAAsB;IAC9B,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/B,KAAK,EAAE,SAAS,WAAW,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,eAAe,EAAE,MAAM,CAAC;IACxB;;;;;;OAMG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;IACtE;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AA8DH,QAAA,MAAM,iBAAiB,4DAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
import { measureRenderedSceneFont } from "./diagramFontMeasure.js";
|
|
25
25
|
import Select from "./Select.svelte";
|
|
26
26
|
import { DEFAULT_FLOW_TOKENS, type FlowTokens } from "@sentropic/diagram-canvas";
|
|
27
|
-
import { INITIAL_FLOW_STATE,
|
|
27
|
+
import { INITIAL_FLOW_STATE, visibleOf, effectiveTarget, highlightOf, flowStateOf, reduce, describeTarget, announce, flowHitSize, stepChange, stepsOf, type FlowState, type FlowAction, type Visible, type StepChange, type EffectiveTarget, type FlowStrings } from "@sentropic/diagram-canvas/flowModel";
|
|
28
28
|
import {
|
|
29
29
|
cardLineMeasurer,
|
|
30
30
|
sceneCardMeasure,
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
} from "./diagramCardModel.js";
|
|
37
37
|
import {
|
|
38
38
|
collapsedOccurrencesOf,
|
|
39
|
+
DEFAULT_SCENE_LABELS,
|
|
39
40
|
sceneContentSize,
|
|
40
41
|
type DiagramSceneSize,
|
|
41
42
|
type SceneLayoutCache,
|
|
@@ -121,6 +122,8 @@
|
|
|
121
122
|
viewport: string;
|
|
122
123
|
expand: (title: string) => string;
|
|
123
124
|
collapse: (title: string) => string;
|
|
125
|
+
/** Localized fallback label for containment relations without an explicit edge label (DE-1b). */
|
|
126
|
+
contains: string;
|
|
124
127
|
}
|
|
125
128
|
|
|
126
129
|
export interface DiagramSceneCamera {
|
|
@@ -171,6 +174,8 @@
|
|
|
171
174
|
labels?: Partial<DiagramSceneFigureLabels>;
|
|
172
175
|
iconBindings?: import("@sentropic/diagram-canvas/diagramSceneModel").SceneIconBindings;
|
|
173
176
|
strictIcons?: boolean;
|
|
177
|
+
/** Selectable start parity for alternating zone depth surfaces (`0` default, `1` flipped). */
|
|
178
|
+
depthParityStart?: 0 | 1;
|
|
174
179
|
resolveGlyph?: (name: string) => DiagramGlyphPaths | undefined;
|
|
175
180
|
onFoldChange?: (
|
|
176
181
|
collapsed: readonly SceneOccurrenceRef[],
|
|
@@ -185,17 +190,7 @@
|
|
|
185
190
|
onSizeChange?: (size: DiagramSceneSize) => void;
|
|
186
191
|
}
|
|
187
192
|
|
|
188
|
-
const DEFAULT_LABELS: DiagramSceneFigureLabels =
|
|
189
|
-
...DEFAULT_FLOW_STRINGS,
|
|
190
|
-
controls: "Zoom",
|
|
191
|
-
zoomIn: "Zoom in",
|
|
192
|
-
zoomOut: "Zoom out",
|
|
193
|
-
fit: "Fit",
|
|
194
|
-
zoomLevel: (percent) => `Zoom ${percent} %`,
|
|
195
|
-
viewport: "Diagram",
|
|
196
|
-
expand: (title) => `Expand ${title}`,
|
|
197
|
-
collapse: (title) => `Collapse ${title}`,
|
|
198
|
-
};
|
|
193
|
+
const DEFAULT_LABELS: DiagramSceneFigureLabels = DEFAULT_SCENE_LABELS;
|
|
199
194
|
|
|
200
195
|
const TOKEN_MAX_DISPLAY_SCALE = "--st-component-diagramScene-maxDisplayScale";
|
|
201
196
|
const TOKEN_MIN_READABLE_SCALE = "--st-component-diagramScene-minReadableScale";
|
|
@@ -224,6 +219,7 @@
|
|
|
224
219
|
resolveGlyph = getDiagramGlyph,
|
|
225
220
|
iconBindings,
|
|
226
221
|
strictIcons = true,
|
|
222
|
+
depthParityStart,
|
|
227
223
|
onFoldChange,
|
|
228
224
|
onSelect,
|
|
229
225
|
onLayout,
|
|
@@ -285,6 +281,7 @@
|
|
|
285
281
|
presentation,
|
|
286
282
|
...(iconBindings === undefined ? {} : { iconBindings }),
|
|
287
283
|
strictIcons,
|
|
284
|
+
...(depthParityStart === undefined ? {} : { depthParityStart }),
|
|
288
285
|
resolveGlyph: resolveGlyph as typeof getDiagramGlyph,
|
|
289
286
|
measureLines: lineMeasurer,
|
|
290
287
|
collapsed: collapsedNow,
|
|
@@ -308,6 +305,7 @@
|
|
|
308
305
|
presentation,
|
|
309
306
|
...(iconBindings === undefined ? {} : { iconBindings }),
|
|
310
307
|
strictIcons,
|
|
308
|
+
...(depthParityStart === undefined ? {} : { depthParityStart }),
|
|
311
309
|
resolveGlyph,
|
|
312
310
|
measureLines: lineMeasurer,
|
|
313
311
|
flows: flowOptions,
|
|
@@ -1094,7 +1092,7 @@
|
|
|
1094
1092
|
</div>
|
|
1095
1093
|
</div>
|
|
1096
1094
|
</div>
|
|
1097
|
-
{#if scene}<div class="st-diagramSceneFigure-fallback">{#each sceneTextRows(scene, semanticDocument) as row}<p>{row}</p>{/each}</div>{/if}
|
|
1095
|
+
{#if scene}<div class="st-diagramSceneFigure-fallback">{#each sceneTextRows(scene, semanticDocument, strings) as row}<p>{row}</p>{/each}</div>{/if}
|
|
1098
1096
|
{#if erdTable}<div class="st-diagramErd-fallback">{@html erdTable}</div>{/if}
|
|
1099
1097
|
</figure>
|
|
1100
1098
|
|
|
@@ -57,6 +57,8 @@ export interface DiagramSceneFigureLabels {
|
|
|
57
57
|
viewport: string;
|
|
58
58
|
expand: (title: string) => string;
|
|
59
59
|
collapse: (title: string) => string;
|
|
60
|
+
/** Localized fallback label for containment relations without an explicit edge label (DE-1b). */
|
|
61
|
+
contains: string;
|
|
60
62
|
}
|
|
61
63
|
export interface DiagramSceneCamera {
|
|
62
64
|
readonly zoom: number;
|
|
@@ -107,6 +109,8 @@ export interface DiagramSceneFigureProps {
|
|
|
107
109
|
labels?: Partial<DiagramSceneFigureLabels>;
|
|
108
110
|
iconBindings?: import("@sentropic/diagram-canvas/diagramSceneModel").SceneIconBindings;
|
|
109
111
|
strictIcons?: boolean;
|
|
112
|
+
/** Selectable start parity for alternating zone depth surfaces (`0` default, `1` flipped). */
|
|
113
|
+
depthParityStart?: 0 | 1;
|
|
110
114
|
resolveGlyph?: (name: string) => DiagramGlyphPaths | undefined;
|
|
111
115
|
onFoldChange?: (collapsed: readonly SceneOccurrenceRef[], change: {
|
|
112
116
|
occurrence: SceneOccurrenceRef;
|
|
@@ -1 +1 @@
|
|
|
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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C,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;AA82BH,QAAA,MAAM,kBAAkB;oBArYE,MAAM,KAAG,IAAI;kBAuBjB,IAAI;mBAIH,IAAI;sBAKD,IAAI;qBAkBL,kBAAkB;iBAmVqB,CAAC;AACjE,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,eAAe,kBAAkB,CAAC"}
|
package/dist/DiagramZone.svelte
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import DiagramCard from "./DiagramCard.svelte";
|
|
6
6
|
import DiagramZoneHeader from "./DiagramZoneHeader.svelte";
|
|
7
7
|
import {
|
|
8
|
-
|
|
8
|
+
anatomyZoneGeometry,
|
|
9
9
|
defaultCardMeasure,
|
|
10
10
|
zoneFullText,
|
|
11
11
|
layoutZone,
|
|
@@ -63,6 +63,9 @@
|
|
|
63
63
|
collapsed,
|
|
64
64
|
toggleLabel,
|
|
65
65
|
align,
|
|
66
|
+
anatomy,
|
|
67
|
+
depth,
|
|
68
|
+
depthParityStart,
|
|
66
69
|
x = 0,
|
|
67
70
|
y = 0,
|
|
68
71
|
width,
|
|
@@ -89,6 +92,9 @@
|
|
|
89
92
|
collapsed,
|
|
90
93
|
...(toggleLabel === undefined ? {} : { toggleLabel }),
|
|
91
94
|
...(align === undefined ? {} : { align }),
|
|
95
|
+
...(anatomy === undefined ? {} : { anatomy }),
|
|
96
|
+
...(depth === undefined ? {} : { depth }),
|
|
97
|
+
...(depthParityStart === undefined ? {} : { depthParityStart }),
|
|
92
98
|
x,
|
|
93
99
|
y,
|
|
94
100
|
...(width === undefined ? {} : { width }),
|
|
@@ -98,6 +104,20 @@
|
|
|
98
104
|
// Children geometry is host layout data (§6.1): the Svelte zone paints
|
|
99
105
|
// around the supplied box, so the layout pass sees no child specs.
|
|
100
106
|
const layout = $derived(layoutZone(zoneProps, measure, []));
|
|
107
|
+
/** Expanded chrome geometry for the pinned anatomy (v1 values by default). */
|
|
108
|
+
const zoneGeometry = $derived(anatomyZoneGeometry(anatomy));
|
|
109
|
+
const effectiveAlign = $derived(align ?? (anatomy === "v2" ? "center" : "left"));
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Owner addendum 1: an explicitly threaded depth paints the resolved
|
|
113
|
+
* depth surface; without depth the frame keeps its resting surface,
|
|
114
|
+
* byte-identical.
|
|
115
|
+
*/
|
|
116
|
+
const surfaceStyle = $derived(
|
|
117
|
+
zoneProps.depth === undefined && zoneProps.depthParityStart === undefined
|
|
118
|
+
? ""
|
|
119
|
+
: `;--st-component-diagramZone-surface:var(--st-component-diagramZone-${layout.surface ?? "surface1"}, var(--st-semantic-surface-${(layout.surface ?? "surface1") === "surface1" ? "raised" : "subtle"}))`,
|
|
120
|
+
);
|
|
101
121
|
|
|
102
122
|
const cardProps = $derived(
|
|
103
123
|
toggleLabel === undefined
|
|
@@ -142,32 +162,34 @@
|
|
|
142
162
|
const borderToken = "var(--st-component-diagramZone-borderWidth, 1.5px)";
|
|
143
163
|
const frameTop = (frameY: number): string => `calc(${frameY - y}px - ${borderToken})`;
|
|
144
164
|
const frameInset = (inset: number): string => `calc(${inset}px - ${borderToken})`;
|
|
145
|
-
// Header band: frame top + headerInset, spanning the header
|
|
146
|
-
//
|
|
165
|
+
// Header band: frame top + headerInset, spanning the header inline insets
|
|
166
|
+
// (left and right both anchored to headerInset, matching layoutZone and the
|
|
167
|
+
// toggle inset even when containerPadding differs on v2), as tall as the
|
|
168
|
+
// layout's header block + subtitle.
|
|
147
169
|
const headerStyle = $derived(
|
|
148
170
|
header === undefined
|
|
149
171
|
? undefined
|
|
150
|
-
: `top:${frameTop(y +
|
|
172
|
+
: `top:${frameTop(y + zoneGeometry.headerInset)};left:${frameInset(zoneGeometry.headerInset)};right:${frameInset(zoneGeometry.headerInset)};height:${header.ruleY - zoneGeometry.headerRuleGap - y - zoneGeometry.headerInset}px`,
|
|
151
173
|
);
|
|
152
174
|
const ruleStyle = $derived(
|
|
153
175
|
header === undefined
|
|
154
176
|
? undefined
|
|
155
|
-
: `top:${frameTop(header.ruleY)};left:${frameInset(
|
|
177
|
+
: `top:${frameTop(header.ruleY)};left:${frameInset(zoneGeometry.ruleInsetStart)};right:${frameInset(zoneGeometry.ruleInsetEnd)}`,
|
|
156
178
|
);
|
|
157
179
|
const contentStyle = $derived(
|
|
158
180
|
header === undefined
|
|
159
181
|
? undefined
|
|
160
|
-
: `top:${frameTop(header.contentTop)};left:${frameInset(containerPadding ??
|
|
182
|
+
: `top:${frameTop(header.contentTop)};left:${frameInset(containerPadding ?? zoneGeometry.contentInsetInline)};right:${frameInset(containerPadding ?? zoneGeometry.contentInsetInline)};bottom:${frameInset(containerPadding ?? zoneGeometry.contentInsetBottom)}`,
|
|
161
183
|
);
|
|
162
184
|
const footerRuleStyle = $derived(
|
|
163
185
|
header?.footerRuleY === undefined
|
|
164
186
|
? undefined
|
|
165
|
-
: `top:${frameTop(header.footerRuleY)};left:${frameInset(
|
|
187
|
+
: `top:${frameTop(header.footerRuleY)};left:${frameInset(zoneGeometry.ruleInsetStart)};right:${frameInset(zoneGeometry.ruleInsetEnd)}`,
|
|
166
188
|
);
|
|
167
189
|
const footerStyle = $derived(
|
|
168
190
|
header === undefined
|
|
169
191
|
? undefined
|
|
170
|
-
: `left:${frameInset(containerPadding ??
|
|
192
|
+
: `left:${frameInset(containerPadding ?? zoneGeometry.contentInsetInline)};right:${frameInset(containerPadding ?? zoneGeometry.contentInsetInline)};bottom:var(--st-component-diagramZone-footerBottomInset, var(--st-component-diagramCard-footerBottomInset, 9.25px))`,
|
|
171
193
|
);
|
|
172
194
|
|
|
173
195
|
$effect(() => {
|
|
@@ -200,8 +222,10 @@
|
|
|
200
222
|
<!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
|
|
201
223
|
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
202
224
|
<div
|
|
203
|
-
class="st-diagramZone st-diagramZone--expanded{
|
|
204
|
-
style={
|
|
225
|
+
class="st-diagramZone st-diagramZone--expanded{effectiveAlign === "center" ? " st-diagramZone--center" : ""}{proposed === true ? " st-diagramZone--proposed" : ""}{anatomy === "v2" ? " st-diagramZone--v2" : ""}"
|
|
226
|
+
style={anatomy === "v2"
|
|
227
|
+
? `width:${layout.box.width}px;height:${layout.box.height}px;--st-component-diagramCard-iconSize:var(--st-component-diagramCardCompact-iconSize, 52px);--st-component-diagramCard-iconTextGap:var(--st-component-diagramCardCompact-iconTextGap, 4px);--st-component-diagramZone-headerInset:var(--st-component-diagramCardCompact-headerInset, 12px)${surfaceStyle}`
|
|
228
|
+
: `width:${layout.box.width}px;height:${layout.box.height}px${surfaceStyle}`}
|
|
205
229
|
data-tone={tone}
|
|
206
230
|
data-proposed={proposed === true ? "true" : undefined}
|
|
207
231
|
role="group"
|
|
@@ -222,6 +246,8 @@
|
|
|
222
246
|
subtitle={header.subtitle}
|
|
223
247
|
iconName={layout.icon.name}
|
|
224
248
|
iconGlyph={layout.icon.glyph}
|
|
249
|
+
iconSize={header.iconBox?.size}
|
|
250
|
+
headerInset={zoneGeometry.headerInset}
|
|
225
251
|
headerTextWidth={header.headerTextWidth}
|
|
226
252
|
headerBlockHeight={header.headerBlockHeight}
|
|
227
253
|
subtitleWidth={subtitleWidth}
|
|
@@ -232,7 +258,7 @@
|
|
|
232
258
|
label: toggleLabel,
|
|
233
259
|
onToggle: () => onToggle?.({ entityId, collapsed: false }),
|
|
234
260
|
}}
|
|
235
|
-
toggleTopInset={
|
|
261
|
+
toggleTopInset={zoneGeometry.toggleTopInset}
|
|
236
262
|
/>
|
|
237
263
|
</div>
|
|
238
264
|
<div class="st-diagramZone-rule" style={ruleStyle} aria-hidden="true"></div>
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAkNH,QAAA,MAAM,WAAW,sDAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { lineBoxHeight } from "./diagramCardModel.js";
|
|
3
3
|
import DiagramCardHeader from "./DiagramCardHeader.svelte";
|
|
4
|
-
import {
|
|
4
|
+
import { type DiagramGlyphPaths, type LaidOutLine } from "./diagramCardModel.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal zone header (DC-D1, spec §6.2): the shared `DiagramCardHeader`
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
subtitle: readonly LaidOutLine[];
|
|
17
17
|
iconName?: string;
|
|
18
18
|
iconGlyph?: DiagramGlyphPaths;
|
|
19
|
+
/** Pictogram box edge; defaults to the v1 `70` (v2: `52`). */
|
|
20
|
+
iconSize?: number;
|
|
21
|
+
/** Frame header inset; defaults to the v1 `16` (v2: `12`). */
|
|
22
|
+
headerInset?: number;
|
|
19
23
|
headerTextWidth: number;
|
|
20
24
|
/**
|
|
21
25
|
* Header row height from the shared model (`headerSlotGeometry`, review
|
|
@@ -41,6 +45,8 @@
|
|
|
41
45
|
subtitle,
|
|
42
46
|
iconName,
|
|
43
47
|
iconGlyph,
|
|
48
|
+
iconSize,
|
|
49
|
+
headerInset = 16,
|
|
44
50
|
headerTextWidth,
|
|
45
51
|
headerBlockHeight,
|
|
46
52
|
subtitleWidth,
|
|
@@ -55,12 +61,13 @@
|
|
|
55
61
|
{title}
|
|
56
62
|
{iconName}
|
|
57
63
|
{iconGlyph}
|
|
64
|
+
{iconSize}
|
|
58
65
|
{headerTextWidth}
|
|
59
66
|
{headerBlockHeight}
|
|
60
67
|
{toggle}
|
|
61
68
|
toggleTopOffset={toggleTopInset === undefined
|
|
62
69
|
? undefined
|
|
63
|
-
: toggleTopInset -
|
|
70
|
+
: toggleTopInset - headerInset}
|
|
64
71
|
/>
|
|
65
72
|
{#if subtitle.length > 0}
|
|
66
73
|
<div class="st-diagramZoneHeader-subtitle" style={`width:${subtitleWidth}px`}>
|
|
@@ -12,6 +12,10 @@ interface DiagramZoneHeaderProps {
|
|
|
12
12
|
subtitle: readonly LaidOutLine[];
|
|
13
13
|
iconName?: string;
|
|
14
14
|
iconGlyph?: DiagramGlyphPaths;
|
|
15
|
+
/** Pictogram box edge; defaults to the v1 `70` (v2: `52`). */
|
|
16
|
+
iconSize?: number;
|
|
17
|
+
/** Frame header inset; defaults to the v1 `16` (v2: `12`). */
|
|
18
|
+
headerInset?: number;
|
|
15
19
|
headerTextWidth: number;
|
|
16
20
|
/**
|
|
17
21
|
* Header row height from the shared model (`headerSlotGeometry`, review
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiagramZoneHeader.svelte.d.ts","sourceRoot":"","sources":["../src/lib/DiagramZoneHeader.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"DiagramZoneHeader.svelte.d.ts","sourceRoot":"","sources":["../src/lib/DiagramZoneHeader.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAG/E;;;;;;GAMG;AACH,UAAU,sBAAsB;IAC9B,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/B,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gB,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,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC1C,MAAM,CAOR;AAED,2GAA2G;AAC3G,MAAM,MAAM,aAAa,GACrB;IACE,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"}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* measured ellipses (owner A14); title/description retain the complete text
|
|
13
13
|
* and informational diagnostics report the hidden length.
|
|
14
14
|
*/
|
|
15
|
-
import {
|
|
15
|
+
import { anatomyCardGeometry, cardFullText, 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) {
|
|
@@ -55,12 +55,17 @@ function textLines(lines, className, fill, extra) {
|
|
|
55
55
|
*/
|
|
56
56
|
export function renderCardContent(props, measure = defaultCardMeasure) {
|
|
57
57
|
const layout = layoutCard(props, measure);
|
|
58
|
-
const g = { ...
|
|
58
|
+
const g = { ...anatomyCardGeometry(layout.anatomyFallback ?? props.anatomy), width: layout.box.width, height: layout.box.height };
|
|
59
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`.
|
|
63
|
-
|
|
63
|
+
// Owner addendum 1: a folded zone keeps its depth background; leaf cards
|
|
64
|
+
// keep the resting card surface.
|
|
65
|
+
const surfaceFill = props.surface === undefined
|
|
66
|
+
? "var(--st-component-diagramCard-surface, var(--st-semantic-surface-raised))"
|
|
67
|
+
: `var(--st-component-diagramZone-${props.surface}, var(--st-semantic-surface-${props.surface === "surface1" ? "raised" : "subtle"}))`;
|
|
68
|
+
parts.push(`<rect x="1" y="1" width="${g.width - 2}" height="${g.height - 2}" fill="${surfaceFill}" stroke="var(--st-component-diagramCard-border, var(--st-semantic-border-strong))" stroke-width="${g.borderWidth}"${props.proposed === true ? ` stroke-dasharray="var(--st-component-diagramCard-proposedDashArray, 4 5)"` : ""}/>`);
|
|
64
69
|
parts.push(`<rect x="0" y="0" width="${g.accentWidth}" height="${g.height}" fill="var(--st-component-diagramCard-accent, var(--st-semantic-data-category1))"/>`);
|
|
65
70
|
if (layout.iconBox !== undefined && props.icon !== undefined) {
|
|
66
71
|
parts.push(iconGroupFor(props.icon, props.iconGlyph, layout.iconBox.x, layout.iconBox.y, layout.iconBox.size));
|
|
@@ -108,7 +113,7 @@ export function toggleGlyph(toggle, box) {
|
|
|
108
113
|
*/
|
|
109
114
|
export function renderCardSvg(props, measure = defaultCardMeasure) {
|
|
110
115
|
const { content, layout } = renderCardContent(props, measure);
|
|
111
|
-
const g = { ...
|
|
116
|
+
const g = { ...anatomyCardGeometry(layout.anatomyFallback ?? props.anatomy), width: layout.box.width, height: layout.box.height };
|
|
112
117
|
const overflowSlots = layout.diagnostics
|
|
113
118
|
.filter((diagnostic) => diagnostic.code === "card-overflow")
|
|
114
119
|
.map((diagnostic) => diagnostic.slot);
|
|
@@ -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,EAGL,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,wBAAwB,CAAC;AAIhC,YAAY,EACV,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,qBAAqB,GACtB,CAAC;AACF,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAoD5B;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,gBAAgB,EACvB,QAAQ,EAAE,SAAS,aAAa,EAAE,EAClC,OAAO,EAAE,eAAe,G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AM,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 { zoneFullText, CARD_GEOMETRY, ZONE_GEOMETRY, defaultCardMeasure, layoutZone, projectZoneProps, zoneCollapsedCardProps, } from "../diagramCardModel.js";
|
|
18
|
+
import { zoneFullText, anatomyZoneGeometry, 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 };
|
|
@@ -65,7 +65,7 @@ function childContent(child, measure) {
|
|
|
65
65
|
* text — a nested overflow is never lost inside a zone.
|
|
66
66
|
*/
|
|
67
67
|
export function zoneContent(props, children, measure) {
|
|
68
|
-
const g =
|
|
68
|
+
const g = anatomyZoneGeometry(props.anatomy);
|
|
69
69
|
const layout = layoutZone(props, measure, children);
|
|
70
70
|
const x = layout.box.x;
|
|
71
71
|
const y = layout.box.y;
|
|
@@ -85,7 +85,12 @@ export function zoneContent(props, children, measure) {
|
|
|
85
85
|
// Frame (expanded only; collapsed is the card border, §6.4).
|
|
86
86
|
// A proposed zone is always drawn dashed, independently of the tint
|
|
87
87
|
// (owner criterion 5); the dash pattern is the kit's `4 5`.
|
|
88
|
-
|
|
88
|
+
// Owner addendum 1: an explicitly threaded depth paints the resolved
|
|
89
|
+
// depth surface; without depth the frame keeps its resting surface.
|
|
90
|
+
const surfaceFill = props.depth === undefined && props.depthParityStart === undefined
|
|
91
|
+
? "var(--st-component-diagramZone-surface, var(--st-semantic-surface-raised))"
|
|
92
|
+
: `var(--st-component-diagramZone-${layout.surface ?? "surface1"}, var(--st-semantic-surface-${(layout.surface ?? "surface1") === "surface1" ? "raised" : "subtle"}))`;
|
|
93
|
+
parts.push(`<rect class="st-diagramZone-frame" x="0" y="0" width="${width}" height="${height}" rx="${g.radius}" fill="${surfaceFill}" stroke="var(--st-component-diagramZone-border, var(--st-semantic-border-strong))" stroke-width="${g.borderWidth}"${props.proposed === true ? ` stroke-dasharray="var(--st-component-diagramZone-proposedDashArray, 4 5)"` : ""}/>`);
|
|
89
94
|
if (header.iconBox !== undefined && props.icon !== undefined) {
|
|
90
95
|
parts.push(iconGroupFor(props.icon, props.iconGlyph, header.iconBox.x - x, header.iconBox.y - y, header.iconBox.size));
|
|
91
96
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentropic/design-system-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@lucide/svelte": "^0.562.0",
|
|
66
66
|
"@sentropic/design-system-rich-text": "0.1.1",
|
|
67
|
-
"@sentropic/design-system-themes": "0.
|
|
68
|
-
"@sentropic/diagram-canvas": "0.
|
|
67
|
+
"@sentropic/design-system-themes": "0.15.0",
|
|
68
|
+
"@sentropic/diagram-canvas": "0.3.0",
|
|
69
69
|
"@sentropic/graph": "0.3.1"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
99
|
"@sentropic/design-system-theme-dsfr": "0.2.2",
|
|
100
|
-
"@sentropic/design-system-themes": "0.
|
|
100
|
+
"@sentropic/design-system-themes": "0.15.0",
|
|
101
101
|
"@sveltejs/package": "^2.5.0",
|
|
102
102
|
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
|
103
103
|
"@testing-library/svelte": "^5.2.8",
|