@rfkit/charts 1.4.0 → 1.4.1

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 (175) hide show
  1. package/README.md +156 -273
  2. package/components/AxisY/heatmap/index.d.ts +1 -1
  3. package/components/AxisY/heatmap/variants/standard/index.d.ts +6 -0
  4. package/components/Container/runtime.d.ts +10 -0
  5. package/components/Cursor/popover-support.d.ts +8 -0
  6. package/components/Toolbar/registry.d.ts +12 -0
  7. package/components/Toolbar/toggles/index.d.ts +10 -0
  8. package/components/Zoom/ZoomViewportLayer.d.ts +7 -0
  9. package/components/ui/button.d.ts +2 -2
  10. package/config/constants.d.ts +2 -2
  11. package/hooks/index.d.ts +1 -2
  12. package/hooks/module-subscription-core.d.ts +23 -0
  13. package/hooks/publish/enhancedPublish.d.ts +1 -1
  14. package/hooks/publish/index.d.ts +0 -1
  15. package/hooks/publish/publish-event.d.ts +9 -0
  16. package/hooks/useLevelStreamAnalyzer.d.ts +1 -1
  17. package/hooks/useModuleSubscription.d.ts +21 -23
  18. package/index.d.ts +5 -5
  19. package/index.js +7378 -6950
  20. package/modules/Gauge/render.d.ts +0 -2
  21. package/{components/HeatmapCapture → modules/Heatmap/Capture}/tools.d.ts +1 -1
  22. package/modules/Heatmap/CursorPopover.d.ts +6 -0
  23. package/modules/Heatmap/render.d.ts +2 -0
  24. package/modules/Level/CursorPopover.d.ts +6 -0
  25. package/modules/Occupancy/CursorPopover.d.ts +3 -0
  26. package/modules/Occupancy/TotalLine/index.d.ts +1 -1
  27. package/modules/Occupancy/total-line-runtime.d.ts +4 -0
  28. package/modules/Spectrum/AxisYCanvas/index.d.ts +6 -0
  29. package/{components/AxisYByCanvas → modules/Spectrum/AxisYCanvas}/useCanvasAxisY.d.ts +1 -1
  30. package/modules/Spectrum/BandLayer/index.d.ts +5 -0
  31. package/modules/Spectrum/BandLayer/useBandLayerController.d.ts +2 -0
  32. package/{components → modules/Spectrum}/Blaze/tools.d.ts +1 -1
  33. package/modules/Spectrum/CursorPopover.d.ts +6 -0
  34. package/{components → modules/Spectrum}/FrequencyAllocation/color.d.ts +1 -1
  35. package/{components → modules/Spectrum}/FrequencyAllocation/model/resolveFrequencyAllocationData.d.ts +1 -1
  36. package/{components → modules/Spectrum}/FrequencyAllocation/model/resolver.d.ts +1 -1
  37. package/{components → modules/Spectrum}/FrequencyAllocation/model/useAllocationAtCursor.d.ts +1 -1
  38. package/{components → modules/Spectrum}/FrequencyAllocation/model/useFrequencyAllocationData.d.ts +1 -1
  39. package/{components → modules/Spectrum}/FrequencyAllocation/presenters/AllocationInfo/index.d.ts +1 -1
  40. package/{components → modules/Spectrum}/FrequencyAllocation/presenters/AllocationSegments/index.d.ts +1 -1
  41. package/{components → modules/Spectrum}/FrequencyAllocation/tools.d.ts +1 -1
  42. package/{components → modules/Spectrum}/FrequencyAllocation/types.d.ts +1 -1
  43. package/{components → modules/Spectrum}/FrequencyDataBoard/panels/StationInfoPanel/index.d.ts +1 -1
  44. package/{components → modules/Spectrum}/FrequencyTagLine/index.d.ts +1 -1
  45. package/{components → modules/Spectrum}/Markers/MarkerItem/index.d.ts +1 -1
  46. package/{components → modules/Spectrum}/Markers/hooks/useMarkerEvents.d.ts +1 -1
  47. package/{components → modules/Spectrum}/Markers/hooks/useMarkers.d.ts +2 -2
  48. package/{components → modules/Spectrum}/Markers/tools.d.ts +1 -1
  49. package/{components → modules/Spectrum}/Scope/useScope.d.ts +1 -1
  50. package/{components → modules/Spectrum}/Signal/model/resolver.d.ts +1 -1
  51. package/{components → modules/Spectrum}/Signal/model/useStationInfoAtCursor.d.ts +1 -1
  52. package/{components → modules/Spectrum}/Signal/tools.d.ts +1 -1
  53. package/{components → modules/Spectrum}/Signal/useSignalDataManager.d.ts +1 -1
  54. package/{components → modules/Spectrum}/Signal/utils.d.ts +3 -3
  55. package/modules/Spectrum/render.d.ts +31 -52
  56. package/{hooks → modules/Spectrum}/useSpectrumAnalyzer/index.d.ts +1 -1
  57. package/modules/base/BaseRenderer.d.ts +63 -0
  58. package/modules/base/CircularRenderer.d.ts +4 -5
  59. package/package.json +21 -4
  60. package/{modules/tools.d.ts → runtime/passThrough.d.ts} +1 -1
  61. package/store/chart-store.d.ts +11 -0
  62. package/store/context.d.ts +5 -2
  63. package/store/hooks/index.d.ts +1 -1
  64. package/store/hooks/useStore.d.ts +11 -1
  65. package/store/index.d.ts +1 -1
  66. package/store/reducer.d.ts +1 -33
  67. package/store/runtime.d.ts +16 -0
  68. package/tailwind-bridge.css +28 -101
  69. package/theme/init-charts-theme.d.ts +7 -11
  70. package/theme/style-scope.d.ts +0 -1
  71. package/{utils/theme.d.ts → theme/theme-color.d.ts} +0 -11
  72. package/theme/theme-contract.d.ts +28 -0
  73. package/theme/theme-runtime.d.ts +14 -0
  74. package/theme/theme-styles.d.ts +10 -0
  75. package/theme/theme-tokens.d.ts +85 -0
  76. package/types/common.d.ts +1 -1
  77. package/types/store/index.d.ts +6 -4
  78. package/types/store/ui.d.ts +4 -4
  79. package/utils/index.d.ts +0 -1
  80. package/utils/subscription.d.ts +18 -3
  81. package/components/AxisY/heatmap/type/Default/index.d.ts +0 -6
  82. package/components/AxisYByCanvas/index.d.ts +0 -6
  83. package/components/Band/index.d.ts +0 -5
  84. package/components/Band/useBand.d.ts +0 -2
  85. package/components/Cursor/popovers/index.d.ts +0 -10
  86. package/components/SignalAnalysis/Switch/index.d.ts +0 -3
  87. package/components/ToolsBar/registry.d.ts +0 -12
  88. package/components/ToolsBar/toggles/index.d.ts +0 -10
  89. package/components/Zoom/ZoomOffsetContainer/index.d.ts +0 -7
  90. package/lib/LevelStream/useAxisY.d.ts +0 -1
  91. package/theme/charts-theme-controller.d.ts +0 -27
  92. package/theme/charts-theme-environment.d.ts +0 -7
  93. package/theme/shadcn-theme-config.d.ts +0 -221
  94. /package/{lib → charts}/Dial/Chart.d.ts +0 -0
  95. /package/{lib → charts}/Dial/index.d.ts +0 -0
  96. /package/{lib → charts}/Gauge/Chart.d.ts +0 -0
  97. /package/{lib → charts}/Gauge/index.d.ts +0 -0
  98. /package/{lib → charts}/Heatmap/Chart.d.ts +0 -0
  99. /package/{lib → charts}/Heatmap/index.d.ts +0 -0
  100. /package/{lib → charts}/IQ/Chart.d.ts +0 -0
  101. /package/{lib → charts}/IQ/index.d.ts +0 -0
  102. /package/{lib → charts}/LevelStream/Chart.d.ts +0 -0
  103. /package/{lib → charts}/LevelStream/index.d.ts +0 -0
  104. /package/{lib → charts}/Occupancy/Chart.d.ts +0 -0
  105. /package/{lib → charts}/Occupancy/index.d.ts +0 -0
  106. /package/{lib → charts}/SpatialSpectrum/Chart.d.ts +0 -0
  107. /package/{lib → charts}/SpatialSpectrum/index.d.ts +0 -0
  108. /package/{lib → charts}/Spectrum/Chart.d.ts +0 -0
  109. /package/{lib → charts}/Spectrum/index.d.ts +0 -0
  110. /package/{lib → charts}/index.d.ts +0 -0
  111. /package/components/AxisY/heatmap/{type/Default → variants/standard}/GradientRibbon/index.d.ts +0 -0
  112. /package/components/AxisY/occupancy/{type/Default → variants/standard}/index.d.ts +0 -0
  113. /package/components/{ToolsBar → Toolbar}/controls/Reset.d.ts +0 -0
  114. /package/components/{ToolsBar → Toolbar}/controls/SegmentsDisplayControl/index.d.ts +0 -0
  115. /package/components/{ToolsBar → Toolbar}/controls/SeriesControl/index.d.ts +0 -0
  116. /package/components/{ToolsBar → Toolbar}/controls/SeriesDisplayControl/index.d.ts +0 -0
  117. /package/components/{ToolsBar → Toolbar}/controls/index.d.ts +0 -0
  118. /package/components/{ToolsBar → Toolbar}/decorations/GradientRibbon/index.d.ts +0 -0
  119. /package/components/{ToolsBar → Toolbar}/decorations/SpacerLine.d.ts +0 -0
  120. /package/components/{ToolsBar → Toolbar}/decorations/index.d.ts +0 -0
  121. /package/components/{ToolsBar → Toolbar}/index.d.ts +0 -0
  122. /package/components/{ToolsBar → Toolbar}/primitives/IconBox.d.ts +0 -0
  123. /package/components/{ToolsBar → Toolbar}/primitives/ToolbarContentBox.d.ts +0 -0
  124. /package/components/{ToolsBar → Toolbar}/primitives/ToolbarDropdown.d.ts +0 -0
  125. /package/components/{ToolsBar → Toolbar}/primitives/ToolbarGlyph.d.ts +0 -0
  126. /package/components/{ToolsBar → Toolbar}/primitives/ToolbarGroup.d.ts +0 -0
  127. /package/components/{ToolsBar → Toolbar}/primitives/ToolbarGroupIconBox.d.ts +0 -0
  128. /package/components/{ToolsBar → Toolbar}/primitives/ToolbarSurface.d.ts +0 -0
  129. /package/components/{ToolsBar → Toolbar}/primitives/index.d.ts +0 -0
  130. /package/components/{ToolsBar → Toolbar}/primitives/styles.d.ts +0 -0
  131. /package/{components/GaugeBox/index.d.ts → modules/Gauge/InteractionSurface.d.ts} +0 -0
  132. /package/{components/HeatmapCapture → modules/Heatmap/Capture}/Area/index.d.ts +0 -0
  133. /package/{components/HeatmapCapture → modules/Heatmap/Capture}/RowIndex/index.d.ts +0 -0
  134. /package/{components/HeatmapCapture → modules/Heatmap/Capture}/Slider/index.d.ts +0 -0
  135. /package/{components/FrequencyTagLine → modules/Heatmap/Capture}/Switch/index.d.ts +0 -0
  136. /package/{components/HeatmapCapture → modules/Heatmap/Capture}/index.d.ts +0 -0
  137. /package/{components/HeatmapCapture → modules/Heatmap/TimeRange}/Switch/index.d.ts +0 -0
  138. /package/{components → modules/Heatmap}/TimeRange/useTimeRange.d.ts +0 -0
  139. /package/{components → modules/Spectrum}/Blaze/index.d.ts +0 -0
  140. /package/{components → modules/Spectrum}/DeltaMeasurement/Switch.d.ts +0 -0
  141. /package/{components → modules/Spectrum}/DeltaMeasurement/index.d.ts +0 -0
  142. /package/{components → modules/Spectrum}/DragFrame/index.d.ts +0 -0
  143. /package/{components → modules/Spectrum}/FrequencyAllocation/Switch/index.d.ts +0 -0
  144. /package/{components → modules/Spectrum}/FrequencyAllocation/data.d.ts +0 -0
  145. /package/{components → modules/Spectrum}/FrequencyAllocation/index.d.ts +0 -0
  146. /package/{components → modules/Spectrum}/FrequencyAllocation/model/index.d.ts +0 -0
  147. /package/{components → modules/Spectrum}/FrequencyAllocation/overlays/Tooltip/index.d.ts +0 -0
  148. /package/{components → modules/Spectrum}/FrequencyAllocation/overlays/index.d.ts +0 -0
  149. /package/{components → modules/Spectrum}/FrequencyAllocation/presenters/index.d.ts +0 -0
  150. /package/{components → modules/Spectrum}/FrequencyDataBoard/hooks/index.d.ts +0 -0
  151. /package/{components → modules/Spectrum}/FrequencyDataBoard/hooks/useStationInfoAtCursor.d.ts +0 -0
  152. /package/{components → modules/Spectrum}/FrequencyDataBoard/index.d.ts +0 -0
  153. /package/{components → modules/Spectrum}/FrequencyDataBoard/panels/index.d.ts +0 -0
  154. /package/{components → modules/Spectrum}/FrequencyTagLine/Board/index.d.ts +0 -0
  155. /package/{components/Limit → modules/Spectrum/FrequencyTagLine}/Switch/index.d.ts +0 -0
  156. /package/{components → modules/Spectrum}/Legend/index.d.ts +0 -0
  157. /package/{components → modules/Spectrum}/Limit/Item.d.ts +0 -0
  158. /package/{components/TimeRange → modules/Spectrum/Limit}/Switch/index.d.ts +0 -0
  159. /package/{components → modules/Spectrum}/Limit/index.d.ts +0 -0
  160. /package/{components → modules/Spectrum}/Markers/Switch/index.d.ts +0 -0
  161. /package/{components → modules/Spectrum}/Markers/index.d.ts +0 -0
  162. /package/{components → modules/Spectrum}/Scope/index.d.ts +0 -0
  163. /package/{components → modules/Spectrum}/SegmentsZebra/index.d.ts +0 -0
  164. /package/{components → modules/Spectrum}/Signal/Switch/index.d.ts +0 -0
  165. /package/{components → modules/Spectrum}/Signal/index.d.ts +0 -0
  166. /package/{components → modules/Spectrum}/Signal/metadata/index.d.ts +0 -0
  167. /package/{components → modules/Spectrum}/Signal/metadata/signalType.d.ts +0 -0
  168. /package/{components → modules/Spectrum}/Signal/model/index.d.ts +0 -0
  169. /package/{components → modules/Spectrum}/Signal/model/useUnifiedSignals.d.ts +0 -0
  170. /package/{components → modules/Spectrum}/Signal/presenters/SignalSegments/index.d.ts +0 -0
  171. /package/{components → modules/Spectrum}/Signal/presenters/index.d.ts +0 -0
  172. /package/{components → modules/Spectrum}/Stripe/Switch/index.d.ts +0 -0
  173. /package/{components → modules/Spectrum}/Stripe/index.d.ts +0 -0
  174. /package/{hooks/publish → modules/Spectrum}/useMarkerPublish.d.ts +0 -0
  175. /package/{hooks → modules/Spectrum}/useSpectrumAnalyzer/useTemplateComparison.d.ts +0 -0
