@363045841yyt/klinechart 0.7.5 → 0.7.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/dist/version.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export declare const VERSION: string;
2
- export { VERSION as CORE_VERSION } from '../../core/src';
2
+ export { VERSION as CORE_VERSION } from '@363045841yyt/klinechart-core';
3
3
  //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1,18 @@
1
+ import { SemanticChartConfig, DataFetcher } from '@363045841yyt/klinechart-core/semantic';
2
+ declare const KLineChartElement: import('vue').VueElementConstructor<{
3
+ semanticConfig: SemanticChartConfig;
4
+ dataFetcher: DataFetcher;
5
+ yPaddingPx?: number;
6
+ minKWidth?: number;
7
+ maxKWidth?: number;
8
+ rightAxisWidth?: number;
9
+ bottomAxisHeight?: number;
10
+ priceLabelWidth?: number;
11
+ zoomLevels?: number;
12
+ initialZoomLevel?: number;
13
+ isFullscreen?: boolean;
14
+ }>;
15
+ export { KLineChartElement };
16
+ export default KLineChartElement;
17
+ export type { SemanticChartConfig, DataFetcher };
18
+ //# sourceMappingURL=web-component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-component.d.ts","sourceRoot":"","sources":["../src/web-component.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AAE9F,QAAA,MAAM,iBAAiB;;;;;;;;;;;;EAErB,CAAA;AAIF,OAAO,EAAE,iBAAiB,EAAE,CAAA;AAC5B,eAAe,iBAAiB,CAAA;AAEhC,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@363045841yyt/klinechart",
3
- "version": "0.7.5",
3
+ "version": "0.7.6",
4
4
  "description": "Vue 3 bindings for @363045841yyt/klinechart-core. Idiomatic composables, SFC components.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,6 +28,11 @@
28
28
  "default": "./dist/index.cjs"
29
29
  }
30
30
  },
31
+ "./web-component": {
32
+ "import": {
33
+ "default": "./dist/kline-chart.js"
34
+ }
35
+ },
31
36
  "./style.css": "./dist/klinechart.css"
32
37
  },
33
38
  "files": [
@@ -39,7 +44,8 @@
39
44
  },
40
45
  "scripts": {
41
46
  "dev": "vite --config preview/vite.config.ts",
42
- "build": "vite build && node -e \"require('fs').copyFileSync('dist/index.d.ts','dist/index.d.cts')\"",
47
+ "build": "vite build",
48
+ "build:wc": "cross-env BUILD_TARGET=web-component vite build",
43
49
  "postbuild": "node -e \"require('fs').copyFileSync('dist/index.d.ts','dist/index.d.cts')\"",
44
50
  "test": "vitest run",
45
51
  "test:watch": "vitest",
@@ -69,6 +75,7 @@
69
75
  "@size-limit/preset-small-lib": "^12.1.0",
70
76
  "@vitejs/plugin-vue": "^6.0.0",
71
77
  "@vue/test-utils": "^2.4.10",
78
+ "cross-env": "^7.0.3",
72
79
  "jsdom": "^29.1.1",
73
80
  "publint": "^0.3.0",
74
81
  "size-limit": "^12.1.0",
@@ -76,6 +83,7 @@
76
83
  "unplugin-icons": "^23.0.1",
77
84
  "vite": "^8.0.14",
78
85
  "vite-plugin-babel": "^1.3.2",
86
+ "vite-plugin-css-injected-by-js": "^5.0.1",
79
87
  "vite-plugin-dts": "^5.0.1",
80
88
  "vitest": "^4.1.5",
81
89
  "vue": "^3.5.0"
@@ -20,13 +20,14 @@ import type {
20
20
  IndicatorDefinition,
21
21
  IndicatorSelectorController,
22
22
  KLineData,
23
+ PaneSpec,
23
24
  ToolbarController,
24
25
  ToolDefinition,
25
26
  ToolId,
26
27
  } from '@363045841yyt/klinechart-core'
27
28
 
28
29
  // ---------------------------------------------------------------------------
29
- // Inline mini-signal �?Object.is-equality, sync notify. Drop-in compatible
30
+ // Inline mini-signal �?Object.is-equality, sync notify. Drop-in compatible
30
31
  // with `@363045841yyt/klinechart-core/reactivity` for shape-only test purposes.
31
32
  // ---------------------------------------------------------------------------
32
33
 
@@ -132,6 +133,7 @@ export function createMockChartController(
132
133
  })
