@als-tp/als-react-ts-ui 0.10.0 → 0.10.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/als-react-ts-ui.js +14829 -14650
- package/dist/components/ALSInfographic/ALSInfographic.d.ts +120 -0
- package/dist/components/ALSInfographic/ALSInfographic.d.ts.map +1 -0
- package/dist/components/ALSInfographic/index.d.ts +21 -0
- package/dist/components/ALSInfographic/index.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Infographic } from "@antv/infographic";
|
|
3
|
+
import type { InfographicOptions } from "@antv/infographic";
|
|
4
|
+
export type ALSInfographicSize = "sm" | "md" | "lg" | "full";
|
|
5
|
+
export type ALSInfographicVariant = "default" | "bordered" | "elevated";
|
|
6
|
+
export type ALSInfographicStatus = "idle" | "streaming" | "complete" | "error";
|
|
7
|
+
/** SVG export options */
|
|
8
|
+
export interface SVGExportOptions {
|
|
9
|
+
type: "svg";
|
|
10
|
+
/** Whether to embed remote resources into the SVG (default: true) */
|
|
11
|
+
embedResources?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** PNG export options */
|
|
14
|
+
export interface PNGExportOptions {
|
|
15
|
+
type: "png";
|
|
16
|
+
/** Device pixel ratio (default: window.devicePixelRatio || 2) */
|
|
17
|
+
dpr?: number;
|
|
18
|
+
}
|
|
19
|
+
/** Export options for toDataURL method */
|
|
20
|
+
export type ExportOptions = SVGExportOptions | PNGExportOptions;
|
|
21
|
+
export type { InfographicOptions };
|
|
22
|
+
export interface ALSInfographicContextValue {
|
|
23
|
+
infographicRef: React.MutableRefObject<Infographic | null>;
|
|
24
|
+
status: ALSInfographicStatus;
|
|
25
|
+
setStatus: React.Dispatch<React.SetStateAction<ALSInfographicStatus>>;
|
|
26
|
+
streamingBuffer: string;
|
|
27
|
+
setStreamingBuffer: React.Dispatch<React.SetStateAction<string>>;
|
|
28
|
+
error: Error | null;
|
|
29
|
+
setError: React.Dispatch<React.SetStateAction<Error | null>>;
|
|
30
|
+
}
|
|
31
|
+
export interface ALSInfographicRootProps {
|
|
32
|
+
children: React.ReactNode;
|
|
33
|
+
className?: string;
|
|
34
|
+
style?: React.CSSProperties;
|
|
35
|
+
size?: ALSInfographicSize;
|
|
36
|
+
variant?: ALSInfographicVariant;
|
|
37
|
+
onStatusChange?: (status: ALSInfographicStatus) => void;
|
|
38
|
+
onError?: (error: Error) => void;
|
|
39
|
+
onRendered?: (options: Partial<InfographicOptions>) => void;
|
|
40
|
+
}
|
|
41
|
+
export interface ALSInfographicContainerProps {
|
|
42
|
+
className?: string;
|
|
43
|
+
style?: React.CSSProperties;
|
|
44
|
+
width?: string | number;
|
|
45
|
+
height?: string | number;
|
|
46
|
+
padding?: number | [number, number, number, number];
|
|
47
|
+
editable?: boolean;
|
|
48
|
+
syntax?: string;
|
|
49
|
+
options?: Partial<InfographicOptions>;
|
|
50
|
+
onLoad?: () => void;
|
|
51
|
+
onError?: (error: Error) => void;
|
|
52
|
+
onWarning?: (warnings: unknown[]) => void;
|
|
53
|
+
}
|
|
54
|
+
export interface ALSInfographicStreamingProps {
|
|
55
|
+
chunks: string[] | AsyncIterable<string>;
|
|
56
|
+
className?: string;
|
|
57
|
+
style?: React.CSSProperties;
|
|
58
|
+
width?: string | number;
|
|
59
|
+
height?: string | number;
|
|
60
|
+
padding?: number | [number, number, number, number];
|
|
61
|
+
editable?: boolean;
|
|
62
|
+
chunkDelay?: number;
|
|
63
|
+
autoStart?: boolean;
|
|
64
|
+
onChunk?: (chunk: string, buffer: string) => void;
|
|
65
|
+
onComplete?: (finalSyntax: string) => void;
|
|
66
|
+
onError?: (error: Error) => void;
|
|
67
|
+
}
|
|
68
|
+
export interface ALSInfographicControlsProps {
|
|
69
|
+
children?: React.ReactNode;
|
|
70
|
+
className?: string;
|
|
71
|
+
style?: React.CSSProperties;
|
|
72
|
+
}
|
|
73
|
+
export interface ALSInfographicExportButtonProps {
|
|
74
|
+
children?: React.ReactNode;
|
|
75
|
+
className?: string;
|
|
76
|
+
style?: React.CSSProperties;
|
|
77
|
+
format?: "svg" | "png";
|
|
78
|
+
filename?: string;
|
|
79
|
+
embedResources?: boolean;
|
|
80
|
+
dpr?: number;
|
|
81
|
+
onClick?: () => void;
|
|
82
|
+
}
|
|
83
|
+
export interface ALSInfographicStatusProps {
|
|
84
|
+
className?: string;
|
|
85
|
+
style?: React.CSSProperties;
|
|
86
|
+
showLabel?: boolean;
|
|
87
|
+
labels?: {
|
|
88
|
+
idle?: string;
|
|
89
|
+
streaming?: string;
|
|
90
|
+
complete?: string;
|
|
91
|
+
error?: string;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export interface ALSInfographicHandle {
|
|
95
|
+
getInstance: () => Infographic | null;
|
|
96
|
+
render: (syntax: string) => void;
|
|
97
|
+
update: (options: string | Partial<InfographicOptions>) => void;
|
|
98
|
+
getOptions: () => Partial<InfographicOptions> | undefined;
|
|
99
|
+
exportAs: (format: "svg" | "png", options?: Partial<ExportOptions>) => Promise<string | null>;
|
|
100
|
+
startStreaming: (chunks: string[] | AsyncIterable<string>, chunkDelay?: number) => Promise<void>;
|
|
101
|
+
stopStreaming: () => void;
|
|
102
|
+
destroy: () => void;
|
|
103
|
+
}
|
|
104
|
+
export declare const ALSInfographicRoot: React.ForwardRefExoticComponent<ALSInfographicRootProps & React.RefAttributes<ALSInfographicHandle>>;
|
|
105
|
+
export declare const ALSInfographicContainer: React.ForwardRefExoticComponent<ALSInfographicContainerProps & React.RefAttributes<HTMLDivElement>>;
|
|
106
|
+
export declare const ALSInfographicStreaming: React.FC<ALSInfographicStreamingProps>;
|
|
107
|
+
export declare const ALSInfographicControls: React.FC<ALSInfographicControlsProps>;
|
|
108
|
+
export declare const ALSInfographicExportButton: React.ForwardRefExoticComponent<ALSInfographicExportButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
109
|
+
export declare const ALSInfographicStatus: React.FC<ALSInfographicStatusProps>;
|
|
110
|
+
export declare const ALSInfographicError: React.FC<{
|
|
111
|
+
className?: string;
|
|
112
|
+
style?: React.CSSProperties;
|
|
113
|
+
children?: React.ReactNode;
|
|
114
|
+
}>;
|
|
115
|
+
export declare const ALSInfographicLoading: React.FC<{
|
|
116
|
+
className?: string;
|
|
117
|
+
style?: React.CSSProperties;
|
|
118
|
+
children?: React.ReactNode;
|
|
119
|
+
}>;
|
|
120
|
+
//# sourceMappingURL=ALSInfographic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ALSInfographic.d.ts","sourceRoot":"","sources":["../../../src/components/ALSInfographic/ALSInfographic.tsx"],"names":[],"mappings":"AAAA,OAAO,KASN,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAQ5D,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;AAC7D,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AACxE,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,OAAO,CAAC;AAE/E,yBAAyB;AACzB,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,KAAK,CAAC;IACZ,qEAAqE;IACrE,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,yBAAyB;AACzB,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,KAAK,CAAC;IACZ,iEAAiE;IACjE,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,0CAA0C;AAC1C,MAAM,MAAM,aAAa,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAEhE,YAAY,EAAE,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AAC,MAAM,CAAC,EACxC,UAAU,CAAC,EAAE,MAAM,KAClB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAwBD,eAAO,MAAM,kBAAkB,sGAwJ7B,CAAC;AAEH,eAAO,MAAM,uBAAuB,qGAkGlC,CAAC;AAEH,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAC1C,4BAA4B,CAwI/B,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAUxE,CAAC;AAEF,eAAO,MAAM,0BAA0B,2GAgErC,CAAC;AAEH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAmCpE,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B,CAUA,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B,CAWA,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ALSInfographicSize, ALSInfographicVariant, ALSInfographicStatus as ALSInfographicStatusType, ALSInfographicContextValue, ALSInfographicRootProps, ALSInfographicContainerProps, ALSInfographicStreamingProps, ALSInfographicControlsProps, ALSInfographicExportButtonProps, ALSInfographicStatusProps, ALSInfographicHandle, InfographicOptions, ExportOptions, SVGExportOptions, PNGExportOptions } from "./ALSInfographic";
|
|
2
|
+
export declare const ALSInfographic: {
|
|
3
|
+
Root: import("react").ForwardRefExoticComponent<ALSInfographicRootProps & import("react").RefAttributes<ALSInfographicHandle>>;
|
|
4
|
+
Container: import("react").ForwardRefExoticComponent<ALSInfographicContainerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
Streaming: import("react").FC<ALSInfographicStreamingProps>;
|
|
6
|
+
Controls: import("react").FC<ALSInfographicControlsProps>;
|
|
7
|
+
ExportButton: import("react").ForwardRefExoticComponent<ALSInfographicExportButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
Status: import("react").FC<ALSInfographicStatusProps>;
|
|
9
|
+
Error: import("react").FC<{
|
|
10
|
+
className?: string;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
}>;
|
|
14
|
+
Loading: import("react").FC<{
|
|
15
|
+
className?: string;
|
|
16
|
+
style?: React.CSSProperties;
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
20
|
+
export type { ALSInfographicSize, ALSInfographicVariant, ALSInfographicStatusType, ALSInfographicContextValue, ALSInfographicRootProps, ALSInfographicContainerProps, ALSInfographicStreamingProps, ALSInfographicControlsProps, ALSInfographicExportButtonProps, ALSInfographicStatusProps, ALSInfographicHandle, InfographicOptions, ExportOptions, SVGExportOptions, PNGExportOptions, };
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ALSInfographic/index.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACR,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,IAAI,wBAAwB,EAChD,0BAA0B,EAC1B,uBAAuB,EACvB,4BAA4B,EAC5B,4BAA4B,EAC5B,2BAA2B,EAC3B,+BAA+B,EAC/B,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EACnB,MAAM,kBAAkB,CAAC;AAE1B,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;CAS1B,CAAC;AAEF,YAAY,EACR,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,EACvB,4BAA4B,EAC5B,4BAA4B,EAC5B,2BAA2B,EAC3B,+BAA+B,EAC/B,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,GACnB,CAAC"}
|