@sentropic/design-system-svelte 0.36.0 → 0.37.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/LICENSE.THIRD-PARTY.md +74 -1
  2. package/dist/DiagramCard.svelte +282 -0
  3. package/dist/DiagramCard.svelte.d.ts +44 -0
  4. package/dist/DiagramCard.svelte.d.ts.map +1 -0
  5. package/dist/DiagramCardHeader.svelte +173 -0
  6. package/dist/DiagramCardHeader.svelte.d.ts +37 -0
  7. package/dist/DiagramCardHeader.svelte.d.ts.map +1 -0
  8. package/dist/DiagramZone.svelte +378 -0
  9. package/dist/DiagramZone.svelte.d.ts +45 -0
  10. package/dist/DiagramZone.svelte.d.ts.map +1 -0
  11. package/dist/DiagramZoneHeader.svelte +97 -0
  12. package/dist/DiagramZoneHeader.svelte.d.ts +40 -0
  13. package/dist/DiagramZoneHeader.svelte.d.ts.map +1 -0
  14. package/dist/LabelledIconButton.svelte +63 -0
  15. package/dist/LabelledIconButton.svelte.d.ts +27 -0
  16. package/dist/LabelledIconButton.svelte.d.ts.map +1 -0
  17. package/dist/Pagination.svelte +5 -0
  18. package/dist/diagram-icons/DiagramIcon.svelte +65 -0
  19. package/dist/diagram-icons/DiagramIcon.svelte.d.ts +11 -0
  20. package/dist/diagram-icons/DiagramIcon.svelte.d.ts.map +1 -0
  21. package/dist/diagram-icons/PROVENANCE.md +72 -0
  22. package/dist/diagram-icons/index.d.ts +6 -0
  23. package/dist/diagram-icons/index.d.ts.map +1 -0
  24. package/dist/diagram-icons/index.js +4 -0
  25. package/dist/diagram-icons/registry.d.ts +52 -0
  26. package/dist/diagram-icons/registry.d.ts.map +1 -0
  27. package/dist/diagram-icons/registry.js +79 -0
  28. package/dist/diagram-render/index.d.ts +17 -0
  29. package/dist/diagram-render/index.d.ts.map +1 -0
  30. package/dist/diagram-render/index.js +11 -0
  31. package/dist/diagram-render/renderCardSvg.d.ts +83 -0
  32. package/dist/diagram-render/renderCardSvg.d.ts.map +1 -0
  33. package/dist/diagram-render/renderCardSvg.js +149 -0
  34. package/dist/diagram-render/renderZoneSvg.d.ts +88 -0
  35. package/dist/diagram-render/renderZoneSvg.d.ts.map +1 -0
  36. package/dist/diagram-render/renderZoneSvg.js +184 -0
  37. package/dist/diagramCardModel.d.ts +582 -0
  38. package/dist/diagramCardModel.d.ts.map +1 -0
  39. package/dist/diagramCardModel.js +1133 -0
  40. package/dist/icons.d.ts +2 -0
  41. package/dist/icons.d.ts.map +1 -1
  42. package/dist/icons.js +5 -1
  43. package/dist/index.d.ts +7 -0
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +3 -0
  46. package/dist/presence-badge/LockPresenceBadge.svelte +490 -0
  47. package/dist/presence-badge/LockPresenceBadge.svelte.d.ts +18 -0
  48. package/dist/presence-badge/LockPresenceBadge.svelte.d.ts.map +1 -0
  49. package/dist/presence-badge/index.d.ts +6 -0
  50. package/dist/presence-badge/index.d.ts.map +1 -0
  51. package/dist/presence-badge/index.js +3 -0
  52. package/dist/rich-text-editor/ComposerEditor.svelte +485 -0
  53. package/dist/rich-text-editor/ComposerEditor.svelte.d.ts +16 -0
  54. package/dist/rich-text-editor/ComposerEditor.svelte.d.ts.map +1 -0
  55. package/dist/rich-text-editor/RichTextEditor.svelte +557 -0
  56. package/dist/rich-text-editor/RichTextEditor.svelte.d.ts +45 -0
  57. package/dist/rich-text-editor/RichTextEditor.svelte.d.ts.map +1 -0
  58. package/dist/rich-text-editor/RichTextEditorFixture.svelte.d.ts +8 -0
  59. package/dist/rich-text-editor/RichTextEditorFixture.svelte.d.ts.map +1 -0
  60. package/dist/rich-text-editor/RichTextEditorNestedFixture.svelte.d.ts +13 -0
  61. package/dist/rich-text-editor/RichTextEditorNestedFixture.svelte.d.ts.map +1 -0
  62. package/dist/rich-text-editor/index.d.ts +10 -0
  63. package/dist/rich-text-editor/index.d.ts.map +1 -0
  64. package/dist/rich-text-editor/index.js +4 -0
  65. package/dist/rich-text-editor/rich-text-editor.css +115 -0
  66. package/package.json +54 -7