133
134
  const data = createSignal<ReadonlyArray<KLineData>>(opts.data ?? [])
134
135
  const theme = createSignal<'light' | 'dark'>(opts.theme ?? 'light')
136
+ const paneLayout = createSignal<ReadonlyArray<PaneSpec>>([])
135
137
  const indicatorSelector = createMockIndicatorSelector()
136
138
  const toolbar = createMockToolbar()
137
139
  const drawing = createMockDrawing()
@@ -140,12 +142,15 @@ export function createMockChartController(
140
142
  viewport,
141
143
  data,
142
144
  theme,
145
+ paneLayout,
143
146
  indicatorSelector,
144
147
  toolbar,
145
148
  drawing,
146
149
  setData: (next) => data.set(next),
147
150
  appendData: (next) => data.set([...data.peek(), ...next]),
148
151
  updateData: (next) => data.set(next),
152
+ getData: () => data.peek(),
153
+ getZoomLevelCount: () => 10,
149
154
  setTheme: (next) => theme.set(next),
150
155
  zoomToLevel: (level) =>
151
156
  viewport.set({ ...viewport.peek(), zoomLevel: level }),
@@ -167,12 +172,17 @@ export function createMockChartController(
167
172
  removeIndicator: () => false,
168
173
  updateIndicatorParams: () => false,
169
174
  updateRendererConfig: () => {},
175
+ setTooltipSize: () => {},
176
+ setTooltipAnchorPositioning: () => {},
177
+ getIndicatorTitle: () => undefined,
170
178
  setDrawingTool: (tool) => drawing.setActiveTool(tool),
171
179
  clearDrawings: () => drawing.clearAll(),
172
180
  removeDrawing: () => {},
173
181
  resizeSubPane: () => false,
174
182
  createSubPane: () => false,
175
183
  clearSubPanes: () => {},
184
+ replaceSubPaneIndicator: () => false,
185
+ updatePaneLayout: (_panes: PaneSpec[]) => {},
176
186
  updateCustomMarkers: () => {},
177
187
  clearCustomMarkers: () => {},
178
188
  updateSettingsFacade: () => {},
@@ -50,20 +50,7 @@
50
50
 
51
51
  <script setup lang="ts">
52
52
  import { onMounted, onUnmounted } from 'vue'
53
-
54
- export interface DrawingStyle {
55
- stroke?: string
56
- strokeWidth?: number
57
- strokeStyle?: 'solid' | 'dashed' | 'dotted'
58
- fill?: string
59
- }
60
-
61
- export interface DrawingObject {
62
- id: string
63
- type: string
64
- points: { x: number; y: number }[]
65
- style: DrawingStyle
66
- }
53
+ import type { DrawingObject, DrawingStyle } from '@363045841yyt/klinechart-core/plugin'
67
54
 
68
55
  const props = defineProps<{
69
56
  drawing: DrawingObject
@@ -117,6 +117,7 @@
117
117
 
118
118
  <script setup lang="ts">
119
119
  import { ref, watch, computed } from 'vue'
120
+ import { useFullscreenTeleportTarget } from '../composables/useFullscreenTeleportTarget'
120
121
 
121
122
  export interface ParamConfig {
122
123
  key: string
@@ -146,7 +147,7 @@ const emit = defineEmits<{
146
147
  const localValues = ref<Record<string, number>>({ ...props.values })
147
148
  const showDescription = ref(true)
148
149
 
149
- const teleportTarget = computed(() => 'body')
150
+ const teleportTarget = useFullscreenTeleportTarget()
150
151
 
151
152
  watch(
152
153
  () => props.values,
@@ -293,14 +293,12 @@ import IndicatorParams from './IndicatorParams.vue'
293
293
  import { useFullscreenTeleportTarget } from '../composables/useFullscreenTeleportTarget'
294
294
  import { coreSignalToVueRef } from '../index'
295
295
  import {
296
+ createIndicatorSelectorController,
297
+ type IndicatorDefinition,
296
298
  allIndicators,
297
299
  findIndicator,
298
300
  isSubIndicatorId,
299
- } from '@363045841yyt/klinechart-core/engine/renderers/Indicator/indicatorData'
300
- import type { Indicator } from '@363045841yyt/klinechart-core/engine/renderers/Indicator/indicatorData'
301
- import {
302
- createIndicatorSelectorController,
303
- type IndicatorDefinition,
301
+ type Indicator,
304
302
  } from '@363045841yyt/klinechart-core/controllers'
305
303
 
306
304
  const props = defineProps<{