@rfkit/charts 1.3.13 → 1.4.0

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 (123) hide show
  1. package/README.md +57 -0
  2. package/components/AxisY/spectrum/controls/index.d.ts +3 -0
  3. package/components/AxisY/spectrum/index.d.ts +3 -2
  4. package/components/AxisY/spectrum/{components/Ticks → presenters/TicksPanel}/index.d.ts +3 -3
  5. package/components/AxisY/spectrum/presenters/index.d.ts +1 -0
  6. package/components/AxisY/spectrum/useRanging/index.d.ts +4 -1
  7. package/components/AxisY/spectrum/useRanging/ranging.d.ts +3 -1
  8. package/components/AxisYByCanvas/useCanvasAxisY.d.ts +2 -2
  9. package/components/Cursor/registry.d.ts +7 -0
  10. package/components/DragSelectBox/index.d.ts +3 -1
  11. package/components/FrequencyAllocation/index.d.ts +2 -2
  12. package/components/FrequencyAllocation/model/index.d.ts +4 -0
  13. package/components/FrequencyAllocation/model/resolveFrequencyAllocationData.d.ts +2 -0
  14. package/components/FrequencyAllocation/model/resolver.d.ts +18 -0
  15. package/components/FrequencyAllocation/model/useAllocationAtCursor.d.ts +6 -0
  16. package/components/FrequencyAllocation/model/useFrequencyAllocationData.d.ts +1 -0
  17. package/components/FrequencyAllocation/overlays/Tooltip/index.d.ts +4 -0
  18. package/components/FrequencyAllocation/overlays/index.d.ts +1 -0
  19. package/components/FrequencyAllocation/{AllocationInfo → presenters/AllocationInfo}/index.d.ts +1 -1
  20. package/components/FrequencyAllocation/presenters/AllocationSegments/index.d.ts +12 -0
  21. package/components/FrequencyAllocation/presenters/index.d.ts +2 -0
  22. package/components/FrequencyDataBoard/hooks/index.d.ts +1 -0
  23. package/components/FrequencyDataBoard/hooks/useStationInfoAtCursor.d.ts +1 -0
  24. package/components/FrequencyDataBoard/index.d.ts +1 -0
  25. package/components/FrequencyDataBoard/{StationInfo → panels/StationInfoPanel}/index.d.ts +1 -1
  26. package/components/FrequencyDataBoard/panels/index.d.ts +1 -0
  27. package/components/FrequencyTagLine/index.d.ts +1 -1
  28. package/components/GridLines/OccupancyDashed/index.d.ts +3 -0
  29. package/components/{Dropdown → Overlay/Dropdown}/index.d.ts +10 -2
  30. package/components/{Tooltip → Overlay/Tooltip}/index.d.ts +1 -1
  31. package/components/Overlay/index.d.ts +4 -0
  32. package/components/Signal/index.d.ts +2 -1
  33. package/components/Signal/metadata/index.d.ts +1 -0
  34. package/components/Signal/model/index.d.ts +3 -0
  35. package/components/Signal/model/resolver.d.ts +40 -0
  36. package/components/Signal/model/useStationInfoAtCursor.d.ts +7 -0
  37. package/components/Signal/model/useUnifiedSignals.d.ts +6 -0
  38. package/components/Signal/presenters/SignalSegments/index.d.ts +10 -0
  39. package/components/Signal/presenters/index.d.ts +1 -0
  40. package/components/Signal/utils.d.ts +13 -1
  41. package/components/ToolsBar/{SeriesControl → controls/SeriesControl}/index.d.ts +1 -1
  42. package/components/ToolsBar/controls/index.d.ts +4 -0
  43. package/components/ToolsBar/{GradientRibbon → decorations/GradientRibbon}/index.d.ts +1 -1
  44. package/components/ToolsBar/decorations/index.d.ts +2 -0
  45. package/components/ToolsBar/primitives/IconBox.d.ts +11 -0
  46. package/components/ToolsBar/primitives/ToolbarContentBox.d.ts +11 -0
  47. package/components/ToolsBar/primitives/ToolbarDropdown.d.ts +16 -0
  48. package/components/ToolsBar/primitives/ToolbarGlyph.d.ts +10 -0
  49. package/components/ToolsBar/primitives/ToolbarGroup.d.ts +10 -0
  50. package/components/ToolsBar/primitives/ToolbarGroupIconBox.d.ts +5 -0
  51. package/components/ToolsBar/primitives/ToolbarSurface.d.ts +15 -0
  52. package/components/ToolsBar/primitives/index.d.ts +8 -0
  53. package/components/ToolsBar/primitives/styles.d.ts +41 -0
  54. package/components/ToolsBar/registry.d.ts +12 -0
  55. package/components/ToolsBar/toggles/index.d.ts +10 -0
  56. package/components/ui/button.d.ts +16 -0
  57. package/components/ui/checkbox.d.ts +4 -0
  58. package/components/ui/cursor-follow-layer.d.ts +10 -0
  59. package/components/ui/dialog.d.ts +12 -0
  60. package/components/ui/dropdown-menu.d.ts +9 -0
  61. package/components/ui/input.d.ts +1 -0
  62. package/components/ui/number-input.d.ts +10 -0
  63. package/components/ui/panel.d.ts +9 -0
  64. package/components/ui/popover.d.ts +7 -0
  65. package/components/ui/scroll-area.d.ts +5 -0
  66. package/components/ui/select.d.ts +11 -0
  67. package/components/ui/separator.d.ts +4 -0
  68. package/components/ui/slider.d.ts +2 -0
  69. package/components/ui/switch.d.ts +2 -0
  70. package/components/ui/tabs.d.ts +7 -0
  71. package/components/ui/tooltip.d.ts +7 -0
  72. package/components/ui/useChartsPortalContainer.d.ts +1 -0
  73. package/config/setting.d.ts +3 -3
  74. package/hooks/index.d.ts +2 -2
  75. package/hooks/publish/enhancedPublish.d.ts +17 -0
  76. package/hooks/publish/index.d.ts +1 -0
  77. package/hooks/publish/useSafePublish.d.ts +2 -8
  78. package/hooks/useChartComponent.d.ts +0 -6
  79. package/hooks/useDragSelect.d.ts +2 -0
  80. package/index.d.ts +4 -0
  81. package/index.js +19316 -7774
  82. package/lib/index.d.ts +1 -1
  83. package/package.json +8 -1
  84. package/store/Params.d.ts +2 -1
  85. package/store/constants.d.ts +2 -3
  86. package/store/context.d.ts +1 -1
  87. package/store/globalState.d.ts +4 -0
  88. package/store/hooks/index.d.ts +1 -0
  89. package/store/index.d.ts +1 -1
  90. package/store/reducer.d.ts +0 -34
  91. package/tailwind-bridge.css +123 -0
  92. package/theme/charts-theme-controller.d.ts +27 -0
  93. package/theme/charts-theme-environment.d.ts +7 -0
  94. package/theme/init-charts-theme.d.ts +16 -0
  95. package/theme/shadcn-theme-config.d.ts +221 -0
  96. package/theme/style-scope.d.ts +21 -0
  97. package/types/store/ui.d.ts +15 -1
  98. package/utils/cn.d.ts +2 -0
  99. package/utils/converter.d.ts +1 -1
  100. package/utils/cursor.d.ts +12 -0
  101. package/utils/frequencyCalculation.d.ts +8 -0
  102. package/utils/index.d.ts +1 -0
  103. package/utils/subscription.d.ts +1 -0
  104. package/utils/theme.d.ts +2 -2
  105. package/components/FrequencyAllocation/SegmentContainer.d.ts +0 -12
  106. package/components/FrequencyAllocation/Tooltip/index.d.ts +0 -8
  107. package/components/FrequencyAllocation/useAllocationFinder.d.ts +0 -10
  108. package/components/GridLines/Occdahsed/index.d.ts +0 -3
  109. package/components/Signal/SegmentContainer.d.ts +0 -26
  110. package/components/Signal/useStationFinder.d.ts +0 -12
  111. package/components/ToolsBar/IconBox.d.ts +0 -12
  112. /package/components/AxisY/spectrum/{components/Autoranging/index.d.ts → controls/AutorangingControl.d.ts} +0 -0
  113. /package/components/AxisY/spectrum/{components/Step/index.d.ts → controls/StepControl.d.ts} +0 -0
  114. /package/components/AxisY/spectrum/{components/Unit/index.d.ts → controls/UnitControl.d.ts} +0 -0
  115. /package/components/Cursor/{Popover → popovers}/index.d.ts +0 -0
  116. /package/components/{GuageBox → GaugeBox}/index.d.ts +0 -0
  117. /package/components/{Popover → Overlay/Popover}/index.d.ts +0 -0
  118. /package/components/{Portal → Overlay/Portal}/index.d.ts +0 -0
  119. /package/components/Signal/{type.d.ts → metadata/signalType.d.ts} +0 -0
  120. /package/components/ToolsBar/{Reset.d.ts → controls/Reset.d.ts} +0 -0
  121. /package/components/ToolsBar/{SegmentsDisplayControl → controls/SegmentsDisplayControl}/index.d.ts +0 -0
  122. /package/components/ToolsBar/{SeriesDisplayControl → controls/SeriesDisplayControl}/index.d.ts +0 -0
  123. /package/components/ToolsBar/{SpacerLine.d.ts → decorations/SpacerLine.d.ts} +0 -0
