@baron1996/klinecharts-runtime 0.9.5 → 0.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,7 @@ Browser editing runtime and standard annotation toolbar for deterministic KLineC
4
4
  ChartScene files.
5
5
 
6
6
  ```bash
7
- npm install --save-exact @baron1996/kline-scene-schema@0.6.0 @baron1996/klinecharts-runtime@0.9.5
7
+ npm install --save-exact @baron1996/kline-scene-schema@0.6.0 @baron1996/klinecharts-runtime@0.9.6
8
8
  ```
9
9
 
10
10
  ```ts
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /** Web Runtime npm 包版本;ChartScene runtimeVersion 是独立的数据契约版本。 */
2
- export declare const WEB_RUNTIME_PACKAGE_VERSION: "0.9.5";
2
+ export declare const WEB_RUNTIME_PACKAGE_VERSION: "0.9.6";
3
3
  export { SUPPORTED_OVERLAYS } from '@baron1996/klinecharts-adapter';
4
4
  export * from './cross-period/coordinator.js';
5
5
  export * from './drawing/capabilities.js';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /** Web Runtime npm 包版本;ChartScene runtimeVersion 是独立的数据契约版本。 */
2
- export const WEB_RUNTIME_PACKAGE_VERSION = '0.9.5';
2
+ export const WEB_RUNTIME_PACKAGE_VERSION = '0.9.6';
3
3
  export { SUPPORTED_OVERLAYS } from '@baron1996/klinecharts-adapter';
4
4
  export * from './cross-period/coordinator.js';
5
5
  export * from './drawing/capabilities.js';
@@ -1 +1 @@
1
- {"version":3,"file":"standard-toolbar-styles.d.ts","sourceRoot":"","sources":["../../src/toolbar/standard-toolbar-styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,QAgSnC,CAAC"}
1
+ {"version":3,"file":"standard-toolbar-styles.d.ts","sourceRoot":"","sources":["../../src/toolbar/standard-toolbar-styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,QAsSnC,CAAC"}
@@ -10,6 +10,7 @@ export const STANDARD_TOOLBAR_STYLES = String.raw `
10
10
  position: relative;
11
11
  display: flex;
12
12
  width: 100%;
13
+ max-width: 100%;
13
14
  min-width: 0;
14
15
  color: rgba(32, 35, 42, 1);
15
16
  background: rgba(255, 255, 255, 1);
@@ -18,12 +19,17 @@ export const STANDARD_TOOLBAR_STYLES = String.raw `
18
19
  }
19
20
 
20
21
  .baron-kline-toolbar__viewport {
22
+ flex: 1 1 auto;
21
23
  width: 100%;
24
+ max-width: 100%;
22
25
  min-width: 0;
23
26
  overflow-x: auto;
24
27
  overflow-y: hidden;
25
28
  contain: layout paint;
29
+ overscroll-behavior-x: contain;
26
30
  scrollbar-width: none;
31
+ touch-action: pan-x;
32
+ -webkit-overflow-scrolling: touch;
27
33
  }
28
34
 
29
35
  .baron-kline-toolbar__viewport::-webkit-scrollbar {
@@ -1 +1 @@
1
- {"version":3,"file":"standard-toolbar.d.ts","sourceRoot":"","sources":["../../src/toolbar/standard-toolbar.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACX,wBAAwB,EACxB,0BAA0B,EAC1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACX,eAAe,EACf,sBAAsB,EAEtB,MAAM,aAAa,CAAC;AAgErB,KAAK,sBAAsB,GAAG,wBAAwB,GAAG,0BAA0B,CAAC;AAyKpF,2BAA2B;AAC3B,wBAAgB,qBAAqB,CACpC,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,sBAAsB,EAC/B,OAAO,GAAE,sBAA2B,GAClC,eAAe,CA2QjB"}
1
+ {"version":3,"file":"standard-toolbar.d.ts","sourceRoot":"","sources":["../../src/toolbar/standard-toolbar.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACX,wBAAwB,EACxB,0BAA0B,EAC1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACX,eAAe,EACf,sBAAsB,EAEtB,MAAM,aAAa,CAAC;AAgErB,KAAK,sBAAsB,GAAG,wBAAwB,GAAG,0BAA0B,CAAC;AAyKpF,2BAA2B;AAC3B,wBAAgB,qBAAqB,CACpC,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,sBAAsB,EAC/B,OAAO,GAAE,sBAA2B,GAClC,eAAe,CA8RjB"}
@@ -177,6 +177,21 @@ export function createStandardToolbar(container, runtime, options = {}) {
177
177
  root.append(style, viewport);
178
178
  const tooltip = createTooltip(viewport, `baron-kline-toolbar-tooltip-${toolbarId}`);
179
179
  const cleanupCallbacks = [];
180
+ const handleViewportWheel = (event) => {
181
+ if (event.ctrlKey ||
182
+ viewport.scrollWidth <= viewport.clientWidth ||
183
+ Math.abs(event.deltaX) >= Math.abs(event.deltaY)) {
184
+ return;
185
+ }
186
+ const previousScrollLeft = viewport.scrollLeft;
187
+ viewport.scrollLeft += event.deltaY;
188
+ if (viewport.scrollLeft !== previousScrollLeft) {
189
+ event.preventDefault();
190
+ tooltip.hide();
191
+ }
192
+ };
193
+ viewport.addEventListener('wheel', handleViewportWheel, { passive: false });
194
+ cleanupCallbacks.push(() => viewport.removeEventListener('wheel', handleViewportWheel));
180
195
  const overlayButtons = [];
181
196
  const hostActionControls = new Map();
182
197
  const textInput = document.createElement('input');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baron1996/klinecharts-runtime",
3
- "version": "0.9.5",
3
+ "version": "0.9.6",
4
4
  "description": "Web runtime for deterministic KLineCharts scenes.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",