@sentropic/design-system-svelte 0.40.0 → 0.41.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/LICENSE.THIRD-PARTY.md +2 -1
- 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 +399 -33
- 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/package.json +8 -6
package/LICENSE.THIRD-PARTY.md
CHANGED
|
@@ -26,11 +26,12 @@ sources à l'amont installé : il ne peut pas se désynchroniser en silence.
|
|
|
26
26
|
**Ce qui est copié.** Des chaînes de tracé SVG (attribut `d`) identiques octet pour octet aux données d'icônes lucide, écrites directement dans nos fichiers source et compilées dans le `dist/` publié.
|
|
27
27
|
|
|
28
28
|
**Étendue mesurée.** 21 chaîne(s) de tracé distincte(s),
|
|
29
|
-
|
|
29
|
+
24 occurrence(s), dans 2 fichier(s) source de ce paquet :
|
|
30
30
|
|
|
31
31
|
| Fichier source | Occurrences |
|
|
32
32
|
|---|---|
|
|
33
33
|
| `src/lib/cellDecoration.ts` | 21 |
|
|
34
|
+
| `src/lib/flow-fixtures/before.html` | 3 |
|
|
34
35
|
|
|
35
36
|
Glyphes amont concernés (une chaîne partagée par plusieurs glyphes les nomme tous) :
|
|
36
37
|
`arrow-down`, `arrow-right`, `arrow-up`, `badge-percent`, `barcode`, `check`, `circle-check-big`, `circle-percent`, `circle-question-mark`, `circle-x`, `cloud-snow`, `file-exclamation-point`, `file-question-mark`, `flame`, `house-wifi`, `info`, `message-circle-question-mark`, `message-circle-x`, `minus`, `octagon-x`, `plus`, `shield-question-mark`, `square-check-big`, `square-percent`, `square-x`, `ticket-percent`, `trending-down`, `trending-up`, `triangle-alert`, `x`.
|
package/README.md
CHANGED
|
@@ -90,3 +90,10 @@ This bites hardest under **vitest with jsdom**, where dependencies are externali
|
|
|
90
90
|
|
|
91
91
|
Our own packaging test preprocesses and compiles all 220 published `.svelte` files on every release (`scripts/smoke-pack.mjs`), so a genuinely unparseable file cannot ship. What that test does *not* do is reproduce every consumer bundler configuration — if you find an arrangement where a correct tarball still fails to build, that is worth reporting, and please include the `sha256sum` above.
|
|
92
92
|
|
|
93
|
+
|
|
94
|
+
## DiagramSceneFigure numbered flows
|
|
95
|
+
|
|
96
|
+
DC-2c.1 supports authored flow badges, hover/focus highlighting, logical step
|
|
97
|
+
and node selection, scenario filtering and keyboard navigation. Controlled
|
|
98
|
+
`activeStep`/`scenario` props wait for their parent; hover and focus are immediate.
|
|
99
|
+
See [the reference and interaction contract](../../docs/DC2C_NUMBERED_FLOWS.md).
|
package/dist/DiagramCard.svelte
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { lineBoxHeight } from "./diagramCardModel.js";
|
|
3
|
+
const descriptionId = $props.id();
|
|
2
4
|
import DiagramCardHeader from "./DiagramCardHeader.svelte";
|
|
3
|
-
import {
|
|
5
|
+
import { cardFullText, defaultCardMeasure, layoutCard } from "./diagramCardModel.js";
|
|
4
6
|
import type {
|
|
5
7
|
CardDiagnostic,
|
|
6
8
|
CardLineMeasure,
|
|
@@ -10,14 +12,10 @@
|
|
|
10
12
|
/**
|
|
11
13
|
* `DiagramCard` — the atomic diagram card (DC-1).
|
|
12
14
|
*
|
|
13
|
-
* Spec: spec/SPEC_EVOL_DS_DIAGRAM_CARDS.md §5
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* pinned rule — renders NO normal card; the root carries the host-visible
|
|
18
|
-
* refusal state `data-card-refused="<slot>"` and the diagnostics keep the
|
|
19
|
-
* original slot text. An icon name with no glyph data raises
|
|
20
|
-
* `card-icon-unknown` and the slot collapses (DIF-14).
|
|
15
|
+
* Spec: spec/SPEC_EVOL_DS_DIAGRAM_CARDS.md §5, amended by owner A2/A11.
|
|
16
|
+
* The card stays 460 × 200 and truncates measured slots (owner A14).
|
|
17
|
+
* Full text remains available in title/aria. A missing icon resolves
|
|
18
|
+
* to the visible unknown glyph.
|
|
21
19
|
*
|
|
22
20
|
* The rule stays 1 screen px at every zoom WITHOUT moving the layout: the
|
|
23
21
|
* host publishes the current camera zoom as `--st-diagram-zoom` on the
|
|
@@ -47,6 +45,8 @@
|
|
|
47
45
|
|
|
48
46
|
let {
|
|
49
47
|
entityId,
|
|
48
|
+
autoSize,
|
|
49
|
+
height,
|
|
50
50
|
kicker,
|
|
51
51
|
title,
|
|
52
52
|
body,
|
|
@@ -68,6 +68,8 @@
|
|
|
68
68
|
layoutCard(
|
|
69
69
|
{
|
|
70
70
|
entityId,
|
|
71
|
+
...(autoSize === undefined ? {} : { autoSize }),
|
|
72
|
+
...(height === undefined ? {} : { height }),
|
|
71
73
|
...(kicker === undefined ? {} : { kicker }),
|
|
72
74
|
title,
|
|
73
75
|
body,
|
|
@@ -91,9 +93,8 @@
|
|
|
91
93
|
const unknownIcon = $derived(
|
|
92
94
|
layout.diagnostics.some((diagnostic) => diagnostic.code === "card-icon-unknown"),
|
|
93
95
|
);
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const refused = $derived(firstOverflowDiagnostic(layout.diagnostics));
|
|
96
|
+
|
|
97
|
+
|
|
97
98
|
|
|
98
99
|
$effect(() => {
|
|
99
100
|
if (onDiagnostic === undefined) return;
|
|
@@ -106,38 +107,26 @@
|
|
|
106
107
|
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
107
108
|
<!-- Click selects (the §4.6 select intent), like BarChart's point select:
|
|
108
109
|
keyboard activation of a card is the host figure's concern (DC-2). -->
|
|
109
|
-
{#if refused !== undefined}
|
|
110
|
-
<!-- Overflow = refusal: no normal card is rendered for refused content.
|
|
111
|
-
The host sees the refusal state on the root (data-card-refused) and
|
|
112
|
-
gets the original slot text through onDiagnostic. -->
|
|
113
|
-
<div
|
|
114
|
-
class="st-diagramCard st-diagramCard--refused"
|
|
115
|
-
data-entity={entityId}
|
|
116
|
-
data-tone={tone}
|
|
117
|
-
data-proposed={proposed === true ? "true" : undefined}
|
|
118
|
-
data-card-refused={refused.slot}
|
|
119
|
-
data-card-overflow={refused.slot}
|
|
120
|
-
role="group"
|
|
121
|
-
aria-label={title}
|
|
122
|
-
onclick={() => onSelect?.({ entityId })}
|
|
123
|
-
></div>
|
|
124
|
-
{:else}
|
|
125
110
|
<div
|
|
126
111
|
class="st-diagramCard{bodyMode === "subtitle" ? " st-diagramCard--subtitle" : ""}{align === "center" ? " st-diagramCard--center" : ""}{proposed === true ? " st-diagramCard--proposed" : ""}"
|
|
127
112
|
data-entity={entityId}
|
|
128
113
|
data-tone={tone}
|
|
129
114
|
data-proposed={proposed === true ? "true" : undefined}
|
|
115
|
+
style={`height:${layout.box.height}px`}
|
|
130
116
|
data-card-overflow={overflowSlot}
|
|
131
117
|
data-card-icon-unknown={unknownIcon ? "" : undefined}
|
|
132
118
|
role="group"
|
|
133
|
-
|
|
119
|
+
title={cardFullText({ entityId, kicker, title, body, footer })}
|
|
120
|
+
aria-label={cardFullText({ entityId, kicker, title, body, footer })}
|
|
121
|
+
aria-describedby={descriptionId}
|
|
134
122
|
onclick={() => onSelect?.({ entityId })}
|
|
135
123
|
>
|
|
124
|
+
<span id={descriptionId} hidden>{cardFullText({ entityId, kicker, title, body, footer })}</span>
|
|
136
125
|
<DiagramCardHeader
|
|
137
126
|
kicker={layout.kicker}
|
|
138
127
|
title={layout.title}
|
|
139
|
-
iconName={icon}
|
|
140
|
-
iconGlyph={
|
|
128
|
+
iconName={layout.icon.name}
|
|
129
|
+
iconGlyph={layout.icon.glyph}
|
|
141
130
|
headerTextWidth={layout.headerTextWidth}
|
|
142
131
|
headerBlockHeight={layout.headerBlockHeight}
|
|
143
132
|
toggle={toggle}
|
|
@@ -148,7 +137,7 @@
|
|
|
148
137
|
style={`margin-left:${layout.bodyX - 16}px;width:${layout.bodyWidth}px`}
|
|
149
138
|
>
|
|
150
139
|
{#each layout.body as line, bodyIndex (bodyIndex)}
|
|
151
|
-
<span class={line.secondary ? "st-diagramCard-detail" : "st-diagramCard-line"}>{line.text}</span>
|
|
140
|
+
<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>
|
|
152
141
|
{/each}
|
|
153
142
|
</div>
|
|
154
143
|
<!-- The rule and the footer are positioned together from the shared
|
|
@@ -163,23 +152,23 @@
|
|
|
163
152
|
{#if layout.footerLines.length > 0}
|
|
164
153
|
<div class="st-diagramCard-footer">
|
|
165
154
|
{#each layout.footerLines as line, footerIndex (footerIndex)}
|
|
166
|
-
<span class="st-diagramCard-footerLine">{line.text}</span>
|
|
155
|
+
<span class="st-diagramCard-footerLine" style={`line-height:${lineBoxHeight(line.size)}px;height:${lineBoxHeight(line.size)}px`}>{line.text}</span>
|
|
167
156
|
{/each}
|
|
168
157
|
</div>
|
|
169
158
|
{/if}
|
|
170
159
|
</div>
|
|
171
160
|
</div>
|
|
172
|
-
{/if}
|
|
173
161
|
|
|
174
162
|
<style>
|
|
175
163
|
.st-diagramCard {
|
|
164
|
+
position: relative;
|
|
176
165
|
width: var(--st-component-diagramCard-width, 460px);
|
|
177
166
|
height: var(--st-component-diagramCard-height, 200px);
|
|
178
167
|
box-sizing: border-box;
|
|
179
168
|
border: var(--st-component-diagramCard-borderWidth, 2px) solid
|
|
180
169
|
var(--st-component-diagramCard-border, var(--st-semantic-border-strong));
|
|
181
170
|
border-left: var(--st-component-diagramCard-accentWidth, 8px) solid
|
|
182
|
-
var(--st-component-diagramCard-
|
|
171
|
+
var(--st-component-diagramCard-border, var(--st-semantic-border-strong));
|
|
183
172
|
border-radius: var(--st-component-diagramCard-radius, 0);
|
|
184
173
|
background: var(--st-component-diagramCard-surface, var(--st-semantic-surface-raised));
|
|
185
174
|
color: var(--st-component-diagramCard-text, var(--st-semantic-text-primary));
|
|
@@ -187,7 +176,7 @@
|
|
|
187
176
|
display: flex;
|
|
188
177
|
flex-direction: column;
|
|
189
178
|
text-align: left;
|
|
190
|
-
font-family: var(--st-component-diagramCard-fontFamily, var(--st-font-sans));
|
|
179
|
+
font-family: var(--st-component-diagramCard-fontFamily, var(--st-font-sans, Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif));
|
|
191
180
|
}
|
|
192
181
|
.st-diagramCard--center {
|
|
193
182
|
/* Owner variant: every text slot centred inside its allocation. */
|
|
@@ -2,14 +2,10 @@ import type { CardDiagnostic, CardLineMeasure, DiagramCardProps as DiagramCardDa
|
|
|
2
2
|
/**
|
|
3
3
|
* `DiagramCard` — the atomic diagram card (DC-1).
|
|
4
4
|
*
|
|
5
|
-
* Spec: spec/SPEC_EVOL_DS_DIAGRAM_CARDS.md §5
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* pinned rule — renders NO normal card; the root carries the host-visible
|
|
10
|
-
* refusal state `data-card-refused="<slot>"` and the diagnostics keep the
|
|
11
|
-
* original slot text. An icon name with no glyph data raises
|
|
12
|
-
* `card-icon-unknown` and the slot collapses (DIF-14).
|
|
5
|
+
* Spec: spec/SPEC_EVOL_DS_DIAGRAM_CARDS.md §5, amended by owner A2/A11.
|
|
6
|
+
* The card stays 460 × 200 and truncates measured slots (owner A14).
|
|
7
|
+
* Full text remains available in title/aria. A missing icon resolves
|
|
8
|
+
* to the visible unknown glyph.
|
|
13
9
|
*
|
|
14
10
|
* The rule stays 1 screen px at every zoom WITHOUT moving the layout: the
|
|
15
11
|
* host publishes the current camera zoom as `--st-diagram-zoom` on the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiagramCard.svelte.d.ts","sourceRoot":"","sources":["../src/lib/DiagramCard.svelte.ts"],"names":[],"mappings":"
|
|
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;AAoGH,QAAA,MAAM,WAAW,sDAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { lineBoxHeight } from "./diagramCardModel.js";
|
|
3
|
+
import { getDiagramGlyph } from "./diagram-icons/registry.js";
|
|
2
4
|
import IconButton from "./IconButton.svelte";
|
|
3
5
|
import { Minus, Plus } from "@lucide/svelte";
|
|
4
6
|
import type { DiagramGlyphPaths, LaidOutLine } from "./diagramCardModel.js";
|
|
@@ -36,7 +38,7 @@
|
|
|
36
38
|
kicker,
|
|
37
39
|
title,
|
|
38
40
|
iconName,
|
|
39
|
-
iconGlyph,
|
|
41
|
+
iconGlyph = iconName === undefined || iconName === "none" ? undefined : getDiagramGlyph(iconName) ?? getDiagramGlyph("unknown"),
|
|
40
42
|
headerTextWidth,
|
|
41
43
|
headerBlockHeight,
|
|
42
44
|
toggle,
|
|
@@ -45,7 +47,7 @@
|
|
|
45
47
|
</script>
|
|
46
48
|
|
|
47
49
|
<div class="st-diagramCardHeader" style={`height:${headerBlockHeight}px`}>
|
|
48
|
-
{#if iconName !== undefined && iconGlyph !== undefined}
|
|
50
|
+
{#if iconName !== undefined && iconName !== "none" && iconGlyph !== undefined}
|
|
49
51
|
<svg
|
|
50
52
|
class="st-diagramCardHeader-icon"
|
|
51
53
|
data-diagram-icon={iconName}
|
|
@@ -92,16 +94,17 @@
|
|
|
92
94
|
{/if}
|
|
93
95
|
<div class="st-diagramCardHeader-text" style={`width:${headerTextWidth}px`}>
|
|
94
96
|
{#each kicker as line, kickerIndex (kickerIndex)}
|
|
95
|
-
<span class="st-diagramCard-kicker">{line.text}</span>
|
|
97
|
+
<span class="st-diagramCard-kicker" style={`line-height:${lineBoxHeight(line.size)}px;height:${lineBoxHeight(line.size)}px`}>{line.text}</span>
|
|
96
98
|
{/each}
|
|
97
99
|
{#each title as line, titleIndex (titleIndex)}
|
|
98
|
-
<span class="st-diagramCard-title">{line.text}</span>
|
|
100
|
+
<span class="st-diagramCard-title" style={`line-height:${lineBoxHeight(line.size)}px;height:${lineBoxHeight(line.size)}px`}>{line.text}</span>
|
|
99
101
|
{/each}
|
|
100
102
|
</div>
|
|
101
103
|
{#if toggle !== undefined}
|
|
102
104
|
<div
|
|
103
105
|
class="st-diagramCard-toggle"
|
|
104
|
-
style={toggleTopOffset === undefined ?
|
|
106
|
+
style={`top:${toggleTopOffset === undefined ? "calc(var(--st-component-diagramZone-toggleInset, 8px) - var(--st-component-diagramCard-borderWidth, 2px))" : 'calc(var(--st-component-diagramZone-toggleInset, 8px) - var(--st-component-diagramZone-headerInset, 16px) - var(--st-component-diagramZone-borderWidth, 1.5px))'};right:${toggleTopOffset === undefined ? "calc(var(--st-component-diagramZone-toggleInset, 8px) - var(--st-component-diagramCard-borderWidth, 2px))" : 'calc(var(--st-component-diagramZone-toggleInset, 8px) - var(--st-component-diagramZone-headerInset, 16px) - var(--st-component-diagramZone-borderWidth, 1.5px))'}`}
|
|
107
|
+
|
|
105
108
|
>
|
|
106
109
|
<IconButton
|
|
107
110
|
size="sm"
|
|
@@ -164,10 +167,8 @@
|
|
|
164
167
|
word-break: normal;
|
|
165
168
|
}
|
|
166
169
|
.st-diagramCard-toggle {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
(hrpn folded-card placement), not vertically centred. */
|
|
171
|
-
align-self: flex-start;
|
|
170
|
+
position: absolute;
|
|
171
|
+
width: var(--st-component-diagramCard-toggleBoxSize, 32px);
|
|
172
|
+
height: var(--st-component-diagramCard-toggleBoxSize, 32px);
|
|
172
173
|
}
|
|
173
174
|
</style>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiagramCardHeader.svelte.d.ts","sourceRoot":"","sources":["../src/lib/DiagramCardHeader.svelte.ts"],"names":[],"mappings":"
|
|
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;AA6DH,QAAA,MAAM,iBAAiB,4DAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}
|