@leanspec/ui 0.2.14 → 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 (150) 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 +12 -2
  52. package/eslint.config.js +0 -23
  53. package/package.json.backup +0 -83
  54. package/postcss.config.js +0 -6
  55. package/src/App.css +0 -42
  56. package/src/App.tsx +0 -17
  57. package/src/assets/react.svg +0 -1
  58. package/src/components/LanguageSwitcher.tsx +0 -67
  59. package/src/components/Layout.tsx +0 -88
  60. package/src/components/MainSidebar.tsx +0 -163
  61. package/src/components/MermaidDiagram.tsx +0 -85
  62. package/src/components/MinimalLayout.tsx +0 -51
  63. package/src/components/Navigation.tsx +0 -254
  64. package/src/components/PriorityBadge.tsx +0 -59
  65. package/src/components/ProjectSwitcher.tsx +0 -222
  66. package/src/components/QuickSearch.tsx +0 -225
  67. package/src/components/RootRedirect.tsx +0 -40
  68. package/src/components/SpecDetailLayout.context.ts +0 -10
  69. package/src/components/SpecDetailLayout.tsx +0 -14
  70. package/src/components/SpecsNavSidebar.tsx +0 -615
  71. package/src/components/StatusBadge.tsx +0 -59
  72. package/src/components/ThemeToggle.tsx +0 -25
  73. package/src/components/Tooltip.tsx +0 -29
  74. package/src/components/context/ContextClient.tsx +0 -471
  75. package/src/components/context/ContextFileDetail.tsx +0 -163
  76. package/src/components/dashboard/ActivityItem.tsx +0 -36
  77. package/src/components/dashboard/DashboardClient.tsx +0 -218
  78. package/src/components/dashboard/SpecListItem.tsx +0 -58
  79. package/src/components/dashboard/StatCard.tsx +0 -52
  80. package/src/components/dependencies/SpecNode.tsx +0 -128
  81. package/src/components/dependencies/SpecSidebar.tsx +0 -256
  82. package/src/components/dependencies/constants.ts +0 -25
  83. package/src/components/dependencies/types.ts +0 -38
  84. package/src/components/dependencies/utils.ts +0 -261
  85. package/src/components/metadata-editors/PriorityEditor.tsx +0 -89
  86. package/src/components/metadata-editors/StatusEditor.tsx +0 -85
  87. package/src/components/metadata-editors/TagsEditor.tsx +0 -207
  88. package/src/components/projects/CreateProjectDialog.tsx +0 -162
  89. package/src/components/projects/DirectoryPicker.tsx +0 -182
  90. package/src/components/shared/BackToTop.tsx +0 -39
  91. package/src/components/shared/ColorPicker.tsx +0 -68
  92. package/src/components/shared/EmptyState.tsx +0 -35
  93. package/src/components/shared/ErrorBoundary.tsx +0 -79
  94. package/src/components/shared/PageHeader.tsx +0 -23
  95. package/src/components/shared/PageTransition.tsx +0 -40
  96. package/src/components/shared/ProjectAvatar.tsx +0 -107
  97. package/src/components/shared/Skeletons.tsx +0 -184
  98. package/src/components/spec-detail/EditableMetadata.tsx +0 -129
  99. package/src/components/spec-detail/MarkdownRenderer.tsx +0 -47
  100. package/src/components/spec-detail/TableOfContents.tsx +0 -150
  101. package/src/components/specs/BoardView.tsx +0 -204
  102. package/src/components/specs/ListView.tsx +0 -62
  103. package/src/components/specs/SpecsFilters.tsx +0 -190
  104. package/src/contexts/KeyboardShortcutsContext.tsx +0 -95
  105. package/src/contexts/LayoutContext.tsx +0 -45
  106. package/src/contexts/ProjectContext.tsx +0 -163
  107. package/src/contexts/ThemeContext.tsx +0 -90
  108. package/src/contexts/index.ts +0 -7
  109. package/src/hooks/useKeyboardShortcuts.ts +0 -87
  110. package/src/index.css +0 -624
  111. package/src/lib/api.ts +0 -72
  112. package/src/lib/backend-adapter.ts +0 -382
  113. package/src/lib/date-utils.ts +0 -122
  114. package/src/lib/i18n.test.ts +0 -57
  115. package/src/lib/i18n.ts +0 -51
  116. package/src/lib/markdown-utils.ts +0 -38
  117. package/src/lib/sub-spec-utils.ts +0 -166
  118. package/src/lib/utils.ts +0 -6
  119. package/src/locales/en/common.json +0 -660
  120. package/src/locales/en/errors.json +0 -20
  121. package/src/locales/en/help.json +0 -8
  122. package/src/locales/zh-CN/common.json +0 -660
  123. package/src/locales/zh-CN/errors.json +0 -20
  124. package/src/locales/zh-CN/help.json +0 -8
  125. package/src/main.tsx +0 -12
  126. package/src/pages/ContextPage.tsx +0 -111
  127. package/src/pages/DashboardPage.tsx +0 -97
  128. package/src/pages/DependenciesPage.tsx +0 -881
  129. package/src/pages/ProjectsPage.tsx +0 -432
  130. package/src/pages/SpecDetailPage.tsx +0 -592
  131. package/src/pages/SpecsPage.tsx +0 -319
  132. package/src/pages/StatsPage.tsx +0 -307
  133. package/src/router/projectRoutes.tsx +0 -36
  134. package/src/router.tsx +0 -33
  135. package/src/test/setup.ts +0 -39
  136. package/src/types/api.ts +0 -185
  137. package/tailwind.config.ts +0 -57
  138. package/tsconfig.app.json +0 -29
  139. package/tsconfig.json +0 -7
  140. package/tsconfig.node.json +0 -26
  141. package/tsconfig.tsbuildinfo +0 -1
  142. package/vite.config.ts +0 -27
  143. package/vitest.config.ts +0 -18
  144. /package/{public → dist}/favicon.ico +0 -0
  145. /package/{public → dist}/github-mark-white.svg +0 -0
  146. /package/{public → dist}/github-mark.svg +0 -0
  147. /package/{public → dist}/logo-dark-bg.svg +0 -0
  148. /package/{public → dist}/logo-with-bg.svg +0 -0
  149. /package/{public → dist}/logo.svg +0 -0
  150. /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
- }