@@ -1,34 +1,2 @@
1
1
  import type { DispatchAction, StoreState } from '../types/store';
2
- export declare const reducer: (state: StoreState, action: DispatchAction) => {
3
- [x: string]: unknown;
4
- globalID: string;
5
- config: unknown;
6
- system: import("../types").SystemConfig;
7
- eventBus: import("../types").EventBusProps;
8
- axisY: import("../types").AxisYProps;
9
- axisX: import("..").AxisXProps;
10
- toolsBar: import("../types").ToolsBarProps;
11
- series: import("../types").SeriesProps;
12
- segments: import("../types").SegmentsType;
13
- points: unknown[];
14
- marker: import("..").MarkerProps;
15
- limit: import("../types").LimitProps;
16
- heatmapCapture: import("../types").HeatmapCaptureProps;
17
- cursor: import("../types").CursorProps;
18
- zoom: import("../types").ZoomProps;
19
- signal: import("../types").SignalProps;
20
- signalAnalysis: import("../types").SignalAnalysisProps;
21
- band: import("../types").BandProps;
22
- scope: import("../types").ScopeProps;
23
- gridLines: boolean;
24
- legend: import("../types").LegendProps;
25
- frequencyTagLine: import("../types").FrequencyTagLineBoardProps;
26
- stripe: import("../types").StripeProps;
27
- blaze: import("../types").BlazeProps;
28
- frequencyAllocation: import("../types").FrequencyAllocationProps;
29
- levelStream?: import("../types").LevelStreamProps;
30
- timeRange?: number;
31
- fluorescence: import("../types").FluorescenceProps;
32
- deltaMeasurement: import("../types").DeltaMeasurementProps;
33
- publish?: import("..").Publish;
34
- };
2
+ export declare const reducer: (state: StoreState, action: DispatchAction) => StoreState;
@@ -0,0 +1,16 @@
1
+ import type { DispatchAction, StoreState } from '../types/store';
2
+ import { type ChartStore } from './chart-store';
3
+ type RuntimeCleanup = () => void;
4
+ export interface ChartRuntime {
5
+ destroy: () => void;
6
+ dispatch: (action: DispatchAction) => StoreState;
7
+ getGlobalID: () => string;
8
+ getState: () => StoreState;
9
+ registerCleanup: (cleanup?: RuntimeCleanup | null) => RuntimeCleanup | null;
10
+ setGlobalID: (globalID: string) => void;
11
+ store: ChartStore;
12
+ subscribe: ChartStore['subscribe'];
13
+ }
14
+ export declare const getChartRuntime: (globalID: string) => ChartRuntime | null;
15
+ export declare function createChartRuntime(initialState: StoreState): ChartRuntime;
16
+ export {};
@@ -6,118 +6,45 @@
6
6
  *
