@iccandle/vuejs-widget 0.2.0 → 0.2.2
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 +21 -0
- package/dist/index.d.ts +30 -0
- package/dist/widget-iccandle.cjs +4 -4
- package/dist/widget-iccandle.js +1877 -1674
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -214,6 +214,25 @@ Scan and Pattern Tracker require `localStorage.iccandle_token`. The results ifra
|
|
|
214
214
|
|
|
215
215
|
The root uses CSS custom properties you can override: `--iccandle-primary`, `--iccandle-border`, `--iccandle-text`, `--iccandle-background`, `--iccandle-primary-gradient-end`, `--iccandle-font`.
|
|
216
216
|
|
|
217
|
+
### Chart mask colors
|
|
218
|
+
|
|
219
|
+
During replay the widget draws all predicted candles at once and hides the ones that have not been revealed yet by painting them in a solid "mask" color. The illusion only works if that color is identical to the chart pane background, otherwise the hidden bars show up as visible blocks ahead of the replay cursor.
|
|
220
|
+
|
|
221
|
+
Defaults are `#ffffff` for `light` and `#0F0F0F` for `dark`. If your TradingView `paneProperties.background` differs, pass `chartMaskColors` with the matching value:
|
|
222
|
+
|
|
223
|
+
```vue
|
|
224
|
+
<WidgetIccandle
|
|
225
|
+
:chart-widget="chartWidget"
|
|
226
|
+
:submit-callback="handleSubmit"
|
|
227
|
+
theme="dark"
|
|
228
|
+
:chart-mask-colors="{ dark: '#2F2F2F', light: '#ffffff' }"
|
|
229
|
+
>
|
|
230
|
+
<div ref="containerRef" style="height: 100%" />
|
|
231
|
+
</WidgetIccandle>
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Only the entry for the active theme is used, and each key is optional — omit one to keep its default. Any CSS color string the charting library accepts works, but avoid transparency: a translucent mask lets the real series bleed through. Changing the prop recreates the generated-candle studies, so it can be updated reactively when the host switches themes.
|
|
235
|
+
|
|
217
236
|
### Language
|
|
218
237
|
|
|
219
238
|
`language` accepts `"en"` | `"zh"` | `"vi"` | `"th"` | `"ko"` | `"ja"` | `"mn"` | `"ru"`. Unknown values fall back to `"en"`. The value is used for scanner copy and is forwarded into embed URLs.
|
|
@@ -241,6 +260,7 @@ See [`src/App.vue`](src/App.vue), [`src/tradingview/TradingviewChart.vue`](src/t
|
|
|
241
260
|
| ---- | ---- | ----------- |
|
|
242
261
|
| `WidgetIccandle` | Component | Scanner overlay around your chart subtree. |
|
|
243
262
|
| `WidgetIccandleProps` | Type | Public props of `WidgetIccandle`. |
|
|
263
|
+
| `WidgetChartMaskColors` | Type | `{ light?: string; dark?: string }` for the `chartMaskColors` prop. |
|
|
244
264
|
| `WidgetLanguage` | Type | Supported UI languages. |
|
|
245
265
|
| `withPlayChart` | Function | Wrap a TradingView datafeed (or factory) so replay can inject bars and block live ticks. |
|
|
246
266
|
| `getCustomIndicators` | Function | Returns custom studies used to draw generated / predicted candles. Pass `"light"` or `"dark"`. |
|
|
@@ -260,6 +280,7 @@ See [`src/App.vue`](src/App.vue), [`src/tradingview/TradingviewChart.vue`](src/t
|
|
|
260
280
|
| `chartWidget` | `IChartingLibraryWidget \| null` | Yes | — | Live TradingView widget (`null` until ready). |
|
|
261
281
|
| `submitCallback` | `(iframeSrc: string) => void` | Yes | — | Called with the embed URL after a scan (and for some pricing / news navigations). |
|
|
262
282
|
| `theme` | `"light" \| "dark" \| "system"` | No | `"light"` | Scanner and forwarded embed theme. |
|
|
283
|
+
| `chartMaskColors` | `WidgetChartMaskColors` | No | `{ light: "#ffffff", dark: "#0F0F0F" }` | Per-theme color used to mask not-yet-revealed predicted candles. Must match your chart pane background. |
|
|
263
284
|
| `language` | `WidgetLanguage` | No | `"en"` | Scanner UI language. |
|
|
264
285
|
| `onCloseResult` | `() => void` | No | — | Called when the embed posts `selector.closeResult`. |
|
|
265
286
|
| `iframeLoaded` | `boolean` | No | `true` | When `false`, Scan and Pattern Tracker are disabled. Set `true` after the results iframe has loaded. |
|
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,8 @@ declare type __VLS_Props = {
|
|
|
24
24
|
chartWidget: IChartingLibraryWidget | null;
|
|
25
25
|
submitCallback: (iframeSrc: string) => void;
|
|
26
26
|
theme?: "light" | "dark" | "system";
|
|
27
|
+
/** Simulate-candle mask colors per theme. Defaults: light `#ffffff`, dark `#0F0F0F`. */
|
|
28
|
+
chartMaskColors?: WidgetChartMaskColors;
|
|
27
29
|
language?: WidgetLanguage;
|
|
28
30
|
onCloseResult?: () => void;
|
|
29
31
|
iframeLoaded?: boolean;
|
|
@@ -64,6 +66,9 @@ declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
|
64
66
|
};
|
|
65
67
|
};
|
|
66
68
|
|
|
69
|
+
/** Same origin + path → soft update via postMessage (no iframe remount). */
|
|
70
|
+
export declare function canSoftSelectorNavigate(iframe: HTMLIFrameElement | null | undefined, nextSrc: string): boolean;
|
|
71
|
+
|
|
67
72
|
export declare type GeneratedCandlesTheme = "light" | "dark";
|
|
68
73
|
|
|
69
74
|
export declare const getCustomIndicators: (theme?: GeneratedCandlesTheme) => Promise<readonly CustomIndicator[]>;
|
|
@@ -84,10 +89,33 @@ export declare function postOpenPricingToParent(options?: Pick<OpenPricingMessag
|
|
|
84
89
|
|
|
85
90
|
export declare function postOpenPricingToWindow(target: Window, options?: Pick<OpenPricingMessage, "theme" | "language">): void;
|
|
86
91
|
|
|
92
|
+
export declare function postSelectorLoadingToEmbed(iframe: HTMLIFrameElement | null | undefined, isLoading: boolean): boolean;
|
|
93
|
+
|
|
94
|
+
export declare function postSelectorScanToEmbed(iframe: HTMLIFrameElement | null | undefined, url: string): boolean;
|
|
95
|
+
|
|
96
|
+
export declare const SELECTOR_LOADING_MESSAGE_TYPE = "selector-loading";
|
|
97
|
+
|
|
98
|
+
export declare const SELECTOR_SCAN_MESSAGE_TYPE = "selector-scan";
|
|
99
|
+
|
|
100
|
+
export declare type SelectorLoadingMessage = {
|
|
101
|
+
type: typeof SELECTOR_LOADING_MESSAGE_TYPE;
|
|
102
|
+
isLoading: boolean;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export declare type SelectorScanMessage = {
|
|
106
|
+
type: typeof SELECTOR_SCAN_MESSAGE_TYPE;
|
|
107
|
+
url: string;
|
|
108
|
+
};
|
|
109
|
+
|
|
87
110
|
declare const WIDGET_LANGUAGES: readonly ["en", "zh", "vi", "th", "ko", "ja", "mn", "ru"];
|
|
88
111
|
|
|
89
112
|
export declare const WIDGET_RESULT_URL = "https://embed-iccandle-app.iccandle.ai";
|
|
90
113
|
|
|
114
|
+
export declare type WidgetChartMaskColors = {
|
|
115
|
+
light?: string;
|
|
116
|
+
dark?: string;
|
|
117
|
+
};
|
|
118
|
+
|
|
91
119
|
export declare const WidgetIccandle: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
92
120
|
|
|
93
121
|
declare type WidgetIccandleChartRefs = {
|
|
@@ -107,6 +135,8 @@ export declare type WidgetIccandleProps = {
|
|
|
107
135
|
chartWidget: IChartingLibraryWidget | null;
|
|
108
136
|
submitCallback: (iframeSrc: string) => void;
|
|
109
137
|
theme?: "light" | "dark" | "system";
|
|
138
|
+
/** Simulate-candle mask colors per theme. Defaults: light `#ffffff`, dark `#0F0F0F`. */
|
|
139
|
+
chartMaskColors?: WidgetChartMaskColors;
|
|
110
140
|
language?: WidgetLanguage;
|
|
111
141
|
onCloseResult?: () => void;
|
|
112
142
|
iframeLoaded?: boolean;
|