@tsingroc/tsingroc-components 5.0.0-alpha.27 → 5.0.2

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 (80) hide show
  1. package/dist/components/{AutoResizedECharts.d.ts → AutoResizedECharts/index.d.ts} +2 -2
  2. package/dist/components/{AutoResizedECharts.js → AutoResizedECharts/index.js} +2 -2
  3. package/dist/components/{Calendar.js → Calendar/index.js} +8 -8
  4. package/dist/components/{ConnectedECharts.d.ts → ConnectedECharts/index.d.ts} +2 -2
  5. package/dist/components/{ConnectedECharts.js → ConnectedECharts/index.js} +1 -1
  6. package/dist/components/ECharts/Wrapper.d.ts +5 -0
  7. package/dist/components/ECharts/Wrapper.js +16 -0
  8. package/dist/components/{ECharts.d.ts → ECharts/index.d.ts} +4 -1
  9. package/dist/components/{ECharts.js → ECharts/index.js} +2 -5
  10. package/dist/components/{Header.js → Header/index.js} +3 -3
  11. package/dist/components/{LeftAlignedECharts.d.ts → LeftAlignedECharts/index.d.ts} +2 -2
  12. package/dist/components/{LeftAlignedECharts.js → LeftAlignedECharts/index.js} +3 -3
  13. package/dist/components/{LineChartEditor.js → LineChartEditor/index.js} +3 -6
  14. package/dist/components/{LineChartTable.js → LineChartTable/index.js} +2 -2
  15. package/dist/components/{LinkedLineChart.d.ts → LinkedLineChart/index.d.ts} +1 -1
  16. package/dist/components/{LinkedLineChart.js → LinkedLineChart/index.js} +5 -2
  17. package/dist/components/{QuickDateRangePicker.js → QuickDateRangePicker/index.js} +6 -6
  18. package/dist/components/{SegmentedButtons.js → SegmentedButtons/index.js} +0 -2
  19. package/dist/components/{SelectableECharts.d.ts → SelectableECharts/index.d.ts} +11 -3
  20. package/dist/components/{SelectableECharts.js → SelectableECharts/index.js} +7 -4
  21. package/dist/components/{Sidebar.js → Sidebar/index.js} +3 -3
  22. package/dist/components/{TsingrocDatePicker.js → TsingrocDatePicker/index.js} +5 -5
  23. package/dist/components/{UserButton.js → UserButton/index.js} +3 -3
  24. package/dist/components/auth/AuthProvider.d.ts +39 -8
  25. package/dist/components/auth/AuthProvider.js +24 -1
  26. package/dist/components/auth/AuthService.d.ts +3 -0
  27. package/dist/components/auth/{CasdoorAuth.d.ts → CasdoorAuth/index.d.ts} +20 -3
  28. package/dist/components/auth/{CasdoorAuth.js → CasdoorAuth/index.js} +3 -3
  29. package/dist/components/auth/{EmbeddedAuth.d.ts → EmbeddedAuth/index.d.ts} +8 -3
  30. package/dist/components/auth/{EmbeddedAuth.js → EmbeddedAuth/index.js} +3 -3
  31. package/dist/components/auth/{LocalAuth.d.ts → LocalAuth/index.d.ts} +12 -3
  32. package/dist/components/auth/{LocalAuth.js → LocalAuth/index.js} +2 -2
  33. package/dist/components/auth/LoginCheck.d.ts +16 -0
  34. package/dist/components/auth/LoginCheck.js +5 -0
  35. package/dist/components/auth/SessionStore.d.ts +16 -4
  36. package/dist/components/auth/SessionStore.js +1 -1
  37. package/dist/components/auth/Wrappers.d.ts +37 -0
  38. package/dist/components/auth/Wrappers.js +68 -0
  39. package/dist/echarts/Wrappers.d.ts +34 -0
  40. package/dist/echarts/Wrappers.js +76 -0
  41. package/dist/echarts/coordinateSystems/Wrappers.d.ts +10 -0
  42. package/dist/echarts/coordinateSystems/Wrappers.js +31 -0
  43. package/dist/echarts/gl.js +3 -4
  44. package/dist/echarts/index.js +1 -1
  45. package/dist/echarts/series/Wrappers.d.ts +31 -0
  46. package/dist/echarts/series/Wrappers.js +102 -0
  47. package/dist/echarts/series/boxplotSeries.js +0 -2
  48. package/dist/echarts/series/intervalSeries.js +0 -1
  49. package/dist/echarts/series/maxBarSeries.js +0 -1
  50. package/dist/index.d.ts +0 -1
  51. package/dist/index.js +1 -2
  52. package/dist/utils/destructureLineDataItem.js +1 -2
  53. package/package.json +41 -34
  54. package/dist/components/VerticalColorLegend.d.ts +0 -7
  55. package/dist/components/VerticalColorLegend.js +0 -208
  56. package/dist/components/WeatherMap.d.ts +0 -18
  57. package/dist/components/WeatherMap.js +0 -658
  58. package/dist/deckgl/TiandituLayer.d.ts +0 -13
  59. package/dist/deckgl/TiandituLayer.js +0 -44
  60. package/dist/deckgl/WeatherData.d.ts +0 -53
  61. package/dist/deckgl/WeatherData.js +0 -94
  62. package/dist/deckgl/index.d.ts +0 -1
  63. package/dist/deckgl/index.js +0 -1
  64. /package/dist/components/{Calendar.d.ts → Calendar/index.d.ts} +0 -0
  65. /package/dist/components/{CircularProgress.d.ts → CircularProgress/index.d.ts} +0 -0
  66. /package/dist/components/{CircularProgress.js → CircularProgress/index.js} +0 -0
  67. /package/dist/components/{Header.d.ts → Header/index.d.ts} +0 -0
  68. /package/dist/components/{ImageBackground.d.ts → ImageBackground/index.d.ts} +0 -0
  69. /package/dist/components/{ImageBackground.js → ImageBackground/index.js} +0 -0
  70. /package/dist/components/{IndicatorLight.d.ts → IndicatorLight/index.d.ts} +0 -0
  71. /package/dist/components/{IndicatorLight.js → IndicatorLight/index.js} +0 -0
  72. /package/dist/components/{LineChartEditor.d.ts → LineChartEditor/index.d.ts} +0 -0
  73. /package/dist/components/{LineChartTable.d.ts → LineChartTable/index.d.ts} +0 -0
  74. /package/dist/components/{QuickDateRangePicker.d.ts → QuickDateRangePicker/index.d.ts} +0 -0
  75. /package/dist/components/{SegmentedButtons.d.ts → SegmentedButtons/index.d.ts} +0 -0
  76. /package/dist/components/{Sidebar.d.ts → Sidebar/index.d.ts} +0 -0
  77. /package/dist/components/{TsingrocDatePicker.d.ts → TsingrocDatePicker/index.d.ts} +0 -0
  78. /package/dist/components/{TsingrocTheme.d.ts → TsingrocTheme/index.d.ts} +0 -0
  79. /package/dist/components/{TsingrocTheme.js → TsingrocTheme/index.js} +0 -0
  80. /package/dist/components/{UserButton.d.ts → UserButton/index.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsingroc/tsingroc-components",
3
- "version": "5.0.0-alpha.27",
3
+ "version": "5.0.2",
4
4
  "author": "",
5
5
  "license": "ISC",
6
6
  "description": "",
@@ -29,68 +29,75 @@
29
29
  ],
