@lightfin/react 0.0.0-stage → 0.0.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.
- package/dist/LightfinChart.d.ts +51 -0
- package/dist/LightfinChart.d.ts.map +1 -0
- package/dist/context.d.ts +19 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/hooks.d.ts +23 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +64 -0
- package/dist/index.js.map +1 -0
- package/package.json +40 -4
- package/README.md +0 -3
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Chart, ChartOptionsInput, CrosshairMoveEvent, InstrumentInfo, OrderIntentEvent, Series, SeriesChange } from '@lightfin/core';
|
|
2
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
3
|
+
export interface LightfinChartProps {
|
|
4
|
+
/**
|
|
5
|
+
* Core options (theme, rightOffset, crosshairMode, …), applied once when the
|
|
6
|
+
* chart is created. The engine has no live option setter, so later changes
|
|
7
|
+
* are ignored — give the component a new `key` to recreate it with fresh
|
|
8
|
+
* options.
|
|
9
|
+
*/
|
|
10
|
+
options?: ChartOptionsInput;
|
|
11
|
+
/**
|
|
12
|
+
* Instrument metadata. Re-applied whenever it changes; pass `null`
|
|
13
|
+
* to clear, or omit to leave whatever was set imperatively untouched.
|
|
14
|
+
*/
|
|
15
|
+
instrument?: InstrumentInfo | null;
|
|
16
|
+
/** Class on the outer container the chart fills. Give it a size. */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Inline style on the outer container. Give it a size (e.g. `height`). */
|
|
19
|
+
style?: CSSProperties;
|
|
20
|
+
onCrosshairMove?: (event: CrosshairMoveEvent | null) => void;
|
|
21
|
+
onDataChange?: (change: SeriesChange) => void;
|
|
22
|
+
onSeriesChange?: (series: Series) => void;
|
|
23
|
+
onIndicatorsChange?: () => void;
|
|
24
|
+
onLayoutChange?: () => void;
|
|
25
|
+
onInstrumentChange?: (info: InstrumentInfo | null) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Opt in to the order-intent "+" button. The button only shows
|
|
28
|
+
* while this handler is set.
|
|
29
|
+
*/
|
|
30
|
+
onOrderIntent?: (event: OrderIntentEvent) => void;
|
|
31
|
+
/** Called once with the instance right after it is created. */
|
|
32
|
+
onCreate?: (chart: Chart) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Feature components (see {@link useChartEffect}). They read the chart from
|
|
35
|
+
* context and typically render nothing.
|
|
36
|
+
*/
|
|
37
|
+
children?: ReactNode;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Owns a lightfin chart's lifecycle inside React: creates it on mount, removes
|
|
41
|
+
* it on unmount, keeps event-handler props and the `instrument` wired up, and
|
|
42
|
+
* publishes the instance through a `ref` and to child feature components.
|
|
43
|
+
*
|
|
44
|
+
* ```tsx
|
|
45
|
+
* <LightfinChart style={{ height: 420 }} options={{ theme }}>
|
|
46
|
+
* <Candles bars={bars} />
|
|
47
|
+
* </LightfinChart>
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare const LightfinChart: import("react").ForwardRefExoticComponent<LightfinChartProps & import("react").RefAttributes<Chart | null>>;
|
|
51
|
+
//# sourceMappingURL=LightfinChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LightfinChart.d.ts","sourceRoot":"","sources":["../src/LightfinChart.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,KAAK,EACL,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,MAAM,EACN,YAAY,EACb,MAAM,gBAAgB,CAAA;AASvB,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AASrD,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAA;IAC3B;;;OAGG;IACH,UAAU,CAAC,EAAE,cAAc,GAAG,IAAI,CAAA;IAClC,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,KAAK,IAAI,CAAA;IAC5D,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAA;IAC7C,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACzC,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;IAC/B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;IAC3B,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAA;IAC1D;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAA;IACjD,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;IACjC;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,6GAiEzB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Chart } from '@lightfin/core';
|
|
2
|
+
/**
|
|
3
|
+
* Carries the chart instance down to feature components (via
|
|
4
|
+
* {@link useChart} / {@link useChartEffect}).
|
|
5
|
+
*
|
|
6
|
+
* `undefined` means "no `<LightfinChart>` above me"; `null` means the provider
|
|
7
|
+
* is present but the chart has not been created yet (it is built in a layout
|
|
8
|
+
* effect, one render after mount).
|
|
9
|
+
*/
|
|
10
|
+
export declare const ChartContext: import("react").Context<Chart | null | undefined>;
|
|
11
|
+
/**
|
|
12
|
+
* The chart instance from the nearest {@link LightfinChart}, or `null` until it
|
|
13
|
+
* exists (the frame after mount). Throws if called outside a `<LightfinChart>`.
|
|
14
|
+
*
|
|
15
|
+
* Prefer {@link useChartEffect} for wiring series, indicators, chrome, or
|
|
16
|
+
* annotations — it waits for the instance and cleans up for you.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useChart(): Chart | null;
|
|
19
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAG3C;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,mDAAqD,CAAA;AAE9E;;;;;;GAMG;AACH,wBAAgB,QAAQ,IAAI,KAAK,GAAG,IAAI,CAMvC"}
|
package/dist/hooks.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Chart } from '@lightfin/core';
|
|
2
|
+
import type { DependencyList } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Run an effect against the chart once it exists, re-running when `deps`
|
|
5
|
+
* change and cleaning up on unmount. The escape hatch for wiring anything
|
|
6
|
+
* imperative onto the chart — series, data, indicators, `createChrome`,
|
|
7
|
+
* `createAnnotations`, `addPriceLine` — without a component per feature:
|
|
8
|
+
*
|
|
9
|
+
* ```tsx
|
|
10
|
+
* function Candles({ bars }: { bars: Bar[] }) {
|
|
11
|
+
* useChartEffect(chart => {
|
|
12
|
+
* const series = chart.addCandlestickSeries()
|
|
13
|
+
* series.setData(bars)
|
|
14
|
+
* }, [bars])
|
|
15
|
+
* return null
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* The callback receives a non-null {@link Chart}; the effect simply does not
|
|
20
|
+
* run while the chart is still being created.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useChartEffect(effect: (chart: Chart) => void | (() => void), deps?: DependencyList): void;
|
|
23
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAI3C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,EAC7C,IAAI,GAAE,cAAmB,GACxB,IAAI,CAON"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @lightfin/react — a thin React wrapper.
|
|
3
|
+
*
|
|
4
|
+
* `<LightfinChart>` owns the chart's lifecycle; `useChartEffect` wires features
|
|
5
|
+
* (series, indicators, chrome, annotations, price lines) imperatively onto it.
|
|
6
|
+
* `@lightfin/core` and `react` are both peer dependencies.
|
|
7
|
+
*
|
|
8
|
+
* ```tsx
|
|
9
|
+
* import { LightfinChart, useChartEffect } from '@lightfin/react'
|
|
10
|
+
*
|
|
11
|
+
* function Candles({ bars }: { bars: Bar[] }) {
|
|
12
|
+
* useChartEffect(chart => {
|
|
13
|
+
* chart.addCandlestickSeries().setData(bars)
|
|
14
|
+
* }, [bars])
|
|
15
|
+
* return null
|
|
16
|
+
* }
|
|
17
|
+
*
|
|
18
|
+
* function App() {
|
|
19
|
+
* return (
|
|
20
|
+
* <LightfinChart style={{ height: 420 }}>
|
|
21
|
+
* <Candles bars={bars} />
|
|
22
|
+
* </LightfinChart>
|
|
23
|
+
* )
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export { LightfinChart } from './LightfinChart';
|
|
28
|
+
export type { LightfinChartProps } from './LightfinChart';
|
|
29
|
+
export { ChartContext, useChart } from './context';
|
|
30
|
+
export { useChartEffect } from './hooks';
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { createChart as e } from "@lightfin/core";
|
|
2
|
+
import { createContext as t, forwardRef as n, useContext as r, useEffect as i, useImperativeHandle as a, useLayoutEffect as o, useRef as s, useState as c } from "react";
|
|
3
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
4
|
+
// src/context.ts
|
|
5
|
+
var d = t(void 0);
|
|
6
|
+
function f() {
|
|
7
|
+
let e = r(d);
|
|
8
|
+
if (e === void 0) throw Error("lightfin: useChart must be used inside <LightfinChart>");
|
|
9
|
+
return e;
|
|
10
|
+
}
|
|
11
|
+
// src/LightfinChart.tsx
|
|
12
|
+
var p = typeof window < "u" ? o : i, m = n(function(t, n) {
|
|
13
|
+
let { className: r, style: o, instrument: f, onOrderIntent: m, children: h } = t, g = s(null), [_, v] = c(null), y = s(t);
|
|
14
|
+
y.current = t;
|
|
15
|
+
let b = s(t.options);
|
|
16
|
+
return p(() => {
|
|
17
|
+
let t = g.current;
|
|
18
|
+
if (!t) return;
|
|
19
|
+
let n = e(t, b.current ?? {});
|
|
20
|
+
return y.current.onCreate?.(n), v(n), () => {
|
|
21
|
+
n.remove(), v(null);
|
|
22
|
+
};
|
|
23
|
+
}, []), a(n, () => _, [_]), i(() => {
|
|
24
|
+
if (!_) return;
|
|
25
|
+
let e = y, t = [
|
|
26
|
+
_.on("crosshairMove", (t) => e.current.onCrosshairMove?.(t)),
|
|
27
|
+
_.on("dataChange", (t) => e.current.onDataChange?.(t)),
|
|
28
|
+
_.on("seriesChange", (t) => e.current.onSeriesChange?.(t)),
|
|
29
|
+
_.on("indicatorsChange", () => e.current.onIndicatorsChange?.()),
|
|
30
|
+
_.on("layoutChange", () => e.current.onLayoutChange?.()),
|
|
31
|
+
_.on("instrumentChange", (t) => e.current.onInstrumentChange?.(t))
|
|
32
|
+
];
|
|
33
|
+
return () => {
|
|
34
|
+
for (let e of t) e();
|
|
35
|
+
};
|
|
36
|
+
}, [_]), i(() => {
|
|
37
|
+
if (_ && m) return _.onOrderIntent(m);
|
|
38
|
+
}, [_, m]), i(() => {
|
|
39
|
+
_ && f !== void 0 && _.setInstrument(f);
|
|
40
|
+
}, [_, f]), /* @__PURE__ */ u("div", {
|
|
41
|
+
className: r,
|
|
42
|
+
style: o,
|
|
43
|
+
children: [/* @__PURE__ */ l("div", {
|
|
44
|
+
ref: g,
|
|
45
|
+
style: {
|
|
46
|
+
width: "100%",
|
|
47
|
+
height: "100%"
|
|
48
|
+
}
|
|
49
|
+
}), /* @__PURE__ */ l(d.Provider, {
|
|
50
|
+
value: _,
|
|
51
|
+
children: h
|
|
52
|
+
})]
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
// src/hooks.ts
|
|
56
|
+
function h(e, t = []) {
|
|
57
|
+
let n = f();
|
|
58
|
+
i(() => {
|
|
59
|
+
if (n) return e(n);
|
|
60
|
+
}, [n, ...t]);
|
|
61
|
+
}
|
|
62
|
+
export { d as ChartContext, m as LightfinChart, f as useChart, h as useChartEffect };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["ChartContext","createContext","useChart","chart","useContext","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","LightfinChart","forwardRef","props","containerRef","useRef","setChart","useState","propsRef","optionsRef","container","instance","createChart","useImperativeHandle","ref","p","offs","e","s","i","off","onOrderIntent","instrument","useChartEffect","effect","deps"],"sources":["../src/context.ts","../src/LightfinChart.tsx","../src/hooks.ts"],"sourcesContent":["import type { Chart } from '@lightfin/core'\nimport { createContext, useContext } from 'react'\n\n/**\n * Carries the chart instance down to feature components (via\n * {@link useChart} / {@link useChartEffect}).\n *\n * `undefined` means \"no `<LightfinChart>` above me\"; `null` means the provider\n * is present but the chart has not been created yet (it is built in a layout\n * effect, one render after mount).\n */\nexport const ChartContext = createContext<Chart | null | undefined>(undefined)\n\n/**\n * The chart instance from the nearest {@link LightfinChart}, or `null` until it\n * exists (the frame after mount). Throws if called outside a `<LightfinChart>`.\n *\n * Prefer {@link useChartEffect} for wiring series, indicators, chrome, or\n * annotations — it waits for the instance and cleans up for you.\n */\nexport function useChart(): Chart | null {\n const chart = useContext(ChartContext)\n if (chart === undefined) {\n throw new Error('lightfin: useChart must be used inside <LightfinChart>')\n }\n return chart\n}\n","import { createChart } from '@lightfin/core'\nimport type {\n Chart,\n ChartOptionsInput,\n CrosshairMoveEvent,\n InstrumentInfo,\n OrderIntentEvent,\n Series,\n SeriesChange,\n} from '@lightfin/core'\nimport {\n forwardRef,\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react'\nimport type { CSSProperties, ReactNode } from 'react'\n\nimport { ChartContext } from './context'\n\n// The chart needs the DOM, so it is only ever created client-side; fall back to\n// useEffect on the server so SSR renders the wrapper without a warning.\nconst useIsomorphicLayoutEffect =\n typeof window !== 'undefined' ? useLayoutEffect : useEffect\n\nexport interface LightfinChartProps {\n /**\n * Core options (theme, rightOffset, crosshairMode, …), applied once when the\n * chart is created. The engine has no live option setter, so later changes\n * are ignored — give the component a new `key` to recreate it with fresh\n * options.\n */\n options?: ChartOptionsInput\n /**\n * Instrument metadata. Re-applied whenever it changes; pass `null`\n * to clear, or omit to leave whatever was set imperatively untouched.\n */\n instrument?: InstrumentInfo | null\n /** Class on the outer container the chart fills. Give it a size. */\n className?: string\n /** Inline style on the outer container. Give it a size (e.g. `height`). */\n style?: CSSProperties\n onCrosshairMove?: (event: CrosshairMoveEvent | null) => void\n onDataChange?: (change: SeriesChange) => void\n onSeriesChange?: (series: Series) => void\n onIndicatorsChange?: () => void\n onLayoutChange?: () => void\n onInstrumentChange?: (info: InstrumentInfo | null) => void\n /**\n * Opt in to the order-intent \"+\" button. The button only shows\n * while this handler is set.\n */\n onOrderIntent?: (event: OrderIntentEvent) => void\n /** Called once with the instance right after it is created. */\n onCreate?: (chart: Chart) => void\n /**\n * Feature components (see {@link useChartEffect}). They read the chart from\n * context and typically render nothing.\n */\n children?: ReactNode\n}\n\n/**\n * Owns a lightfin chart's lifecycle inside React: creates it on mount, removes\n * it on unmount, keeps event-handler props and the `instrument` wired up, and\n * publishes the instance through a `ref` and to child feature components.\n *\n * ```tsx\n * <LightfinChart style={{ height: 420 }} options={{ theme }}>\n * <Candles bars={bars} />\n * </LightfinChart>\n * ```\n */\nexport const LightfinChart = forwardRef<Chart | null, LightfinChartProps>(\n function LightfinChart(props, ref) {\n const { className, style, instrument, onOrderIntent, children } = props\n const containerRef = useRef<HTMLDivElement>(null)\n const [chart, setChart] = useState<Chart | null>(null)\n\n // Latest props in a ref so the one-time event subscriptions always reach\n // the current handlers without resubscribing on every render.\n const propsRef = useRef(props)\n propsRef.current = props\n\n // Options are read once; see the prop doc for why changes need a new key.\n const optionsRef = useRef(props.options)\n\n useIsomorphicLayoutEffect(() => {\n const container = containerRef.current\n if (!container) return\n const instance = createChart(container, optionsRef.current ?? {})\n propsRef.current.onCreate?.(instance)\n setChart(instance)\n return () => {\n instance.remove()\n setChart(null)\n }\n }, [])\n\n useImperativeHandle<Chart | null, Chart | null>(ref, () => chart, [chart])\n\n // Subscribe to the latched event handlers once per chart instance.\n useEffect(() => {\n if (!chart) return\n const p = propsRef\n const offs = [\n chart.on('crosshairMove', e => p.current.onCrosshairMove?.(e)),\n chart.on('dataChange', e => p.current.onDataChange?.(e)),\n chart.on('seriesChange', s => p.current.onSeriesChange?.(s)),\n chart.on('indicatorsChange', () => p.current.onIndicatorsChange?.()),\n chart.on('layoutChange', () => p.current.onLayoutChange?.()),\n chart.on('instrumentChange', i => p.current.onInstrumentChange?.(i)),\n ]\n return () => {\n for (const off of offs) off()\n }\n }, [chart])\n\n // Order-intent is its own effect so the \"+\" button only exists while the\n // host actually passes a handler.\n useEffect(() => {\n if (!chart || !onOrderIntent) return\n return chart.onOrderIntent(onOrderIntent)\n }, [chart, onOrderIntent])\n\n // Keep the instrument in sync; `undefined` means \"leave it alone\".\n useEffect(() => {\n if (!chart || instrument === undefined) return\n chart.setInstrument(instrument)\n }, [chart, instrument])\n\n return (\n <div className={className} style={style}>\n <div ref={containerRef} style={{ width: '100%', height: '100%' }} />\n <ChartContext.Provider value={chart}>{children}</ChartContext.Provider>\n </div>\n )\n },\n)\n","import type { Chart } from '@lightfin/core'\nimport { useEffect } from 'react'\nimport type { DependencyList } from 'react'\n\nimport { useChart } from './context'\n\n/**\n * Run an effect against the chart once it exists, re-running when `deps`\n * change and cleaning up on unmount. The escape hatch for wiring anything\n * imperative onto the chart — series, data, indicators, `createChrome`,\n * `createAnnotations`, `addPriceLine` — without a component per feature:\n *\n * ```tsx\n * function Candles({ bars }: { bars: Bar[] }) {\n * useChartEffect(chart => {\n * const series = chart.addCandlestickSeries()\n * series.setData(bars)\n * }, [bars])\n * return null\n * }\n * ```\n *\n * The callback receives a non-null {@link Chart}; the effect simply does not\n * run while the chart is still being created.\n */\nexport function useChartEffect(\n effect: (chart: Chart) => void | (() => void),\n deps: DependencyList = [],\n): void {\n const chart = useChart()\n useEffect(() => {\n if (!chart) return\n return effect(chart)\n // The caller owns `deps`; `chart` is the only implicit dependency.\n }, [chart, ...deps])\n}\n"],"mappings":";;;;AAWA,IAAaA,IAAeC,EAAwC,KAAA,CAAS;AAS7E,SAAgBC,IAAyB;CACvC,IAAMC,IAAQC,EAAWJ,CAAY;CACrC,IAAIG,MAAU,KAAA,GACZ,MAAU,MAAM,wDAAwD;CAE1E,OAAOA;AACT;;ACFA,IAAME,IACJ,OAAO,SAAW,MAAcC,IAAkBC,GAkDvCC,IAAgBC,EAC3B,SAAuB,GAAO,GAAK;CACjC,IAAM,EAAE,cAAW,UAAO,eAAY,kBAAe,gBAAaC,GAC5DC,IAAeC,EAAuB,IAAI,GAC1C,CAACT,GAAOU,KAAYC,EAAuB,IAAI,GAI/CC,IAAWH,EAAOF,CAAK;CAC7B,EAAS,UAAUA;CAGnB,IAAMM,IAAaJ,EAAOF,EAAM,OAAO;CA8CvC,OA5CAL,QAAgC;EAC9B,IAAMY,IAAYN,EAAa;EAC/B,IAAI,CAACM,GAAW;EAChB,IAAMC,IAAWC,EAAYF,GAAWD,EAAW,WAAW,CAAC,CAAC;EAGhE,OAFAD,EAAS,QAAQ,WAAWG,CAAQ,GACpCL,EAASK,CAAQ,SACJ;GAEX,AADAA,EAAS,OAAO,GAChBL,EAAS,IAAI;EACf;CACF,GAAG,CAAC,CAAC,GAELO,EAAgDC,SAAWlB,GAAO,CAACA,CAAK,CAAC,GAGzEI,QAAgB;EACd,IAAI,CAACJ,GAAO;EACZ,IAAMmB,IAAIP,GACJQ,IAAO;GACXpB,EAAM,GAAG,kBAAiB,MAAKmB,EAAE,QAAQ,kBAAkBE,CAAC,CAAC;GAC7DrB,EAAM,GAAG,eAAc,MAAKmB,EAAE,QAAQ,eAAeE,CAAC,CAAC;GACvDrB,EAAM,GAAG,iBAAgB,MAAKmB,EAAE,QAAQ,iBAAiBG,CAAC,CAAC;GAC3DtB,EAAM,GAAG,0BAA0BmB,EAAE,QAAQ,qBAAqB,CAAC;GACnEnB,EAAM,GAAG,sBAAsBmB,EAAE,QAAQ,iBAAiB,CAAC;GAC3DnB,EAAM,GAAG,qBAAoB,MAAKmB,EAAE,QAAQ,qBAAqBI,CAAC,CAAC;EACrE;EACA,aAAa;GACX,KAAK,IAAMC,KAAOJ,GAAM,EAAI;EAC9B;CACF,GAAG,CAACpB,CAAK,CAAC,GAIVI,QAAgB;EACd,IAAKJ,KAAUyB,GACf,OAAOzB,EAAM,cAAcyB,CAAa;CAC1C,GAAG,CAACzB,GAAOyB,CAAa,CAAC,GAGzBrB,QAAgB;EACd,AAAKJ,KAAS0B,MAAe,KAAA,KAC7B1B,EAAM,cAAc0B,CAAU;CAChC,GAAG,CAAC1B,GAAO0B,CAAU,CAAC,GAGpB,kBAAC,OAAD;EAAgB;EAAkB;EAAlC,UAAA,CACE,kBAAC,OAAD;GAAK,KAAKlB;GAAc,OAAO;IAAE,OAAO;IAAQ,QAAQ;GAAO;EAAI,CAAA,GACnE,kBAACX,EAAa,UAAd;GAAuB,OAAOG;GAAQ;EAAgC,CAAA,CACnE;;AAET,CACF;;ACnHA,SAAgB2B,EACd,GACA,IAAuB,CAAC,GAClB;CACN,IAAM3B,IAAQD,EAAS;CACvB,QAAgB;EACd,IAAKC,GACL,OAAO4B,EAAO5B,CAAK;CAErB,GAAG,CAACA,GAAO,GAAG6B,CAAI,CAAC;AACrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightfin/react",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "React bindings for @lightfin/core: <LightfinChart> plus hooks.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"module": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./package.json": "./package.json"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "rm -rf dist && vite build && tsc -p tsconfig.build.json",
|
|
26
|
+
"prepublishOnly": "bun run build",
|
|
27
|
+
"typecheck": "tsc --noEmit",
|
|
28
|
+
"test": "vitest run",
|
|
29
|
+
"size": "size-limit"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"@lightfin/core": "*",
|
|
33
|
+
"react": ">=18.0.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@lightfin/core": "workspace:*",
|
|
37
|
+
"react": "^19.3.1",
|
|
38
|
+
"react-dom": "^19.3.1",
|
|
39
|
+
"@types/react": "^19.3.0",
|
|
40
|
+
"@types/react-dom": "^19.3.0"
|
|
41
|
+
}
|
|
42
|
+
}
|
package/README.md
DELETED