Skip to content

Commit 6b2efdd

Browse files
committed
Cila: Home page MDX rewrite, Mermaid mobile touch fix, AsciinemaPlayer cols tuning, MDX list style isolation
1 parent cda1a35 commit 6b2efdd

8 files changed

Lines changed: 37 additions & 20 deletions

File tree

www/public/openapi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"openapi": "3.1.0",
33
"info": {
44
"title": "phantom-daemon",
5-
"version": "1.0.0"
5+
"version": "1.0.5"
66
},
77
"paths": {
88
"/api/core/backup/export": {

www/src/pages/docs/api/pages/index/index.en.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ Technical reference for the endpoints served by ***Phantom Daemon*** over Unix D
1313
A -->|"UDS"| D["Phantom Daemon"]
1414
`} />
1515

16-
<Mermaid chart={`flowchart
17-
Q["Request"] -->|"UDS · daemon.sock"| D["Phantom Daemon"]
18-
`} />
19-
2016
<InlineNotification
2117
kind="info"
2218
title="Modular Architecture"
@@ -27,4 +23,10 @@ Technical reference for the endpoints served by ***Phantom Daemon*** over Unix D
2723

2824
---
2925

26+
## Daemon OpenAPI Reference
27+
28+
<Mermaid chart={`flowchart
29+
Q["Request"] -->|"UDS · daemon.sock"| D["Phantom Daemon"]
30+
`} />
31+
3032
<OpenApiDoc />

www/src/pages/docs/api/pages/index/index.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ import { InlineNotification } from '@carbon/react';
1313
A -->|"UDS"| D["Phantom Daemon"]
1414
`} />
1515

16-
<Mermaid chart={`flowchart
17-
Q["Sorgu"] -->|"UDS · daemon.sock"| D["Phantom Daemon"]
18-
`} />
19-
2016
<InlineNotification
2117
kind="info"
2218
title="Modüler Mimari"
@@ -27,4 +23,10 @@ import { InlineNotification } from '@carbon/react';
2723

2824
---
2925

26+
## Daemon OpenAPI Reference
27+
28+
<Mermaid chart={`flowchart
29+
Q["Request"] -->|"UDS · daemon.sock"| D["Phantom Daemon"]
30+
`} />
31+
3032
<OpenApiDoc />

www/src/pages/docs/home/pages/index/index.en.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ When the service starts, kernel state (nftables rules, routing policies) is rebu
7979
curl -sSL get.phantom.tc | bash
8080
```
8181

82-
<AsciinemaPlayer src="/assets/phantom-wg-install.cast" />
82+
<AsciinemaPlayer src="/assets/phantom-wg-install.cast" cols={160} />
8383

8484
### Configuration
8585

www/src/pages/docs/home/pages/index/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Servis başlatıldığında kernel state (nftables kuralları, routing policy'le
7979
curl -sSL get.phantom.tc | bash
8080
```
8181

82-
<AsciinemaPlayer src="/assets/phantom-wg-install.cast" />
82+
<AsciinemaPlayer src="/assets/phantom-wg-install.cast" cols={160} />
8383

8484
### Yapılandırma
8585

www/src/shared/components/content/styles/MDXContent.scss

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,23 @@
3131
margin-bottom: spacing.$spacing-05;
3232
}
3333

34-
ul, ol {
34+
> ul, > ol {
3535
@include type.type-style('body-01');
3636
color: var(--cds-text-secondary);
3737
margin-bottom: spacing.$spacing-05;
3838
padding-left: spacing.$spacing-07;
3939
}
4040

41-
ul {
41+
> ul {
4242
list-style-type: disc;
4343
}
4444

45-
ol {
45+
> ol {
4646
list-style-type: decimal;
4747
}
4848

49-
li {
49+
> ul > li,
50+
> ol > li {
5051
margin-bottom: spacing.$spacing-03;
5152
}
5253

www/src/shared/components/visualization/Mermaid.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ const MermaidInner: React.FC<MermaidProps> = ({ chart }) => {
5050
const MAX_ZOOM = 2;
5151
const MIN_ZOOM = 0.5;
5252
const MAX_PAN = 300;
53+
const MOBILE_BREAKPOINT = 672;
54+
55+
const [isMobile, setIsMobile] = useState(false);
56+
57+
useEffect(() => {
58+
const mq = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT}px)`);
59+
setIsMobile(mq.matches);
60+
const handler = (e: MediaQueryListEvent) => setIsMobile(e.matches);
61+
mq.addEventListener('change', handler);
62+
return () => mq.removeEventListener('change', handler);
63+
}, []);
5364

5465
const getCurrentTheme = useCallback((): 'neutral' | 'dark' => {
5566
const carbonTheme = document.documentElement.getAttribute('data-carbon-theme');
@@ -495,11 +506,13 @@ const MermaidInner: React.FC<MermaidProps> = ({ chart }) => {
495506
onMouseMove={handleMouseMove}
496507
onMouseUp={handleMouseUp}
497508
onMouseLeave={handleMouseLeave}
498-
onTouchStart={handleTouchStart}
499-
onTouchMove={handleTouchMove}
500-
onTouchEnd={handleTouchEnd}
509+
{...(!isMobile && {
510+
onTouchStart: handleTouchStart,
511+
onTouchMove: handleTouchMove,
512+
onTouchEnd: handleTouchEnd,
513+
})}
501514
style={{
502-
cursor: loadingState === 'success' ? (isDragging ? 'grabbing' : 'grab') : 'default',
515+
cursor: loadingState === 'success' && !isMobile ? (isDragging ? 'grabbing' : 'grab') : 'default',
503516
display: loadingState === 'success' ? 'flex' : 'none',
504517
...(containerHeight && {
505518
height: `${containerHeight}px`,

www/src/shared/components/visualization/styles/AsciinemaPlayer.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@use '@carbon/react/scss/spacing' as sp;
22

33
.asciinema-player-wrapper {
4-
max-width: 820px;
54
margin-bottom: sp.$spacing-07;
65
border-radius: 8px;
76
overflow: hidden;

0 commit comments

Comments
 (0)