@lark-apaas/fullstack-vite-preset 1.0.2-alpha.4 → 1.0.2-alpha.6
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/lib/module-alias/echarts.d.ts +0 -4
- package/lib/module-alias/echarts.d.ts.map +1 -1
- package/lib/module-alias/echarts.js +2 -17
- package/lib/module-alias/echarts.js.map +1 -1
- package/lib/vite-plugins/module-alias-plugin.d.ts.map +1 -1
- package/lib/vite-plugins/module-alias-plugin.js +0 -4
- package/lib/vite-plugins/module-alias-plugin.js.map +1 -1
- package/package.json +2 -4
- package/src/module-alias/echarts.mjs +0 -14
- package/lib/module-alias/echarts-for-react.d.ts +0 -21
- package/lib/module-alias/echarts-for-react.d.ts.map +0 -1
- package/lib/module-alias/echarts-for-react.js +0 -108
- package/lib/module-alias/echarts-for-react.js.map +0 -1
- package/lib/vite-plugins/inspector-css-plugin.d.ts +0 -19
- package/lib/vite-plugins/inspector-css-plugin.d.ts.map +0 -1
- package/lib/vite-plugins/inspector-css-plugin.js +0 -70
- package/lib/vite-plugins/inspector-css-plugin.js.map +0 -1
- package/src/module-alias/echarts-for-react.mjs +0 -86
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import * as echartsNamespace from 'echarts';
|
|
2
2
|
export { echartsNamespace as echarts };
|
|
3
3
|
export * from 'echarts';
|
|
4
|
-
/**
|
|
5
|
-
* Mount echarts to window for debugging
|
|
6
|
-
*/
|
|
7
|
-
export declare function registerEchartsToWindow(): void;
|
|
8
4
|
export declare function resgisterEchartsTheme(): void;
|
|
9
5
|
//# sourceMappingURL=echarts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"echarts.d.ts","sourceRoot":"","sources":["../../src/module-alias/echarts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"echarts.d.ts","sourceRoot":"","sources":["../../src/module-alias/echarts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,gBAAgB,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,gBAAgB,IAAI,OAAO,EAAE,CAAC;AACvC,cAAc,SAAS,CAAC;AAOxB,wBAAgB,qBAAqB,IAAI,IAAI,CAoB5C"}
|
|
@@ -37,9 +37,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.echarts = void 0;
|
|
40
|
-
exports.registerEchartsToWindow = registerEchartsToWindow;
|
|
41
40
|
exports.resgisterEchartsTheme = resgisterEchartsTheme;
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
43
41
|
// @ts-nocheck - echarts types are complex, ignore for re-export
|
|
44
42
|
const echartsNamespace = __importStar(require("echarts"));
|
|
45
43
|
exports.echarts = echartsNamespace;
|
|
@@ -47,17 +45,6 @@ __exportStar(require("echarts"), exports);
|
|
|
47
45
|
const echarts_1 = require("echarts");
|
|
48
46
|
const registry_echarts_theme_1 = require("./registry_echarts_theme");
|
|
49
47
|
let isRegistered = false;
|
|
50
|
-
let isWindowMounted = false;
|
|
51
|
-
/**
|
|
52
|
-
* Mount echarts to window for debugging
|
|
53
|
-
*/
|
|
54
|
-
function registerEchartsToWindow() {
|
|
55
|
-
if (isWindowMounted || typeof globalThis.window === 'undefined') {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
isWindowMounted = true;
|
|
59
|
-
globalThis.echarts = echartsNamespace;
|
|
60
|
-
}
|
|
61
48
|
function resgisterEchartsTheme() {
|
|
62
49
|
// Register ud theme, only register once globally
|
|
63
50
|
if (isRegistered) {
|
|
@@ -69,16 +56,14 @@ function resgisterEchartsTheme() {
|
|
|
69
56
|
if (process.env.NODE_ENV === 'development') {
|
|
70
57
|
// Listen for HMR update completion to re-register theme
|
|
71
58
|
// Vite uses import.meta.hot instead of webpack's module.hot
|
|
72
|
-
// @ts-
|
|
59
|
+
// @ts-ignore - import.meta.hot is Vite-specific
|
|
73
60
|
if (import.meta.hot) {
|
|
74
|
-
//
|
|
75
|
-
// @ts-expect-error
|
|
61
|
+
// @ts-ignore
|
|
76
62
|
import.meta.hot.on('vite:afterUpdate', () => {
|
|
77
63
|
(0, echarts_1.registerTheme)('ud', (0, registry_echarts_theme_1.getShadcnEChartsTheme)());
|
|
78
64
|
});
|
|
79
65
|
}
|
|
80
66
|
}
|
|
81
67
|
}
|
|
82
|
-
registerEchartsToWindow();
|
|
83
68
|
resgisterEchartsTheme();
|
|
84
69
|
//# sourceMappingURL=echarts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"echarts.js","sourceRoot":"","sources":["../../src/module-alias/echarts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"echarts.js","sourceRoot":"","sources":["../../src/module-alias/echarts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,sDAoBC;AA9BD,gEAAgE;AAChE,0DAA4C;AACf,mCAAO;AACpC,0CAAwB;AAExB,qCAAwC;AACxC,qEAAiE;AAEjE,IAAI,YAAY,GAAG,KAAK,CAAC;AAEzB,SAAgB,qBAAqB;IACnC,iDAAiD;IACjD,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO;IACT,CAAC;IACD,YAAY,GAAG,IAAI,CAAC;IACpB,6DAA6D;IAC7D,IAAA,uBAAa,EAAC,IAAI,EAAE,IAAA,8CAAqB,GAAE,CAAC,CAAC;IAE7C,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE,CAAC;QAC3C,wDAAwD;QACxD,4DAA4D;QAC5D,gDAAgD;QAChD,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YACpB,aAAa;YACb,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;gBAC1C,IAAA,uBAAa,EAAC,IAAI,EAAE,IAAA,8CAAqB,GAAE,CAAC,CAAC;YAC/C,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC;AAED,qBAAqB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-alias-plugin.d.ts","sourceRoot":"","sources":["../../src/vite-plugins/module-alias-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"module-alias-plugin.d.ts","sourceRoot":"","sources":["../../src/vite-plugins/module-alias-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAwB1C;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -28,10 +28,6 @@ function moduleAliasPlugin() {
|
|
|
28
28
|
if (source === 'echarts') {
|
|
29
29
|
return path_1.default.resolve(__dirname, '../../src/module-alias/echarts.mjs');
|
|
30
30
|
}
|
|
31
|
-
// Replace 'echarts-for-react' with our wrapper (ESM version in src/)
|
|
32
|
-
if (source === 'echarts-for-react') {
|
|
33
|
-
return path_1.default.resolve(__dirname, '../../src/module-alias/echarts-for-react.mjs');
|
|
34
|
-
}
|
|
35
31
|
return null;
|
|
36
32
|
},
|
|
37
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-alias-plugin.js","sourceRoot":"","sources":["../../src/vite-plugins/module-alias-plugin.ts"],"names":[],"mappings":";;;;;AASA,
|
|
1
|
+
{"version":3,"file":"module-alias-plugin.js","sourceRoot":"","sources":["../../src/vite-plugins/module-alias-plugin.ts"],"names":[],"mappings":";;;;;AASA,8CAwBC;AAhCD,gDAAwB;AAExB;;;;;GAKG;AACH,SAAgB,iBAAiB;IAC/B,OAAO;QACL,IAAI,EAAE,wBAAwB;QAC9B,OAAO,EAAE,KAAK;QAEd,SAAS,CAAC,MAAM,EAAE,QAAQ;YACxB,wDAAwD;YACxD,IAAI,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;gBAClD,OAAO,IAAI,CAAC;YACd,CAAC;YAED,wDAAwD;YACxD,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;gBACtB,OAAO,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,iCAAiC,CAAC,CAAC;YACpE,CAAC;YAED,2DAA2D;YAC3D,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;gBACzB,OAAO,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,oCAAoC,CAAC,CAAC;YACvE,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC;AACJ,CAAC;AAED,kBAAe,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/fullstack-vite-preset",
|
|
3
|
-
"version": "1.0.2-alpha.
|
|
3
|
+
"version": "1.0.2-alpha.6",
|
|
4
4
|
"files": [
|
|
5
5
|
"lib",
|
|
6
6
|
"src/empty.css",
|
|
7
7
|
"src/inspector-stub.js",
|
|
8
8
|
"src/module-alias/clsx.mjs",
|
|
9
9
|
"src/module-alias/echarts.mjs",
|
|
10
|
-
"src/module-alias/echarts-for-react.mjs",
|
|
11
10
|
"src/module-alias/registry_echarts_theme.mjs",
|
|
12
11
|
"src/overlay"
|
|
13
12
|
],
|
|
@@ -33,7 +32,7 @@
|
|
|
33
32
|
"@babel/parser": "^7.28.0",
|
|
34
33
|
"@babel/traverse": "^7.28.0",
|
|
35
34
|
"@babel/types": "^7.28.2",
|
|
36
|
-
"@lark-apaas/devtool-kits": "
|
|
35
|
+
"@lark-apaas/devtool-kits": "1.2.17-alpha.28",
|
|
37
36
|
"@lark-apaas/miaoda-inspector-jsx-runtime": "^1.0.1",
|
|
38
37
|
"@lark-apaas/vite-inspector-plugin": "^1.0.1",
|
|
39
38
|
"@vitejs/plugin-react": "^4.5.0",
|
|
@@ -41,7 +40,6 @@
|
|
|
41
40
|
"colorjs.io": "^0.5.2",
|
|
42
41
|
"dotenv": "^16.4.5",
|
|
43
42
|
"echarts": "^6.0.0",
|
|
44
|
-
"echarts-for-react": "^3.0.2",
|
|
45
43
|
"postcss-import": "^16.1.1",
|
|
46
44
|
"styled-jsx": "^5.1.6",
|
|
47
45
|
"tailwind-merge": "^2.5.5",
|
|
@@ -2,23 +2,10 @@ import * as echartsNamespace from 'echarts';
|
|
|
2
2
|
export { echartsNamespace as echarts };
|
|
3
3
|
export * from 'echarts';
|
|
4
4
|
|
|
5
|
-
import * as echarts from 'echarts';
|
|
6
5
|
import { registerTheme } from 'echarts';
|
|
7
6
|
import { getShadcnEChartsTheme } from './registry_echarts_theme.mjs';
|
|
8
7
|
|
|
9
8
|
let isRegistered = false;
|
|
10
|
-
let isWindowMounted = false;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Mount echarts to window for debugging
|
|
14
|
-
*/
|
|
15
|
-
export function registerEchartsToWindow() {
|
|
16
|
-
if (isWindowMounted || typeof globalThis.window === 'undefined') {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
isWindowMounted = true;
|
|
20
|
-
globalThis.echarts = echarts;
|
|
21
|
-
}
|
|
22
9
|
|
|
23
10
|
export function resgisterEchartsTheme() {
|
|
24
11
|
// Register ud theme, only register once globally
|
|
@@ -39,5 +26,4 @@ export function resgisterEchartsTheme() {
|
|
|
39
26
|
}
|
|
40
27
|
}
|
|
41
28
|
|
|
42
|
-
registerEchartsToWindow();
|
|
43
29
|
resgisterEchartsTheme();
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import OriginalReactECharts from 'echarts-for-react';
|
|
3
|
-
import type { EChartsReactProps } from 'echarts-for-react';
|
|
4
|
-
/**
|
|
5
|
-
* Convert HSL/HSLA color to hex or rgba
|
|
6
|
-
*/
|
|
7
|
-
export declare function convertColorToHex(color: string): string;
|
|
8
|
-
/**
|
|
9
|
-
* Deep traverse object to transform all HSL colors in 'color' property
|
|
10
|
-
*/
|
|
11
|
-
export declare function transformColors<T>(value: T, visited?: WeakSet<object>): T;
|
|
12
|
-
/**
|
|
13
|
-
* EChartsReact wrapper component
|
|
14
|
-
* - Automatically converts HSL colors to hex in option
|
|
15
|
-
*/
|
|
16
|
-
export declare class EChartsReact extends React.Component<EChartsReactProps> {
|
|
17
|
-
render(): React.CElement<EChartsReactProps, OriginalReactECharts>;
|
|
18
|
-
}
|
|
19
|
-
export * from 'echarts-for-react';
|
|
20
|
-
export default EChartsReact;
|
|
21
|
-
//# sourceMappingURL=echarts-for-react.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"echarts-for-react.d.ts","sourceRoot":"","sources":["../../src/module-alias/echarts-for-react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,oBAAoB,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG3D;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAoBvD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,kBAAwB,GAAG,CAAC,CAqC/E;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC;IAClE,MAAM;CASP;AAED,cAAc,mBAAmB,CAAC;AAClC,eAAe,YAAY,CAAC"}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.EChartsReact = void 0;
|
|
21
|
-
exports.convertColorToHex = convertColorToHex;
|
|
22
|
-
exports.transformColors = transformColors;
|
|
23
|
-
const react_1 = __importDefault(require("react"));
|
|
24
|
-
const echarts_for_react_1 = __importDefault(require("echarts-for-react"));
|
|
25
|
-
const colorjs_io_1 = __importDefault(require("colorjs.io"));
|
|
26
|
-
/**
|
|
27
|
-
* Convert HSL/HSLA color to hex or rgba
|
|
28
|
-
*/
|
|
29
|
-
function convertColorToHex(color) {
|
|
30
|
-
if (typeof color !== 'string')
|
|
31
|
-
return color;
|
|
32
|
-
const trimmed = color.trim();
|
|
33
|
-
if (!trimmed.startsWith('hsl')) {
|
|
34
|
-
return color;
|
|
35
|
-
}
|
|
36
|
-
try {
|
|
37
|
-
const colorObj = new colorjs_io_1.default(trimmed);
|
|
38
|
-
if (colorObj.alpha < 1) {
|
|
39
|
-
return colorObj.to('srgb').toString({ format: 'rgba' });
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
return colorObj.to('srgb').toString({ format: 'hex' });
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
catch (error) {
|
|
46
|
-
console.warn(`Failed to convert color: ${color}`, error);
|
|
47
|
-
return color;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Deep traverse object to transform all HSL colors in 'color' property
|
|
52
|
-
*/
|
|
53
|
-
function transformColors(value, visited = new WeakSet()) {
|
|
54
|
-
if (value === null || value === undefined)
|
|
55
|
-
return value;
|
|
56
|
-
if (typeof value !== 'object')
|
|
57
|
-
return value;
|
|
58
|
-
if (visited.has(value))
|
|
59
|
-
return value;
|
|
60
|
-
if (value instanceof Date || value instanceof RegExp)
|
|
61
|
-
return value;
|
|
62
|
-
if (typeof value === 'function')
|
|
63
|
-
return value;
|
|
64
|
-
visited.add(value);
|
|
65
|
-
if (Array.isArray(value)) {
|
|
66
|
-
return value.map((item) => transformColors(item, visited));
|
|
67
|
-
}
|
|
68
|
-
const obj = value;
|
|
69
|
-
const result = {};
|
|
70
|
-
for (const key in obj) {
|
|
71
|
-
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
72
|
-
continue;
|
|
73
|
-
const propValue = obj[key];
|
|
74
|
-
if (key === 'color') {
|
|
75
|
-
if (typeof propValue === 'string') {
|
|
76
|
-
result[key] = convertColorToHex(propValue);
|
|
77
|
-
}
|
|
78
|
-
else if (Array.isArray(propValue)) {
|
|
79
|
-
result[key] = propValue.map((item) => typeof item === 'string' ? convertColorToHex(item) : transformColors(item, visited));
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
result[key] = transformColors(propValue, visited);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
result[key] = transformColors(propValue, visited);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return result;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* EChartsReact wrapper component
|
|
93
|
-
* - Automatically converts HSL colors to hex in option
|
|
94
|
-
*/
|
|
95
|
-
class EChartsReact extends react_1.default.Component {
|
|
96
|
-
render() {
|
|
97
|
-
const { option, ...rest } = this.props;
|
|
98
|
-
const transformedOption = option ? transformColors(option) : option;
|
|
99
|
-
return react_1.default.createElement(echarts_for_react_1.default, {
|
|
100
|
-
option: transformedOption,
|
|
101
|
-
...rest,
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
exports.EChartsReact = EChartsReact;
|
|
106
|
-
__exportStar(require("echarts-for-react"), exports);
|
|
107
|
-
exports.default = EChartsReact;
|
|
108
|
-
//# sourceMappingURL=echarts-for-react.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"echarts-for-react.js","sourceRoot":"","sources":["../../src/module-alias/echarts-for-react.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAQA,8CAoBC;AAKD,0CAqCC;AAtED,kDAA0B;AAC1B,0EAAqD;AAErD,4DAA+B;AAE/B;;GAEG;AACH,SAAgB,iBAAiB,CAAC,KAAa;IAC7C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAE5C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,IAAI,oBAAK,CAAC,OAAO,CAAC,CAAC;QAEpC,IAAI,QAAQ,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAC1D,CAAC;aAAM,CAAC;YACN,OAAO,QAAQ,CAAC,EAAE,CAAC,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CSS imports
|
|
4
|
-
*
|
|
5
|
-
* Creates an empty inspector.dev.css stub file if it doesn't exist.
|
|
6
|
-
* This is needed because:
|
|
7
|
-
* 1. @lark-apaas/client-toolkit imports @/inspector.dev.css
|
|
8
|
-
* 2. Vite's internal postcss-import processes @import statements before
|
|
9
|
-
* custom plugins can intercept them
|
|
10
|
-
* 3. The inspector UI injects its own styles at runtime, so this file
|
|
11
|
-
* can be empty
|
|
12
|
-
*
|
|
13
|
-
* In production mode, the stub file is cleaned up after build.
|
|
14
|
-
* In development mode, the stub file is kept (or user can provide real CSS).
|
|
15
|
-
*/
|
|
16
|
-
export declare function inspectorCssPlugin(options: {
|
|
17
|
-
isDev: boolean;
|
|
18
|
-
}): Plugin;
|
|
19
|
-
//# sourceMappingURL=inspector-css-plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inspector-css-plugin.d.ts","sourceRoot":"","sources":["../../src/vite-plugins/inspector-css-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,MAAM,CAAC;AAKnD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CA8CtE"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.inspectorCssPlugin = inspectorCssPlugin;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const INSPECTOR_CSS_FILENAME = 'inspector.dev.css';
|
|
10
|
-
const EMPTY_CSS_CONTENT = '/* Inspector CSS - placeholder for postcss-import */\n';
|
|
11
|
-
/**
|
|
12
|
-
* Vite plugin to handle inspector CSS imports
|
|
13
|
-
*
|
|
14
|
-
* Creates an empty inspector.dev.css stub file if it doesn't exist.
|
|
15
|
-
* This is needed because:
|
|
16
|
-
* 1. @lark-apaas/client-toolkit imports @/inspector.dev.css
|
|
17
|
-
* 2. Vite's internal postcss-import processes @import statements before
|
|
18
|
-
* custom plugins can intercept them
|
|
19
|
-
* 3. The inspector UI injects its own styles at runtime, so this file
|
|
20
|
-
* can be empty
|
|
21
|
-
*
|
|
22
|
-
* In production mode, the stub file is cleaned up after build.
|
|
23
|
-
* In development mode, the stub file is kept (or user can provide real CSS).
|
|
24
|
-
*/
|
|
25
|
-
function inspectorCssPlugin(options) {
|
|
26
|
-
const { isDev } = options;
|
|
27
|
-
let createdStubFile = null;
|
|
28
|
-
return {
|
|
29
|
-
name: 'vite-inspector-css',
|
|
30
|
-
enforce: 'pre',
|
|
31
|
-
configResolved(config) {
|
|
32
|
-
const rootDir = config.root || process.cwd();
|
|
33
|
-
const stubPath = path_1.default.resolve(rootDir, 'client/src', INSPECTOR_CSS_FILENAME);
|
|
34
|
-
// Create stub file if it doesn't exist (both dev and production)
|
|
35
|
-
// This prevents Vite's internal postcss-import from failing
|
|
36
|
-
if (!fs_1.default.existsSync(stubPath)) {
|
|
37
|
-
try {
|
|
38
|
-
// Ensure directory exists
|
|
39
|
-
const dir = path_1.default.dirname(stubPath);
|
|
40
|
-
if (!fs_1.default.existsSync(dir)) {
|
|
41
|
-
fs_1.default.mkdirSync(dir, { recursive: true });
|
|
42
|
-
}
|
|
43
|
-
fs_1.default.writeFileSync(stubPath, EMPTY_CSS_CONTENT);
|
|
44
|
-
// Only track for cleanup in production mode
|
|
45
|
-
if (!isDev) {
|
|
46
|
-
createdStubFile = stubPath;
|
|
47
|
-
}
|
|
48
|
-
console.log(`[vite-inspector-css] Created stub: ${stubPath}`);
|
|
49
|
-
}
|
|
50
|
-
catch (e) {
|
|
51
|
-
console.warn(`[vite-inspector-css] Could not create stub file: ${e}`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
buildEnd() {
|
|
56
|
-
// Clean up the stub file after production build completes
|
|
57
|
-
if (createdStubFile && fs_1.default.existsSync(createdStubFile)) {
|
|
58
|
-
try {
|
|
59
|
-
fs_1.default.unlinkSync(createdStubFile);
|
|
60
|
-
console.log(`[vite-inspector-css] Cleaned up stub: ${createdStubFile}`);
|
|
61
|
-
}
|
|
62
|
-
catch (e) {
|
|
63
|
-
console.warn(`[vite-inspector-css] Could not clean up stub file: ${e}`);
|
|
64
|
-
}
|
|
65
|
-
createdStubFile = null;
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
//# sourceMappingURL=inspector-css-plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inspector-css-plugin.js","sourceRoot":"","sources":["../../src/vite-plugins/inspector-css-plugin.ts"],"names":[],"mappings":";;;;;AAqBA,gDA8CC;AAnED,4CAAoB;AACpB,gDAAwB;AAGxB,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AACnD,MAAM,iBAAiB,GAAG,wDAAwD,CAAC;AAEnF;;;;;;;;;;;;;GAaG;AACH,SAAgB,kBAAkB,CAAC,OAA2B;IAC5D,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAC1B,IAAI,eAAe,GAAkB,IAAI,CAAC;IAE1C,OAAO;QACL,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,KAAK;QAEd,cAAc,CAAC,MAAsB;YACnC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;YAC7C,MAAM,QAAQ,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,EAAE,YAAY,EAAE,sBAAsB,CAAC,CAAC;YAE7E,iEAAiE;YACjE,4DAA4D;YAC5D,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,QAA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-
/**
|
|
6
|
-
* Convert HSL/HSLA color to hex or rgba
|
|
7
|
-
*/
|
|
8
|
-
export function convertColorToHex(color) {
|
|
9
|
-
if (typeof color !== 'string') return color;
|
|
10
|
-
|
|
11
|
-
const trimmed = color.trim();
|
|
12
|
-
if (!trimmed.startsWith('hsl')) {
|
|
13
|
-
return color;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
try {
|
|
17
|
-
const colorObj = new Color(trimmed);
|
|
18
|
-
|
|
19
|
-
if (colorObj.alpha < 1) {
|
|
20
|
-
return colorObj.to('srgb').toString({ format: 'rgba' });
|
|
21
|
-
} else {
|
|
22
|
-
return colorObj.to('srgb').toString({ format: 'hex' });
|
|
23
|
-
}
|
|
24
|
-
} catch (error) {
|
|
25
|
-
console.warn(`Failed to convert color: ${color}`, error);
|
|
26
|
-
return color;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Deep traverse object to transform all HSL colors in 'color' property
|
|
32
|
-
*/
|
|
33
|
-
export function transformColors(value, visited = new WeakSet()) {
|
|
34
|
-
if (value === null || value === undefined) return value;
|
|
35
|
-
if (typeof value !== 'object') return value;
|
|
36
|
-
if (visited.has(value)) return value;
|
|
37
|
-
if (value instanceof Date || value instanceof RegExp) return value;
|
|
38
|
-
if (typeof value === 'function') return value;
|
|
39
|
-
|
|
40
|
-
visited.add(value);
|
|
41
|
-
|
|
42
|
-
if (Array.isArray(value)) {
|
|
43
|
-
return value.map((item) => transformColors(item, visited));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const result = {};
|
|
47
|
-
for (const key in value) {
|
|
48
|
-
if (!Object.prototype.hasOwnProperty.call(value, key)) continue;
|
|
49
|
-
|
|
50
|
-
const propValue = value[key];
|
|
51
|
-
|
|
52
|
-
if (key === 'color') {
|
|
53
|
-
if (typeof propValue === 'string') {
|
|
54
|
-
result[key] = convertColorToHex(propValue);
|
|
55
|
-
} else if (Array.isArray(propValue)) {
|
|
56
|
-
result[key] = propValue.map((item) =>
|
|
57
|
-
typeof item === 'string' ? convertColorToHex(item) : transformColors(item, visited)
|
|
58
|
-
);
|
|
59
|
-
} else {
|
|
60
|
-
result[key] = transformColors(propValue, visited);
|
|
61
|
-
}
|
|
62
|
-
} else {
|
|
63
|
-
result[key] = transformColors(propValue, visited);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return result;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* EChartsReact wrapper component
|
|
72
|
-
*/
|
|
73
|
-
export class EChartsReact extends React.Component {
|
|
74
|
-
render() {
|
|
75
|
-
const { option, ...rest } = this.props;
|
|
76
|
-
const transformedOption = option ? transformColors(option) : option;
|
|
77
|
-
|
|
78
|
-
return React.createElement(OriginalReactECharts, {
|
|
79
|
-
option: transformedOption,
|
|
80
|
-
...rest,
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export * from 'echarts-for-react';
|
|
86
|
-
export default EChartsReact;
|