@umami/shiso 1.12.0 → 1.13.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.
Files changed (121) hide show
  1. package/dist/chunks/App.js +76 -49
  2. package/dist/chunks/abnfDiagram-VCTEODGH.js +109 -0
  3. package/dist/chunks/arc.js +130 -0
  4. package/dist/chunks/architecture-7GRP2DOG.js +4 -0
  5. package/dist/chunks/architectureDiagram-5GKGNRK7.js +7466 -0
  6. package/dist/chunks/array.js +8 -0
  7. package/dist/chunks/blockDiagram-I7D4REHJ.js +2546 -0
  8. package/dist/chunks/c4Diagram-7LVT6UL2.js +3654 -0
  9. package/dist/chunks/channel.js +9 -0
  10. package/dist/chunks/chunk-2Q5K7J3B.js +21 -0
  11. package/dist/chunks/chunk-4HAMMTFA.js +6106 -0
  12. package/dist/chunks/chunk-5VM5RSS4.js +21 -0
  13. package/dist/chunks/chunk-75Z2AOVW.js +2185 -0
  14. package/dist/chunks/chunk-DU6HZSFF.js +8729 -0
  15. package/dist/chunks/chunk-F27PBJKO.js +95 -0
  16. package/dist/chunks/chunk-FOHPRMQF.js +27162 -0
  17. package/dist/chunks/chunk-GMAD6QVW.js +2369 -0
  18. package/dist/chunks/chunk-GVQU2GXP.js +58 -0
  19. package/dist/chunks/chunk-IMKFNOWR.js +2593 -0
  20. package/dist/chunks/chunk-JWPE2WC7.js +12 -0
  21. package/dist/chunks/chunk-L3NEJ4N5.js +420 -0
  22. package/dist/chunks/chunk-OSK3NFVY.js +1029 -0
  23. package/dist/chunks/chunk-P2QGCYS3.js +95 -0
  24. package/dist/chunks/chunk-POPQ4Y6H.js +33 -0
  25. package/dist/chunks/chunk-PWAF6VOD.js +467 -0
  26. package/dist/chunks/chunk-SHT3W25Y.js +4813 -0
  27. package/dist/chunks/chunk-SVP7TREG.js +686 -0
  28. package/dist/chunks/chunk-TICWLB2K.js +3800 -0
  29. package/dist/chunks/chunk-XXDRQBXY.js +12 -0
  30. package/dist/chunks/chunk-Y2CYZVJY.js +15 -0
  31. package/dist/chunks/classDiagram-ZZMXUADV.js +33 -0
  32. package/dist/chunks/classDiagram-v2-VYDZK3BY.js +33 -0
  33. package/dist/chunks/cose-bilkent-JH36ORCC.js +4268 -0
  34. package/dist/chunks/cynefin-OW5HDTMX.js +4 -0
  35. package/dist/chunks/cynefinDiagram-5FMLGOSQ.js +482 -0
  36. package/dist/chunks/cytoscape.esm.js +28282 -0
  37. package/dist/chunks/dagre-GXQ25YYZ.js +583 -0
  38. package/dist/chunks/dagre.js +4235 -0
  39. package/dist/chunks/defaultLocale.js +246 -0
  40. package/dist/chunks/diagram-S7CK7UJ4.js +402 -0
  41. package/dist/chunks/diagram-UQ7AKVKN.js +291 -0
  42. package/dist/chunks/diagram-VSXAHHWV.js +553 -0
  43. package/dist/chunks/diagram-VX7I27RA.js +798 -0
  44. package/dist/chunks/diagram-Z3DM3KII.js +186 -0
  45. package/dist/chunks/dist.js +92 -0
  46. package/dist/chunks/docs.js +987 -91
  47. package/dist/chunks/ebnfDiagram-PWID7BFC.js +123 -0
  48. package/dist/chunks/erDiagram-RLTQ6QDP.js +2295 -0
  49. package/dist/chunks/eventmodeling-NTZA5JFV.js +4 -0
  50. package/dist/chunks/flowDiagram-HODETNUW.js +17 -0
  51. package/dist/chunks/ganttDiagram-EL5Y4UJY.js +3928 -0
  52. package/dist/chunks/gitGraph-4MIJSDKK.js +4 -0
  53. package/dist/chunks/gitGraphDiagram-WWUBYQGX.js +1153 -0
  54. package/dist/chunks/graphlib.js +4194 -0
  55. package/dist/chunks/info-A6RAGUB7.js +4 -0
  56. package/dist/chunks/infoDiagram-27XIBGKW.js +25 -0
  57. package/dist/chunks/init.js +14 -0
  58. package/dist/chunks/ishikawaDiagram-5VMMS53U.js +971 -0
  59. package/dist/chunks/journeyDiagram-3NMN7TZE.js +1226 -0
  60. package/dist/chunks/kanban-definition-UXKFOSKX.js +1241 -0
  61. package/dist/chunks/katex.js +26463 -0
  62. package/dist/chunks/line.js +48 -0
  63. package/dist/chunks/linear.js +391 -0
  64. package/dist/chunks/mermaid-parser.core.js +754 -0
  65. package/dist/chunks/mermaid.core.js +4898 -0
  66. package/dist/chunks/mindmap-definition-YA3MSWOX.js +1309 -0
  67. package/dist/chunks/ordinal.js +84 -0
  68. package/dist/chunks/packet-AYTQ26CC.js +4 -0
  69. package/dist/chunks/path.js +106 -0
  70. package/dist/chunks/pegDiagram-XKGWAZYB.js +115 -0
  71. package/dist/chunks/pie-WAS4IAKB.js +4 -0
  72. package/dist/chunks/pieDiagram-E7YTZNPT.js +297 -0
  73. package/dist/chunks/quadrantDiagram-AXDQQJYC.js +2234 -0
  74. package/dist/chunks/radar-RG4KPBEZ.js +4 -0
  75. package/dist/chunks/railroad-74A4TZTK.js +4 -0
  76. package/dist/chunks/railroad-abnf-HS5TGJTU.js +4 -0
  77. package/dist/chunks/railroad-ebnf-LZEXJU2U.js +4 -0
  78. package/dist/chunks/railroad-peg-WCYAUIDC.js +4 -0
  79. package/dist/chunks/railroadDiagram-O6MQD6OU.js +89 -0
  80. package/dist/chunks/requirementDiagram-BXWQKSXE.js +2464 -0
  81. package/dist/chunks/rough.esm.js +1396 -0
  82. package/dist/chunks/sankeyDiagram-P5KCCOFB.js +1308 -0
  83. package/dist/chunks/sequenceDiagram-WJ2MYXX4.js +5445 -0
  84. package/dist/chunks/sizeCapture-INFHLROL.js +56 -0
  85. package/dist/chunks/src.js +2653 -0
  86. package/dist/chunks/stateDiagram-D77RDMKH.js +368 -0
  87. package/dist/chunks/stateDiagram-v2-MP3YSRHH.js +33 -0
  88. package/dist/chunks/swimlanes-42K2YHIH.js +6925 -0
  89. package/dist/chunks/swimlanesDiagram-VR7AAH4N.js +32 -0
  90. package/dist/chunks/timeline-definition-24CTP7MA.js +1507 -0
  91. package/dist/chunks/treeView-Q6P3EWNA.js +4 -0
  92. package/dist/chunks/treemap-WGGIJYW6.js +4 -0
  93. package/dist/chunks/vennDiagram-4TSXK5OY.js +2803 -0
  94. package/dist/chunks/wardley-WFR3VGLG.js +4 -0
  95. package/dist/chunks/wardleyDiagram-VM6X3IG4.js +877 -0
  96. package/dist/chunks/xychartDiagram-S5SC5T6Z.js +2698 -0
  97. package/dist/components.js +2 -2
  98. package/dist/entry-client.js +1 -1
  99. package/dist/entry-server.js +1 -1
  100. package/docs.schema.json +1 -1
  101. package/package.json +2 -1
  102. package/scripts/expand-navigation-globs.mjs +77 -8
  103. package/src/components/CodeBlock.tsx +36 -0
  104. package/src/components/Docs.tsx +44 -21
  105. package/src/components/OpenApiOperation.tsx +28 -20
  106. package/src/components/SideNav.tsx +8 -3
  107. package/src/components/docs/Changelog.tsx +163 -0
  108. package/src/components/docs/Mermaid.tsx +164 -0
  109. package/src/components/docs/Panel.tsx +23 -0
  110. package/src/components/docs/ParamField.tsx +17 -5
  111. package/src/components/docs/PropertiesTable.tsx +2 -2
  112. package/src/components/docs/ResponseField.tsx +17 -5
  113. package/src/components/docs/Tiles.tsx +59 -0
  114. package/src/components/docs/Tree.tsx +359 -0
  115. package/src/components/docs/Update.tsx +72 -0
  116. package/src/components/docs/index.ts +7 -0
  117. package/src/components/docs/panel-context.tsx +25 -0
  118. package/src/components/docs/styles.ts +49 -0
  119. package/src/components/icons/index.ts +4 -0
  120. package/src/lib/rehype-shiki.ts +18 -1
  121. package/types/components.d.ts +79 -0
