@leanspec/ui 0.2.13 → 0.2.15-dev.21022397862

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 (149) hide show
  1. package/bin/leanspec-ui.js +191 -0
  2. package/dist/assets/_baseUniq-CRqreL7N.js +1 -0
  3. package/dist/assets/arc-DMhx9AJT.js +1 -0
  4. package/dist/assets/architectureDiagram-VXUJARFQ-DM0L0YzO.js +36 -0
  5. package/dist/assets/blockDiagram-VD42YOAC-DHQXDHsD.js +122 -0
  6. package/dist/assets/c4Diagram-YG6GDRKO-0L7o2gpH.js +10 -0
  7. package/dist/assets/channel-2tOl0nAZ.js +1 -0
  8. package/dist/assets/chunk-4BX2VUAB-CwFT-Uaj.js +1 -0
  9. package/dist/assets/chunk-55IACEB6-CjvuUHHG.js +1 -0
  10. package/dist/assets/chunk-B4BG7PRW-BRJBysMK.js +165 -0
  11. package/dist/assets/chunk-DI55MBZ5-BnNEeoaA.js +220 -0
  12. package/dist/assets/chunk-FMBD7UC4-BK2l30pm.js +15 -0
  13. package/dist/assets/chunk-QN33PNHL-BN_cZkCU.js +1 -0
  14. package/dist/assets/chunk-QZHKN3VN-Brc3Yrub.js +1 -0
  15. package/dist/assets/chunk-TZMSLE5B-D2zzpLfO.js +1 -0
  16. package/dist/assets/classDiagram-2ON5EDUG-BB9CSNmS.js +1 -0
  17. package/dist/assets/classDiagram-v2-WZHVMYZB-BB9CSNmS.js +1 -0
  18. package/dist/assets/clone-BjxVFtyI.js +1 -0
  19. package/dist/assets/core-DV6XEvTN.js +1 -0
  20. package/dist/assets/cose-bilkent-S5V4N54A-CLJgM3XR.js +1 -0
  21. package/dist/assets/cytoscape.esm-5J0xJHOV.js +321 -0
  22. package/dist/assets/dagre-6UL2VRFP-_IFvBJKJ.js +4 -0
  23. package/dist/assets/diagram-PSM6KHXK--83HIYSQ.js +24 -0
  24. package/dist/assets/diagram-QEK2KX5R-6jAWnCnZ.js +43 -0
  25. package/dist/assets/diagram-S2PKOQOG-D5pwHvjZ.js +24 -0
  26. package/dist/assets/erDiagram-Q2GNP2WA-B4FV3mTd.js +60 -0
  27. package/dist/assets/flowDiagram-NV44I4VS-mtD2kF4M.js +162 -0
  28. package/dist/assets/ganttDiagram-JELNMOA3-BKALgqTK.js +267 -0
  29. package/dist/assets/gitGraphDiagram-NY62KEGX-Bd7r0pAf.js +65 -0
  30. package/dist/assets/graph-B2rEI7cK.js +1 -0
  31. package/dist/assets/index-Bekv_o1t.css +1 -0
  32. package/dist/assets/index-DSRxU-E5.js +389 -0
  33. package/dist/assets/infoDiagram-WHAUD3N6--nJOBKqh.js +2 -0
  34. package/dist/assets/journeyDiagram-XKPGCS4Q-BzGutKN3.js +139 -0
  35. package/dist/assets/kanban-definition-3W4ZIXB7-DyQO17vq.js +89 -0
  36. package/dist/assets/katex-XbL3y5x-.js +261 -0
  37. package/dist/assets/layout-iCSHU015.js +1 -0
  38. package/dist/assets/min-BK_AIJdo.js +1 -0
  39. package/dist/assets/mindmap-definition-VGOIOE7T-BZMj_6zo.js +68 -0
  40. package/dist/assets/pieDiagram-ADFJNKIX-CkAGsq9p.js +30 -0
  41. package/dist/assets/quadrantDiagram-AYHSOK5B-CWa93px1.js +7 -0
  42. package/dist/assets/requirementDiagram-UZGBJVZJ-CufFVR8c.js +64 -0
  43. package/dist/assets/sankeyDiagram-TZEHDZUN-BEPgVgU4.js +10 -0
  44. package/dist/assets/sequenceDiagram-WL72ISMW-BkdBWhel.js +145 -0
  45. package/dist/assets/stateDiagram-FKZM4ZOC-D5T73yx0.js +1 -0
  46. package/dist/assets/stateDiagram-v2-4FDKWEC3-9hJWG2n6.js +1 -0
  47. package/dist/assets/timeline-definition-IT6M3QCI-CX7kTdU2.js +61 -0
  48. package/dist/assets/treemap-KMMF4GRG-ftWCQ9lJ.js +128 -0
  49. package/dist/assets/xychartDiagram-PRI3JC2R-Ngrels4n.js +7 -0
  50. package/{index.html → dist/index.html} +2 -1
  51. package/package.json +13 -3
  52. package/eslint.config.js +0 -23
  53. package/postcss.config.js +0 -6
  54. package/src/App.css +0 -42
  55. package/src/App.tsx +0 -17
  56. package/src/assets/react.svg +0 -1
  57. package/src/components/LanguageSwitcher.tsx +0 -67
  58. package/src/components/Layout.tsx +0 -88
  59. package/src/components/MainSidebar.tsx +0 -163
  60. package/src/components/MermaidDiagram.tsx +0 -85
  61. package/src/components/MinimalLayout.tsx +0 -51
  62. package/src/components/Navigation.tsx +0 -254
  63. package/src/components/PriorityBadge.tsx +0 -59
  64. package/src/components/ProjectSwitcher.tsx +0 -222
  65. package/src/components/QuickSearch.tsx +0 -225
  66. package/src/components/RootRedirect.tsx +0 -40
  67. package/src/components/SpecDetailLayout.context.ts +0 -10
  68. package/src/components/SpecDetailLayout.tsx +0 -14
  69. package/src/components/SpecsNavSidebar.tsx +0 -615
  70. package/src/components/StatusBadge.tsx +0 -59
  71. package/src/components/ThemeToggle.tsx +0 -25
  72. package/src/components/Tooltip.tsx +0 -29
  73. package/src/components/context/ContextClient.tsx +0 -471
  74. package/src/components/context/ContextFileDetail.tsx +0 -163
  75. package/src/components/dashboard/ActivityItem.tsx +0 -36
  76. package/src/components/dashboard/DashboardClient.tsx +0 -218
  77. package/src/components/dashboard/SpecListItem.tsx +0 -58
  78. package/src/components/dashboard/StatCard.tsx +0 -52
  79. package/src/components/dependencies/SpecNode.tsx +0 -128
  80. package/src/components/dependencies/SpecSidebar.tsx +0 -256
  81. package/src/components/dependencies/constants.ts +0 -25
  82. package/src/components/dependencies/types.ts +0 -38
  83. package/src/components/dependencies/utils.ts +0 -261
  84. package/src/components/metadata-editors/PriorityEditor.tsx +0 -89
  85. package/src/components/metadata-editors/StatusEditor.tsx +0 -85
  86. package/src/components/metadata-editors/TagsEditor.tsx +0 -207
  87. package/src/components/projects/CreateProjectDialog.tsx +0 -162
  88. package/src/components/projects/DirectoryPicker.tsx +0 -182
  89. package/src/components/shared/BackToTop.tsx +0 -39
  90. package/src/components/shared/ColorPicker.tsx +0 -68
  91. package/src/components/shared/EmptyState.tsx +0 -35
  92. package/src/components/shared/ErrorBoundary.tsx +0 -79
  93. package/src/components/shared/PageHeader.tsx +0 -23
  94. package/src/components/shared/PageTransition.tsx +0 -40
  95. package/src/components/shared/ProjectAvatar.tsx +0 -107
  96. package/src/components/shared/Skeletons.tsx +0 -184
  97. package/src/components/spec-detail/EditableMetadata.tsx +0 -129
  98. package/src/components/spec-detail/MarkdownRenderer.tsx +0 -47
  99. package/src/components/spec-detail/TableOfContents.tsx +0 -150
  100. package/src/components/specs/BoardView.tsx +0 -204
  101. package/src/components/specs/ListView.tsx +0 -62
  102. package/src/components/specs/SpecsFilters.tsx +0 -190
  103. package/src/contexts/KeyboardShortcutsContext.tsx +0 -95
  104. package/src/contexts/LayoutContext.tsx +0 -45
  105. package/src/contexts/ProjectContext.tsx +0 -163
  106. package/src/contexts/ThemeContext.tsx +0 -90
  107. package/src/contexts/index.ts +0 -7
  108. package/src/hooks/useKeyboardShortcuts.ts +0 -87
  109. package/src/index.css +0 -624
  110. package/src/lib/api.ts +0 -72
  111. package/src/lib/backend-adapter.ts +0 -382
  112. package/src/lib/date-utils.ts +0 -122
  113. package/src/lib/i18n.test.ts +0 -57
  114. package/src/lib/i18n.ts +0 -51
  115. package/src/lib/markdown-utils.ts +0 -38
  116. package/src/lib/sub-spec-utils.ts +0 -166
  117. package/src/lib/utils.ts +0 -6
  118. package/src/locales/en/common.json +0 -660
  119. package/src/locales/en/errors.json +0 -20
  120. package/src/locales/en/help.json +0 -8
  121. package/src/locales/zh-CN/common.json +0 -660
  122. package/src/locales/zh-CN/errors.json +0 -20
  123. package/src/locales/zh-CN/help.json +0 -8
  124. package/src/main.tsx +0 -12
  125. package/src/pages/ContextPage.tsx +0 -111
  126. package/src/pages/DashboardPage.tsx +0 -97
  127. package/src/pages/DependenciesPage.tsx +0 -881
  128. package/src/pages/ProjectsPage.tsx +0 -432
  129. package/src/pages/SpecDetailPage.tsx +0 -592
  130. package/src/pages/SpecsPage.tsx +0 -319
  131. package/src/pages/StatsPage.tsx +0 -307
  132. package/src/router/projectRoutes.tsx +0 -36
  133. package/src/router.tsx +0 -33
  134. package/src/test/setup.ts +0 -39
  135. package/src/types/api.ts +0 -185
  136. package/tailwind.config.ts +0 -57
  137. package/tsconfig.app.json +0 -29
  138. package/tsconfig.json +0 -7
  139. package/tsconfig.node.json +0 -26
  140. package/tsconfig.tsbuildinfo +0 -1
  141. package/vite.config.ts +0 -27
  142. package/vitest.config.ts +0 -18
  143. /package/{public → dist}/favicon.ico +0 -0
  144. /package/{public → dist}/github-mark-white.svg +0 -0
  145. /package/{public → dist}/github-mark.svg +0 -0
  146. /package/{public → dist}/logo-dark-bg.svg +0 -0
  147. /package/{public → dist}/logo-with-bg.svg +0 -0
  148. /package/{public → dist}/logo.svg +0 -0
  149. /package/{public → dist}/vite.svg +0 -0