package/lib/index.d.ts CHANGED
@@ -5,4 +5,4 @@ import IQ from './IQ';
5
5
  import LevelStream from './LevelStream';
6
6
  import Occupancy from './Occupancy';
7
7
  import Spectrum from './Spectrum';
8
- export { Spectrum, LevelStream, IQ, Gauge, Dial, Heatmap, Occupancy };
8
+ export { Dial, Gauge, Heatmap, IQ, LevelStream, Occupancy, Spectrum };
package/package.json CHANGED
@@ -1,10 +1,17 @@
1
1
  {
2
2
  "name": "@rfkit/charts",
3
3
  "description": "a chart library based on all",
4
+ "exports": {
5
+ ".": {
6
+ "types": "./index.d.ts",
7
+ "import": "./index.js"
8
+ },
9
+ "./tailwind-bridge.css": "./tailwind-bridge.css"
10
+ },
4
11
  "module": "index.js",
5
12
  "types": "index.d.ts",
6
13
  "author": "Hxgh",
7
14
  "license": "MIT",
8
- "version": "1.3.13",
15
+ "version": "1.4.0",
9
16
  "private": false
10
17
  }
package/store/Params.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type React from 'react';
2
- import type { ParamsProps, StoreState } from '../types';
2
+ import type { AxisYProps, ParamsProps, StoreState } from '../types';
3
3
  /**
4
4
  * 混合参数
5
5
  * @param key 参数键名
@@ -8,5 +8,6 @@ import type { ParamsProps, StoreState } from '../types';
8
8
  * @returns 混合后的参数
9
9
  */