@@ -0,0 +1,72 @@
1
+ import type { ReactNode } from 'react';
2
+ import { Badge } from './Badge';
3
+ import { styles } from './styles';
4
+ import { slugify } from './utils';
5
+
6
+ export interface UpdateRss {
7
+ title?: string;
8
+ description?: string;
9
+ }
10
+
11
+ export interface UpdateProps {
12
+ /** Left-hand label. Also creates the anchor id (slugified, like headings). */
13
+ label: string;
14
+ description?: ReactNode;
15
+ tags?: string[];
16
+ /**
17
+ * Mintlify compatibility: custom RSS title/description for this entry.
18
+ * Shiso does not generate an RSS feed yet; the prop is accepted and ignored.
19
+ */
20
+ rss?: UpdateRss;
21
+ children?: ReactNode;
22
+ }
23
+
24
+ function normalizeTags(tags: UpdateProps['tags']): string[] {
25
+ if (!Array.isArray(tags)) {
26
+ return [];
27
+ }
28
+
29
+ const seen = new Set<string>();
30
+ for (const tag of tags) {
31
+ if (typeof tag !== 'string') {
32
+ continue;
33
+ }
34
+ const trimmed = tag.trim();
35
+ if (trimmed && !seen.has(trimmed)) {
36
+ seen.add(trimmed);
37
+ }
38
+ }
39
+
40
+ return [...seen];
41
+ }
42
+
43
+ export function Update({ label, description, tags, rss: _rss, children }: UpdateProps) {
44
+ const id = slugify(label, 'update');
45
+ const normalizedTags = normalizeTags(tags);
46
+
47
+ return (
48
+ <section
49
+ id={id}
50
+ aria-label={label}
51
+ className={styles.update}
52
+ data-tags={normalizedTags.join(',')}
53
+ >
54
+ <div className={styles.updateMeta}>
55
+ <a href={`#${id}`} className={styles.updateLabel}>
56
+ {label}
57
+ </a>
58
+ {description ? <div className={styles.updateDescription}>{description}</div> : null}
59
+ {normalizedTags.length > 0 ? (
60
+ <div className={styles.updateTags}>
61
+ {normalizedTags.map(tag => (
62
+ <Badge key={tag} size="sm">
63
+ {tag}
64
+ </Badge>
65
+ ))}
66
+ </div>
67
+ ) : null}
68
+ </div>
69
+ <div className={styles.updateBody}>{children}</div>
70
+ </section>
71
+ );
72
+ }
@@ -3,16 +3,23 @@ export * from './Badge';
3
3
  export * from './Button';
