@rfkit/charts 1.1.27 → 1.1.29

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.
@@ -23,6 +23,7 @@ export declare const createLongPressEventManager: (id: string, name?: string, fu
23
23
  export declare const calculateEventRelativePosition: (e: React.MouseEvent<HTMLElement> | React.WheelEvent<HTMLElement>) => TopRightBottomLeft;
24
24
  export declare const EVENT_PRIORITY_LEVELS: {
25
25
  void: number;
26
+ eventBus: number;
26
27
  signal: number;
27
28
  zoom: number;
28
29
  dragFrame: number;
package/index.js CHANGED
@@ -2234,7 +2234,6 @@ var __webpack_modules__ = {
2234
2234
  white-space: nowrap;
2235
2235
  margin-left: 10px;
2236
2236
  font-size: 12px;
2237
- transition: transform .2s ease-out, margin-left .2s ease-out;
2238
2237
  position: absolute;
2239
2238
  top: 10px;
2240
2239
  left: -200px;
@@ -6815,6 +6814,7 @@ const calculateEventRelativePosition = (e)=>{
6815
6814
  const EVENT_PRIORITY_LEVEL_DEFAULT = 'void';
6816
6815
  const EVENT_PRIORITY_LEVELS = {
6817
6816
  [EVENT_PRIORITY_LEVEL_DEFAULT]: 0,
6817
+ [constants_ToolType.EventBus]: 1,
6818
6818
  [constants_ToolType.Signal]: 1,
6819
6819
  [constants_ToolType.Zoom]: 2,
6820
6820
  [constants_ToolType.DragFrame]: 2,
@@ -7352,15 +7352,24 @@ EventBus_styles_module_options.domAPI = styleDomAPI_default();
7352
7352
  EventBus_styles_module_options.insertStyleElement = insertStyleElement_default();
7353
7353
  injectStylesIntoStyleTag_default()(EventBus_styles_module.Z, EventBus_styles_module_options);
7354
7354
  const components_EventBus_styles_module = EventBus_styles_module.Z && EventBus_styles_module.Z.locals ? EventBus_styles_module.Z.locals : void 0;
7355
+ const useEventBusCallback_COMPONENT_KEY = constants_ToolType.EventBus;
7355
7356
  function useEventBusCallback(id) {
7356
7357
  const { state: { segments, axisX: { frequencyFormat }, eventBus: { onDoubleClick } } } = useStore_useStore();
7357
7358
  (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
7358
- createDoubleClickEventManager(id, 'useEventBusCallback', (_, e)=>{
7359
+ createDoubleClickEventManager(id, useEventBusCallback_COMPONENT_KEY, (_, e)=>{
7360
+ if (!compareEventPriority(id, useEventBusCallback_COMPONENT_KEY)) return;
7359
7361
  const { left } = e;
7360
7362
  const frequency = frequencyFormat(left);
7361
7363
  onDoubleClick(frequency, e);
7362
7364
  });
7365
+ createMouseUpEventManager(id, useEventBusCallback_COMPONENT_KEY, ()=>{
7366
+ resetEventLevel(id, useEventBusCallback_COMPONENT_KEY);
7367
+ });
7368
+ createMouseLeaveEventManager(id, useEventBusCallback_COMPONENT_KEY, ()=>{
7369
+ resetEventLevel(id, useEventBusCallback_COMPONENT_KEY);
7370
+ });
7363
7371
  }, [
7372
+ id,
7364
7373
  segments,
7365
7374
  frequencyFormat,
7366
7375
  onDoubleClick
@@ -9905,9 +9914,10 @@ function splitZoomLeft({ left, globalID }) {
9905
9914
  const { zoom, segments } = getGlobalStoreState(globalID);
9906
9915
  const { start, end } = zoom.interval;
9907
9916
  const { totalPoints } = segments;
9908
- const safeLeft = Math.max(0, Math.min(100, left));
9917
+ const safeLeft = left;
9909
9918
  const intervalWidth = end - start + 1;
9910
- const insideLeft = Math.max(0, Math.min(100, (safeLeft * totalPoints / 100 - start) * 100 / intervalWidth));
9919
+ const rawInsideLeft = (safeLeft * totalPoints / 100 - start) * 100 / intervalWidth;
9920
+ const insideLeft = rawInsideLeft;
9911
9921
  const outsideLeft = 100 * start / totalPoints;
9912
9922
  const multiple = totalPoints / intervalWidth;
9913
9923
  return {
package/package.json CHANGED
@@ -5,6 +5,6 @@
5
5
  "types": "index.d.ts",
6
6
  "author": "Hxgh",
7
7
  "license": "MIT",
8
- "version": "1.1.27",
8
+ "version": "1.1.29",
9
9
  "private": false
10
10
  }