30
30
  "scripts": {
31
31
  "test": "echo \"Error: no test specified\" && exit 1",
32
- "dev": "vite",
33
- "lint": "oxlint --type-aware",
34
- "format": "dprint fmt && oxlint --type-aware --fix",
35
- "build": "rm -rf dist && (npx babel src --out-dir dist --extensions .ts,.tsx & tsc -p tsconfig.lib.json & copyfiles src/**/*.css dist --up 1 & wait)",
36
- "prepublishOnly": "npm run build",
37
- "docs:build": "vite build",
38
- "docs:preview": "vite preview"
32
+ "storybook": "storybook dev -p 6006 --no-open",
33
+ "build-storybook": "storybook build -o dist-storybook",
34
+ "lint": "oxlint && dprint check",
35
+ "format": "oxlint --fix && dprint fmt",
36
+ "build": "rm -rf dist && (npx babel src --out-dir dist --extensions .ts,.tsx & tsc -p tsconfig.lib.json & copyfiles src/**/*.css dist --up 1 & wait)"
39
37
  },
40
38
  "dependencies": {
41
39
  "antd-style": "^4.1.0",
42
- "casdoor-js-sdk": "^0.16.0",
43
- "dayjs": "^1.11.19",
44
- "deck.gl": "^9.2.6",
45
- "geotiff": "^2.1.3",
46
- "jwt-decode": "^4.0.0",
47
- "react-icons": "^5.5.0",
48
- "rollup-plugin-worker-factory": "^0.5.7",
49
- "weatherlayers-gl": "^2025.12.0"
40
+ "casdoor-js-sdk": "^0.18.0",
41
+ "dayjs": "^1.11.20",
42
+ "jwt-decode": "^4.0.0"
50
43
  },