package/src/main.tsx DELETED
@@ -1,12 +0,0 @@
1
- import { StrictMode } from 'react'
2
- import { createRoot } from 'react-dom/client'
3
- import '@leanspec/ui-components/styles.css'
4
- import './index.css'
5
- import './lib/i18n'
6
- import App from './App'
7
-
8
- createRoot(document.getElementById('root')!).render(
9
- <StrictMode>
10
- <App />
11
- </StrictMode>,
12
- )
@@ -1,111 +0,0 @@
1
- /**
2
- * Project Context Page
3
- * Displays project-level context files for AI agents and development workflows
4
- * Spec 131 - UI Project Context Visibility
5
- * Aligned with Next.js UI implementation
6
- */
7
-
8
- import { useEffect, useState } from 'react';
9
- import { AlertCircle } from 'lucide-react';
10
- import { Card, CardContent } from '@leanspec/ui-components';
11
- import { ContextClient } from '../components/context/ContextClient';
12
- import { ContextPageSkeleton } from '../components/shared/Skeletons';
13
- import { useProject } from '../contexts';
14
- import { useTranslation } from 'react-i18next';
15
- import { api } from '../lib/api';
16
- import type { ProjectContext } from '../types/api';
17
-
18
- export function ContextPage() {
19
- const { currentProject, loading: projectLoading, error: projectError } = useProject();
20
- const { t } = useTranslation(['common', 'errors']);
21
- const [context, setContext] = useState<ProjectContext | null>(null);
22
- const [loading, setLoading] = useState(true);
23
- const [error, setError] = useState<string | null>(null);
24
-
25
- useEffect(() => {
26
- async function loadContext() {
27
- // Wait for project loading to complete before attempting to load context
28
- if (projectLoading) {
29
- return;
30
- }
31
-
32
- if (!currentProject?.id) {
33
- setContext(null);
34
- setLoading(false);
35
- return;
36
- }
37
-
38
- setLoading(true);
39
- setError(null);
40
-
41
- try {
42
- const projectContext = await api.getProjectContext();
43
- setContext(projectContext);
44
- } catch (err) {
45
- const message = err instanceof Error ? err.message : t('contextPage.errors.list', { ns: 'common' });
46
- setError(message);
47
- } finally {
48
- setLoading(false);
49
- }
50
- }
51
-
52
- void loadContext();
53
- }, [currentProject?.id, projectLoading, t]);
54
-
55
- if (projectLoading || loading) {
56
- return <ContextPageSkeleton />;
57
- }
58
-
59
- // Handle actual API/project errors (only show project errors if they're real errors, not "no projects" state)
60
- if (error && currentProject) {
61
- return (
62
- <Card>
63
- <CardContent className="py-10 text-center space-y-3">
64
- <div className="flex justify-center">
65
- <AlertCircle className="h-6 w-6 text-destructive" />
66
- </div>
67
- <div className="text-lg font-semibold">{t('contextPage.errors.loadFailed', { ns: 'common' })}</div>
68
- <p className="text-sm text-muted-foreground">
69
- {projectError || error || t('errors.loadingError', { ns: 'errors' })}
70
- </p>
71
- </CardContent>
72
- </Card>
73
- );
74
- }
75
-
76
- // No project selected - guide user to create/select one
77
- if (!currentProject) {
78
- return (
79
- <Card>
80
- <CardContent className="py-10 text-center space-y-3">
81
- <div className="flex justify-center">
82
- <AlertCircle className="h-6 w-6 text-muted-foreground" />
83
- </div>
84
- <div className="text-lg font-semibold">{t('contextPage.errors.noProject', { ns: 'common' })}</div>
85
- <p className="text-sm text-muted-foreground">
86
- {t('contextPage.errors.noProjectDescription', { ns: 'common' })}
87
- </p>
88
- </CardContent>
89
- </Card>
90
- );
91
- }
92
-
93
- if (!context) {
94
- return (
95
- <Card>
96
- <CardContent className="py-10 text-center space-y-3">
97
- <div className="flex justify-center">
98
- <AlertCircle className="h-6 w-6 text-muted-foreground" />
99
- </div>
100
- <div className="text-lg font-semibold">{t('contextPage.emptyState.title')}</div>
101
- <p className="text-sm text-muted-foreground">
102
- {t('contextPage.emptyState.description')}
103
- </p>
104
- </CardContent>
105
- </Card>
106
- );
107
- }
108
-
109
- return <ContextClient context={context} />;
110
- }
111
-
@@ -1,97 +0,0 @@
1
- import { useCallback, useEffect, useState } from 'react';
2
- import { AlertCircle } from 'lucide-react';
3
- import { Button, Card, CardContent } from '@leanspec/ui-components';
4
- import { Link } from 'react-router-dom';
5
- import { api } from '../lib/api';
6
- import type { Stats } from '../types/api';
7
- import { useProject } from '../contexts';
8
- import { DashboardClient } from '../components/dashboard/DashboardClient';
9
- import type { DashboardSpec } from '../components/dashboard/SpecListItem';
10
- import { DashboardSkeleton } from '../components/shared/Skeletons';
11
- import { useTranslation } from 'react-i18next';
12
-
13
- export function DashboardPage() {
14
- const { currentProject, loading: projectLoading } = useProject();
15
- const [specs, setSpecs] = useState<DashboardSpec[]>([]);
16
- const [stats, setStats] = useState<Stats | null>(null);
17
- const [loading, setLoading] = useState(true);
18
- const [error, setError] = useState<string | null>(null);
19
- const { t } = useTranslation('common');
20
- const projectColor = currentProject && 'color' in currentProject ? (currentProject as { color?: string }).color : undefined;
21
- const basePath = currentProject?.id ? `/projects/${currentProject.id}` : '/projects/default';
22
-
23
- const loadData = useCallback(async () => {
24
- if (projectLoading || !currentProject) return;
25
- try {
26
- setLoading(true);
27
- const [specsData, statsData] = await Promise.all([
28
- api.getSpecs(),
29
- api.getStats(),
30
- ]);
31
-
32
- setSpecs(Array.isArray(specsData) ? specsData : []);
33
- setStats(statsData);
34
- setError(null);
35
- } catch (err) {
36
- console.error('Failed to load dashboard data', err);
37
- setError(t('dashboard.state.errorDescription'));
38
- } finally {
39
- setLoading(false);
40
- }
41
- }, [currentProject, projectLoading, t]);
42
-
43
- useEffect(() => {
44
- void loadData();
45
- }, [loadData]);
46
-
47
- if (projectLoading || loading) {
48
- return <DashboardSkeleton />;
49
- }
50
-
51
- if (!currentProject) {
52
- return (
53
- <Card>
54
- <CardContent className="py-10 text-center space-y-3">
55
- <div className="text-lg font-semibold">{t('dashboard.state.noProjectTitle', { defaultValue: 'No project selected' })}</div>
56
- <p className="text-sm text-muted-foreground">
57
- {t('dashboard.state.noProjectDescription', { defaultValue: 'Select or create a project to view the dashboard.' })}
58
- </p>
59
- <Link to="/projects" className="inline-flex">
60
- <Button variant="secondary" size="sm">{t('projectsPage.title', { defaultValue: 'Projects' })}</Button>
61
- </Link>
62
- </CardContent>
63
- </Card>
64
- );
65
- }
66
-
67
- if (error) {
68
- return (
69
- <Card>
70
- <CardContent className="py-10 text-center space-y-3">
71
- <div className="flex justify-center">
72
- <AlertCircle className="h-6 w-6 text-destructive" />
73
- </div>
74
- <div className="text-lg font-semibold">{t('dashboard.state.errorTitle')}</div>
75
- <p className="text-sm text-muted-foreground">{error || t('dashboard.state.errorDescription')}</p>
76
- <Button variant="secondary" size="sm" onClick={loadData} className="mt-2">
77
- {t('actions.retry')}
78
- </Button>
79
- </CardContent>
80
- </Card>
81
- );
82
- }
83
-
84
- if (!stats) {
85
- return null;
86
- }
87
-
88
- return (
89
- <DashboardClient
90
- specs={specs}
91
- stats={stats}
92
- projectColor={projectColor}
93
- projectName={currentProject?.name}
94
- basePath={basePath}
95
- />
96
- );
97
- }