@clidey/dory 0.1.0 → 0.3.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/README.md +1 -1
- package/docs/api-playground-demo.mdx +119 -0
- package/docs/api-reference/openapi.json +366 -0
- package/docs/api-reference/operations/create.mdx +5 -0
- package/docs/api-reference/operations/delete.mdx +5 -0
- package/docs/api-reference/operations/get.mdx +5 -0
- package/docs/api-reference/operations/update.mdx +5 -0
- package/docs/assets/dory.jpeg +0 -0
- package/docs/dory.json +12 -131
- package/docs/favicon.svg +75 -0
- package/docs/features.mdx +440 -0
- package/docs/introduction.mdx +44 -0
- package/docs/logo/logo.png +0 -0
- package/package.json +9 -10
- package/src/mdx/fence.tsx +2 -1
- package/src/mdx/mermaid.tsx +39 -11
- package/src/mdx/source.tsx +15 -4
- package/docs/README.md +0 -2
- package/docs/configuration/app-settings/feature-flags.mdx +0 -157
- package/docs/configuration/app-settings/user-settings.mdx +0 -201
- package/docs/configuration/installation-setup/env-vars.mdx +0 -198
- package/docs/configuration/installation-setup/installation.mdx +0 -127
- package/docs/integrations/analytics-monitoring/error-tracking.mdx +0 -199
- package/docs/integrations/analytics-monitoring/notifications.mdx +0 -189
- package/docs/integrations/analytics-monitoring/user-analytics.mdx +0 -182
- package/docs/integrations/shopify-integration/shopify-setup.mdx +0 -226
- package/docs/integrations/shopify-integration/shopify-webhooks.mdx +0 -207
- package/docs/overview/developer-overview/dev-architecture.mdx +0 -292
- package/docs/overview/product-intro/app-overview.mdx +0 -167
- package/docs/overview/product-intro/architecture.mdx +0 -203
- package/docs/overview/product-intro/core-concepts.mdx +0 -267
- package/docs/platform-admin/billing-subscriptions/billing.mdx +0 -176
- package/docs/platform-admin/system-maintenance/db-migrations.mdx +0 -184
- package/docs/platform-admin/system-maintenance/health-monitoring.mdx +0 -222
- package/docs/platform-admin/system-maintenance/queue-management.mdx +0 -234
- package/docs/platform-admin/user-team-management/teams.mdx +0 -170
- package/docs/platform-admin/user-team-management/users.mdx +0 -185
- package/docs/support/legal/dependency-analysis.mdx +0 -132
- package/docs/support/legal/privacy-terms.mdx +0 -73
- package/docs/support/troubleshooting/common-issues.mdx +0 -159
- package/docs/usage/api-usage/api-inventory.mdx +0 -213
- package/docs/usage/api-usage/api-products.mdx +0 -249
- package/docs/usage/api-usage/api-purchase-orders.mdx +0 -289
- package/docs/usage/api-usage/api-reports.mdx +0 -227
- package/docs/usage/api-usage/api-suppliers.mdx +0 -171
- package/docs/usage/api-usage/api-user-management.mdx +0 -171
- package/docs/usage/ui-workflows/bundles.mdx +0 -157
- package/docs/usage/ui-workflows/demand-planning.mdx +0 -210
- package/docs/usage/ui-workflows/favorites.mdx +0 -167
- package/docs/usage/ui-workflows/inventory-management.mdx +0 -179
- package/docs/usage/ui-workflows/onboarding.mdx +0 -215
- package/docs/usage/ui-workflows/purchase-orders.mdx +0 -200
- package/docs/usage/ui-workflows/reports.mdx +0 -257
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Features'
|
|
3
|
+
description: 'Overview of available components and features'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Headings Examples
|
|
7
|
+
|
|
8
|
+
```mdx
|
|
9
|
+
# Heading 1
|
|
10
|
+
```
|
|
11
|
+
# Heading 1
|
|
12
|
+
|
|
13
|
+
```mdx
|
|
14
|
+
## Heading 2
|
|
15
|
+
```
|
|
16
|
+
# Heading 2
|
|
17
|
+
|
|
18
|
+
```mdx
|
|
19
|
+
### Heading 3
|
|
20
|
+
```
|
|
21
|
+
# Heading 3
|
|
22
|
+
```mdx
|
|
23
|
+
#### Heading 4
|
|
24
|
+
```
|
|
25
|
+
# Heading 4
|
|
26
|
+
```mdx
|
|
27
|
+
##### Heading 5
|
|
28
|
+
```
|
|
29
|
+
# Heading 5
|
|
30
|
+
```mdx
|
|
31
|
+
###### Heading 6
|
|
32
|
+
```
|
|
33
|
+
# Heading 6
|
|
34
|
+
|
|
35
|
+
<br />
|
|
36
|
+
|
|
37
|
+
## Lists Examples
|
|
38
|
+
|
|
39
|
+
```mdx
|
|
40
|
+
- List item 1
|
|
41
|
+
- List item 2
|
|
42
|
+
- List item 3
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- List item 1
|
|
46
|
+
- List item 2
|
|
47
|
+
- List item 3
|
|
48
|
+
|
|
49
|
+
```mdx
|
|
50
|
+
1. List item 1
|
|
51
|
+
2. List item 2
|
|
52
|
+
3. List item 3
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
1. List item 1
|
|
56
|
+
2. List item 2
|
|
57
|
+
3. List item 3
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
<br />
|
|
62
|
+
|
|
63
|
+
### Images
|
|
64
|
+
|
|
65
|
+
```mdx
|
|
66
|
+
<img src="./assets/dory.jpeg" alt="Example image" className="object-cover w-64 h-64" />
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
<img src="./assets/dory.jpeg" alt="Example image" className="object-cover w-64 h-64" />
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
<br />
|
|
73
|
+
<br />
|
|
74
|
+
<br />
|
|
75
|
+
|
|
76
|
+
## Code Components
|
|
77
|
+
|
|
78
|
+
### Code Block
|
|
79
|
+
```typescript
|
|
80
|
+
function example() {
|
|
81
|
+
return "Hello World";
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Code Group Block
|
|
86
|
+
|
|
87
|
+
<CodeGroup>
|
|
88
|
+
```typescript
|
|
89
|
+
function example(): string {
|
|
90
|
+
return "Hello World";
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
```javascript
|
|
94
|
+
function example() {
|
|
95
|
+
return "Hello World";
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
</CodeGroup>
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
<br />
|
|
102
|
+
<br />
|
|
103
|
+
<br />
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## Interactive Components
|
|
107
|
+
|
|
108
|
+
### Mermaid
|
|
109
|
+
|
|
110
|
+
```mdx
|
|
111
|
+
mermaid
|
|
112
|
+
graph TD
|
|
113
|
+
|
|
114
|
+
%% Main Start
|
|
115
|
+
Start([Start Process]) --> Validate[Validate Input]
|
|
116
|
+
|
|
117
|
+
%% Decision Point
|
|
118
|
+
Validate -->|Valid| ProcessData{Is Data Clean?}
|
|
119
|
+
Validate -->|Invalid| Error[Show Error Message]
|
|
120
|
+
|
|
121
|
+
%% Clean Data Branch
|
|
122
|
+
ProcessData -->|Yes| Clean[Clean Data]
|
|
123
|
+
Clean --> Analyze[Analyze Data]
|
|
124
|
+
|
|
125
|
+
%% Dirty Data Branch
|
|
126
|
+
ProcessData -->|No| Notify[Notify User]
|
|
127
|
+
Notify --> Wait[Wait for Input]
|
|
128
|
+
Wait --> Validate
|
|
129
|
+
|
|
130
|
+
%% Parallel Branches After Analysis
|
|
131
|
+
Analyze --> Split1 & Split2
|
|
132
|
+
|
|
133
|
+
subgraph Parallel Tasks
|
|
134
|
+
Split1[Generate Report] --> Merge
|
|
135
|
+
Split2[Update Dashboard] --> Merge
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
Merge --> Decision2{Is More Input Needed?}
|
|
139
|
+
Decision2 -->|Yes| WaitMore[Wait for More Input]
|
|
140
|
+
WaitMore --> Validate
|
|
141
|
+
Decision2 -->|No| End([End Process])
|
|
142
|
+
|
|
143
|
+
%% Style and Class Definitions
|
|
144
|
+
classDef decision fill:#f9f,stroke:#333,stroke-width:2px;
|
|
145
|
+
class ProcessData,Decision2 decision;
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
<strong>
|
|
150
|
+
<p>Note: Mermaid should be inside a code block with type "mermaid"</p>
|
|
151
|
+
</strong>
|
|
152
|
+
|
|
153
|
+
```mermaid
|
|
154
|
+
graph TD
|
|
155
|
+
|
|
156
|
+
%% Main Start
|
|
157
|
+
Start([Start Process]) --> Validate[Validate Input]
|
|
158
|
+
|
|
159
|
+
%% Decision Point
|
|
160
|
+
Validate -->|Valid| ProcessData{Is Data Clean?}
|
|
161
|
+
Validate -->|Invalid| Error[Show Error Message]
|
|
162
|
+
|
|
163
|
+
%% Clean Data Branch
|
|
164
|
+
ProcessData -->|Yes| Clean[Clean Data]
|
|
165
|
+
Clean --> Analyze[Analyze Data]
|
|
166
|
+
|
|
167
|
+
%% Dirty Data Branch
|
|
168
|
+
ProcessData -->|No| Notify[Notify User]
|
|
169
|
+
Notify --> Wait[Wait for Input]
|
|
170
|
+
Wait --> Validate
|
|
171
|
+
|
|
172
|
+
%% Parallel Branches After Analysis
|
|
173
|
+
Analyze --> Split1 & Split2
|
|
174
|
+
|
|
175
|
+
subgraph Parallel Tasks
|
|
176
|
+
Split1[Generate Report] --> Merge
|
|
177
|
+
Split2[Update Dashboard] --> Merge
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
Merge --> Decision2{Is More Input Needed?}
|
|
181
|
+
Decision2 -->|Yes| WaitMore[Wait for More Input]
|
|
182
|
+
WaitMore --> Validate
|
|
183
|
+
Decision2 -->|No| End([End Process])
|
|
184
|
+
|
|
185
|
+
%% Style and Class Definitions
|
|
186
|
+
classDef decision fill:#f9f,stroke:#333,stroke-width:2px;
|
|
187
|
+
class ProcessData,Decision2 decision;
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Accordion
|
|
192
|
+
|
|
193
|
+
```mdx
|
|
194
|
+
<AccordionGroup>
|
|
195
|
+
<Accordion title="First Section" icon="DocumentIcon">
|
|
196
|
+
This is the content of the first accordion section.
|
|
197
|
+
</Accordion>
|
|
198
|
+
<Accordion title="Second Section" icon="CodeBracketIcon">
|
|
199
|
+
This is the content of the second accordion section.
|
|
200
|
+
</Accordion>
|
|
201
|
+
</AccordionGroup>
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
<AccordionGroup>
|
|
205
|
+
<Accordion title="First Section" icon="DocumentIcon">
|
|
206
|
+
This is the content of the first accordion section.
|
|
207
|
+
</Accordion>
|
|
208
|
+
<Accordion title="Second Section" icon="CodeBracketIcon">
|
|
209
|
+
This is the content of the second accordion section.
|
|
210
|
+
</Accordion>
|
|
211
|
+
</AccordionGroup>
|
|
212
|
+
|
|
213
|
+
### Callouts
|
|
214
|
+
|
|
215
|
+
```mdx
|
|
216
|
+
<Note>
|
|
217
|
+
This is a note callout with important information.
|
|
218
|
+
</Note>
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
<Note>
|
|
222
|
+
This is a note callout with important information.
|
|
223
|
+
</Note>
|
|
224
|
+
|
|
225
|
+
```mdx
|
|
226
|
+
<Warning>
|
|
227
|
+
This is a warning callout for critical information.
|
|
228
|
+
</Warning>
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
<Warning>
|
|
232
|
+
This is a warning callout for critical information.
|
|
233
|
+
</Warning>
|
|
234
|
+
|
|
235
|
+
```mdx
|
|
236
|
+
<Info>
|
|
237
|
+
This is an info callout for general information.
|
|
238
|
+
</Info>
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
<Info>
|
|
242
|
+
This is an info callout for general information.
|
|
243
|
+
</Info>
|
|
244
|
+
|
|
245
|
+
```mdx
|
|
246
|
+
<Tip>
|
|
247
|
+
This is a tip callout for helpful suggestions.
|
|
248
|
+
</Tip>
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
<Tip>
|
|
252
|
+
This is a tip callout for helpful suggestions.
|
|
253
|
+
</Tip>
|
|
254
|
+
|
|
255
|
+
```mdx
|
|
256
|
+
<Check>
|
|
257
|
+
This is a check callout for completed items.
|
|
258
|
+
</Check>
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
<Check>
|
|
262
|
+
This is a check callout for completed items.
|
|
263
|
+
</Check>
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
<br />
|
|
267
|
+
|
|
268
|
+
### Cards
|
|
269
|
+
```mdx
|
|
270
|
+
<CardGroup cols={2}>
|
|
271
|
+
<Card
|
|
272
|
+
title="Example Card"
|
|
273
|
+
description="This is an example card component with an icon and title."
|
|
274
|
+
icon="FileText"
|
|
275
|
+
href="#"
|
|
276
|
+
/>
|
|
277
|
+
<Card
|
|
278
|
+
title="Another Card"
|
|
279
|
+
description="This is another example card with different content."
|
|
280
|
+
icon="Code"
|
|
281
|
+
href="#"
|
|
282
|
+
/>
|
|
283
|
+
</CardGroup>
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
<CardGroup cols={2}>
|
|
287
|
+
<Card
|
|
288
|
+
title="Example Card"
|
|
289
|
+
description="This is an example card component with an icon and title."
|
|
290
|
+
icon="FileText"
|
|
291
|
+
href="#"
|
|
292
|
+
/>
|
|
293
|
+
<Card
|
|
294
|
+
title="Another Card"
|
|
295
|
+
description="This is another example card with different content."
|
|
296
|
+
icon="Code"
|
|
297
|
+
href="#"
|
|
298
|
+
/>
|
|
299
|
+
</CardGroup>
|
|
300
|
+
|
|
301
|
+
<br />
|
|
302
|
+
|
|
303
|
+
### Expandable
|
|
304
|
+
|
|
305
|
+
```mdx
|
|
306
|
+
<Expandable title="Click to Expand">
|
|
307
|
+
This is an expandable section that can be toggled.
|
|
308
|
+
</Expandable>
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
<Expandable title="Click to Expand">
|
|
312
|
+
This is an expandable section that can be toggled.
|
|
313
|
+
</Expandable>
|
|
314
|
+
|
|
315
|
+
### Source
|
|
316
|
+
|
|
317
|
+
```mdx
|
|
318
|
+
<Source url="https://github.com/clidey/dory" paths={[
|
|
319
|
+
{ path: "src/mdx/source.tsx", range: "1-46" },
|
|
320
|
+
{ path: "docs/features.mdx", range: "318-322" },
|
|
321
|
+
]} />
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
<Source url="https://github.com/clidey/dory" paths={[
|
|
325
|
+
{ path: "src/mdx/source.tsx", range: "1-46" },
|
|
326
|
+
{ path: "docs/features.mdx", range: "318-322" },
|
|
327
|
+
]} />
|
|
328
|
+
|
|
329
|
+
<br />
|
|
330
|
+
<br />
|
|
331
|
+
<br />
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
## Special Components
|
|
335
|
+
|
|
336
|
+
### Grids
|
|
337
|
+
|
|
338
|
+
#### Rows
|
|
339
|
+
```mdx
|
|
340
|
+
<Row cols={2}>
|
|
341
|
+
<Icon icon="FileText" />
|
|
342
|
+
<Icon icon="CheckCircle" />
|
|
343
|
+
</Row>
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
<Row cols={2}>
|
|
347
|
+
<Icon icon="FileText" />
|
|
348
|
+
<Icon icon="CheckCircle" />
|
|
349
|
+
</Row>
|
|
350
|
+
|
|
351
|
+
<br />
|
|
352
|
+
|
|
353
|
+
#### Columns
|
|
354
|
+
|
|
355
|
+
```mdx
|
|
356
|
+
<Col>
|
|
357
|
+
<Icon icon="FileText" />
|
|
358
|
+
<Icon icon="FileText" />
|
|
359
|
+
</Col>
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
<Col>
|
|
363
|
+
<Icon icon="FileText" />
|
|
364
|
+
<Icon icon="FileText" />
|
|
365
|
+
</Col>
|
|
366
|
+
|
|
367
|
+
<br />
|
|
368
|
+
<br />
|
|
369
|
+
<br />
|
|
370
|
+
|
|
371
|
+
### Latex
|
|
372
|
+
|
|
373
|
+
```mdx
|
|
374
|
+
<Latex>
|
|
375
|
+
E = mc^2
|
|
376
|
+
</Latex>
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
<Latex>
|
|
380
|
+
E = mc^2
|
|
381
|
+
</Latex>
|
|
382
|
+
|
|
383
|
+
<br />
|
|
384
|
+
<br />
|
|
385
|
+
<br />
|
|
386
|
+
|
|
387
|
+
### Tables
|
|
388
|
+
|
|
389
|
+
```mdx
|
|
390
|
+
| Property | Description |
|
|
391
|
+
| -------- | ------------------------------------- |
|
|
392
|
+
| Name | Full name of user |
|
|
393
|
+
| Age | Reported age |
|
|
394
|
+
| Joined | Whether the user joined the community |
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
| Property | Description |
|
|
398
|
+
| -------- | ------------------------------------- |
|
|
399
|
+
| Name | Full name of user |
|
|
400
|
+
| Age | Reported age |
|
|
401
|
+
| Joined | Whether the user joined the community |
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
### Steps
|
|
405
|
+
|
|
406
|
+
```mdx
|
|
407
|
+
<Steps>
|
|
408
|
+
<Step title="First Step">
|
|
409
|
+
This is the first step in the process.
|
|
410
|
+
</Step>
|
|
411
|
+
<Step title="Second Step">
|
|
412
|
+
This is the second step in the process.
|
|
413
|
+
</Step>
|
|
414
|
+
</Steps>
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
<Steps>
|
|
418
|
+
<Step title="First Step">
|
|
419
|
+
This is the first step in the process.
|
|
420
|
+
</Step>
|
|
421
|
+
<Step title="Second Step">
|
|
422
|
+
This is the second step in the process.
|
|
423
|
+
</Step>
|
|
424
|
+
</Steps>
|
|
425
|
+
|
|
426
|
+
### Icons
|
|
427
|
+
|
|
428
|
+
```mdx
|
|
429
|
+
<Col rows={2}>
|
|
430
|
+
<Icon icon="Code" />
|
|
431
|
+
<Icon icon="FileText" />
|
|
432
|
+
<Icon icon="CheckCircle" />
|
|
433
|
+
</Col>
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
<Row cols={3}>
|
|
437
|
+
<Icon icon="Code" />
|
|
438
|
+
<Icon icon="FileText" />
|
|
439
|
+
<Icon icon="CheckCircle" />
|
|
440
|
+
</Row>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Introduction'
|
|
3
|
+
description: 'Welcome to Docucod and Dory documentation'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Introduction
|
|
7
|
+
|
|
8
|
+
## Welcome to Docucod and Dory
|
|
9
|
+
|
|
10
|
+
This documentation is powered by two complementary tools:
|
|
11
|
+
|
|
12
|
+
1. **Docucod** - An AI-powered documentation assistant that automatically generates and maintains documentation
|
|
13
|
+
2. **Dory** - A lightweight static site generator specifically designed to deploy Docucod-generated documentation
|
|
14
|
+
|
|
15
|
+
## What is Docucod?
|
|
16
|
+
|
|
17
|
+
Docucod analyzes your codebase and automatically:
|
|
18
|
+
- Generates comprehensive documentation
|
|
19
|
+
- Updates existing documentation when code changes
|
|
20
|
+
- Maintains consistent style and formatting
|
|
21
|
+
- Ensures accuracy and completeness
|
|
22
|
+
|
|
23
|
+
## What is Dory?
|
|
24
|
+
|
|
25
|
+
Dory is a lightweight static site generator built for developers who want fast, clean, and customizable documentation. It was created specifically to deploy Docucod-generated documentation with:
|
|
26
|
+
|
|
27
|
+
- 🧠 **Simple** — Drop in `.mdx` files and configure one `dory.json`
|
|
28
|
+
- ⚡ **Fast** — Instant hot reload in dev, quick static builds for prod
|
|
29
|
+
- 🌐 **Portable** — No SSR, no lock-in, deploy anywhere
|
|
30
|
+
- 🧩 **Flexible** — Hackable theme, readable codebase, minimal magic
|
|
31
|
+
|
|
32
|
+
## Documentation Structure
|
|
33
|
+
|
|
34
|
+
This documentation is organized to help you:
|
|
35
|
+
- Get started quickly with both Docucod and Dory
|
|
36
|
+
- Understand core concepts and features
|
|
37
|
+
- Follow best practices and examples
|
|
38
|
+
- Find detailed API references
|
|
39
|
+
|
|
40
|
+
Let's begin exploring Docucod and Dory's capabilities!
|
|
41
|
+
|
|
42
|
+
<br/>
|
|
43
|
+
<br/>
|
|
44
|
+
<br/>
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clidey/dory",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "A CLI tool for building and previewing documentation sites",
|
|
7
7
|
"keywords": [
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"scripts": {
|
|
28
28
|
"dev": "vite",
|
|
29
29
|
"build": "tsc -b && vite build",
|
|
30
|
-
"preview": "vite preview"
|
|
30
|
+
"preview": "vite preview",
|
|
31
|
+
"publish": "npm publish --access public"
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
34
|
"@algolia/autocomplete-core": "^1.19.2",
|
|
@@ -40,10 +41,13 @@
|
|
|
40
41
|
"@heroicons/react": "^2.2.0",
|
|
41
42
|
"@mdx-js/preact": "^3.1.0",
|
|
42
43
|
"@mdx-js/rollup": "^3.1.0",
|
|
44
|
+
"@preact/preset-vite": "^2.10.1",
|
|
43
45
|
"@tailwindcss/vite": "^4.1.8",
|
|
46
|
+
"@types/react-highlight-words": "^0.20.0",
|
|
44
47
|
"classnames": "^2.5.1",
|
|
45
48
|
"flexsearch": "^0.8.205",
|
|
46
49
|
"gray-matter": "^4.0.3",
|
|
50
|
+
"gzip-size-cli": "^5.1.0",
|
|
47
51
|
"katex": "^0.16.22",
|
|
48
52
|
"lucide-react": "^0.513.0",
|
|
49
53
|
"mermaid": "^11.6.0",
|
|
@@ -53,19 +57,14 @@
|
|
|
53
57
|
"react-highlight-words": "^0.21.0",
|
|
54
58
|
"remark-gfm": "^4.0.1",
|
|
55
59
|
"saas": "^1.0.0",
|
|
60
|
+
"sass-embedded": "^1.89.2",
|
|
56
61
|
"sirv": "^3.0.1",
|
|
57
62
|
"tailwindcss": "^4.1.8",
|
|
63
|
+
"typescript": "~5.8.3",
|
|
58
64
|
"unist-util-visit": "^5.0.0",
|
|
65
|
+
"vite": "^6.3.5",
|
|
59
66
|
"vite-plugin-mdx": "^3.6.1",
|
|
60
67
|
"wouter-preact": "^3.7.1"
|
|
61
68
|
},
|
|
62
|
-
"devDependencies": {
|
|
63
|
-
"@preact/preset-vite": "^2.10.1",
|
|
64
|
-
"@types/react-highlight-words": "^0.20.0",
|
|
65
|
-
"gzip-size-cli": "^5.1.0",
|
|
66
|
-
"sass-embedded": "^1.89.2",
|
|
67
|
-
"typescript": "~5.8.3",
|
|
68
|
-
"vite": "^6.3.5"
|
|
69
|
-
},
|
|
70
69
|
"packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39"
|
|
71
70
|
}
|
package/src/mdx/fence.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import { Code, CodeGroup, CodeGroupContext, supportedLanguages } from './code'
|
|
|
4
4
|
import { MermaidRenderer } from './mermaid'
|
|
5
5
|
import { Loading } from '../components/loading'
|
|
6
6
|
import { useDarkMode } from '../utils/hooks'
|
|
7
|
+
import classNames from 'classnames'
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
export function Fence({
|
|
@@ -34,7 +35,7 @@ export function Fence({
|
|
|
34
35
|
theme={isDark ? themes.vsDark : themes.vsLight}>
|
|
35
36
|
{({ className, style, tokens, getTokenProps }) => (
|
|
36
37
|
<pre>
|
|
37
|
-
<Code className={className} style={style} title={supportedLanguage}>
|
|
38
|
+
<Code className={classNames(className, "whitespace-pre-wrap")} style={style} title={supportedLanguage}>
|
|
38
39
|
{tokens.map((line, lineIndex) => (
|
|
39
40
|
<Fragment key={lineIndex}>
|
|
40
41
|
{line
|
package/src/mdx/mermaid.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ExclamationTriangleIcon } from '@heroicons/react/24/outline'
|
|
1
2
|
import classNames from 'classnames'
|
|
2
3
|
import { useEffect, useMemo, useRef, useState } from 'preact/compat'
|
|
3
4
|
|
|
@@ -6,6 +7,7 @@ export function MermaidRenderer({ content }: { content: string }) {
|
|
|
6
7
|
const [isFullscreen, setIsFullscreen] = useState(false)
|
|
7
8
|
const [isLoaded, setIsLoaded] = useState(false)
|
|
8
9
|
const [error, setError] = useState<string | null>(null)
|
|
10
|
+
const [isValid, setIsValid] = useState<boolean | null>(null)
|
|
9
11
|
|
|
10
12
|
const diagramId = useMemo(() => `mermaid-${btoa(content).replace(/[^a-zA-Z0-9]/g, '').substring(0, 10)}`, [content])
|
|
11
13
|
|
|
@@ -15,8 +17,7 @@ export function MermaidRenderer({ content }: { content: string }) {
|
|
|
15
17
|
const renderMermaid = async () => {
|
|
16
18
|
try {
|
|
17
19
|
const mermaid = (await import('mermaid')).default
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
|
|
20
21
|
if (!mounted || !mermaidRef.current) return
|
|
21
22
|
|
|
22
23
|
mermaid.initialize({
|
|
@@ -24,14 +25,14 @@ export function MermaidRenderer({ content }: { content: string }) {
|
|
|
24
25
|
theme: 'base',
|
|
25
26
|
themeVariables: {
|
|
26
27
|
fontSize: '14px',
|
|
27
|
-
nodePadding: 20,
|
|
28
|
+
nodePadding: 20,
|
|
28
29
|
notePadding: 15,
|
|
29
|
-
padding: 10,
|
|
30
|
-
nodeBorderRadius: 8,
|
|
30
|
+
padding: 10,
|
|
31
|
+
nodeBorderRadius: 8,
|
|
31
32
|
},
|
|
32
33
|
flowchart: {
|
|
33
|
-
nodeSpacing: 50,
|
|
34
|
-
rankSpacing: 80,
|
|
34
|
+
nodeSpacing: 50,
|
|
35
|
+
rankSpacing: 80,
|
|
35
36
|
padding: 20,
|
|
36
37
|
useMaxWidth: true,
|
|
37
38
|
},
|
|
@@ -45,9 +46,20 @@ export function MermaidRenderer({ content }: { content: string }) {
|
|
|
45
46
|
.replace(/^\s*style .*$/gm, '')
|
|
46
47
|
.replace(/^\s*classDef .*$/gm, '')
|
|
47
48
|
.replace(/^\s*class .*$/gm, '');
|
|
49
|
+
|
|
50
|
+
// Validate the mermaid syntax first
|
|
51
|
+
try {
|
|
52
|
+
await mermaid.parse(contentWithoutStyle)
|
|
53
|
+
setIsValid(true)
|
|
54
|
+
} catch (parseError) {
|
|
55
|
+
setIsValid(false)
|
|
56
|
+
if (mounted) {
|
|
57
|
+
setError(parseError instanceof Error ? parseError.message : 'Invalid diagram syntax')
|
|
58
|
+
}
|
|
59
|
+
return
|
|
60
|
+
}
|
|
48
61
|
|
|
49
62
|
const { svg } = await mermaid.render(diagramId, contentWithoutStyle);
|
|
50
|
-
|
|
51
63
|
|
|
52
64
|
if (mounted && mermaidRef.current) {
|
|
53
65
|
mermaidRef.current.innerHTML = svg
|
|
@@ -56,6 +68,7 @@ export function MermaidRenderer({ content }: { content: string }) {
|
|
|
56
68
|
} catch (err) {
|
|
57
69
|
console.error('Mermaid rendering error:', err)
|
|
58
70
|
if (mounted) {
|
|
71
|
+
setIsValid(false)
|
|
59
72
|
setError(err instanceof Error ? err.message : 'Failed to render diagram')
|
|
60
73
|
}
|
|
61
74
|
}
|
|
@@ -72,10 +85,25 @@ export function MermaidRenderer({ content }: { content: string }) {
|
|
|
72
85
|
setIsFullscreen(!isFullscreen)
|
|
73
86
|
}
|
|
74
87
|
|
|
75
|
-
if (error) {
|
|
88
|
+
if (error || isValid === false) {
|
|
76
89
|
return (
|
|
77
|
-
<div className="
|
|
78
|
-
<
|
|
90
|
+
<div className="mermaid-wrapper my-8">
|
|
91
|
+
<div className="flex flex-col items-center justify-center py-12 px-6 text-center bg-gradient-to-br from-red-50 to-red-100 dark:from-red-900/20 dark:to-red-800/20 border-2 border-dashed border-red-300 dark:border-red-700 rounded-lg">
|
|
92
|
+
<div className="w-16 h-16 mb-4 flex items-center justify-center bg-red-100 dark:bg-red-900/30 rounded-full">
|
|
93
|
+
<ExclamationTriangleIcon className="w-8 h-8 text-red-500" />
|
|
94
|
+
</div>
|
|
95
|
+
<h3 className="text-lg font-semibold text-red-700 dark:text-red-300 mb-2">
|
|
96
|
+
Diagram Syntax Error
|
|
97
|
+
</h3>
|
|
98
|
+
<p className="text-red-600 dark:text-red-400 mb-4 max-w-md">
|
|
99
|
+
The Mermaid diagram contains invalid syntax and cannot be rendered.
|
|
100
|
+
</p>
|
|
101
|
+
<div className="bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-800 rounded-md p-3 max-w-md">
|
|
102
|
+
<p className="text-sm text-red-700 dark:text-red-300 font-mono break-all">
|
|
103
|
+
{error}
|
|
104
|
+
</p>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
79
107
|
</div>
|
|
80
108
|
)
|
|
81
109
|
}
|
package/src/mdx/source.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type PathRange = {
|
|
2
2
|
path: string;
|
|
3
|
-
range
|
|
3
|
+
range?: string;
|
|
4
4
|
};
|
|
5
5
|
|
|
6
6
|
type SourceProps = {
|
|
@@ -10,7 +10,18 @@ type SourceProps = {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export const Source = ({ url, branch = "main", paths }: SourceProps) => {
|
|
13
|
-
const createSourceUrl = (path: string, range
|
|
13
|
+
const createSourceUrl = (path: string, range?: string) => {
|
|
14
|
+
if (!range) {
|
|
15
|
+
if (url.includes('github.com')) {
|
|
16
|
+
return `${url}/blob/${branch}/${path}`;
|
|
17
|
+
} else if (url.includes('bitbucket.org')) {
|
|
18
|
+
return `${url}/src/${branch}/${path}`;
|
|
19
|
+
} else if (url.includes('gitlab.com')) {
|
|
20
|
+
return `${url}/-/blob/${branch}/${path}`;
|
|
21
|
+
}
|
|
22
|
+
return url;
|
|
23
|
+
}
|
|
24
|
+
|
|
14
25
|
const [start, end] = range.split('-');
|
|
15
26
|
|
|
16
27
|
if (url.includes('github.com')) {
|
|
@@ -29,7 +40,7 @@ export const Source = ({ url, branch = "main", paths }: SourceProps) => {
|
|
|
29
40
|
<p className="text-sm text-slate-900 dark:text-white">Sources:</p>
|
|
30
41
|
<ul className="list-none pl-0 flex flex-wrap gap-2 mt-2">
|
|
31
42
|
{paths.map(({ path, range }) => (
|
|
32
|
-
<li key={path + range}>
|
|
43
|
+
<li key={path + (range || '')}>
|
|
33
44
|
<a
|
|
34
45
|
href={createSourceUrl(path, range)}
|
|
35
46
|
target="_blank"
|
|
@@ -37,7 +48,7 @@ export const Source = ({ url, branch = "main", paths }: SourceProps) => {
|
|
|
37
48
|
className="rounded px-3 py-1 font-mono text-sm text-slate-700 dark:text-slate-400 hover:opacity-80 transition-colors border border-slate-200 dark:border-slate-700"
|
|
38
49
|
>
|
|
39
50
|
{path}
|
|
40
|
-
<span className="ml-2 opacity-70">{range}</span>
|
|
51
|
+
{range && <span className="ml-2 opacity-70">{range}</span>}
|
|
41
52
|
</a>
|
|
42
53
|
</li>
|
|
43
54
|
))}
|
package/docs/README.md
DELETED