51
44
  "peerDependencies": {
52
45
  "@ant-design/icons": "^6.1.0",
53
- "antd": "^6.2.3",
46
+ "antd": "^6.3.3",
54
47
  "echarts": "^6.0.0",
55
48
  "echarts-gl": "^2.0.9",
56
49
  "react": "^19.2.4",
57
50
  "react-dom": "^19.2.4"
58
51
  },
52
+ "peerDependenciesMeta": {
53
+ "echarts-gl": {
54
+ "optional": true
55
+ }
56
+ },
59
57
  "devDependencies": {
60
58
  "@ant-design/icons": "^6.1.0",
61
- "@ant-design/v5-patch-for-react-19": "^1.0.3",
62
59
  "@babel/cli": "^7.28.6",
63
60
  "@babel/core": "^7.29.0",
64
61
  "@babel/preset-react": "^7.28.5",
65
62
  "@babel/preset-typescript": "^7.28.5",
66
- "@content-collections/core": "^0.13.1",
67
- "@content-collections/mdx": "^0.2.2",
68
- "@content-collections/vite": "^0.2.8",
69
- "@types/node": "^22.19.9",
70
- "@types/react": "^19.2.13",
63
+ "@storybook/addon-a11y": "^10.3.3",
64
+ "@storybook/addon-docs": "^10.3.3",
65
+ "@storybook/addon-mcp": "^0.4.2",
66
+ "@storybook/addon-vitest": "^10.3.3",
67
+ "@storybook/react-vite": "^10.3.3",
68
+ "@types/node": "^22.19.15",
69
+ "@types/react": "^19.2.14",
71
70
  "@types/react-dom": "^19.2.3",
72
- "@vitejs/plugin-react": "^5.1.3",
73
- "antd": "^6.2.3",
71
+ "@vitejs/plugin-react": "^5.2.0",
72
+ "@vitest/browser-playwright": "^4.1.1",
73
+ "@vitest/coverage-v8": "^4.1.1",
74
+ "antd": "^6.3.4",
74
75
  "babel-plugin-react-compiler": "^1.0.0",
75
76
  "copyfiles": "^2.4.1",
76
- "dprint": "^0.51.1",
77
+ "dprint": "^0.53.0",
77
78
  "echarts": "^6.0.0",
78
79
  "echarts-gl": "^2.0.9",
79
80
  "eslint-plugin-react-hooks": "^7.0.1",
80
- "oxlint": "^1.43.0",
81
- "oxlint-tsgolint": "^0.11.4",
81
+ "oxlint": "^1.57.0",
82
+ "oxlint-tsgolint": "^0.17.3",
83
+ "playwright": "^1.58.2",
82
84
  "react": "^19.2.4",
83
85
  "react-dom": "^19.2.4",
84
- "react-markdown": "^10.1.0",
85
- "remark-gfm": "^4.0.1",
86
- "typedoc": "^0.28.16",
87
- "typescript": "^5.9.3",
88
- "vite": "npm:rolldown-vite@^7.3.1",
89
- "zod": "^4.3.6"
86
+ "storybook": "^10.3.3",
87
+ "typescript": "^6.0.2",
88
+ "vitest": "^4.1.1"
90
89
  },