@@ -87,7 +87,7 @@ Glyphes amont concernés (une chaîne partagée par plusieurs glyphes les nomme
87
87
  ## 2. Dépendances installées avec ce paquet
88
88
 
89
89
  Fermeture **transitive** de `dependencies` et `optionalDependencies`, dérivée
90
- de `package-lock.json` : 1 paquet(s), 1 famille(s) de licences.
90
+ de `package-lock.json` : 3 paquet(s), 2 famille(s) de licences.
91
91
  Ces paquets ne sont pas recopiés dans notre tarball — npm les récupère du
92
92
  registre avec leurs propres fichiers de licence. Ils sont recensés ici parce
93
93
  qu'ils arrivent dans le `node_modules` du consommateur de notre fait.
@@ -95,6 +95,8 @@ qu'ils arrivent dans le `node_modules` du consommateur de notre fait.
95
95
  | Paquet | Version | Licence déclarée |
96
96
  |---|---|---|
97
97
  | `@lucide/svelte` | 0.562.0 | ISC |
98
+ | `@tiptap/markdown` | 3.32.0 | MIT |
99
+ | `marked` | 17.0.6 | MIT |
98
100
 
99
101
  ### Textes de notice
100
102
 
@@ -139,3 +141,74 @@ qu'ils arrivent dans le `node_modules` du consommateur de notre fait.
139
141
  > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
140
142
  > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
141
143
  > SOFTWARE.
144
+
145
+ #### `@tiptap/markdown` 3.32.0 — MIT
146
+
147
+ > MIT License
148
+ >
149
+ > Copyright (c) 2025, Tiptap GmbH
150
+ >
151
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
152
+ > of this software and associated documentation files (the "Software"), to deal
153
+ > in the Software without restriction, including without limitation the rights
154
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
155
+ > copies of the Software, and to permit persons to whom the Software is
156
+ > furnished to do so, subject to the following conditions:
157
+ >
158
+ > The above copyright notice and this permission notice shall be included in all
159
+ > copies or substantial portions of the Software.
160
+ >
161
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
162
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
163
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
164
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
165
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
166
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
167
+ > SOFTWARE.
168
+
169
+ #### `marked` 17.0.6 — MIT
170
+
171
+ > # License information
172
+ >
173
+ > ## Contribution License Agreement
174
+ >
175
+ > If you contribute code to this project, you are implicitly allowing your code
176
+ > to be distributed under the MIT license. You are also implicitly verifying that
177
+ > all code is your original work. `</legalese>`
178
+ >
179
+ > ## Marked
180
+ >
181
+ > Copyright (c) 2018+, MarkedJS (https://github.com/markedjs/)
182
+ > Copyright (c) 2011-2018, Christopher Jeffrey (https://github.com/chjj/)
183
+ >
184
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
185
+ > of this software and associated documentation files (the "Software"), to deal
186
+ > in the Software without restriction, including without limitation the rights
187
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
188
+ > copies of the Software, and to permit persons to whom the Software is
189
+ > furnished to do so, subject to the following conditions:
190
+ >
191
+ > The above copyright notice and this permission notice shall be included in
192
+ > all copies or substantial portions of the Software.
193
+ >
194
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
195
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
196
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
197
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
198
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
199
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
200
+ > THE SOFTWARE.
201
+ >
202
+ > ## Markdown
203
+ >
204
+ > Copyright © 2004, John Gruber
205
+ > http://daringfireball.net/
206
+ > All rights reserved.
207
+ >
208
+ > Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
209
+ >
210
+ > * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
211
+ > * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
212
+ > * Neither the name “Markdown” nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
213
+ >
214
+ > This software is provided by the copyright holders and contributors “as is” and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
@@ -0,0 +1,282 @@
1
+ <script lang="ts">
2
+ import DiagramCardHeader from "./DiagramCardHeader.svelte";
3
+ import { defaultCardMeasure, firstOverflowDiagnostic, layoutCard } from "./diagramCardModel.js";
4
+ import type {
5
+ CardDiagnostic,
6
+ CardLineMeasure,
7
+ DiagramCardProps as DiagramCardData,
8
+ } from "./diagramCardModel.js";
9
+
10
+ /**
11
+ * `DiagramCard` — the atomic diagram card (DC-1).
12
+ *
13
+ * Spec: spec/SPEC_EVOL_DS_DIAGRAM_CARDS.md §5. Fixed 460 × 200 box, square
14
+ * corners, footer pinned at 9.25, one 1 px rule, no shortening. Overflow
15
+ * = refusal (owner criterion): any `card-overflow` — a too-wide line, a
16
+ * line-count overflow, or a header+body height that does not fit above the
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).
21
+ *
22
+ * The rule stays 1 screen px at every zoom WITHOUT moving the layout: the
23
+ * host publishes the current camera zoom as `--st-diagram-zoom` on the
24
+ * canvas viewport, the rule's layout box keeps a constant 1 px footprint,
25
+ * and only its painted stroke is counter-scaled by `scaleY(1/zoom)`
26
+ * (review pass 2, item 5) — the HTML twin of the SVG
27
+ * `vector-effect="non-scaling-stroke"`.
28
+ *
29
+ * The pictogram path data arrives via the `iconGlyph` prop (resolved by
30
+ * the host from the `diagram-icons` subpath, e.g. `getDiagramGlyph`, or by
31
+ * `projectCardProps` from `diagram-render`): the barrel never resolves the
32
+ * icon registry graph (§5.6). Line splits come from the shared
33
+ * `layoutCard`, the same geometry the pure `renderCardSvg` consumes.
34
+ */
35
+ export interface DiagramCardProps extends DiagramCardData {
36
+ /**
37
+ * Text measurer. Defaults to the deterministic greedy wrapper;
38
+ * production hosts pass their measured `LineMeasurer` adapter so the
39
+ * Svelte card wraps against the same advances as layout and rendering.
40
+ */
41
+ measure?: CardLineMeasure;
42
+ /** Select intent (§4.6): `{ event: "intent", name: "select", target }`. */
43
+ onSelect?: (event: { entityId: string }) => void;
44
+ /** One call per diagnostic the layout raises. */
45
+ onDiagnostic?: (diagnostic: CardDiagnostic) => void;
46
+ }
47
+
48
+ let {
49
+ entityId,
50
+ kicker,
51
+ title,
52
+ body,
53
+ detailCount,
54
+ footer,
55
+ icon,
56
+ iconGlyph,
57
+ tone,
58
+ proposed,
59
+ toggle,
60
+ align,
61
+ bodyMode,
62
+ measure = defaultCardMeasure,
63
+ onSelect,
64
+ onDiagnostic,
65
+ }: DiagramCardProps = $props();
66
+
67
+ const layout = $derived(
68
+ layoutCard(
69
+ {
70
+ entityId,
71
+ ...(kicker === undefined ? {} : { kicker }),
72
+ title,
73
+ body,
74
+ ...(detailCount === undefined ? {} : { detailCount }),
75
+ ...(footer === undefined ? {} : { footer }),
76
+ ...(icon === undefined ? {} : { icon }),
77
+ ...(iconGlyph === undefined ? {} : { iconGlyph }),
78
+ ...(tone === undefined ? {} : { tone }),
79
+ ...(proposed === undefined ? {} : { proposed }),
80
+ ...(toggle === undefined ? {} : { toggle }),
81
+ ...(align === undefined ? {} : { align }),
82
+ ...(bodyMode === undefined ? {} : { bodyMode }),
83
+ },
84
+ measure,
85
+ ),
86
+ );
87
+
88
+ const overflowSlot = $derived(
89
+ layout.diagnostics.find((diagnostic) => diagnostic.code === "card-overflow")?.slot,
90
+ );
91
+ const unknownIcon = $derived(
92
+ layout.diagnostics.some((diagnostic) => diagnostic.code === "card-icon-unknown"),
93
+ );
94
+ // Overflow = refusal: the same predicate as the pure renderer
95
+ // (`firstOverflowDiagnostic`), so both renderers refuse together.
96
+ const refused = $derived(firstOverflowDiagnostic(layout.diagnostics));
97
+
98
+ $effect(() => {
99
+ if (onDiagnostic === undefined) return;
100
+ for (const diagnostic of layout.diagnostics) onDiagnostic(diagnostic);
101
+ });
102
+ </script>
103
+
104
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
105
+ <!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
106
+ <!-- svelte-ignore a11y_click_events_have_key_events -->
107
+ <!-- Click selects (the §4.6 select intent), like BarChart's point select:
108
+ 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
+ <div
126
+ class="st-diagramCard{bodyMode === "subtitle" ? " st-diagramCard--subtitle" : ""}{align === "center" ? " st-diagramCard--center" : ""}{proposed === true ? " st-diagramCard--proposed" : ""}"
127
+ data-entity={entityId}
128
+ data-tone={tone}
129
+ data-proposed={proposed === true ? "true" : undefined}
130
+ data-card-overflow={overflowSlot}
131
+ data-card-icon-unknown={unknownIcon ? "" : undefined}
132
+ role="group"
133
+ aria-label={title}
134
+ onclick={() => onSelect?.({ entityId })}
135
+ >
136
+ <DiagramCardHeader
137
+ kicker={layout.kicker}
138
+ title={layout.title}
139
+ iconName={icon}
140
+ iconGlyph={iconGlyph}
141
+ headerTextWidth={layout.headerTextWidth}
142
+ headerBlockHeight={layout.headerBlockHeight}
143
+ toggle={toggle}
144
+ />
145
+ <div class="st-diagramCard-gap" aria-hidden="true"></div>
146
+ <div
147
+ class="st-diagramCard-body"
148
+ style={`margin-left:${layout.bodyX - 16}px;width:${layout.bodyWidth}px`}
149
+ >
150
+ {#each layout.body as line, bodyIndex (bodyIndex)}
151
+ <span class={line.secondary ? "st-diagramCard-detail" : "st-diagramCard-line"}>{line.text}</span>
152
+ {/each}
153
+ </div>
154
+ <!-- The rule and the footer are positioned together from the shared
155
+ geometry: the foot wrapper is pinned to the bottom (margin-top:auto),
156
+ the rule keeps its 4 px margins inside it, so the rule→footer gap is
157
+ the frozen 4 px at every body line count, exactly as the SVG pins
158
+ ruleY from the footer. -->
159
+ <div class="st-diagramCard-foot">
160
+ {#if layout.ruleY !== undefined}
161
+ <div class="st-diagramCard-rule" aria-hidden="true"></div>
162
+ {/if}
163
+ {#if layout.footerLines.length > 0}
164
+ <div class="st-diagramCard-footer">
165
+ {#each layout.footerLines as line, footerIndex (footerIndex)}
166
+ <span class="st-diagramCard-footerLine">{line.text}</span>
167
+ {/each}
168
+ </div>
169
+ {/if}
170
+ </div>
171
+ </div>
172
+ {/if}
173
+
174
+ <style>
175
+ .st-diagramCard {
176
+ width: var(--st-component-diagramCard-width, 460px);
177
+ height: var(--st-component-diagramCard-height, 200px);
178
+ box-sizing: border-box;
179
+ border: var(--st-component-diagramCard-borderWidth, 2px) solid
180
+ var(--st-component-diagramCard-border, var(--st-semantic-border-strong));
181
+ border-left: var(--st-component-diagramCard-accentWidth, 8px) solid
182
+ var(--st-component-diagramCard-accent, var(--st-semantic-data-category1));
183
+ border-radius: var(--st-component-diagramCard-radius, 0);
184
+ background: var(--st-component-diagramCard-surface, var(--st-semantic-surface-raised));
185
+ color: var(--st-component-diagramCard-text, var(--st-semantic-text-primary));
186
+ padding: var(--st-component-diagramCard-padding, 8px);
187
+ display: flex;
188
+ flex-direction: column;
189
+ text-align: left;
190
+ font-family: var(--st-component-diagramCard-fontFamily, var(--st-font-sans));
191
+ }
192
+ .st-diagramCard--center {
193
+ /* Owner variant: every text slot centred inside its allocation. */
194
+ text-align: center;
195
+ }
196
+ /* Neutral status prop: a proposed card is always drawn dashed,
197
+ independently of the tint (owner criterion 5). */
198
+ .st-diagramCard--proposed {
199
+ border-style: dashed;
200
+ }
201
+ .st-diagramCard-gap {
202
+ display: block;
203
+ height: var(--st-component-diagramCard-gap, 6px);
204
+ flex: 0 0 var(--st-component-diagramCard-gap, 6px);
205
+ }
206
+ .st-diagramCard-body {
207
+ /* margin-left and width both come from the shared layout: the body box
208
+ is exactly layout.bodyWidth wide at layout.bodyX — −2 px / 436 px for
209
+ leaf bodies (bodyInsetFromBar 14 vs headerInset 16), 16 px / 396 px
210
+ for the centred collapsed-subtitle measure (§6.2.1: the subtitle is
211
+ centred at 32 + 396/2 = 230, not over the wider content box). */
212
+ min-width: 0;
213
+ flex: 0 0 auto;
214
+ font-size: var(--st-component-diagramCard-bodyFontSize, 24px);
215
+ font-weight: var(--st-component-diagramCard-bodyFontWeight, 400);
216
+ line-height: var(--st-component-diagramCard-bodyLineHeight, 1.3);
217
+ }
218
+ .st-diagramCard--subtitle .st-diagramCard-body {
219
+ /* §6.2.1: the collapsed-zone subtitle block is centred horizontally
220
+ and vertically inside the card body area. */
221
+ flex: 1 1 auto;
222
+ display: flex;
223
+ flex-direction: column;
224
+ justify-content: center;
225
+ text-align: center;
226
+ }
227
+ .st-diagramCard-line,
228
+ .st-diagramCard-detail {
229
+ display: block;
230
+ min-width: 0;
231
+ /* No mid-word break: an over-long word overflows and is diagnosed
232
+ (Astra J4), never silently broken or cut. */
233
+ overflow-wrap: normal;
234
+ word-break: normal;
235
+ }
236
+ .st-diagramCard-detail {
237
+ color: var(--st-component-diagramCard-secondaryText, var(--st-semantic-text-secondary));
238
+ }
239
+ /* Rule and footer share one pinned wrapper (`.st-diagramCard-foot`):
240
+ the wrapper takes the automatic top margin, so spare body space grows
241
+ above the rule and the rule→footer gap stays the frozen 4 px. */
242
+ .st-diagramCard-foot {
243
+ margin-top: auto;
244
+ flex: 0 0 auto;
245
+ }
246
+ .st-diagramCard-rule {
247
+ display: block;
248
+ flex: 0 0 auto;
249
+ /* 1 screen px at every zoom, with a constant LAYOUT footprint (review
250
+ pass 2, item 5): the box height never reads --st-diagram-zoom, so at
251
+ overview zoom 0.25 the rule still occupies exactly 1 px of layout and
252
+ the pinned footer never moves. Only the painted stroke is
253
+ counter-scaled: the host scales the viewport by --st-diagram-zoom, so
254
+ scaleY(1/zoom) on the fixed 1 px box paints exactly 1 screen px — the
255
+ HTML twin of the SVG vector-effect="non-scaling-stroke". */
256
+ height: var(--st-component-diagramCard-ruleHeight, 1px);
257
+ margin: var(--st-component-diagramCard-ruleMargin, 4px) 0;
258
+ background: var(--st-component-diagramCard-rule, var(--st-semantic-border-subtle));
259
+ transform: scaleY(calc(1 / var(--st-diagram-zoom, 1)));
260
+ transform-origin: center;
261
+ }
262
+ .st-diagramCard-footer {
263
+ /* Pinned footer: text-box bottom at (height − border − inset); the flex
264
+ content bottom sits at (height − padding − border), so the margin is
265
+ (inset − padding) = 1.25 px at the frozen values. No margin-top:auto
266
+ here: the rule and the footer are positioned together by the shared
267
+ foot wrapper. */
268
+ margin-bottom: calc(
269
+ var(--st-component-diagramCard-footerBottomInset, 9.25px) -
270
+ var(--st-component-diagramCard-padding, 8px)
271
+ );
272
+ font-size: var(--st-component-diagramCard-footerFontSize, 24px);
273
+ font-weight: var(--st-component-diagramCard-footerFontWeight, 700);
274
+ line-height: var(--st-component-diagramCard-footerLineHeight, 1.3);
275
+ }
276
+ .st-diagramCard-footerLine {
277
+ display: block;
278
+ min-width: 0;
279
+ overflow-wrap: normal;
280
+ word-break: normal;
281
+ }
282
+ </style>
@@ -0,0 +1,44 @@
1
+ import type { CardDiagnostic, CardLineMeasure, DiagramCardProps as DiagramCardData } from "./diagramCardModel.js";
2
+ /**
3
+ * `DiagramCard` — the atomic diagram card (DC-1).
4
+ *
5
+ * Spec: spec/SPEC_EVOL_DS_DIAGRAM_CARDS.md §5. Fixed 460 × 200 box, square
6
+ * corners, footer pinned at 9.25, one 1 px rule, no shortening. Overflow
7
+ * = refusal (owner criterion): any `card-overflow` — a too-wide line, a
8
+ * line-count overflow, or a header+body height that does not fit above the
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).
13
+ *
14
+ * The rule stays 1 screen px at every zoom WITHOUT moving the layout: the
15
+ * host publishes the current camera zoom as `--st-diagram-zoom` on the
16
+ * canvas viewport, the rule's layout box keeps a constant 1 px footprint,
17
+ * and only its painted stroke is counter-scaled by `scaleY(1/zoom)`
18
+ * (review pass 2, item 5) — the HTML twin of the SVG
19
+ * `vector-effect="non-scaling-stroke"`.
20
+ *
21
+ * The pictogram path data arrives via the `iconGlyph` prop (resolved by
22
+ * the host from the `diagram-icons` subpath, e.g. `getDiagramGlyph`, or by
23
+ * `projectCardProps` from `diagram-render`): the barrel never resolves the
24
+ * icon registry graph (§5.6). Line splits come from the shared
25
+ * `layoutCard`, the same geometry the pure `renderCardSvg` consumes.
26
+ */
27
+ export interface DiagramCardProps extends DiagramCardData {
28
+ /**
29
+ * Text measurer. Defaults to the deterministic greedy wrapper;
30
+ * production hosts pass their measured `LineMeasurer` adapter so the
31
+ * Svelte card wraps against the same advances as layout and rendering.
32
+ */
33
+ measure?: CardLineMeasure;
34
+ /** Select intent (§4.6): `{ event: "intent", name: "select", target }`. */
35
+ onSelect?: (event: {
36
+ entityId: string;
37
+ }) => void;
38
+ /** One call per diagnostic the layout raises. */
39
+ onDiagnostic?: (diagnostic: CardDiagnostic) => void;
40
+ }
41
+ declare const DiagramCard: import("svelte").Component<DiagramCardProps, {}, "">;
42
+ type DiagramCard = ReturnType<typeof DiagramCard>;
43
+ export default DiagramCard;
44
+ //# sourceMappingURL=DiagramCard.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiagramCard.svelte.d.ts","sourceRoot":"","sources":["../src/lib/DiagramCard.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACR,cAAc,EACd,eAAe,EACf,gBAAgB,IAAI,eAAe,EACpC,MAAM,uBAAuB,CAAC;AAG/B;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;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;AAmGH,QAAA,MAAM,WAAW,sDAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
@@ -0,0 +1,173 @@
1
+ <script lang="ts">
2
+ import IconButton from "./IconButton.svelte";
3
+ import { Minus, Plus } from "@lucide/svelte";
4
+ import type { DiagramGlyphPaths, LaidOutLine } from "./diagramCardModel.js";
5
+
6
+ /**
7
+ * Internal shared header row (DC-D1): icon box, kicker over title, toggle
8
+ * slot. Composed by `DiagramCard` and (DC-2) by `DiagramZoneHeader`, so
9
+ * zone and card headers cannot diverge in size, spacing or typography.
10
+ * Not a public export: exercised through `DiagramCard`.
11
+ */
12
+ interface DiagramCardHeaderProps {
13
+ kicker: readonly LaidOutLine[];
14
+ title: readonly LaidOutLine[];
15
+ iconName?: string;
16
+ iconGlyph?: DiagramGlyphPaths;
17
+ /** Width the title/kicker block may take (toggle-aware). */
18
+ headerTextWidth: number;
19
+ /**
20
+ * Header row height from the shared model (`headerSlotGeometry`, review
21
+ * pass 2 item 10): `max(icon 70, kicker+title)` with an icon, the bare
22
+ * kicker+title line boxes without one. Applied here as the row height so
23
+ * the Svelte header places the body exactly where `layoutCard` /
24
+ * `layoutZone` and the SVG renderers place it.
25
+ */
26
+ headerBlockHeight: number;
27
+ toggle?: { collapsed: boolean; label: string; onToggle?: () => void };
28
+ /**
29
+ * Extra px the toggle slot is pulled up (zone expanded: the toggle sits
30
+ * at frame top + 10 while the header band starts at + 16, so −6).
31
+ */
32
+ toggleTopOffset?: number;
33
+ }
34
+
35
+ let {
36
+ kicker,
37
+ title,
38
+ iconName,
39
+ iconGlyph,
40
+ headerTextWidth,
41
+ headerBlockHeight,
42
+ toggle,
43
+ toggleTopOffset,
44
+ }: DiagramCardHeaderProps = $props();
45
+ </script>
46
+
47
+ <div class="st-diagramCardHeader" style={`height:${headerBlockHeight}px`}>
48
+ {#if iconName !== undefined && iconGlyph !== undefined}
49
+ <svg
50
+ class="st-diagramCardHeader-icon"
51
+ data-diagram-icon={iconName}
52
+ viewBox="0 0 64 64"
53
+ width="70"
54
+ height="70"
55
+ aria-hidden="true"
56
+ focusable="false"
57
+ >
58
+ <path
59
+ d="M8 53L32 44L56 53L32 62Z"
60
+ fill="var(--st-component-diagramIcon-baseFill, color-mix(in srgb, var(--st-semantic-feedback-info) 18%, var(--st-semantic-surface-raised)))"
61
+ />
62
+ <path
63
+ d={iconGlyph.face}
64
+ fill="var(--st-component-diagramIcon-faceFill, color-mix(in srgb, var(--st-semantic-feedback-info) 75%, var(--st-semantic-surface-raised)))"
65
+ stroke="var(--st-component-diagramIcon-faceStroke, var(--st-semantic-feedback-info))"
66
+ stroke-width="1.5"
67
+ stroke-linejoin="round"
68
+ />
69
+ {#if iconGlyph.line !== undefined}
70
+ <path
71
+ d={iconGlyph.line}
72
+ fill="none"
73
+ stroke={iconGlyph.darkLine === true
74
+ ? "var(--st-component-diagramIcon-lineDarkStroke, var(--st-semantic-feedback-info))"
75
+ : "var(--st-component-diagramIcon-lineStroke, var(--st-semantic-surface-raised))"}
76
+ stroke-width="2.5"
77
+ stroke-linecap="round"
78
+ stroke-linejoin="round"
79
+ />
80
+ {/if}
81
+ {#if iconGlyph.text !== undefined}
82
+ <text
83
+ x="32"
84
+ y="47"
85
+ text-anchor="middle"
86
+ fill="var(--st-component-diagramIcon-lineStroke, var(--st-semantic-surface-raised))"
87
+ font-size="13"
88
+ font-weight="750"
89
+ >{iconGlyph.text}</text>
90
+ {/if}
91
+ </svg>
92
+ {/if}
93
+ <div class="st-diagramCardHeader-text" style={`width:${headerTextWidth}px`}>
94
+ {#each kicker as line, kickerIndex (kickerIndex)}
95
+ <span class="st-diagramCard-kicker">{line.text}</span>
96
+ {/each}
97
+ {#each title as line, titleIndex (titleIndex)}
98
+ <span class="st-diagramCard-title">{line.text}</span>
99
+ {/each}
100
+ </div>
101
+ {#if toggle !== undefined}
102
+ <div
103
+ class="st-diagramCard-toggle"
104
+ style={toggleTopOffset === undefined ? undefined : `margin-top:${toggleTopOffset}px`}
105
+ >
106
+ <IconButton
107
+ size="sm"
108
+ variant="ghost"
109
+ aria-label={toggle.label}
110
+ aria-expanded={!toggle.collapsed}
111
+ onclick={toggle.onToggle}
112
+ >
113
+ {#if toggle.collapsed}
114
+ <Plus size="var(--st-component-button-anatomy-density-sm-fontSize)" aria-hidden="true" />
115
+ {:else}
116
+ <Minus size="var(--st-component-button-anatomy-density-sm-fontSize)" aria-hidden="true" />
117
+ {/if}
118
+ </IconButton>
119
+ </div>
120
+ {/if}
121
+ </div>
122
+
123
+ <style>
124
+ .st-diagramCardHeader {
125
+ display: flex;
126
+ align-items: center;
127
+ gap: var(--st-component-diagramCard-iconTextGap, 6px);
128
+ min-width: 0;
129
+ flex: 0 0 auto;
130
+ }
131
+ .st-diagramCardHeader-icon {
132
+ flex: 0 0 var(--st-component-diagramCard-iconSize, 70px);
133
+ width: var(--st-component-diagramCard-iconSize, 70px);
134
+ height: var(--st-component-diagramCard-iconSize, 70px);
135
+ }
136
+ .st-diagramCardHeader-text {
137
+ display: flex;
138
+ flex-direction: column;
139
+ justify-content: center;
140
+ min-width: 0;
141
+ flex: 0 1 auto;
142
+ }
143
+ .st-diagramCard-kicker {
144
+ display: block;
145
+ min-width: 0;
146
+ font-size: var(--st-component-diagramCard-kickerFontSize, 22px);
147
+ font-weight: var(--st-component-diagramCard-kickerFontWeight, 400);
148
+ line-height: var(--st-component-diagramCard-kickerLineHeight, 1.3);
149
+ letter-spacing: var(--st-component-diagramCard-kickerLetterSpacing, 0.04em);
150
+ text-transform: var(--st-component-diagramCard-kickerTextTransform, uppercase);
151
+ color: var(--st-component-diagramCard-secondaryText, var(--st-semantic-text-secondary));
152
+ /* No mid-word break: an over-long word is diagnosed, never broken. */
153
+ overflow-wrap: normal;
154
+ word-break: normal;
155
+ }
156
+ .st-diagramCard-title {
157
+ display: block;
158
+ min-width: 0;
159
+ font-size: var(--st-component-diagramCard-titleFontSize, 32px);
160
+ font-weight: var(--st-component-diagramCard-titleFontWeight, 700);
161
+ line-height: var(--st-component-diagramCard-titleLineHeight, 1.3);
162
+ color: var(--st-component-diagramCard-text, var(--st-semantic-text-primary));
163
+ overflow-wrap: normal;
164
+ word-break: normal;
165
+ }
166
+ .st-diagramCard-toggle {
167
+ flex: 0 0 auto;
168
+ margin-left: auto;
169
+ /* Top right of the header row with the card's own top margin
170
+ (hrpn folded-card placement), not vertically centred. */
171
+ align-self: flex-start;
172
+ }
173
+ </style>
@@ -0,0 +1,37 @@
1
+ import type { DiagramGlyphPaths, LaidOutLine } from "./diagramCardModel.js";
2
+ /**
3
+ * Internal shared header row (DC-D1): icon box, kicker over title, toggle
4
+ * slot. Composed by `DiagramCard` and (DC-2) by `DiagramZoneHeader`, so
5
+ * zone and card headers cannot diverge in size, spacing or typography.
6
+ * Not a public export: exercised through `DiagramCard`.
7
+ */
8
+ interface DiagramCardHeaderProps {
9
+ kicker: readonly LaidOutLine[];
10
+ title: readonly LaidOutLine[];
11
+ iconName?: string;
12
+ iconGlyph?: DiagramGlyphPaths;
13
+ /** Width the title/kicker block may take (toggle-aware). */
14
+ headerTextWidth: number;
15
+ /**
16
+ * Header row height from the shared model (`headerSlotGeometry`, review
17
+ * pass 2 item 10): `max(icon 70, kicker+title)` with an icon, the bare
18
+ * kicker+title line boxes without one. Applied here as the row height so
19
+ * the Svelte header places the body exactly where `layoutCard` /
20
+ * `layoutZone` and the SVG renderers place it.
21
+ */
22
+ headerBlockHeight: number;
23
+ toggle?: {
24
+ collapsed: boolean;
25
+ label: string;
26
+ onToggle?: () => void;
27
+ };
28
+ /**
29
+ * Extra px the toggle slot is pulled up (zone expanded: the toggle sits
30
+ * at frame top + 10 while the header band starts at + 16, so −6).
31
+ */
32
+ toggleTopOffset?: number;
33
+ }
34
+ declare const DiagramCardHeader: import("svelte").Component<DiagramCardHeaderProps, {}, "">;
35
+ type DiagramCardHeader = ReturnType<typeof DiagramCardHeader>;
36
+ export default DiagramCardHeader;
37
+ //# sourceMappingURL=DiagramCardHeader.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiagramCardHeader.svelte.d.ts","sourceRoot":"","sources":["../src/lib/DiagramCardHeader.svelte.ts"],"names":[],"mappings":"AAKA,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;AA2DH,QAAA,MAAM,iBAAiB,4DAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}