4
4
  export * from './Callout';
5
5
  export * from './Card';
6
+ export * from './Changelog';
6
7
  export * from './CodeGroup';
7
8
  export * from './Columns';
8
9
  export * from './Expandable';
9
10
  export * from './Frame';
10
11
  export * from './Icon';
11
12
  export * from './Link';
13
+ export * from './Mermaid';
14
+ export * from './Panel';
15
+ export * from './panel-context';
12
16
  export * from './ParamField';
13
17
  export * from './PropertiesTable';
14
18
  export * from './ResponseField';
15
19
  export * from './Steps';
16
20
  export * from './Tabs';
21
+ export * from './Tiles';
17
22
  export * from './Tooltip';
23
+ export * from './Tree';
24
+ export * from './Update';
18
25
  export * from './ZoomableImage';
@@ -0,0 +1,25 @@
1
+ import { createContext, type ReactNode, useContext, useState } from 'react';
2
+
3
+ interface PanelContextValue {
4
+ content: ReactNode;
5
+ setContent: (content: ReactNode) => void;
6
+ }
7
+
8
+ const PanelContext = createContext<PanelContextValue>({
9
+ content: null,
10
+ setContent: () => {},
11
+ });
12
+
13
+ export function PanelProvider({ children }: { children: ReactNode }) {
14
+ const [content, setContent] = useState<ReactNode>(null);
15
+
16
+ return <PanelContext.Provider value={{ content, setContent }}>{children}</PanelContext.Provider>;
17
+ }
18
+
19
+ export function usePanelContent(): ReactNode {
20
+ return useContext(PanelContext).content;
21
+ }
22
+
23
+ export function useSetPanelContent(): (content: ReactNode) => void {
24
+ return useContext(PanelContext).setContent;
25
+ }
@@ -68,6 +68,8 @@ export const styles = {
68
68
  'relative mt-3 px-4 pb-1 text-center text-sm leading-5 text-muted-foreground [&_p]:m-0 [&_a]:font-semibold',
69
69
 
70
70
  field: 'my-3',
71
+ fieldGroup:
72
+ 'my-4 divide-y divide-border overflow-hidden rounded-lg border border-border text-sm leading-6 [&>[data-slot=field-group-item]]:my-0 [&>[data-slot=field-group-item]]:px-4 [&>[data-slot=field-group-item]]:py-3 [&_[data-slot=field-group-body]]:mt-2 [&_[data-slot=field-group-type]]:text-xs',
71
73
  paramField: 'my-3',
72
74
  fieldHeader: 'flex flex-wrap items-center gap-2',
73
75
  fieldBody: 'mt-3',
@@ -84,4 +86,51 @@ export const styles = {
84
86
 
85
87
  tooltipTrigger:
86
88
  'peer cursor-help border-0 border-muted-foreground border-b border-dotted bg-transparent p-0 text-inherit [font:inherit]',
89
+
90
+ update:
91
+ 'my-8 grid scroll-mt-24 grid-cols-1 gap-4 border-border border-t pt-6 md:grid-cols-[220px_minmax(0,1fr)]',
92
+ updateMeta: 'flex min-w-0 flex-col items-start gap-2 md:sticky md:top-24 md:self-start',
93
+ updateLabel:
94
+ 'w-fit text-lg font-semibold text-foreground hover:text-primary hover:underline [&:hover]:decoration-primary',
95
+ updateDescription: 'text-sm text-muted-foreground leading-6',
96
+ updateTags: 'flex flex-wrap gap-1.5',
97
+ updateBody: 'min-w-0 [&>:first-child]:mt-0 [&>:last-child]:mb-0 [&_:where(p,ul,ol)]:leading-7',
98
+ changelog: 'my-4 flex flex-col',
99
+ changelogFilters: 'mb-2 flex flex-wrap items-center gap-1',
100
+ changelogFilterButton:
101
+ 'rounded-md p-0.5 outline-none focus-visible:ring-2 focus-visible:ring-ring [&>[data-slot=badge]]:cursor-pointer',
102
+ changelogClear:
103
+ 'ml-1 text-xs font-medium text-muted-foreground hover:text-foreground hover:underline',
104
+ changelogEmpty: 'my-6 text-sm text-muted-foreground',
105
+
106
+ mermaid: 'my-4',
107
+ mermaidTitle: 'mb-2 text-sm font-semibold text-foreground',
108
+ mermaidViewport:
109
+ 'relative overflow-auto rounded-lg border border-border bg-card p-4 [&_svg]:mx-auto [&_svg]:max-w-full [&_svg]:shrink-0',
110
+ mermaidSvg: 'origin-top-left transition-transform duration-150 [&_svg]:h-auto [&_svg]:max-w-none',
111
+ mermaidFallback: 'bg-transparent p-0 font-mono text-xs text-muted-foreground whitespace-pre-wrap',
112
+ mermaidError: 'mt-2 text-sm text-destructive',
113
+ mermaidControls:
114
+ 'absolute flex items-center gap-1 rounded-md border border-border bg-background/90 p-1 shadow-sm [&_button]:flex [&_button]:size-6 [&_button]:items-center [&_button]:justify-center [&_button]:rounded [&_button]:text-sm [&_button]:text-muted-foreground [&_button:hover]:bg-muted [&_button:hover]:text-foreground',
115
+
116
+ panel: 'flex min-w-0 flex-col gap-4 text-sm [&>:first-child]:mt-0 [&>:last-child]:mb-0',
117
+ panelInline: 'my-4 lg:hidden',
118
+
119
+ tile: 'block h-full overflow-hidden rounded-lg border border-border bg-card hover:border-primary',
120
+ tilePreview:
121
+ 'flex h-36 items-center justify-center gap-2 overflow-hidden border-border border-b bg-muted/40 bg-[radial-gradient(circle_at_1px_1px,var(--border)_1px,transparent_0)] bg-[size:16px_16px] p-4 [&_img]:max-h-full [&_img]:w-auto [&_img]:max-w-full [&_img]:object-contain',
122
+ tileBody: 'flex flex-col gap-1 p-4',
123
+ tileTitle: 'text-sm font-semibold text-foreground',
124
+ tileDescription: 'text-sm text-muted-foreground leading-6',
125
+
126
+ tree: 'not-prose my-4 overflow-hidden rounded-lg border border-border bg-card text-sm',
127
+ treeList: 'flex flex-col gap-0.5 p-3',
128
+ treeGroup: 'my-0 ml-[15px] flex list-none flex-col gap-px border-border border-l pl-1',
129
+ treeItem: 'my-0 min-w-0 list-none p-0 [&::marker]:content-none',
130
+ treeRow:
131
+ 'flex w-full min-w-0 items-center gap-1.5 rounded-md px-2 py-1 text-left text-foreground hover:bg-muted [&:focus-visible]:bg-muted [&:focus-visible]:ring-2 [&:focus-visible]:ring-ring [&:focus-visible]:outline-none',
132
+ treeChevron: 'shrink-0 text-muted-foreground transition-transform [&[data-open]]:rotate-90',
133
+ treeIcon: 'shrink-0 text-muted-foreground',
134
+ treeName: 'min-w-0 flex-1 truncate font-mono text-[0.85rem]',
135
+ treeHighlight: 'bg-primary/10 text-primary [&_svg]:text-primary',
87
136
  } as const;
@@ -3,11 +3,15 @@ export {
3
3
  ArrowRight,
4
4
  Check,
5
5
  Check as CheckIcon,
6
+ ChevronDown,
6
7
  ChevronRight,
7
8
  CircleAlert,
8
9
  Copy,
9
10
  ExternalLink,
11
+ File,
10
12
  FileText,
13
+ Folder,
14
+ FolderOpen,
11
15
  Hand,
12
16
  Info as InfoIcon,
13
17
  Lightbulb,
@@ -133,8 +133,25 @@ async function highlightBlock(pre: MdNode, code: MdNode, config: ResolvedCodeBlo
133
133
  ? codeProperties.className.map(String)
134
134
  : [];
135
135
  const requested = classes.map(value => value.match(/^language-(\S+)$/)?.[1]).find(Boolean);
136
- const lang = resolveLanguage(requested);
137
136
  const meta = parseCodeMeta(typeof code.data?.meta === 'string' ? code.data.meta : '');
137
+
138
+ // Mermaid diagrams render client-side via the <Mermaid> component; keep the
139
+ // raw definition so CodeBlock can hand it over untouched.
140
+ if (requested === 'mermaid') {
141
+ const metaRaw = typeof code.data?.meta === 'string' ? code.data.meta : '';
142
+ const placement = metaRaw.match(/placement=["'](top-left|top-right|bottom-left|bottom-right)["']/)?.[1];
143
+ const actions = metaRaw.match(/actions=\{(true|false)\}/)?.[1];
144
+ pre.properties = {
145
+ ...(pre.properties as Properties),
146
+ 'data-language': 'mermaid',
147
+ ...(meta.title ? { 'data-title': meta.title } : {}),
148
+ ...(placement ? { 'data-placement': placement } : {}),
149
+ ...(actions ? { 'data-actions': actions } : {}),
150
+ };
151
+ return;
152
+ }
153
+
154
+ const lang = resolveLanguage(requested);
138
155
  // mdast-util-to-hast appends a trailing newline to the code text.
139
156
  const source = toText(code).replace(/\n$/, '');
140
157
 
@@ -211,6 +211,85 @@ export interface TooltipProps {
211
211
 
212
212
  export declare function Tooltip(props: TooltipProps): ReactElement;
213
213
 
214
+ export interface UpdateRss {
215
+ title?: string;
216
+ description?: string;
217
+ }
218
+
219
+ export interface UpdateProps {
220
+ label: string;
221
+ description?: ReactNode;
222
+ tags?: string[];
223
+ rss?: UpdateRss;
224
+ children?: ReactNode;
225
+ }
226
+
227
+ export declare function Update(props: UpdateProps): ReactElement;
228
+
229
+ export interface ChangelogProps {
230
+ children?: ReactNode;
231
+ }
232
+
233
+ export declare function Changelog(props: ChangelogProps): ReactElement;
234
+
235
+ export type MermaidPlacement = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
236
+
237
+ export interface MermaidProps {
238
+ chart?: string;
239
+ title?: ReactNode;
240
+ actions?: boolean;
241
+ placement?: MermaidPlacement;
242
+ children?: ReactNode;
243
+ }
244
+
245
+ export declare function Mermaid(props: MermaidProps): ReactElement;
246
+
247
+ export interface PanelProps {
248
+ children?: ReactNode;
249
+ }
250
+
251
+ export declare function Panel(props: PanelProps): ReactElement;
252
+
253
+ export interface TileProps {
254
+ href: string;
255
+ title?: ReactNode;
256
+ description?: ReactNode;
257
+ children: ReactNode;
258
+ target?: '_self' | '_blank';
259
+ }
260
+
261
+ export interface TilesProps {
262
+ children?: ReactNode;
263
+ cols?: 1 | 2 | 3 | 4;
264
+ }
265
+
266
+ export declare function Tile(props: TileProps): ReactElement;
267
+ export declare function Tiles(props: TilesProps): ReactElement;
268
+
269
+ export interface TreeFolderProps {
270
+ name: string;
271
+ defaultOpen?: boolean;
272
+ openable?: boolean;
273
+ highlight?: boolean;
274
+ children?: ReactNode;
275
+ }
276
+
277
+ export interface TreeFileProps {
278
+ name: string;
279
+ highlight?: boolean;
280
+ }
281
+
282
+ export interface TreeProps {
283
+ children?: ReactNode;
284
+ style?: React.CSSProperties;
285
+ className?: string;
286
+ }
287
+
288
+ export declare function Tree(props: TreeProps): ReactElement;
289
+ export declare function FileTree(props: TreeProps): ReactElement;
290
+ export declare function TreeFolder(props: TreeFolderProps): ReactElement;
291
+ export declare function TreeFile(props: TreeFileProps): ReactElement;
292
+
214
293
  export interface ZoomableImageProps extends ImgHTMLAttributes<HTMLImageElement> {
215
294
  noZoom?: boolean;
216
295
  }