91
90
  "overrides": {
92
91
  "echarts-gl": {
93
92
  "echarts": "^6.0.0"
94
93
  }
94
+ },
95
+ "imports": {
96
+ "#.storybook/preview": "./.storybook/preview.tsx",
97
+ "#src/*": [
98
+ "./dist/*",
99
+ "./dist/*.js",
100
+ "./dist/*/index.js"
101
+ ]
95
102
  }
96
103
  }
@@ -1,7 +0,0 @@
1
- import type { HTMLAttributes } from "react";
2
- export interface VerticalColorLegendProps extends HTMLAttributes<HTMLDivElement> {
3
- title?: string;
4
- palette: [number, [number, number, number]][];
5
- }
6
- declare function VerticalColorLegend(props: VerticalColorLegendProps): import("react/jsx-runtime").JSX.Element;
7
- export default VerticalColorLegend;
@@ -1,208 +0,0 @@
1
- import { c as _c } from "react/compiler-runtime";
2
- import { theme } from "antd";
3
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
- function VerticalColorLegend(props) {
5
- const $ = _c(43);
6
- let palette;
7
- let rest;
8
- let title;
9
- if ($[0] !== props) {
10
- ({
11
- title,
12
- palette,
13
- ...rest
14
- } = props);
15
- $[0] = props;
16
- $[1] = palette;
17
- $[2] = rest;
18
- $[3] = title;
19
- } else {
20
- palette = $[1];
21
- rest = $[2];
22
- title = $[3];
23
- }
24
- const {
25
- token
26
- } = theme.useToken();
27
- let t0;
28
- if ($[4] !== palette) {
29
- t0 = palette.at(-1);
30
- $[4] = palette;
31
- $[5] = t0;
32
- } else {
33
- t0 = $[5];
34
- }
35
- const max = t0[0];
36
- const min = palette[0][0];
37
- const range = max - min;
38
- let t1;
39
- if ($[6] !== rest.style || $[7] !== token.colorText || $[8] !== token.fontSizeSM) {
40
- t1 = {
41
- display: "flex",
42
- flexDirection: "column",
43
- userSelect: "none",
44
- fontSize: token.fontSizeSM,
45
- color: token.colorText,
46
- textShadow: "-1px -1px white, 0px -1px white, 1px -1px white, 1px 0px white, 1px 1px white, 0px 1px white, -1px 1px white, -1px 0px white",
47
- ...rest.style
48
- };
49
- $[6] = rest.style;
50
- $[7] = token.colorText;
51
- $[8] = token.fontSizeSM;
52
- $[9] = t1;
53
- } else {
54
- t1 = $[9];
55
- }
56
- let t2;
57
- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
58
- t2 = {
59
- fontWeight: "bold"
60
- };
61
- $[10] = t2;
62
- } else {
63
- t2 = $[10];
64
- }
65
- let t3;
66
- if ($[11] !== title) {
67
- t3 = /*#__PURE__*/_jsx("div", {
68
- style: t2,
69
- children: title
70
- });
71
- $[11] = title;
72
- $[12] = t3;
73
- } else {
74
- t3 = $[12];
75
- }
76
- let t4;
77
- if ($[13] !== token.paddingXXS) {
78
- t4 = {
79
- display: "flex",
80
- flexBasis: "100%",
81
- alignItems: "stretch",
82
- gap: token.paddingXXS,
83
- paddingBlock: "0.5em"
84
- };
85
- $[13] = token.paddingXXS;
86
- $[14] = t4;
87
- } else {
88
- t4 = $[14];
89
- }
90
- let t5;
91
- if ($[15] !== min || $[16] !== palette || $[17] !== range) {
92
- let t6;
93
- if ($[19] !== min || $[20] !== range) {
94
- t6 = t7 => {
95
- const [value, color] = t7;
96
- return `rgb(${color.join(", ")}) ${(value - min) / range * 100}%`;
97
- };
98
- $[19] = min;
99
- $[20] = range;
100
- $[21] = t6;
101
- } else {
102
- t6 = $[21];
103
- }
104
- t5 = palette.map(t6).join(", ");
105
- $[15] = min;
106
- $[16] = palette;
107
- $[17] = range;
108
- $[18] = t5;
109
- } else {
110
- t5 = $[18];
111
- }
112
- const t6 = `linear-gradient(
113
- to top,
114
- ${t5}
115
- )`;
116
- let t7;
117
- if ($[22] !== t6) {
118
- t7 = /*#__PURE__*/_jsx("div", {
119
- style: {
120
- width: 24,
121
- background: t6
122
- }
123
- });
124
- $[22] = t6;
125
- $[23] = t7;
126
- } else {
127
- t7 = $[23];
128
- }
129
- let t8;
130
- if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
131
- t8 = {
132
- lineHeight: 0,
133
- verticalAlign: "middle"
134
- };
135
- $[24] = t8;
136
- } else {
137
- t8 = $[24];
138
- }
139
- let t9;
140
- if ($[25] !== max || $[26] !== palette || $[27] !== range) {
141
- let t10;
142
- if ($[29] !== max || $[30] !== range) {
143
- t10 = (t11, i) => {
144
- const [value_0] = t11;
145
- return /*#__PURE__*/_jsx("div", {
146
- style: {
147
- position: "relative",
148
- top: `${(max - value_0) / range * 100}%`
149
- },
150
- children: value_0.toFixed(1)
151
- }, i);
152
- };
153
- $[29] = max;
154
- $[30] = range;
155
- $[31] = t10;
156
- } else {
157
- t10 = $[31];
158
- }
159
- t9 = palette.map(t10);
160
- $[25] = max;
161
- $[26] = palette;
162
- $[27] = range;
163
- $[28] = t9;
164
- } else {
165
- t9 = $[28];
166
- }
167
- let t10;
168
- if ($[32] !== t9) {
169
- t10 = /*#__PURE__*/_jsx("div", {
170
- style: t8,
171
- children: t9
172
- });
173
- $[32] = t9;
174
- $[33] = t10;
175
- } else {
176
- t10 = $[33];
177
- }
178
- let t11;
179
- if ($[34] !== t10 || $[35] !== t4 || $[36] !== t7) {
180
- t11 = /*#__PURE__*/_jsxs("div", {
181
- style: t4,
182
- children: [t7, t10]
183
- });
184
- $[34] = t10;
185
- $[35] = t4;
186
- $[36] = t7;
187
- $[37] = t11;
188
- } else {
189
- t11 = $[37];
190
- }
191
- let t12;
192
- if ($[38] !== rest || $[39] !== t1 || $[40] !== t11 || $[41] !== t3) {
193
- t12 = /*#__PURE__*/_jsxs("div", {
194
- ...rest,
195
- style: t1,
196
- children: [t3, t11]
197
- });
198
- $[38] = rest;
199
- $[39] = t1;
200
- $[40] = t11;
201
- $[41] = t3;
202
- $[42] = t12;
203
- } else {
204
- t12 = $[42];
205
- }
206
- return t12;
207
- }
208
- export default VerticalColorLegend;
@@ -1,18 +0,0 @@
1
- import { type HTMLAttributes } from "react";
2
- import { type WeatherData } from "../deckgl/WeatherData";
3
- export { type WeatherData };
4
- export interface WeatherMapProps extends HTMLAttributes<HTMLDivElement> {
5
- /** 天地图平台的 token。*/
6
- tiandituTk: string;
7
- /** 要显示的天气数据。如果为 `undefined`,则会显示加载界面。*/
8
- data: WeatherData | undefined;
9
- }
10
- /**
11
- * 一张显示各类天气信息的地图。
12
- *
13
- * 多余的属性会被传递给组件最外层的 [`div` 元素][1]。
14
- *
15
- * [1]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div
16
- */
17
- declare function WeatherMap(props: WeatherMapProps): import("react/jsx-runtime").JSX.Element;
18
- export default WeatherMap;