7
7
  * This file intentionally does NOT include Tailwind preflight/reset.
8
8
  * Theme values follow the shared `theme` / `theme-follow-OS` root contract.
9
+ * It only maps canonical charts tokens into Tailwind/shadcn semantic color
10
+ * names and does not ship legacy rfkit aliases or deprecated bridge extras.
9
11
  */
10
12
 
11
- /* Use @rfkit/theme's :root[theme="dark"] / :root[theme="light"] attributes. */
13
+ /* Use the shared root `theme` / `theme-follow-OS` contract. */
12
14
  @custom-variant dark (&:is(:root[theme="dark"] *));
13
15
 
14
16
  @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));
17
+ --color-background: var(--background);
18
+ --color-foreground: var(--foreground);
19
+ --color-card: var(--card);
20
+ --color-card-foreground: var(--card-foreground);
21
+ --color-popover: var(--popover);
22
+ --color-popover-foreground: var(--popover-foreground);
23
+ --color-primary: var(--primary);
28
24
  --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));
25
+ --color-secondary: var(--secondary);
26
+ --color-secondary-foreground: var(--secondary-foreground);
27
+ --color-muted: var(--muted);
28
+ --color-muted-foreground: var(--muted-foreground);
29
+ --color-accent: var(--accent);
30
+ --color-accent-foreground: var(--accent-foreground);
31
+ --color-warning: var(--warning);
45
32
  --color-warning-foreground: var(--warning-foreground, #ffffff);
46
- --color-success: var(--success, var(--theme-color-success));
33
+ --color-success: var(--success);
47
34
  --color-success-foreground: var(--success-foreground, #ffffff);
48
- --color-destructive: var(--destructive, var(--theme-color-error));
35
+ --color-destructive: var(--destructive);
49
36
  --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);
37
+ --color-border: var(--border);
38
+ --color-input: var(--input);
39
+ --color-ring: var(--ring);
40
+ --color-chart-panel: var(--chart-panel);
41
+ --color-chart-panel-foreground: var(--chart-panel-foreground);
42
+ --color-chart-grid: var(--chart-grid);
43
+ --color-chart-grid-strong: var(--chart-grid-strong);
44
+ --color-chart-highlight: var(--chart-highlight);
45
+ --color-chart-surface: var(--chart-surface);
90
46
  --radius-sm: calc(var(--radius, var(--size-border-radius-base, 0px)) - 4px);
91
47
  --radius-md: calc(var(--radius, var(--size-border-radius-base, 0px)) - 2px);
92
48
  --radius-lg: var(--radius, var(--size-border-radius-base, 0px));
93
49
  --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
50
  }
