@leanspec/ui 0.2.18 → 0.2.19-dev.21166357960
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 +62 -20
- package/bin/leanspec-ui.js +10 -120
- package/dist/assets/{_baseUniq-CRqreL7N.js → _baseUniq-BN2nrmp8.js} +1 -1
- package/dist/assets/{arc-DMhx9AJT.js → arc-DAXxc4BL.js} +1 -1
- package/dist/assets/{architectureDiagram-VXUJARFQ-DM0L0YzO.js → architectureDiagram-VXUJARFQ-CtM5U6Z5.js} +1 -1
- package/dist/assets/{blockDiagram-VD42YOAC-DHQXDHsD.js → blockDiagram-VD42YOAC-DND250ek.js} +1 -1
- package/dist/assets/{c4Diagram-YG6GDRKO-0L7o2gpH.js → c4Diagram-YG6GDRKO-PvsL12rx.js} +1 -1
- package/dist/assets/channel-1a8WQS2Z.js +1 -0
- package/dist/assets/{chunk-4BX2VUAB-CwFT-Uaj.js → chunk-4BX2VUAB-yyInKyW_.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-CjvuUHHG.js → chunk-55IACEB6-C3nKr2gE.js} +1 -1
- package/dist/assets/{chunk-B4BG7PRW-BRJBysMK.js → chunk-B4BG7PRW-CIWQUvJ7.js} +1 -1
- package/dist/assets/{chunk-DI55MBZ5-BnNEeoaA.js → chunk-DI55MBZ5-C4Xa1a3a.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-BK2l30pm.js → chunk-FMBD7UC4-CEfJ5XyU.js} +1 -1
- package/dist/assets/{chunk-QN33PNHL-BN_cZkCU.js → chunk-QN33PNHL-Ch6G9RNi.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-Brc3Yrub.js → chunk-QZHKN3VN-Duk4D1_f.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-D2zzpLfO.js → chunk-TZMSLE5B-BzRV9wvM.js} +1 -1
- package/dist/assets/classDiagram-2ON5EDUG-DYGarCPI.js +1 -0
- package/dist/assets/classDiagram-v2-WZHVMYZB-DYGarCPI.js +1 -0
- package/dist/assets/clone-D6kZIOjX.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-CLJgM3XR.js → cose-bilkent-S5V4N54A-DTE1CZWu.js} +1 -1
- package/dist/assets/{dagre-6UL2VRFP-_IFvBJKJ.js → dagre-6UL2VRFP-BeFhU0QM.js} +1 -1
- package/dist/assets/{diagram-PSM6KHXK--83HIYSQ.js → diagram-PSM6KHXK-BeS2KN4f.js} +1 -1
- package/dist/assets/{diagram-QEK2KX5R-6jAWnCnZ.js → diagram-QEK2KX5R-CWAgvi2t.js} +1 -1
- package/dist/assets/{diagram-S2PKOQOG-D5pwHvjZ.js → diagram-S2PKOQOG-3UVNwkYv.js} +1 -1
- package/dist/assets/{erDiagram-Q2GNP2WA-B4FV3mTd.js → erDiagram-Q2GNP2WA-Ds6pETf4.js} +1 -1
- package/dist/assets/{flowDiagram-NV44I4VS-mtD2kF4M.js → flowDiagram-NV44I4VS-BsA_hd7D.js} +1 -1
- package/dist/assets/{ganttDiagram-JELNMOA3-BKALgqTK.js → ganttDiagram-JELNMOA3-AcETePa6.js} +1 -1
- package/dist/assets/{gitGraphDiagram-NY62KEGX-Bd7r0pAf.js → gitGraphDiagram-NY62KEGX-BJpGT_Y4.js} +1 -1
- package/dist/assets/{graph-B2rEI7cK.js → graph-uj1pkrZx.js} +1 -1
- package/dist/assets/index-C4Vs5qK_.js +438 -0
- package/dist/assets/index-CS99yPu4.css +1 -0
- package/dist/assets/{infoDiagram-WHAUD3N6--nJOBKqh.js → infoDiagram-WHAUD3N6-Daxe45IA.js} +1 -1
- package/dist/assets/{journeyDiagram-XKPGCS4Q-BzGutKN3.js → journeyDiagram-XKPGCS4Q-DysXZOrF.js} +1 -1
- package/dist/assets/{kanban-definition-3W4ZIXB7-DyQO17vq.js → kanban-definition-3W4ZIXB7-BanTsgrp.js} +1 -1
- package/dist/assets/{layout-iCSHU015.js → layout-BCjayFNY.js} +1 -1
- package/dist/assets/{min-BK_AIJdo.js → min-DKTt0a_v.js} +1 -1
- package/dist/assets/{mindmap-definition-VGOIOE7T-BZMj_6zo.js → mindmap-definition-VGOIOE7T-CtvPrp9_.js} +1 -1
- package/dist/assets/{pieDiagram-ADFJNKIX-CkAGsq9p.js → pieDiagram-ADFJNKIX-DbHzkt1v.js} +1 -1
- package/dist/assets/{quadrantDiagram-AYHSOK5B-CWa93px1.js → quadrantDiagram-AYHSOK5B-DsR_iixJ.js} +1 -1
- package/dist/assets/{requirementDiagram-UZGBJVZJ-CufFVR8c.js → requirementDiagram-UZGBJVZJ-ASA55Hr8.js} +1 -1
- package/dist/assets/{sankeyDiagram-TZEHDZUN-BEPgVgU4.js → sankeyDiagram-TZEHDZUN-ChYUFKBD.js} +1 -1
- package/dist/assets/{sequenceDiagram-WL72ISMW-BkdBWhel.js → sequenceDiagram-WL72ISMW-BlKiiFic.js} +1 -1
- package/dist/assets/{stateDiagram-FKZM4ZOC-D5T73yx0.js → stateDiagram-FKZM4ZOC-BoNgcnv6.js} +1 -1
- package/dist/assets/stateDiagram-v2-4FDKWEC3-D1ODp9Xk.js +1 -0
- package/dist/assets/{timeline-definition-IT6M3QCI-CX7kTdU2.js → timeline-definition-IT6M3QCI-DXO1gIRz.js} +1 -1
- package/dist/assets/{treemap-KMMF4GRG-ftWCQ9lJ.js → treemap-KMMF4GRG-CVNPaOGK.js} +1 -1
- package/dist/assets/{xychartDiagram-PRI3JC2R-Ngrels4n.js → xychartDiagram-PRI3JC2R-op7Due4F.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +10 -5
- package/dist/assets/channel-2tOl0nAZ.js +0 -1
- package/dist/assets/classDiagram-2ON5EDUG-BB9CSNmS.js +0 -1
- package/dist/assets/classDiagram-v2-WZHVMYZB-BB9CSNmS.js +0 -1
- package/dist/assets/clone-BjxVFtyI.js +0 -1
- package/dist/assets/index-Bekv_o1t.css +0 -1
- package/dist/assets/index-DSRxU-E5.js +0 -389
- package/dist/assets/stateDiagram-v2-4FDKWEC3-9hJWG2n6.js +0 -1
package/README.md
CHANGED
|
@@ -1,10 +1,37 @@
|
|
|
1
1
|
# @leanspec/ui
|
|
2
2
|
|
|
3
|
-
Primary Vite-based Single Page Application for LeanSpec spec management (web + desktop).
|
|
3
|
+
Primary Vite-based Single Page Application for LeanSpec spec management (web + desktop).
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
This is a lightweight, fast SPA built with Vite
|
|
7
|
+
This is a lightweight, fast SPA built with Vite. It provides a modern UI for viewing and managing LeanSpec specifications.
|
|
8
|
+
|
|
9
|
+
**Unified Server Architecture**: The UI is served by the Rust HTTP server on port 3000. When you run `npx @leanspec/ui`, it starts a single process that serves both the static UI files and the API endpoints. This provides:
|
|
10
|
+
- Single port (default: 3000)
|
|
11
|
+
- Same-origin API requests (no CORS needed)
|
|
12
|
+
- Better performance (no Node.js HTTP server overhead)
|
|
13
|
+
- Simpler deployment
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Start the unified HTTP server
|
|
19
|
+
npx @leanspec/ui
|
|
20
|
+
|
|
21
|
+
# Custom port and host
|
|
22
|
+
npx @leanspec/ui --port 3001 --host 0.0.0.0
|
|
23
|
+
|
|
24
|
+
# Auto-add project
|
|
25
|
+
npx @leanspec/ui --project /path/to/specs
|
|
26
|
+
|
|
27
|
+
# Read-only mode
|
|
28
|
+
npx @leanspec/ui --readonly
|
|
29
|
+
|
|
30
|
+
# All CLI arguments are passed to the Rust HTTP server
|
|
31
|
+
npx @leanspec/ui --help
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Visit `http://localhost:3000` to access the UI.
|
|
8
35
|
|
|
9
36
|
## Architecture
|
|
10
37
|
|
|
@@ -13,7 +40,7 @@ This is a lightweight, fast SPA built with Vite that replaces the previous Next.
|
|
|
13
40
|
- **Routing**: React Router 7 (client-side)
|
|
14
41
|
- **Components**: `@leanspec/ui-components` (shared library)
|
|
15
42
|
- **Styling**: Tailwind CSS 3
|
|
16
|
-
- **Backend**:
|
|
43
|
+
- **Backend**: Same-origin API served by the Rust HTTP server at `http://localhost:3000`
|
|
17
44
|
|
|
18
45
|
## Features
|
|
19
46
|
|
|
@@ -26,24 +53,48 @@ This is a lightweight, fast SPA built with Vite that replaces the previous Next.
|
|
|
26
53
|
|
|
27
54
|
## Development
|
|
28
55
|
|
|
56
|
+
### Development with HMR (Recommended)
|
|
57
|
+
|
|
58
|
+
For fast UI development with Hot Module Replacement:
|
|
59
|
+
|
|
29
60
|
```bash
|
|
30
|
-
#
|
|
31
|
-
|
|
61
|
+
# Terminal 1: Start Rust HTTP server (API on port 3000)
|
|
62
|
+
cd rust/leanspec-http
|
|
63
|
+
cargo run
|
|
32
64
|
|
|
33
|
-
# Start dev server (
|
|
65
|
+
# Terminal 2: Start Vite dev server (UI on port 5173)
|
|
66
|
+
cd packages/ui
|
|
34
67
|
pnpm dev
|
|
68
|
+
```
|
|
35
69
|
|
|
36
|
-
|
|
70
|
+
Access the UI at `http://localhost:5173`. Vite's proxy automatically forwards API requests to port 3000.
|
|
71
|
+
|
|
72
|
+
### Production-like Development
|
|
73
|
+
|
|
74
|
+
To test the unified server locally:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Build UI
|
|
37
78
|
pnpm build
|
|
38
79
|
|
|
39
|
-
#
|
|
40
|
-
|
|
80
|
+
# Start unified server (serves UI + API on port 3000)
|
|
81
|
+
cd ../../rust/leanspec-http
|
|
82
|
+
cargo run
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Access at `http://localhost:3000`.
|
|
41
86
|
|
|
87
|
+
### Other Commands
|
|
88
|
+
|
|
89
|
+
```bash
|
|
42
90
|
# Type check
|
|
43
91
|
pnpm typecheck
|
|
44
92
|
|
|
45
93
|
# Lint
|
|
46
94
|
pnpm lint
|
|
95
|
+
|
|
96
|
+
# Preview production build (Vite preview server)
|
|
97
|
+
pnpm preview
|
|
47
98
|
```
|
|
48
99
|
|
|
49
100
|
## Configuration
|
|
@@ -52,10 +103,10 @@ The API base URL can be configured via environment variable:
|
|
|
52
103
|
|
|
53
104
|
```bash
|
|
54
105
|
# .env.local
|
|
55
|
-
VITE_API_URL=http://localhost:
|
|
106
|
+
VITE_API_URL=http://localhost:3000
|
|
56
107
|
```
|
|
57
108
|
|
|
58
|
-
Default is `
|
|
109
|
+
Default is same-origin (`/api`) which matches the unified HTTP server.
|
|
59
110
|
|
|
60
111
|
## Build Output
|
|
61
112
|
|
|
@@ -71,15 +122,6 @@ The built static files can be:
|
|
|
71
122
|
2. Deployed to any static hosting (Vercel, Netlify, etc.)
|
|
72
123
|
3. Bundled in the Tauri desktop app
|
|
73
124
|
|
|
74
|
-
## Migration from Next.js
|
|
75
|
-
|
|
76
|
-
This SPA replaces the previous Next.js implementation with:
|
|
77
|
-
- ✅ ~99% smaller bundle (sub-MB Vite assets vs 129MB+ Next.js)
|
|
78
|
-
- ✅ Faster dev HMR and builds
|
|
79
|
-
- ✅ Simpler architecture (no SSR overhead)
|
|
80
|
-
- ✅ Same features and functionality
|
|
81
|
-
- ✅ Better performance
|
|
82
|
-
|
|
83
125
|
## License
|
|
84
126
|
|
|
85
127
|
MIT
|
package/bin/leanspec-ui.js
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
3
|
* LeanSpec UI Launcher
|
|
4
|
-
*
|
|
5
|
-
* This script
|
|
6
|
-
*
|
|
7
|
-
* 2. Serves the pre-built Vite UI on port 3000
|
|
8
|
-
*
|
|
9
|
-
* For development, use `npm run dev` or `pnpm dev` instead.
|
|
4
|
+
*
|
|
5
|
+
* This script starts the Rust HTTP server and serves the embedded UI
|
|
6
|
+
* from the same process and port.
|
|
10
7
|
*/
|
|
11
8
|
|
|
12
9
|
import { spawn } from 'child_process';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { join, dirname, extname } from 'path';
|
|
10
|
+
import { existsSync } from 'fs';
|
|
11
|
+
import { join, dirname } from 'path';
|
|
16
12
|
import { fileURLToPath } from 'url';
|
|
17
13
|
import { createRequire } from 'module';
|
|
18
14
|
|
|
@@ -20,93 +16,8 @@ const require = createRequire(import.meta.url);
|
|
|
20
16
|
const __filename = fileURLToPath(import.meta.url);
|
|
21
17
|
const __dirname = dirname(__filename);
|
|
22
18
|
|
|
23
|
-
// Configuration
|
|
24
|
-
const UI_PORT = process.env.PORT || 3000;
|
|
25
|
-
const API_PORT = process.env.API_PORT || 3333;
|
|
26
19
|
const DIST_DIR = join(__dirname, '..', 'dist');
|
|
27
20
|
|
|
28
|
-
// MIME types
|
|
29
|
-
const MIME_TYPES = {
|
|
30
|
-
'.html': 'text/html',
|
|
31
|
-
'.js': 'application/javascript',
|
|
32
|
-
'.css': 'text/css',
|
|
33
|
-
'.json': 'application/json',
|
|
34
|
-
'.png': 'image/png',
|
|
35
|
-
'.jpg': 'image/jpeg',
|
|
36
|
-
'.jpeg': 'image/jpeg',
|
|
37
|
-
'.gif': 'image/gif',
|
|
38
|
-
'.svg': 'image/svg+xml',
|
|
39
|
-
'.ico': 'image/x-icon',
|
|
40
|
-
'.woff': 'font/woff',
|
|
41
|
-
'.woff2': 'font/woff2',
|
|
42
|
-
'.ttf': 'font/ttf',
|
|
43
|
-
'.eot': 'application/vnd.ms-fontobject',
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
function getMimeType(filePath) {
|
|
47
|
-
const ext = extname(filePath).toLowerCase();
|
|
48
|
-
return MIME_TYPES[ext] || 'application/octet-stream';
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function serveFile(res, filePath) {
|
|
52
|
-
if (!existsSync(filePath)) {
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
try {
|
|
57
|
-
const content = readFileSync(filePath);
|
|
58
|
-
const mimeType = getMimeType(filePath);
|
|
59
|
-
res.writeHead(200, { 'Content-Type': mimeType });
|
|
60
|
-
res.end(content);
|
|
61
|
-
return true;
|
|
62
|
-
} catch (err) {
|
|
63
|
-
console.error('Error serving file:', filePath, err);
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const server = createServer((req, res) => {
|
|
69
|
-
// Remove query string and clean path
|
|
70
|
-
const url = req.url?.split('?')[0] || '/';
|
|
71
|
-
let filePath = join(DIST_DIR, url);
|
|
72
|
-
|
|
73
|
-
// Try serving the file directly
|
|
74
|
-
if (existsSync(filePath) && !filePath.endsWith('/')) {
|
|
75
|
-
const stat = require('fs').statSync(filePath);
|
|
76
|
-
if (stat.isFile()) {
|
|
77
|
-
if (serveFile(res, filePath)) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// Try with .html extension
|
|
84
|
-
if (!filePath.endsWith('.html') && existsSync(filePath + '.html')) {
|
|
85
|
-
if (serveFile(res, filePath + '.html')) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Try index.html in directory
|
|
91
|
-
if (existsSync(join(filePath, 'index.html'))) {
|
|
92
|
-
if (serveFile(res, join(filePath, 'index.html'))) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// Fallback to index.html for SPA routing
|
|
98
|
-
const indexPath = join(DIST_DIR, 'index.html');
|
|
99
|
-
if (existsSync(indexPath)) {
|
|
100
|
-
if (serveFile(res, indexPath)) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// 404
|
|
106
|
-
res.writeHead(404, { 'Content-Type': 'text/plain' });
|
|
107
|
-
res.end('404 Not Found');
|
|
108
|
-
});
|
|
109
|
-
|
|
110
21
|
// Check if dist exists
|
|
111
22
|
if (!existsSync(DIST_DIR)) {
|
|
112
23
|
console.error('Error: UI build not found!');
|
|
@@ -117,16 +28,18 @@ if (!existsSync(DIST_DIR)) {
|
|
|
117
28
|
process.exit(1);
|
|
118
29
|
}
|
|
119
30
|
|
|
120
|
-
// Start the Rust HTTP server (API
|
|
31
|
+
// Start the Rust HTTP server (serves API + UI)
|
|
121
32
|
let httpServerProcess;
|
|
122
33
|
try {
|
|
123
34
|
// Try to resolve @leanspec/http-server
|
|
124
35
|
const httpServerPath = require.resolve('@leanspec/http-server/bin/leanspec-http.js');
|
|
125
36
|
|
|
126
37
|
console.log('🚀 Starting LeanSpec HTTP server...');
|
|
127
|
-
|
|
38
|
+
const args = process.argv.slice(2);
|
|
39
|
+
|
|
40
|
+
httpServerProcess = spawn('node', [httpServerPath, ...args], {
|
|
128
41
|
stdio: 'inherit',
|
|
129
|
-
env: { ...process.env,
|
|
42
|
+
env: { ...process.env, LEANSPEC_UI_DIST: DIST_DIR }
|
|
130
43
|
});
|
|
131
44
|
|
|
132
45
|
httpServerProcess.on('error', (err) => {
|
|
@@ -151,29 +64,6 @@ try {
|
|
|
151
64
|
process.exit(1);
|
|
152
65
|
}
|
|
153
66
|
|
|
154
|
-
// Start the UI server
|
|
155
|
-
server.listen(UI_PORT, () => {
|
|
156
|
-
console.log('');
|
|
157
|
-
console.log(`✅ LeanSpec is running!`);
|
|
158
|
-
console.log(` UI: http://localhost:${UI_PORT}`);
|
|
159
|
-
console.log(` API: http://localhost:${API_PORT}`);
|
|
160
|
-
console.log('');
|
|
161
|
-
console.log(`Press Ctrl+C to stop`);
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
server.on('error', (err) => {
|
|
165
|
-
if (err.code === 'EADDRINUSE') {
|
|
166
|
-
console.error(`Error: Port ${UI_PORT} is already in use`);
|
|
167
|
-
console.error('Try setting a different port: PORT=3001 npx @leanspec/ui');
|
|
168
|
-
} else {
|
|
169
|
-
console.error('Server error:', err);
|
|
170
|
-
}
|
|
171
|
-
if (httpServerProcess) {
|
|
172
|
-
httpServerProcess.kill();
|
|
173
|
-
}
|
|
174
|
-
process.exit(1);
|
|
175
|
-
});
|
|
176
|
-
|
|
177
67
|
// Cleanup on exit
|
|
178
68
|
process.on('SIGINT', () => {
|
|
179
69
|
console.log('\n\nShutting down...');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bg as S,bH as ln,aH as A,be as P,bI as gn,bJ as dn,aG as W,bK as hn,bL as z,bM as pn,bC as An,bN as m,bh as N,bm as H,bp as T,bO as _n,bk as on,bP as wn,bF as On,aI as V,bD as bn,bQ as R}from"./index-
|
|
1
|
+
import{bg as S,bH as ln,aH as A,be as P,bI as gn,bJ as dn,aG as W,bK as hn,bL as z,bM as pn,bC as An,bN as m,bh as N,bm as H,bp as T,bO as _n,bk as on,bP as wn,bF as On,aI as V,bD as bn,bQ as R}from"./index-C4Vs5qK_.js";var Pn="[object Symbol]";function x(n){return typeof n=="symbol"||S(n)&&ln(n)==Pn}function vn(n,r){for(var e=-1,i=n==null?0:n.length,f=Array(i);++e<i;)f[e]=r(n[e],e,n);return f}var K=P?P.prototype:void 0,U=K?K.toString:void 0;function k(n){if(typeof n=="string")return n;if(A(n))return vn(n,k)+"";if(x(n))return U?U.call(n):"";var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}function yn(){}function En(n,r){for(var e=-1,i=n==null?0:n.length;++e<i&&r(n[e],e,n)!==!1;);return n}function cn(n,r,e,i){for(var f=n.length,t=e+-1;++t<f;)if(r(n[t],t,n))return t;return-1}function Tn(n){return n!==n}function In(n,r,e){for(var i=e-1,f=n.length;++i<f;)if(n[i]===r)return i;return-1}function Rn(n,r,e){return r===r?In(n,r,e):cn(n,Tn,e)}function Ln(n,r){var e=n==null?0:n.length;return!!e&&Rn(n,r,0)>-1}function M(n){return W(n)?gn(n):dn(n)}var Sn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xn=/^\w*$/;function C(n,r){if(A(n))return!1;var e=typeof n;return e=="number"||e=="symbol"||e=="boolean"||n==null||x(n)?!0:xn.test(n)||!Sn.test(n)||r!=null&&n in Object(r)}var Mn=500;function Cn(n){var r=hn(n,function(i){return e.size===Mn&&e.clear(),i}),e=r.cache;return r}var $n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dn=/\\(\\)?/g,Fn=Cn(function(n){var r=[];return n.charCodeAt(0)===46&&r.push(""),n.replace($n,function(e,i,f,t){r.push(f?t.replace(Dn,"$1"):i||e)}),r});function Gn(n){return n==null?"":k(n)}function j(n,r){return A(n)?n:C(n,r)?[n]:Fn(Gn(n))}function I(n){if(typeof n=="string"||x(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}function nn(n,r){r=j(r,n);for(var e=0,i=r.length;n!=null&&e<i;)n=n[I(r[e++])];return e&&e==i?n:void 0}function mn(n,r,e){var i=n==null?void 0:nn(n,r);return i===void 0?e:i}function rn(n,r){for(var e=-1,i=r.length,f=n.length;++e<i;)n[f+e]=r[e];return n}var B=P?P.isConcatSpreadable:void 0;function Nn(n){return A(n)||z(n)||!!(B&&n&&n[B])}function Br(n,r,e,i,f){var t=-1,s=n.length;for(e||(e=Nn),f||(f=[]);++t<s;){var u=n[t];e(u)?rn(f,u):i||(f[f.length]=u)}return f}function Hn(n,r,e,i){var f=-1,t=n==null?0:n.length;for(i&&t&&(e=n[++f]);++f<t;)e=r(e,n[f],f,n);return e}function en(n,r){for(var e=-1,i=n==null?0:n.length,f=0,t=[];++e<i;){var s=n[e];r(s,e,n)&&(t[f++]=s)}return t}function Kn(){return[]}var Un=Object.prototype,Bn=Un.propertyIsEnumerable,q=Object.getOwnPropertySymbols,qn=q?function(n){return n==null?[]:(n=Object(n),en(q(n),function(r){return Bn.call(n,r)}))}:Kn;function Zn(n,r,e){var i=r(n);return A(n)?i:rn(i,e(n))}function Z(n){return Zn(n,M,qn)}var Yn="__lodash_hash_undefined__";function Jn(n){return this.__data__.set(n,Yn),this}function Qn(n){return this.__data__.has(n)}function v(n){var r=-1,e=n==null?0:n.length;for(this.__data__=new pn;++r<e;)this.add(n[r])}v.prototype.add=v.prototype.push=Jn;v.prototype.has=Qn;function Xn(n,r){for(var e=-1,i=n==null?0:n.length;++e<i;)if(r(n[e],e,n))return!0;return!1}function tn(n,r){return n.has(r)}var Wn=1,zn=2;function fn(n,r,e,i,f,t){var s=e&Wn,u=n.length,a=r.length;if(u!=a&&!(s&&a>u))return!1;var h=t.get(n),g=t.get(r);if(h&&g)return h==r&&g==n;var l=-1,d=!0,o=e&zn?new v:void 0;for(t.set(n,r),t.set(r,n);++l<u;){var p=n[l],_=r[l];if(i)var w=s?i(_,p,l,r,n,t):i(p,_,l,n,r,t);if(w!==void 0){if(w)continue;d=!1;break}if(o){if(!Xn(r,function(O,b){if(!tn(o,b)&&(p===O||f(p,O,e,i,t)))return o.push(b)})){d=!1;break}}else if(!(p===_||f(p,_,e,i,t))){d=!1;break}}return t.delete(n),t.delete(r),d}function Vn(n){var r=-1,e=Array(n.size);return n.forEach(function(i,f){e[++r]=[f,i]}),e}function $(n){var r=-1,e=Array(n.size);return n.forEach(function(i){e[++r]=i}),e}var kn=1,jn=2,nr="[object Boolean]",rr="[object Date]",er="[object Error]",ir="[object Map]",tr="[object Number]",fr="[object RegExp]",sr="[object Set]",ur="[object String]",ar="[object Symbol]",lr="[object ArrayBuffer]",gr="[object DataView]",Y=P?P.prototype:void 0,L=Y?Y.valueOf:void 0;function dr(n,r,e,i,f,t,s){switch(e){case gr:if(n.byteLength!=r.byteLength||n.byteOffset!=r.byteOffset)return!1;n=n.buffer,r=r.buffer;case lr:return!(n.byteLength!=r.byteLength||!t(new m(n),new m(r)));case nr:case rr:case tr:return An(+n,+r);case er:return n.name==r.name&&n.message==r.message;case fr:case ur:return n==r+"";case ir:var u=Vn;case sr:var a=i&kn;if(u||(u=$),n.size!=r.size&&!a)return!1;var h=s.get(n);if(h)return h==r;i|=jn,s.set(n,r);var g=fn(u(n),u(r),i,f,t,s);return s.delete(n),g;case ar:if(L)return L.call(n)==L.call(r)}return!1}var hr=1,pr=Object.prototype,Ar=pr.hasOwnProperty;function _r(n,r,e,i,f,t){var s=e&hr,u=Z(n),a=u.length,h=Z(r),g=h.length;if(a!=g&&!s)return!1;for(var l=a;l--;){var d=u[l];if(!(s?d in r:Ar.call(r,d)))return!1}var o=t.get(n),p=t.get(r);if(o&&p)return o==r&&p==n;var _=!0;t.set(n,r),t.set(r,n);for(var w=s;++l<a;){d=u[l];var O=n[d],b=r[d];if(i)var G=s?i(b,O,d,r,n,t):i(O,b,d,n,r,t);if(!(G===void 0?O===b||f(O,b,e,i,t):G)){_=!1;break}w||(w=d=="constructor")}if(_&&!w){var y=n.constructor,E=r.constructor;y!=E&&"constructor"in n&&"constructor"in r&&!(typeof y=="function"&&y instanceof y&&typeof E=="function"&&E instanceof E)&&(_=!1)}return t.delete(n),t.delete(r),_}var or=1,J="[object Arguments]",Q="[object Array]",c="[object Object]",wr=Object.prototype,X=wr.hasOwnProperty;function Or(n,r,e,i,f,t){var s=A(n),u=A(r),a=s?Q:N(n),h=u?Q:N(r);a=a==J?c:a,h=h==J?c:h;var g=a==c,l=h==c,d=a==h;if(d&&H(n)){if(!H(r))return!1;s=!0,g=!1}if(d&&!g)return t||(t=new T),s||_n(n)?fn(n,r,e,i,f,t):dr(n,r,a,e,i,f,t);if(!(e&or)){var o=g&&X.call(n,"__wrapped__"),p=l&&X.call(r,"__wrapped__");if(o||p){var _=o?n.value():n,w=p?r.value():r;return t||(t=new T),f(_,w,e,i,t)}}return d?(t||(t=new T),_r(n,r,e,i,f,t)):!1}function D(n,r,e,i,f){return n===r?!0:n==null||r==null||!S(n)&&!S(r)?n!==n&&r!==r:Or(n,r,e,i,D,f)}var br=1,Pr=2;function vr(n,r,e,i){var f=e.length,t=f;if(n==null)return!t;for(n=Object(n);f--;){var s=e[f];if(s[2]?s[1]!==n[s[0]]:!(s[0]in n))return!1}for(;++f<t;){s=e[f];var u=s[0],a=n[u],h=s[1];if(s[2]){if(a===void 0&&!(u in n))return!1}else{var g=new T,l;if(!(l===void 0?D(h,a,br|Pr,i,g):l))return!1}}return!0}function sn(n){return n===n&&!on(n)}function yr(n){for(var r=M(n),e=r.length;e--;){var i=r[e],f=n[i];r[e]=[i,f,sn(f)]}return r}function un(n,r){return function(e){return e==null?!1:e[n]===r&&(r!==void 0||n in Object(e))}}function Er(n){var r=yr(n);return r.length==1&&r[0][2]?un(r[0][0],r[0][1]):function(e){return e===n||vr(e,n,r)}}function cr(n,r){return n!=null&&r in Object(n)}function Tr(n,r,e){r=j(r,n);for(var i=-1,f=r.length,t=!1;++i<f;){var s=I(r[i]);if(!(t=n!=null&&e(n,s)))break;n=n[s]}return t||++i!=f?t:(f=n==null?0:n.length,!!f&&wn(f)&&On(s,f)&&(A(n)||z(n)))}function Ir(n,r){return n!=null&&Tr(n,r,cr)}var Rr=1,Lr=2;function Sr(n,r){return C(n)&&sn(r)?un(I(n),r):function(e){var i=mn(e,n);return i===void 0&&i===r?Ir(e,n):D(r,i,Rr|Lr)}}function xr(n){return function(r){return r?.[n]}}function Mr(n){return function(r){return nn(r,n)}}function Cr(n){return C(n)?xr(I(n)):Mr(n)}function an(n){return typeof n=="function"?n:n==null?V:typeof n=="object"?A(n)?Sr(n[0],n[1]):Er(n):Cr(n)}function $r(n,r){return n&&bn(n,r,M)}function Dr(n,r){return function(e,i){if(e==null)return e;if(!W(e))return n(e,i);for(var f=e.length,t=-1,s=Object(e);++t<f&&i(s[t],t,s)!==!1;);return e}}var F=Dr($r);function Fr(n){return typeof n=="function"?n:V}function qr(n,r){var e=A(n)?En:F;return e(n,Fr(r))}function Gr(n,r){var e=[];return F(n,function(i,f,t){r(i,f,t)&&e.push(i)}),e}function Zr(n,r){var e=A(n)?en:Gr;return e(n,an(r))}function mr(n,r,e,i,f){return f(n,function(t,s,u){e=i?(i=!1,t):r(e,t,s,u)}),e}function Yr(n,r,e){var i=A(n)?Hn:mr,f=arguments.length<3;return i(n,an(r),e,f,F)}var Nr=1/0,Hr=R&&1/$(new R([,-0]))[1]==Nr?function(n){return new R(n)}:yn,Kr=200;function Jr(n,r,e){var i=-1,f=Ln,t=n.length,s=!0,u=[],a=u;if(t>=Kr){var h=r?null:Hr(n);if(h)return $(h);s=!1,f=tn,a=new v}else a=r?[]:u;n:for(;++i<t;){var g=n[i],l=r?r(g):g;if(g=g!==0?g:0,s&&l===l){for(var d=a.length;d--;)if(a[d]===l)continue n;r&&a.push(l),u.push(g)}else f(a,l,e)||(a!==u&&a.push(l),u.push(g))}return u}export{F as a,Br as b,vn as c,an as d,rn as e,Zn as f,qn as g,Z as h,x as i,En as j,M as k,Jr as l,Zr as m,qr as n,cn as o,Fr as p,$r as q,Yr as r,Kn as s,Tr as t,j as u,I as v,nn as w,Ir as x,Gn as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a3 as ln,a4 as an,a5 as g,a6 as tn,a7 as H,a8 as q,a9 as _,aa as un,ab as B,ac as rn,ad as L,ae as o,af as sn,ag as on,ah as fn}from"./index-
|
|
1
|
+
import{a3 as ln,a4 as an,a5 as g,a6 as tn,a7 as H,a8 as q,a9 as _,aa as un,ab as B,ac as rn,ad as L,ae as o,af as sn,ag as on,ah as fn}from"./index-C4Vs5qK_.js";function cn(l){return l.innerRadius}function gn(l){return l.outerRadius}function yn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,C,a){var O=I-l,i=D-h,n=C-v,d=a-A,u=d*O-n*i;if(!(u*u<g))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function W(l,h,I,D,v,A,C){var a=l-I,O=h-D,i=(C?A:-A)/L(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,F=(u+f)/2,t=(s+c)/2,m=f-u,y=c-s,R=m*m+y*y,T=v-A,P=u*c-f*s,S=(y<0?-1:1)*L(fn(0,T*T*R-P*P)),j=(P*y-m*S)/R,z=(-P*m-y*S)/R,w=(P*y+m*S)/R,p=(-P*m+y*S)/R,x=j-F,e=z-t,r=w-F,G=p-t;return x*x+e*e>r*r+G*G&&(j=w,z=p),{cx:j,cy:z,x01:-n,y01:-d,x11:j*(v/T-1),y11:z*(v/T-1)}}function hn(){var l=cn,h=gn,I=B(0),D=null,v=yn,A=dn,C=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=A.apply(this,arguments)-an,F=un(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>g))a.moveTo(0,0);else if(F>tn-g)a.moveTo(s*H(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>g&&(a.moveTo(u*H(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,y=c,R=f,T=c,P=F,S=F,j=C.apply(this,arguments)/2,z=j>g&&(D?+D.apply(this,arguments):L(u*u+s*s)),w=_(un(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(z>g){var G=sn(z/u*q(j)),M=sn(z/s*q(j));(P-=G*2)>g?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(S-=M*2)>g?(M*=t?1:-1,m+=M,y-=M):(S=0,m=y=(f+c)/2)}var J=s*H(m),K=s*q(m),N=u*H(T),Q=u*q(T);if(w>g){var U=s*H(y),V=s*q(y),X=u*H(R),Y=u*q(R),E;if(F<rn)if(E=pn(J,K,X,Y,U,V,N,Q)){var Z=J-E[0],$=K-E[1],b=U-E[0],k=V-E[1],nn=1/q(on((Z*b+$*k)/(L(Z*Z+$*$)*L(b*b+k*k)))/2),en=L(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>g?x>g?(e=W(X,Y,J,K,s,x,t),r=W(U,V,N,Q,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(J,K),a.arc(0,0,s,m,y,!t)):a.moveTo(J,K),!(u>g)||!(P>g)?a.lineTo(N,Q):p>g?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-rn/2;return[H(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:B(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:B(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:B(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:B(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:B(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:B(+n),i):A},i.padAngle=function(n){return arguments.length?(C=typeof n=="function"?n:B(+n),i):C},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
|