10
10
  export declare function mergeParameter<K extends keyof StoreState>(key: K, params: Partial<StoreState[K]>, state?: StoreState): StoreState[K];
11
+ export declare function normalizeAxisYProps(axisY?: Partial<AxisYProps>): Partial<AxisYProps> | undefined;
11
12
  declare const Params: React.FC<ParamsProps>;
12
13
  export default Params;
@@ -14,9 +14,8 @@ export declare const axisYTypeList: {
14
14
  default: string;
15
15
  };
16
16
  export declare const DEFAULT_MAX_POINTS = 1001;
17
- export declare const intervalDefault: {
17
+ export declare const ZOOM_INTERVAL_DEFAULT: {
18
18
  start: number;
19
19
  end: number;
20
20
  };
21
- export declare const dataRateDefault = 1;
22
- export declare const HEATMAP_HEIGHT_DEFAULT = 100;
21
+ export declare const DATA_RATE_DEFAULT = 1;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { DispatchAction, StoreState } from '../types/store';
3
- interface AppContextType {
3
+ export interface AppContextType {
4
4
  state: StoreState;
5
5
  dispatch: (action: DispatchAction) => void;
6
6
  }
@@ -7,3 +7,7 @@ export declare const setGlobalStoreState: (globalID: string, state: RecursiveObj
7
7
  * 获取全局store状态
8
8
  */
9
9
  export declare const getGlobalStoreState: (globalID: string) => RecursiveObject | null;
10
+ /**
11
+ * 清理指定图表实例的全局store状态
12
+ */
13
+ export declare const clearGlobalStoreState: (globalID: string) => void;
@@ -0,0 +1 @@
1
+ export { useSelector, useStore } from './useStore';
package/store/index.d.ts CHANGED
@@ -2,4 +2,4 @@ import type React from 'react';
2
2
  import type { StoreProps } from '../types/store';
3
3
  declare const Store: React.FC<StoreProps>;
4
4
  export default Store;
5
- export { useSelector, useStore } from './hooks/useStore';
5
+ export { useSelector, useStore } from './hooks';
@@ -1,38 +1,4 @@
1
1
  import type { DispatchAction, StoreState } from '../types/store';
2
- export declare const UPDATE_THEME = "UPDATE_THEME";
3
- export declare const defaultState: () => {
4
- [key: string]: unknown;
5
- globalID: string;
6
- config: unknown;
7
- system: import("../types").SystemConfig;
8
- eventBus: import("../types").EventBusProps;
9
- axisY: import("../types").AxisYProps;
10
- axisX: import("..").AxisXProps;
11
- toolsBar: import("../types").ToolsBarProps;
12
- series: import("../types").SeriesProps;
13
- segments: import("../types").SegmentsType;
14
- points: unknown[];
15
- marker: import("..").MarkerProps;
16
- limit: import("../types").LimitProps;
17
- heatmapCapture: import("../types").HeatmapCaptureProps;
18
- cursor: import("../types").CursorProps;
19
- zoom: import("../types").ZoomProps;
20
- signal: import("../types").SignalProps;
21
- signalAnalysis: import("../types").SignalAnalysisProps;
22
- band: import("../types").BandProps;
23
- scope: import("../types").ScopeProps;
24
- gridLines: boolean;
25
- legend: import("../types").LegendProps;
26
- frequencyTagLine: import("../types").FrequencyTagLineBoardProps;
27
- stripe: import("../types").StripeProps;
28
- blaze: import("../types").BlazeProps;
29
- frequencyAllocation: import("../types").FrequencyAllocationProps;
30
- levelStream?: import("../types").LevelStreamProps;
31
- timeRange?: number;
32
- fluorescence: import("../types").FluorescenceProps;
33
- deltaMeasurement: import("../types").DeltaMeasurementProps;
34
- publish?: import("..").Publish;
35
- };
36
2
  export declare const reducer: (state: StoreState, action: DispatchAction) => {
37
3
  [x: string]: unknown;
38
4
  globalID: string;
@@ -0,0 +1,123 @@
1
+ /* Tailwind/shadcn semantic token bridge for rfkit-charts.
2
+ *
3
+ * Default package usage now loads the required component styles automatically.
4
+ * This file remains as an optional advanced entry for consumers that want to
5
+ * reuse the same semantic tokens in their own Tailwind v4 global CSS.
6
+ *
7
+ * This file intentionally does NOT include Tailwind preflight/reset.
8
+ * Theme values follow the shared `theme` / `theme-follow-OS` root contract.
9
+ */
10
+
11
+ /* Use @rfkit/theme's :root[theme="dark"] / :root[theme="light"] attributes. */
12
+ @custom-variant dark (&:is(:root[theme="dark"] *));
13
+
14
+ @theme inline {
15
+ --color-background: var(--background, var(--theme-bg-base));
16
+ --color-foreground: var(--foreground, var(--theme-color-base));
17
+ --color-card: var(--card, var(--background, var(--theme-bg-base)));
18
+ --color-card-foreground: var(
19
+ --card-foreground,
20
+ var(--foreground, var(--theme-color-base))
21
+ );
22
+ --color-popover: var(--popover, var(--background, var(--theme-bg-base)));
23
+ --color-popover-foreground: var(
24
+ --popover-foreground,
25
+ var(--foreground, var(--theme-color-base))
26
+ );
27
+ --color-primary: var(--primary, var(--theme-color-primary));
28
+ --color-primary-foreground: var(--primary-foreground, #ffffff);
29
+ --color-secondary: var(--secondary, var(--theme-bg-second));
30
+ --color-secondary-foreground: var(
31
+ --secondary-foreground,
32
+ var(--foreground, var(--theme-color-base))
33
+ );
34
+ --color-muted: var(--muted, var(--theme-bg-third, var(--theme-bg-second)));
35
+ --color-muted-foreground: var(
36
+ --muted-foreground,
37
+ color-mix(in srgb, var(--theme-color-base) 70%, transparent)
38
+ );
39
+ --color-accent: var(--accent, var(--secondary, var(--theme-bg-second)));
40
+ --color-accent-foreground: var(
41
+ --accent-foreground,
42
+ var(--foreground, var(--theme-color-base))
43
+ );
44
+ --color-warning: var(--warning, var(--theme-color-warn));
45
+ --color-warning-foreground: var(--warning-foreground, #ffffff);
46
+ --color-success: var(--success, var(--theme-color-success));
47
+ --color-success-foreground: var(--success-foreground, #ffffff);
48
+ --color-destructive: var(--destructive, var(--theme-color-error));
49
+ --color-destructive-foreground: var(--destructive-foreground, #ffffff);
50
+ --color-border: var(--border, var(--theme-border-base));
51
+ --color-input: var(--input, var(--border, var(--theme-border-base)));
52
+ --color-ring: var(--ring, var(--primary, var(--theme-color-primary)));
53
+ --color-chart-panel: var(
54
+ --chart-panel,
55
+ color-mix(in srgb, var(--theme-bg-base) 96%, transparent)
56
+ );
57
+ --color-chart-panel-foreground: var(
58
+ --chart-panel-foreground,
59
+ var(--foreground, var(--theme-color-base))
60
+ );
61
+ --color-chart-grid: var(
62
+ --chart-grid,
63
+ color-mix(in srgb, var(--theme-color-base) 12%, transparent)
64
+ );
65
+ --color-chart-grid-strong: var(
66
+ --chart-grid-strong,
67
+ color-mix(in srgb, var(--theme-color-base) 28%, transparent)
68
+ );
69
+ --color-chart-highlight: var(
70
+ --chart-highlight,
71
+ var(--primary, var(--theme-color-primary))
72
+ );
73
+ --color-chart-warning: var(
74
+ --chart-warning,
75
+ var(--warning, var(--theme-color-warn))
76
+ );
77
+ --color-chart-danger: var(
78
+ --chart-danger,
79
+ var(--destructive, var(--theme-color-error))
80
+ );
81
+ --color-chart-surface: var(
82
+ --chart-surface,
83
+ var(--secondary, var(--theme-bg-second))
84
+ );
85
+ --color-chart-1: var(--chart-1, var(--primary, var(--theme-color-primary)));
86
+ --color-chart-2: var(--chart-2, var(--warning, var(--theme-color-warn)));
87
+ --color-chart-3: var(--chart-3, #4d7cf8);
88
+ --color-chart-4: var(--chart-4, #5ab9c1);
89
+ --color-chart-5: var(--chart-5, #682e8f);
90
+ --radius-sm: calc(var(--radius, var(--size-border-radius-base, 0px)) - 4px);
91
+ --radius-md: calc(var(--radius, var(--size-border-radius-base, 0px)) - 2px);
92
+ --radius-lg: var(--radius, var(--size-border-radius-base, 0px));
93
+ --radius-xl: calc(var(--radius, var(--size-border-radius-base, 0px)) + 4px);
94
+ --color-sidebar: var(--sidebar, var(--background, var(--theme-bg-base)));
95
+ --color-sidebar-foreground: var(
96
+ --sidebar-foreground,
97
+ var(--foreground, var(--theme-color-base))
98
+ );
99
+ --color-sidebar-primary: var(
100
+ --sidebar-primary,
101
+ var(--primary, var(--theme-color-primary))
102
+ );
103
+ --color-sidebar-primary-foreground: var(
104
+ --sidebar-primary-foreground,
105
+ #ffffff
106
+ );
107
+ --color-sidebar-accent: var(
108
+ --sidebar-accent,
109
+ var(--secondary, var(--theme-bg-second))
110
+ );
111
+ --color-sidebar-accent-foreground: var(
112
+ --sidebar-accent-foreground,
113
+ var(--foreground, var(--theme-color-base))
114
+ );
115
+ --color-sidebar-border: var(
116
+ --sidebar-border,
117
+ var(--border, var(--theme-border-base))
118
+ );
119
+ --color-sidebar-ring: var(
120
+ --sidebar-ring,
121
+ var(--ring, var(--theme-color-primary))
122
+ );
123
+ }
@@ -0,0 +1,27 @@
1
+ import { ThemeType } from '@rfkit/theme';
2
+ export type ChartsThemePreference = 'system' | ThemeType;
3
+ export interface ChartsThemeState {
4
+ mode: boolean;
5
+ preference: ChartsThemePreference;
6
+ theme: ThemeType;
7
+ }
8
+ export interface ApplyChartsThemeOptions {
9
+ mode?: boolean;
10
+ preference?: ChartsThemePreference;
11
+ theme?: ThemeType;
12
+ }
13
+ type ChartsThemeListener = (state: ChartsThemeState) => void;
14
+ export declare const getChartsThemeState: () => ChartsThemeState;
15
+ export declare const getChartsThemePreference: () => ChartsThemePreference;
16
+ /**
17
+ * @deprecated 新代码应由应用层或 @rfkit/theme 写入 theme / theme-follow-OS。
18
+ * charts 仅保留该方法作为兼容层。
19
+ */
20
+ export declare const applyChartsTheme: (options?: ApplyChartsThemeOptions) => ChartsThemeState;
21
+ /**
22
+ * @deprecated 新代码应由应用层或 @rfkit/theme 写入 theme / theme-follow-OS。
23
+ * charts 仅保留该方法作为兼容层。
24
+ */
25
+ export declare const applyChartsThemePreference: (preference: ChartsThemePreference) => ChartsThemeState;
26
+ export declare const subscribeChartsThemeChange: (listener: ChartsThemeListener) => () => void;
27
+ export {};
@@ -0,0 +1,7 @@
1
+ import { type SizeConfigs, type ThemeConfigs } from '@rfkit/theme';
2
+ export declare const ensureChartsThemeStyles: (themeConfigs?: ThemeConfigs) => void;
3
+ export interface InitializeChartsThemeEnvironmentOptions {
4
+ sizeConfigs?: SizeConfigs;
5
+ themeConfigs?: ThemeConfigs;
6
+ }
7
+ export declare const initializeChartsThemeEnvironment: (options?: InitializeChartsThemeEnvironmentOptions) => void;
@@ -0,0 +1,16 @@
1
+ import type { SizeConfigs, ThemeConfigs } from '@rfkit/theme';
2
+ import type { ChartsThemeState } from './charts-theme-controller';
3
+ export type ChartsThemeChange = Pick<ChartsThemeState, 'mode' | 'theme'>;
4
+ export interface InitChartsThemeOptions {
5
+ mode?: boolean;
6
+ sizeConfigs?: SizeConfigs;
7
+ subscribeThemeChange?: (e: ChartsThemeChange) => void;
8
+ theme?: ChartsThemeState['theme'];
9
+ themeConfigs?: ThemeConfigs;
10
+ }
11
+ export interface InitChartsThemeResult {
12
+ cleanup?: () => void;
13
+ mode: boolean;
14
+ theme: ChartsThemeState['theme'];
15
+ }
16
+ export declare function initChartsTheme(options?: InitChartsThemeOptions): InitChartsThemeResult;
@@ -0,0 +1,221 @@
1
+ export declare const RFKIT_CHARTS_SHADCN_THEME_CONFIGS: [{
2
+ readonly name: "--background";
3
+ readonly dark: "#202020";
4
+ readonly light: "#FFFFFF";
5
+ }, {
6
+ readonly name: "--foreground";
7
+ readonly dark: "#FFFFFF";
8
+ readonly light: "#1D2129";
9
+ }, {
10
+ readonly name: "--card";
11
+ readonly dark: "var(--background)";
12
+ readonly light: "var(--background)";
13
+ }, {
14
+ readonly name: "--card-foreground";
15
+ readonly dark: "var(--foreground)";
16
+ readonly light: "var(--foreground)";
17
+ }, {
18
+ readonly name: "--popover";
19
+ readonly dark: "var(--background)";
20
+ readonly light: "var(--background)";
21
+ }, {
22
+ readonly name: "--popover-foreground";
23
+ readonly dark: "var(--foreground)";
24
+ readonly light: "var(--foreground)";
25
+ }, {
26
+ readonly name: "--primary";
27
+ readonly dark: "#4371F8";
28
+ readonly light: "#2A51F7";
29
+ }, {
30
+ readonly name: "--primary-foreground";
31
+ readonly dark: "#FFFFFF";
32
+ readonly light: "#FFFFFF";
33
+ }, {
34
+ readonly name: "--secondary";
35
+ readonly dark: "#29292B";
36
+ readonly light: "#F0F1F3";
37
+ }, {
38
+ readonly name: "--secondary-foreground";
39
+ readonly dark: "var(--foreground)";
40
+ readonly light: "var(--foreground)";
41
+ }, {
42
+ readonly name: "--muted";
43
+ readonly dark: "#2F2F2F";
44
+ readonly light: "#E1E2E8";
45
+ }, {
46
+ readonly name: "--muted-foreground";
47
+ readonly dark: "rgba(255, 255, 255, 0.7)";
48
+ readonly light: "rgba(29, 33, 41, 0.7)";
49
+ }, {
50
+ readonly name: "--accent";
51
+ readonly dark: "var(--secondary)";
52
+ readonly light: "var(--secondary)";
53
+ }, {
54
+ readonly name: "--accent-foreground";
55
+ readonly dark: "var(--foreground)";
56
+ readonly light: "var(--foreground)";
57
+ }, {
58
+ readonly name: "--warning";
59
+ readonly dark: "#FF9626";
60
+ readonly light: "#FF7D00";
61
+ }, {
62
+ readonly name: "--warning-foreground";
63
+ readonly dark: "#FFFFFF";
64
+ readonly light: "#FFFFFF";
65
+ }, {
66
+ readonly name: "--success";
67
+ readonly dark: "#23C343";
68
+ readonly light: "#00B42A";
69
+ }, {
70
+ readonly name: "--success-foreground";
71
+ readonly dark: "#FFFFFF";
72
+ readonly light: "#FFFFFF";
73
+ }, {
74
+ readonly name: "--destructive";
75
+ readonly dark: "#F76965";
76
+ readonly light: "#F53F3F";
77
+ }, {
78
+ readonly name: "--destructive-foreground";
79
+ readonly dark: "#FFFFFF";
80
+ readonly light: "#FFFFFF";
81
+ }, {
82
+ readonly name: "--border";
83
+ readonly dark: "#313131";
84
+ readonly light: "#F0F0F0";
85
+ }, {
86
+ readonly name: "--input";
87
+ readonly dark: "var(--border)";
88
+ readonly light: "var(--border)";
89
+ }, {
90
+ readonly name: "--ring";
91
+ readonly dark: "var(--primary)";
92
+ readonly light: "var(--primary)";
93
+ }, {
94
+ readonly name: "--chart-panel";
95
+ readonly dark: "rgba(32, 32, 32, 0.96)";
96
+ readonly light: "rgba(255, 255, 255, 0.96)";
97
+ }, {
98
+ readonly name: "--chart-panel-foreground";
99
+ readonly dark: "var(--foreground)";
100
+ readonly light: "var(--foreground)";
101
+ }, {
102
+ readonly name: "--chart-grid";
103
+ readonly dark: "rgba(255, 255, 255, 0.12)";
104
+ readonly light: "rgba(29, 33, 41, 0.12)";
105
+ }, {
106
+ readonly name: "--chart-grid-strong";
107
+ readonly dark: "rgba(255, 255, 255, 0.28)";
108
+ readonly light: "rgba(29, 33, 41, 0.28)";
109
+ }, {
110
+ readonly name: "--chart-highlight";
111
+ readonly dark: "var(--primary)";
112
+ readonly light: "var(--primary)";
113
+ }, {
114
+ readonly name: "--chart-warning";
115
+ readonly dark: "var(--warning)";
116
+ readonly light: "var(--warning)";
117
+ }, {
118
+ readonly name: "--chart-danger";
119
+ readonly dark: "var(--destructive)";
120
+ readonly light: "var(--destructive)";
121
+ }, {
122
+ readonly name: "--chart-surface";
123
+ readonly dark: "var(--secondary)";
124
+ readonly light: "var(--secondary)";
125
+ }, {
126
+ readonly name: "--chart-1";
127
+ readonly dark: "var(--primary)";
128
+ readonly light: "var(--primary)";
129
+ }, {
130
+ readonly name: "--chart-2";
131
+ readonly dark: "var(--warning)";
132
+ readonly light: "var(--warning)";
133
+ }, {
134
+ readonly name: "--chart-3";
135
+ readonly dark: "#4D7CF8";
136
+ readonly light: "#4D7CF8";
137
+ }, {
138
+ readonly name: "--chart-4";
139
+ readonly dark: "#5AB9C1";
140
+ readonly light: "#5AB9C1";
141
+ }, {
142
+ readonly name: "--chart-5";
143
+ readonly dark: "#682E8F";
144
+ readonly light: "#682E8F";
145
+ }, {
146
+ readonly name: "--radius";
147
+ readonly dark: "var(--size-border-radius-base)";
148
+ readonly light: "var(--size-border-radius-base)";
149
+ }, {
150
+ readonly name: "--sidebar";
151
+ readonly dark: "var(--background)";
152
+ readonly light: "var(--background)";
153
+ }, {
154
+ readonly name: "--sidebar-foreground";
155
+ readonly dark: "var(--foreground)";
156
+ readonly light: "var(--foreground)";
157
+ }, {
158
+ readonly name: "--sidebar-primary";
159
+ readonly dark: "var(--primary)";
160
+ readonly light: "var(--primary)";
161
+ }, {
162
+ readonly name: "--sidebar-primary-foreground";
163
+ readonly dark: "var(--primary-foreground)";
164
+ readonly light: "var(--primary-foreground)";
165
+ }, {
166
+ readonly name: "--sidebar-accent";
167
+ readonly dark: "var(--secondary)";
168
+ readonly light: "var(--secondary)";
169
+ }, {
170
+ readonly name: "--sidebar-accent-foreground";
171
+ readonly dark: "var(--foreground)";
172
+ readonly light: "var(--foreground)";
173
+ }, {
174
+ readonly name: "--sidebar-border";
175
+ readonly dark: "var(--border)";
176
+ readonly light: "var(--border)";
177
+ }, {
178
+ readonly name: "--sidebar-ring";
179
+ readonly dark: "var(--ring)";
180
+ readonly light: "var(--ring)";
181
+ }, {
182
+ readonly name: "--theme-color-primary";
183
+ readonly dark: "var(--primary)";
184
+ readonly light: "var(--primary)";
185
+ }, {
186
+ readonly name: "--theme-color-warn";
187
+ readonly dark: "var(--warning)";
188
+ readonly light: "var(--warning)";
189
+ }, {
190
+ readonly name: "--theme-color-error";
191
+ readonly dark: "var(--destructive)";
192
+ readonly light: "var(--destructive)";
193
+ }, {
194
+ readonly name: "--theme-color-success";
195
+ readonly dark: "var(--success)";
196
+ readonly light: "var(--success)";
197
+ }, {
198
+ readonly name: "--theme-bg-base";
199
+ readonly dark: "var(--background)";
200
+ readonly light: "var(--background)";
201
+ }, {
202
+ readonly name: "--theme-bg-second";
203
+ readonly dark: "var(--secondary)";
204
+ readonly light: "var(--secondary)";
205
+ }, {
206
+ readonly name: "--theme-bg-third";
207
+ readonly dark: "var(--muted)";
208
+ readonly light: "var(--muted)";
209
+ }, {
210
+ readonly name: "--theme-color-base";
211
+ readonly dark: "var(--foreground)";
212
+ readonly light: "var(--foreground)";
213
+ }, {
214
+ readonly name: "--theme-border-base";
215
+ readonly dark: "var(--border)";
216
+ readonly light: "var(--border)";
217
+ }, {
218
+ readonly name: "--theme-box-shadow-base";
219
+ readonly dark: "0 1px 2px 0 rgba(255, 255, 255, 0.03),0 1px 6px -1px rgba(255, 255, 255, 0.02),0 2px 4px 0 rgba(255, 255, 255, 0.02)";
220
+ readonly light: "0 1px 2px 0 rgba(0, 0, 0, 0.03),0 1px 6px -1px rgba(0, 0, 0, 0.02),0 2px 4px 0 rgba(0, 0, 0, 0.02)";
221
+ }];
@@ -0,0 +1,21 @@
1
+ export declare const CHARTS_STYLE_SCOPE_ATTRIBUTE = "data-rfkit-charts-root";
2
+ export declare const CHARTS_STYLE_SCOPE_SELECTOR = "[data-rfkit-charts-root]";
3
+ export declare const CHARTS_STYLE_SCOPE_VALUE = "true";
4
+ export declare const CHARTS_PORTAL_SLOT_ATTRIBUTE = "data-rfkit-charts-portal";
5
+ export declare const CHARTS_PORTAL_Z_INDEX: Record<string, number>;
6
+ export declare const CHARTS_SCOPE_STYLE_VARS: {
7
+ readonly '--radius': "0px";
8
+ readonly '--radius-sm': "0px";
9
+ readonly '--radius-md': "0px";
10
+ readonly '--radius-lg': "0px";
11
+ readonly '--radius-xl': "0px";
12
+ readonly '--radius-micro': "0px";
13
+ readonly '--radius-control': "0px";
14
+ readonly '--radius-group': "0px";
15
+ readonly '--radius-surface': "0px";
16
+ readonly '--radius-pill': "9999px";
17
+ readonly '--theme-border-radius-base': "var(--radius-surface)";
18
+ readonly '--size-border-radius-second': "var(--radius-control)";
19
+ };
20
+ export declare const applyChartsScopeRoot: (element: HTMLElement) => void;
21
+ export declare const ensureChartsPortalRoot: (slot: string) => HTMLDivElement;
@@ -22,10 +22,24 @@ export interface LimitProps {
22
22
  label?: string;
23
23
  onChange: (l: number[]) => void;
24
24
  }
25
+ export interface CursorEventSnapshot {
26
+ sourceId: string;
27
+ sourceType: ModuleType;
28
+ clientX: number;
29
+ clientY: number;
30
+ bounds: {
31
+ left: number;
32
+ top: number;
33
+ right: number;
34
+ bottom: number;
35
+ width: number;
36
+ height: number;
37
+ };
38
+ }
25
39
  export interface CursorProps {
26
40
  show: boolean;
27
41
  active: boolean;
28
- event: React.MouseEvent | null;
42
+ event: CursorEventSnapshot | null;
29
43
  coord: TopRightBottomLeft;
30
44
  timeout: number;
31
45
  mode?: ModuleType;
package/utils/cn.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from 'clsx';
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -12,4 +12,4 @@ declare const mW2dBm: (input: number) => number;
12
12
  declare const mW2dBuV: (input: number) => number;
13
13
  declare const mW2V: (input: number) => number;
14
14
  declare const spectrum2dBm: (inputs: Array<number>) => number[];
15
- export { dBm2dBuV, dBm2V, dBm2mW, dBuV2dBm, dBuV2V, dBuV2uV, dBuV2mW, V2dBm, V2dBuV, V2mW, mW2dBm, mW2dBuV, mW2V, spectrum2dBm };
15
+ export { dBm2dBuV, dBm2mW, dBm2V, dBuV2dBm, dBuV2mW, dBuV2uV, dBuV2V, mW2dBm, mW2dBuV, mW2V, spectrum2dBm, V2dBm, V2dBuV, V2mW };
@@ -0,0 +1,12 @@
1
+ import { ModuleType } from '../config';
2
+ import type { CursorEventSnapshot } from '../types/store';
3
+ interface CursorStateLike {
4
+ show: boolean;
5
+ active: boolean;
6
+ event?: {
7
+ sourceType?: ModuleType;
8
+ } | null;
9
+ }
10
+ export declare const hasActiveSpectrumCursor: (cursor: CursorStateLike) => boolean;
11
+ export declare const resolveCursorVisibleBounds: (target: HTMLElement) => CursorEventSnapshot["bounds"];
12
+ export {};
@@ -135,6 +135,14 @@ export declare function calculatePositionFromFrequencyRange(range: FrequencyRang
135
135
  * @returns 光标位置信息
136
136
  */
137
137
  export declare function calculateCursorPosition(left: number, segments: SegmentType[]): CursorPosition;
138
+ /**
139
+ * 根据当前光标段位和点索引,获取内部命中使用的精确频率。
140
+ *
141
+ * 注意:
142
+ * - 这里返回的是基于 frequencyCache 的采样频率,不是展示层格式化后的字符串
143
+ * - 用于 hover / active 命中,可以避免展示格式化或索引换算差异带来的误判
144
+ */
145
+ export declare function getCursorFrequencyAtPosition(segments: SegmentType[], position: CursorPosition): number;
138
146
  /**
139
147
  * 判断光标是否在频率范围内(使用索引 + 容差)
140
148
  *
package/utils/index.d.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import type { TimestampedFloat32Array } from '@rfkit/spectrum-analyzer';
5
5
  export * from './array';
6
+ export * from './cursor';
6
7
  export * from './frequency';
7
8
  export * from './frequencyCalculation';
8
9
  export * from './object';
@@ -23,6 +23,7 @@ interface ChartSubscriptions {
23
23
  [id: string]: Subscription;
24
24
  }
25
25
  export declare function createSubscriptionManager(id: string, name?: string, func?: CSMCallback): (...args: any[]) => void;
26
+ export declare function clearChartRuntimeScopes(scopes: Array<string | undefined>): void;
26
27
  export interface rawData {
27
28
  getAllRawData: (left?: number) => SpectrumOutputData;
28
29
  }
package/utils/theme.d.ts CHANGED
@@ -9,10 +9,10 @@ export interface ThemeFillStyle {
9
9
  /**
10
10
  * 获取主题填充样式
11
11
  */
12
- export declare function getThemeFillStyle(): ThemeFillStyle;
12
+ export declare function getThemeFillStyle(scopeTarget?: Element | null): ThemeFillStyle;
13
13
  /**
14
14
  * 获取主题颜色,支持透明度改变
15
15
  * @param property CSS 变量名
16
16
  * @param opacity 可选的透明度 (0-1)
17
17
  */
18
- export declare const getThemeColor: (property: string, opacity?: number) => string;
18
+ export declare const getThemeColor: (property: string, opacity?: number, scopeTarget?: Element | null) => string;
@@ -1,12 +0,0 @@
1
- import type React from 'react';
2
- import type { FrequencyAllocationItem } from '../../types';
3
- import type { BandPosition, FrequencyRange } from './types';
4
- interface SegmentContainerProps {
5
- style: React.CSSProperties;
6
- bandPositions: BandPosition[];
7
- onMouseEnter: (band: FrequencyAllocationItem, range: FrequencyRange) => (e: React.MouseEvent) => void;
8
- onMouseMove: (e: React.MouseEvent) => void;
9
- onMouseLeave: () => void;
10
- }
11
- declare const SegmentContainer: React.FC<SegmentContainerProps>;
12
- export default SegmentContainer;
@@ -1,8 +0,0 @@
1
- import type React from 'react';
2
- import type { TooltipState } from '../types';
3
- /**
4
- * 频率划分 Tooltip 组件
5
- * 包含定位逻辑,内部使用 AllocationInfo 展示内容
6
- */
7
- declare const Tooltip: React.FC<TooltipState>;
8
- export default Tooltip;