@@ -1,16 +1,12 @@
1
- import type { SizeConfigs, ThemeConfigs } from '@rfkit/theme';
2
- import type { ChartsThemeState } from './charts-theme-controller';
3
- export type ChartsThemeChange = Pick<ChartsThemeState, 'mode' | 'theme'>;
1
+ import { type ChartsThemeState } from './theme-runtime.ts';
2
+ import type { ChartsSizeTokensConfig, ChartsThemeTokensConfig } from './theme-tokens.ts';
3
+ export type ChartsThemeChange = ChartsThemeState;
4
4
  export interface InitChartsThemeOptions {
5
- mode?: boolean;
6
- sizeConfigs?: SizeConfigs;
7
- subscribeThemeChange?: (e: ChartsThemeChange) => void;
8
- theme?: ChartsThemeState['theme'];
9
- themeConfigs?: ThemeConfigs;
5
+ onChange?: (state: ChartsThemeChange) => void;
6
+ sizes?: ChartsSizeTokensConfig;
7
+ tokens?: ChartsThemeTokensConfig;
10
8
  }
11
- export interface InitChartsThemeResult {
9
+ export interface InitChartsThemeResult extends ChartsThemeState {
12
10
  cleanup?: () => void;
13
- mode: boolean;
14
- theme: ChartsThemeState['theme'];
15
11
  }
16
12
  export declare function initChartsTheme(options?: InitChartsThemeOptions): InitChartsThemeResult;
@@ -14,7 +14,6 @@ export declare const CHARTS_SCOPE_STYLE_VARS: {
14
14
  readonly '--radius-group': "0px";
15
15
  readonly '--radius-surface': "0px";
16
16
  readonly '--radius-pill': "9999px";
17
- readonly '--theme-border-radius-base': "var(--radius-surface)";
18
17
  readonly '--size-border-radius-second': "var(--radius-control)";
19
18
  };
20
19
  export declare const applyChartsScopeRoot: (element: HTMLElement) => void;
@@ -1,18 +1,7 @@
1
- /**
2
- * 主题相关工具函数
3
- */
4
1
  export interface ThemeFillStyle {
5
2
  fillStyle: string;
6
3
  fillStylePrimary: string;
7
4
  fillStyleTransparentBase: string;
8
5
  }
9
- /**
10
- * 获取主题填充样式
11
- */
12
6
  export declare function getThemeFillStyle(scopeTarget?: Element | null): ThemeFillStyle;
13
- /**
14
- * 获取主题颜色,支持透明度改变
15
- * @param property CSS 变量名
16
- * @param opacity 可选的透明度 (0-1)
17
- */
18
7
  export declare const getThemeColor: (property: string, opacity?: number, scopeTarget?: Element | null) => string;
@@ -0,0 +1,28 @@
1
+ export declare const THEME_KEY = "theme";
2
+ export declare const THEME_FOLLOW_OS_KEY = "theme-follow-OS";
3
+ export declare const SIZE_KEY = "size";
4
+ export declare const ThemeType: {
5
+ readonly Dark: "dark";
6
+ readonly Light: "light";
7
+ };
8
+ export type ThemeType = (typeof ThemeType)[keyof typeof ThemeType];
9
+ export declare const SizeType: {
10
+ readonly Middle: "middle";
11
+ readonly Small: "small";
12
+ };
13
+ export type SizeType = (typeof SizeType)[keyof typeof SizeType];
14
+ export interface ChartsThemeContract {
15
+ followOS: boolean;
16
+ theme: ThemeType;
17
+ }
18
+ export declare const DEFAULT_THEME: ThemeType;
19
+ export declare const DEFAULT_FOLLOW_OS = true;
20
+ export declare const DEFAULT_SIZE: SizeType;
21
+ export declare const canUseDOM: () => boolean;
22
+ export declare const getThemeMedia: () => MediaQueryList;
23
+ export declare const isThemeType: (value: string | null) => value is ThemeType;
24
+ export declare const getSystemTheme: () => ThemeType;
25
+ export declare const readThemeContract: () => ChartsThemeContract;
26
+ export declare const getRootTheme: () => ThemeType;
27
+ export declare const getRootThemeFollowOS: () => boolean;
28
+ export declare const writeThemeContract: ({ followOS, theme }: ChartsThemeContract) => void;
@@ -0,0 +1,14 @@
1
+ import { type ThemeType } from './theme-contract.ts';
2
+ export type ChartsThemePreference = 'system' | ThemeType;
3
+ export interface ChartsThemeState {
4
+ contractTheme: ThemeType;
5
+ followOS: boolean;
6
+ preference: ChartsThemePreference;
7
+ theme: ThemeType;
8
+ }
9
+ type ChartsThemeListener = (state: ChartsThemeState) => void;
10
+ export declare const resolveChartsThemeState: () => ChartsThemeState;
11
+ export declare const getChartsThemeState: () => ChartsThemeState;
12
+ export declare const subscribeChartsThemeChange: (listener: ChartsThemeListener) => () => void;
13
+ export declare const resetChartsThemeRuntimeForTests: () => void;
14
+ export {};
@@ -0,0 +1,10 @@
1
+ import { type ChartsSizeTokensConfig, type ChartsThemeTokensConfig } from './theme-tokens.ts';
2
+ export interface ThemeStyleOptions {
3
+ sizes?: ChartsSizeTokensConfig;
4
+ tokens?: ChartsThemeTokensConfig;
5
+ }
6
+ export declare const ensureRootThemeStyles: ({ tokens }?: ThemeStyleOptions) => void;
7
+ export declare const ensureChartsThemeStyles: ({ tokens }?: ThemeStyleOptions) => void;
8
+ export declare const ensureChartsSizeStyles: (sizes?: ChartsSizeTokensConfig) => void;
9
+ export declare const initializeRootThemeEnvironment: (options?: ThemeStyleOptions) => void;
10
+ export declare const initializeChartsThemeEnvironment: (options?: ThemeStyleOptions) => void;
@@ -0,0 +1,85 @@
1
+ export interface ThemeToneValues {
2
+ dark: string;
3
+ light: string;
4
+ }
5
+ export interface SizeScaleValues {
6
+ middle: string;
7
+ small: string;
8
+ }
9
+ export interface ThemeVariableDefinition extends ThemeToneValues {
10
+ name: string;
11
+ }
12
+ export interface SizeVariableDefinition extends SizeScaleValues {
13
+ name: string;
14
+ }
15
+ export declare const SEMANTIC_TOKEN_VARIABLES: {
16
+ readonly accent: "--accent";
17
+ readonly accentForeground: "--accent-foreground";
18
+ readonly background: "--background";
19
+ readonly border: "--border";
20
+ readonly card: "--card";
21
+ readonly cardForeground: "--card-foreground";
22
+ readonly destructive: "--destructive";
23
+ readonly destructiveForeground: "--destructive-foreground";
24
+ readonly foreground: "--foreground";
25
+ readonly input: "--input";
26
+ readonly muted: "--muted";
27
+ readonly mutedForeground: "--muted-foreground";
28
+ readonly popover: "--popover";
29
+ readonly popoverForeground: "--popover-foreground";
30
+ readonly primary: "--primary";
31
+ readonly primaryForeground: "--primary-foreground";
32
+ readonly radius: "--radius";
33
+ readonly ring: "--ring";
34
+ readonly secondary: "--secondary";
35
+ readonly secondaryForeground: "--secondary-foreground";
36
+ readonly success: "--success";
37
+ readonly successForeground: "--success-foreground";
38
+ readonly warning: "--warning";
39
+ readonly warningForeground: "--warning-foreground";
40
+ };
41
+ export declare const CHART_TOKEN_VARIABLES: {
42
+ readonly grid: "--chart-grid";
43
+ readonly gridStrong: "--chart-grid-strong";
44
+ readonly highlight: "--chart-highlight";
45
+ readonly panel: "--chart-panel";
46
+ readonly panelForeground: "--chart-panel-foreground";
47
+ readonly surface: "--chart-surface";
48
+ };
49
+ export declare const SIZE_TOKEN_VARIABLES: {
50
+ readonly font: {
51
+ readonly base: "--size-font-base";
52
+ readonly max: "--size-font-max";
53
+ readonly second: "--size-font-second";
54
+ };
55
+ readonly radius: {
56
+ readonly base: "--size-border-radius-base";
57
+ readonly second: "--size-border-radius-second";
58
+ };
59
+ readonly spacing: {
60
+ readonly base: "--size-gap-base";
61
+ };
62
+ };
63
+ export type SemanticTokenName = keyof typeof SEMANTIC_TOKEN_VARIABLES;
64
+ export type ChartTokenName = keyof typeof CHART_TOKEN_VARIABLES;
65
+ export type SemanticTokenConfig = Partial<Record<SemanticTokenName, Partial<ThemeToneValues>>>;
66
+ export type ChartTokenConfig = Partial<Record<ChartTokenName, Partial<ThemeToneValues>>>;
67
+ export interface ChartsThemeTokensConfig {
68
+ chart?: ChartTokenConfig;
69
+ semantic?: SemanticTokenConfig;
70
+ }
71
+ export interface ChartsSizeTokensConfig {
72
+ font?: Partial<Record<keyof typeof SIZE_TOKEN_VARIABLES.font, Partial<SizeScaleValues>>>;
73
+ radius?: Partial<Record<keyof typeof SIZE_TOKEN_VARIABLES.radius, Partial<SizeScaleValues>>>;
74
+ spacing?: Partial<Record<keyof typeof SIZE_TOKEN_VARIABLES.spacing, Partial<SizeScaleValues>>>;
75
+ }
76
+ export declare const getCanonicalThemeVariableDefinitions: (tokens?: ChartsThemeTokensConfig) => {
77
+ dark: string;
78
+ light: string;
79
+ name: string;
80
+ }[];
81
+ export declare const getSizeVariableDefinitions: (sizes?: ChartsSizeTokensConfig) => {
82
+ middle: string;
83
+ small: string;
84
+ name: string;
85
+ }[];
package/types/common.d.ts CHANGED
@@ -20,13 +20,13 @@ export interface RenderChartType {
20
20
  reset(): unknown;
21
21
  resize(): unknown;
22
22
  dispose(): (() => void) | undefined;
23
+ updateParams(params: RecursiveObject): void;
23
24
  updateProps?(...arg: unknown[]): unknown;
24
25
  updateSeries?(...arg: unknown[]): unknown;
25
26
  setDisabledClearRect?(disabledClearRect: boolean): unknown;
26
27
  useRangeAutoFocus?(): unknown;
27
28
  setSeries?(s: SetSeries): unknown;
28
29
  setRange?(range: AxisYRange): void;
29
- updateParams?(params: RecursiveObject): void;
30
30
  }
31
31
  export interface SeriesConfig {
32
32
  readonly name: string;
@@ -24,7 +24,7 @@ import type { HeatmapCaptureProps } from './heatmap';
24
24
  import type { MarkerProps } from './marker';
25
25
  import type { LevelStreamProps, SeriesProps } from './series';
26
26
  import type { SignalAnalysisProps, SignalProps } from './signal';
27
- import type { BandProps, BlazeProps, CursorProps, DeltaMeasurementProps, EventBusProps, FluorescenceProps, FrequencyTagLineBoardProps, LegendProps, LimitProps, ScopeProps, StripeProps, SystemConfig, ToolsBarProps, ZoomProps } from './ui';
27
+ import type { BandProps, BlazeProps, CursorProps, DeltaMeasurementProps, EventBusProps, FluorescenceProps, FrequencyTagLineBoardProps, LegendProps, LimitProps, ScopeProps, StripeProps, SystemConfig, ToolbarProps, ZoomProps } from './ui';
28
28
  export interface StoreState {
29
29
  globalID: string;
30
30
  config: unknown;
@@ -32,7 +32,7 @@ export interface StoreState {
32
32
  eventBus: EventBusProps;
33
33
  axisY: AxisYProps;
34
34
  axisX: AxisXProps;
35
- toolsBar: ToolsBarProps;
35
+ toolbar: ToolbarProps;
36
36
  series: SeriesProps;
37
37
  segments: SegmentsType;
38
38
  points: unknown[];
@@ -58,9 +58,11 @@ export interface StoreState {
58
58
  [key: string]: unknown;
59
59
  publish?: Publish;
60
60
  }
61
+ export type StoreUpdatePayload = Record<string, unknown> | StoreState | ((state: StoreState) => Record<string, unknown> | StoreState | null | undefined);
61
62
  export interface DispatchAction {
62
63
  type?: string;
63
- payload: Record<string, unknown>;
64
+ payload: StoreUpdatePayload;
65
+ replace?: boolean;
64
66
  }
65
67
  export interface StoreProps extends ParamsProps {
66
68
  children: React.ReactNode;
@@ -86,7 +88,7 @@ export interface ParamsProps {
86
88
  series?: Partial<SeriesProps>;
87
89
  frequencyTagLine?: Partial<FrequencyTagLineBoardProps>;
88
90
  frequencyAllocation?: Partial<FrequencyAllocationProps>;
89
- toolsBar?: Partial<ToolsBarProps>;
91
+ toolbar?: Partial<ToolbarProps>;
90
92
  band?: Partial<BandProps>;
91
93
  levelStream?: Partial<LevelStreamProps>;
92
94
  deltaMeasurement?: Partial<DeltaMeasurementProps>;
@@ -1,6 +1,10 @@
1
1
  import type { FluorescenceRenderMode } from '@rfkit/renderer';
2
2
  import type { ModuleType } from '../../config';
3
3
  import type { AxisXRange, RecursiveObject, TopRightBottomLeft } from '..';
4
+ export interface ToolbarProps {
5
+ show: boolean;
6
+ hiddenTools?: string[];
7
+ }
4
8
  export interface SystemConfig {
5
9
  width: number;
6
10
  height: number;
@@ -9,10 +13,6 @@ export interface SystemConfig {
9
13
  borderRadius: boolean;
10
14
  onChange: (e: RecursiveObject) => void;
11
15
  }
12
- export interface ToolsBarProps {
13
- show: boolean;
14
- hiddenTools?: string[];
15
- }
16
16
  export interface LimitProps {
17
17
  show: boolean;
18
18
  disabled?: boolean;
package/utils/index.d.ts CHANGED
@@ -7,7 +7,6 @@ export * from './cursor';
7
7
  export * from './frequency';
8
8
  export * from './frequencyCalculation';
9
9
  export * from './object';
10
- export * from './theme';
11
10
  export * from './throttle';
12
11
  export * from './time';
13
12
  /**
@@ -3,13 +3,21 @@ import type { RecursiveFunction } from '../types';
3
3
  interface ChartsGlobal {
4
4
  datas: Record<string, unknown>;
5
5
  subscriptions: ChartSubscriptions;
6
+ owners: RuntimeOwners;
6
7
  }
7
8
  declare global {
8
9
  interface Window {
9
10
  charts?: ChartsGlobal;
10
11
  }
11
12
  }
12
- export declare function openData<T = unknown>(globalID: string, data: T | undefined, defaultData: T): T;
13
+ interface RuntimeOwnerRecord {
14
+ datas: Set<string>;
15
+ subscriptions: Set<string>;
16
+ }
17
+ interface RuntimeOwners {
18
+ [owner: string]: RuntimeOwnerRecord;
19
+ }
20
+ export declare function openData<T = unknown>(key: string, data: T | undefined, defaultData: T, owner?: string): T;
13
21
  /**
14
22
  * 共享订阅
15
23
  * Note: Using any[] for callback args since this is a generic pub/sub system
@@ -22,8 +30,15 @@ interface Subscription {
22
30
  interface ChartSubscriptions {
23
31
  [id: string]: Subscription;
24
32
  }
25
- export declare function createSubscriptionManager(id: string, name?: string, func?: CSMCallback): (...args: any[]) => void;
26
- export declare function clearChartRuntimeScopes(scopes: Array<string | undefined>): void;
33
+ export declare function createSubscriptionManager(id: string, name?: string, func?: CSMCallback, owner?: string): (...args: any[]) => void;
34
+ export declare const getPublishSubscriptionKey: (globalID: string) => string;
35
+ export declare const getModuleSubscriptionKey: (globalID: string, moduleName: string) => string;
36
+ export declare const getDatabaseStorageKey: (globalID: string) => string;
37
+ export declare const getAnalyzerStorageKey: (globalID: string) => string;
38
+ export declare const getUpdateDataSubscriptionKey: (id?: string) => string;
39
+ export declare const createPublishSubscriptionManager: (globalID: string, func?: CSMCallback, name?: string) => (...args: any[]) => void;
40
+ export declare const createModuleSubscriptionManager: (globalID: string, moduleName: string, func?: CSMCallback, name?: string) => (...args: any[]) => void;
41
+ export declare function releaseChartsRuntimeOwners(owners: Array<string | undefined>): void;
27
42
  export interface rawData {
28
43
  getAllRawData: (left?: number) => SpectrumOutputData;
29
44
  }
@@ -1,6 +0,0 @@
1
- import type React from 'react';
2
- interface Props {
3
- id: string;
4
- }
5
- declare const Default: React.FC<Props>;
6
- export default Default;
@@ -1,6 +0,0 @@
1
- import type { RenderChartType } from '../../types';
2
- interface AxisYByCanvasProps {
3
- chart: RenderChartType;
4
- }
5
- export default function AxisYByCanvas(props: AxisYByCanvasProps): import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,5 +0,0 @@
1
- import type React from 'react';
2
- import useBand from './useBand';
3
- export { useBand };
4
- declare const Band: React.FC;
5
- export default Band;
@@ -1,2 +0,0 @@
1
- import type { BandProps } from '../../types';
2
- export default function useBand(): (e: BandProps) => void;
@@ -1,10 +0,0 @@
1
- import type React from 'react';
2
- interface PopoverProps {
3
- id: string;
4
- timestamp?: string;
5
- }
6
- export declare const SpectrumPopover: React.FC<PopoverProps>;
7
- export declare const HeatmapPopover: React.FC<PopoverProps>;
8
- export declare const LevelStreamPopover: React.FC<PopoverProps>;
9
- export declare const OccupancyPopover: React.FC;
10
- export {};
@@ -1,3 +0,0 @@
1
- import type React from 'react';
2
- declare const SignalAnalysisSwitch: React.FC;
3
- export default SignalAnalysisSwitch;
@@ -1,12 +0,0 @@
1
- import type React from 'react';
2
- import { ChartType, ToolsBarItemType } from '../../config';
3
- export interface ToolConfig {
4
- component: React.ComponentType<Record<string, unknown>>;
5
- toolType: ToolsBarItemType;
6
- supportedCharts: ChartType[];
7
- excludedCharts?: ChartType[];
8
- props?: Record<string, unknown>;
9
- }
10
- export declare const TOOL_CONFIGS: ToolConfig[];
11
- export declare const isToolConfigVisible: (config: ToolConfig, chartType: ChartType | undefined, hiddenTools?: string[]) => boolean;
12
- export declare const resolveToolConfigProps: (config: ToolConfig, chartType: ChartType | undefined) => Record<string, unknown>;
@@ -1,10 +0,0 @@
1
- export { AutorangingControl as AutorangingSwitch, UnitControl as UnitSwitch } from '../../AxisY/spectrum/controls';
2
- export { default as DeltaMeasurementSwitch } from '../../DeltaMeasurement/Switch';
3
- export { default as FrequencyAllocationSwitch } from '../../FrequencyAllocation/Switch';
4
- export { default as HeatmapCaptureSwitch } from '../../HeatmapCapture/Switch';
5
- export { default as LimitSwitch } from '../../Limit/Switch';
6
- export { default as MarkersSwitch } from '../../Markers/Switch';
7
- export { default as SignalSwitch } from '../../Signal/Switch';
8
- export { default as TimeRangeSwitch } from '../../TimeRange/Switch';
9
- export { default as ZoomSwitch } from '../../Zoom/Switch';
10
- export { default as FluorescenceSwitch } from '../../../modules/Fluorescence/Switch';
@@ -1,7 +0,0 @@
1
- interface Props {
2
- children: React.ReactNode;
3
- className?: string;
4
- style?: React.CSSProperties;
5
- }
6
- declare const ZoomOffsetContainer: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
7
- export default ZoomOffsetContainer;
@@ -1 +0,0 @@
1
- export default function useAxisY(): void;
@@ -1,27 +0,0 @@
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 {};
@@ -1,7 +0,0 @@
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;