@validationcloud/fractal-ui 1.55.0 → 1.57.0
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/charts.d.ts +9 -0
- package/dist/charts.js +25 -0
- package/dist/components/echarts-renderer/mavrik-theme-horizontal.json.d.ts +17 -6
- package/dist/{src/components → components}/echarts-renderer/mavrik-theme-horizontal.json.js +10 -8
- package/dist/components/echarts-renderer/mavrik-theme.d.ts +30 -0
- package/dist/components/echarts-renderer/mavrik-theme.js +25 -0
- package/dist/components/echarts-renderer/mavrik-theme.json.d.ts +17 -6
- package/dist/{src/components → components}/echarts-renderer/mavrik-theme.json.js +10 -8
- package/dist/components/echarts-renderer/sanitize-chart-options-for-static-rendering.d.ts +9 -0
- package/dist/components/echarts-renderer/sanitize-chart-options-for-static-rendering.js +21 -0
- package/dist/components/select/select.d.ts +10 -8
- package/dist/{src/components → components}/select/select.js +43 -43
- package/dist/fonts/OFL.txt +93 -0
- package/dist/fonts/Poppins-Bold.ttf +0 -0
- package/dist/fonts/Poppins-Medium.ttf +0 -0
- package/dist/fonts/Poppins-Regular.ttf +0 -0
- package/dist/fonts/Poppins-SemiBold.ttf +0 -0
- package/dist/index.d.ts +0 -6
- package/dist/index.js +59 -74
- package/dist/lib/render-chart-to-image.d.ts +8 -1
- package/dist/lib/render-chart-to-image.js +83 -0
- package/dist/lib/render-mavrik-chart-to-image.d.ts +2 -1
- package/dist/lib/render-mavrik-chart-to-image.js +22 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +6 -2
- package/package.json +11 -11
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -527
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -402
- package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.6_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -208
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -136
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -130
- package/dist/node_modules/.pnpm/@radix-ui_number@1.1.1/node_modules/@radix-ui/number/dist/index.js +0 -6
- package/dist/node_modules/.pnpm/@radix-ui_primitive@1.1.2/node_modules/@radix-ui/primitive/dist/index.js +0 -9
- package/dist/node_modules/.pnpm/@radix-ui_react-arrow@1.1.3_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@1_d580df0584800d3ed24dd50bc4bb768c/node_modules/@radix-ui/react-arrow/dist/index.js +0 -24
- package/dist/node_modules/.pnpm/@radix-ui_react-collection@1.1.3_@types_react-dom@19.2.3_@types_react@19.2.6__@types_re_965c21727754e936eeb7d35183788fa0/node_modules/@radix-ui/react-collection/dist/index.js +0 -49
- package/dist/node_modules/.pnpm/@radix-ui_react-context@1.1.2_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-context/dist/index.js +0 -53
- package/dist/node_modules/.pnpm/@radix-ui_react-direction@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-direction/dist/index.js +0 -10
- package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.6_@types_react-dom@19.2.3_@types_react@19.2.6__@t_c6844451b48448597731ceee2c7ec947/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -128
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.1.2_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-focus-guards/dist/index.js +0 -18
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.1.3_@types_react-dom@19.2.3_@types_react@19.2.6__@types_r_1236dc37c73a65e17034434472fa319b/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -137
- package/dist/node_modules/.pnpm/@radix-ui_react-id@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-id/dist/index.js +0 -13
- package/dist/node_modules/.pnpm/@radix-ui_react-popper@1.2.3_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_875fb0de6110028421a3e7790df757e0/node_modules/@radix-ui/react-popper/dist/index.js +0 -219
- package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.5_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_5324bcb5f7050b43e9225714ff37edcd/node_modules/@radix-ui/react-portal/dist/index.js +0 -16
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.0.3_@types_react-dom@19.2.3_@types_react@19.2.6__@types_rea_87a4386c2964ee4c9c162dadc854f596/node_modules/@radix-ui/react-primitive/dist/index.js +0 -35
- package/dist/node_modules/.pnpm/@radix-ui_react-select@2.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_6ddc7a756051e26689ab8a69ff12c731/node_modules/@radix-ui/react-select/dist/index.js +0 -821
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.2.0_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-slot/dist/index.js +0 -48
- package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +0 -10
- package/dist/node_modules/.pnpm/@radix-ui_react-use-controllable-state@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -32
- package/dist/node_modules/.pnpm/@radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +0 -14
- package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +0 -6
- package/dist/node_modules/.pnpm/@radix-ui_react-use-previous@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-previous/dist/index.js +0 -8
- package/dist/node_modules/.pnpm/@radix-ui_react-use-size@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-size/dist/index.js +0 -27
- package/dist/node_modules/.pnpm/@radix-ui_react-visually-hidden@1.1.3_@types_react-dom@19.2.3_@types_react@19.2.6__@typ_06b3b0029799d875b5a80b38402a9c14/node_modules/@radix-ui/react-visually-hidden/dist/index.js +0 -30
- package/dist/node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.js +0 -52
- package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js +0 -7
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es2015/component.js +0 -71
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +0 -7
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +0 -25
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/Combination.js +0 -11
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +0 -112
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/UI.js +0 -31
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +0 -16
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +0 -68
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/medium.js +0 -5
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/sidecar.js +0 -7
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0/node_modules/react-style-singleton/dist/es2015/component.js +0 -11
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0/node_modules/react-style-singleton/dist/es2015/hook.js +0 -15
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0/node_modules/react-style-singleton/dist/es2015/singleton.js +0 -30
- package/dist/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.js +0 -27
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0/node_modules/use-callback-ref/dist/es2015/assignRef.js +0 -6
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +0 -26
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0/node_modules/use-callback-ref/dist/es2015/useRef.js +0 -25
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0/node_modules/use-sidecar/dist/es2015/exports.js +0 -18
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0/node_modules/use-sidecar/dist/es2015/medium.js +0 -67
- package/dist/src/components/echarts-renderer/mavrik-theme.js +0 -23
- package/dist/src/lib/render-chart-to-image.js +0 -51
- /package/dist/{src/assets → assets}/animated-loader.svg.js +0 -0
- /package/dist/{src/assets → assets}/default-avatar.svg.js +0 -0
- /package/dist/{src/assets → assets}/not-found.svg.js +0 -0
- /package/dist/{src/assets → assets}/vc-logo.svg.js +0 -0
- /package/dist/{src/components → components}/animated-loader/animated-loader.js +0 -0
- /package/dist/{src/components → components}/badge/badge.js +0 -0
- /package/dist/{src/components → components}/box/box.js +0 -0
- /package/dist/{src/components → components}/button/button.js +0 -0
- /package/dist/{src/components → components}/client-modal/client-modal.js +0 -0
- /package/dist/{src/components → components}/collapsible/collapsible.js +0 -0
- /package/dist/{src/components → components}/copy-button/copy-button.js +0 -0
- /package/dist/{src/components → components}/decorated-icon/decorated-icon.js +0 -0
- /package/dist/{src/components → components}/dropdown-menu/dropdown-menu.js +0 -0
- /package/dist/{src/components → components}/echarts-renderer/calculate-title-layout.js +0 -0
- /package/dist/{src/components → components}/echarts-renderer/detect-horizontal-bars.js +0 -0
- /package/dist/{src/components → components}/echarts-renderer/echarts-chart-option.js +0 -0
- /package/dist/{src/components → components}/echarts-renderer/echarts-renderer.js +0 -0
- /package/dist/{src/components → components}/echarts-renderer/echarts-theme-option.js +0 -0
- /package/dist/{src/components → components}/echarts-renderer/mavrik-chart.js +0 -0
- /package/dist/{src/components → components}/echarts-renderer/sanitize-chart-options.js +0 -0
- /package/dist/{src/components → components}/echarts-renderer/use-chart-instance.js +0 -0
- /package/dist/{src/components → components}/echarts-renderer/watermark-graphic.js +0 -0
- /package/dist/{src/components → components}/error-boundary/error-boundary.js +0 -0
- /package/dist/{src/components → components}/icon/icon.js +0 -0
- /package/dist/{src/components → components}/icon-button/icon-button.js +0 -0
- /package/dist/{src/components → components}/input-button/input-button.js +0 -0
- /package/dist/{src/components → components}/mount-svg-sprite/mount-svg-sprite.js +0 -0
- /package/dist/{src/components → components}/not-found-component/not-found-component.js +0 -0
- /package/dist/{src/components → components}/page-padding/page-padding.js +0 -0
- /package/dist/{src/components → components}/protocol-logo/protocol-logo.js +0 -0
- /package/dist/{src/components → components}/scroll-area/index.js +0 -0
- /package/dist/{src/components → components}/scroll-area/scroll-area-viewport.js +0 -0
- /package/dist/{src/components → components}/scroll-area/scroll-area.js +0 -0
- /package/dist/{src/components → components}/skeleton/skeleton.js +0 -0
- /package/dist/{src/components → components}/switch/switch.js +0 -0
- /package/dist/{src/components → components}/text-input/text-input.js +0 -0
- /package/dist/{src/components → components}/tooltip/tooltip.js +0 -0
- /package/dist/{src/components → components}/tooltip-provider/tooltip-provider.js +0 -0
- /package/dist/{src/components → components}/touch-target/touch-target.js +0 -0
- /package/dist/{src/components → components}/user-dropdown/user-dropdown.js +0 -0
- /package/dist/{src/components → components}/user-dropdown-mobile/user-dropdown-mobile.js +0 -0
- /package/dist/{src/hooks → hooks}/use-scroll-to-bottom.js +0 -0
- /package/dist/{src/internal → internal}/modal-header.js +0 -0
- /package/dist/{src/internal → internal}/modal.js +0 -0
- /package/dist/{src/internal → internal}/react-portal.js +0 -0
- /package/dist/{src/internal → internal}/round-button.js +0 -0
- /package/dist/{src/lib → lib}/tailwind-merge.js +0 -0
- /package/dist/{src/utils → utils}/disable-password-managers.js +0 -0
package/dist/index.js
CHANGED
|
@@ -1,79 +1,64 @@
|
|
|
1
|
-
import { AnimatedLoader as
|
|
2
|
-
import { Badge as p } from "./
|
|
3
|
-
import { Box as x } from "./
|
|
4
|
-
import { Button as n } from "./
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import { TooltipProvider as so } from "./src/components/tooltip-provider/tooltip-provider.js";
|
|
31
|
-
import { TouchTarget as ho } from "./src/components/touch-target/touch-target.js";
|
|
32
|
-
import { twMerge as To } from "./src/lib/tailwind-merge.js";
|
|
33
|
-
import { UserDropdown as Mo } from "./src/components/user-dropdown/user-dropdown.js";
|
|
34
|
-
import { UserDropdownMobile as go } from "./src/components/user-dropdown-mobile/user-dropdown-mobile.js";
|
|
35
|
-
import { useScrollToBottom as So } from "./src/hooks/use-scroll-to-bottom.js";
|
|
1
|
+
import { AnimatedLoader as e } from "./components/animated-loader/animated-loader.js";
|
|
2
|
+
import { Badge as p } from "./components/badge/badge.js";
|
|
3
|
+
import { Box as x } from "./components/box/box.js";
|
|
4
|
+
import { Button as n } from "./components/button/button.js";
|
|
5
|
+
import { ClientModal as d } from "./components/client-modal/client-modal.js";
|
|
6
|
+
import { Collapsible as i, CollapsibleContent as u, CollapsibleTrigger as c } from "./components/collapsible/collapsible.js";
|
|
7
|
+
import { CopyButton as B } from "./components/copy-button/copy-button.js";
|
|
8
|
+
import { DecoratedIcon as C } from "./components/decorated-icon/decorated-icon.js";
|
|
9
|
+
import { DropdownMenu as T, DropdownMenuItem as s } from "./components/dropdown-menu/dropdown-menu.js";
|
|
10
|
+
import { ErrorBoundary as M } from "./components/error-boundary/error-boundary.js";
|
|
11
|
+
import { ScrollArea as b } from "./components/scroll-area/index.js";
|
|
12
|
+
import { Icon as h } from "./components/icon/icon.js";
|
|
13
|
+
import { IconButton as y } from "./components/icon-button/icon-button.js";
|
|
14
|
+
import { InputButton as L } from "./components/input-button/input-button.js";
|
|
15
|
+
import { MountSvgSprite as k } from "./components/mount-svg-sprite/mount-svg-sprite.js";
|
|
16
|
+
import { NotFoundComponent as F } from "./components/not-found-component/not-found-component.js";
|
|
17
|
+
import { PagePadding as j } from "./components/page-padding/page-padding.js";
|
|
18
|
+
import { ProtocolLogo as z } from "./components/protocol-logo/protocol-logo.js";
|
|
19
|
+
import { Select as H, SelectItem as J } from "./components/select/select.js";
|
|
20
|
+
import { Skeleton as O } from "./components/skeleton/skeleton.js";
|
|
21
|
+
import { Switch as R } from "./components/switch/switch.js";
|
|
22
|
+
import { TextInput as W } from "./components/text-input/text-input.js";
|
|
23
|
+
import { Tooltip as Y } from "./components/tooltip/tooltip.js";
|
|
24
|
+
import { TooltipProvider as _ } from "./components/tooltip-provider/tooltip-provider.js";
|
|
25
|
+
import { TouchTarget as oo } from "./components/touch-target/touch-target.js";
|
|
26
|
+
import { twMerge as eo } from "./lib/tailwind-merge.js";
|
|
27
|
+
import { UserDropdown as po } from "./components/user-dropdown/user-dropdown.js";
|
|
28
|
+
import { UserDropdownMobile as xo } from "./components/user-dropdown-mobile/user-dropdown-mobile.js";
|
|
29
|
+
import { useScrollToBottom as no } from "./hooks/use-scroll-to-bottom.js";
|
|
36
30
|
export {
|
|
37
|
-
|
|
31
|
+
e as AnimatedLoader,
|
|
38
32
|
p as Badge,
|
|
39
33
|
x as Box,
|
|
40
34
|
n as Button,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
J as
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
so as TooltipProvider,
|
|
71
|
-
ho as TouchTarget,
|
|
72
|
-
Mo as UserDropdown,
|
|
73
|
-
go as UserDropdownMobile,
|
|
74
|
-
h as isEChartsChartOption,
|
|
75
|
-
d as isEChartsThemeOption,
|
|
76
|
-
To as twMerge,
|
|
77
|
-
T as useChartInstance,
|
|
78
|
-
So as useScrollToBottom
|
|
35
|
+
d as ClientModal,
|
|
36
|
+
i as Collapsible,
|
|
37
|
+
u as CollapsibleContent,
|
|
38
|
+
c as CollapsibleTrigger,
|
|
39
|
+
B as CopyButton,
|
|
40
|
+
C as DecoratedIcon,
|
|
41
|
+
T as DropdownMenu,
|
|
42
|
+
s as DropdownMenuItem,
|
|
43
|
+
M as ErrorBoundary,
|
|
44
|
+
h as Icon,
|
|
45
|
+
y as IconButton,
|
|
46
|
+
L as InputButton,
|
|
47
|
+
k as MountSvgSprite,
|
|
48
|
+
F as NotFoundComponent,
|
|
49
|
+
j as PagePadding,
|
|
50
|
+
z as ProtocolLogo,
|
|
51
|
+
b as ScrollArea,
|
|
52
|
+
H as Select,
|
|
53
|
+
J as SelectItem,
|
|
54
|
+
O as Skeleton,
|
|
55
|
+
R as Switch,
|
|
56
|
+
W as TextInput,
|
|
57
|
+
Y as Tooltip,
|
|
58
|
+
_ as TooltipProvider,
|
|
59
|
+
oo as TouchTarget,
|
|
60
|
+
po as UserDropdown,
|
|
61
|
+
xo as UserDropdownMobile,
|
|
62
|
+
eo as twMerge,
|
|
63
|
+
no as useScrollToBottom
|
|
79
64
|
};
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
export interface RenderChartToImageOptions {
|
|
2
2
|
option: unknown;
|
|
3
3
|
theme?: Record<string, unknown>;
|
|
4
|
+
/**
|
|
5
|
+
* Adds Validation Cloud watermark graphic to the chart option before rendering.
|
|
6
|
+
*
|
|
7
|
+
* Note: The default is `false` because some server-side image backends can be
|
|
8
|
+
* inconsistent when decoding SVG images.
|
|
9
|
+
*/
|
|
10
|
+
includeWatermark?: boolean;
|
|
4
11
|
width?: number;
|
|
5
12
|
height?: number;
|
|
6
13
|
devicePixelRatio?: number;
|
|
@@ -25,4 +32,4 @@ export interface RenderChartToImageOptions {
|
|
|
25
32
|
* });
|
|
26
33
|
* ```
|
|
27
34
|
*/
|
|
28
|
-
export declare function renderChartToImage({ option, theme, width, height, devicePixelRatio, }: RenderChartToImageOptions): Buffer;
|
|
35
|
+
export declare function renderChartToImage({ option, theme, includeWatermark, width, height, devicePixelRatio, }: RenderChartToImageOptions): Buffer;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as p from "echarts";
|
|
2
|
+
import { randomUUID as y } from "node:crypto";
|
|
3
|
+
import e from "node:path";
|
|
4
|
+
import { fileURLToPath as O } from "node:url";
|
|
5
|
+
import { Image as b, Canvas as g, FontLibrary as h } from "skia-canvas";
|
|
6
|
+
import { calculateTitleLayout as j } from "../components/echarts-renderer/calculate-title-layout.js";
|
|
7
|
+
import { addWatermarkToOptions as P } from "../components/echarts-renderer/watermark-graphic.js";
|
|
8
|
+
globalThis.Image = b;
|
|
9
|
+
let s = !1;
|
|
10
|
+
function T() {
|
|
11
|
+
if (!s)
|
|
12
|
+
try {
|
|
13
|
+
const t = e.dirname(O(import.meta.url)), r = [
|
|
14
|
+
// dist/src/lib -> dist/fonts (packaged) OR src/lib -> src/fonts (dev)
|
|
15
|
+
e.resolve(t, "../../fonts"),
|
|
16
|
+
// dist/lib -> dist/fonts (packaged)
|
|
17
|
+
e.resolve(t, "../fonts")
|
|
18
|
+
];
|
|
19
|
+
let n;
|
|
20
|
+
for (const o of r)
|
|
21
|
+
try {
|
|
22
|
+
h.use("Poppins", [
|
|
23
|
+
e.join(o, "Poppins-Regular.ttf"),
|
|
24
|
+
e.join(o, "Poppins-Medium.ttf"),
|
|
25
|
+
e.join(o, "Poppins-SemiBold.ttf"),
|
|
26
|
+
e.join(o, "Poppins-Bold.ttf")
|
|
27
|
+
]), s = !0;
|
|
28
|
+
return;
|
|
29
|
+
} catch (a) {
|
|
30
|
+
n = a;
|
|
31
|
+
}
|
|
32
|
+
throw n;
|
|
33
|
+
} catch (t) {
|
|
34
|
+
console.warn("Failed to register Poppins fonts, charts will use fallback font:", t), s = !0;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const I = /* @__PURE__ */ new Set([
|
|
38
|
+
"aria",
|
|
39
|
+
// Tries to set DOM attributes which node-canvas doesn't implement
|
|
40
|
+
"toolbox",
|
|
41
|
+
// Export/zoom/reset buttons - not useful in static image
|
|
42
|
+
"dataZoom",
|
|
43
|
+
// Interactive range slider
|
|
44
|
+
"brush",
|
|
45
|
+
// Selection tool
|
|
46
|
+
"axisPointer"
|
|
47
|
+
// Crosshair on hover
|
|
48
|
+
]);
|
|
49
|
+
function v(t) {
|
|
50
|
+
if (!t || typeof t != "object" || Array.isArray(t))
|
|
51
|
+
return { animation: !1 };
|
|
52
|
+
const r = Object.fromEntries(
|
|
53
|
+
Object.entries(t).filter(([n]) => !I.has(n))
|
|
54
|
+
);
|
|
55
|
+
return r.animation = !1, r;
|
|
56
|
+
}
|
|
57
|
+
function S({
|
|
58
|
+
option: t,
|
|
59
|
+
theme: r,
|
|
60
|
+
includeWatermark: n = !1,
|
|
61
|
+
width: o = 800,
|
|
62
|
+
height: a = 600,
|
|
63
|
+
devicePixelRatio: m = 2
|
|
64
|
+
}) {
|
|
65
|
+
T();
|
|
66
|
+
let i;
|
|
67
|
+
r && typeof r == "object" && (i = `theme-${y()}`, p.registerTheme(i, r));
|
|
68
|
+
const f = new g(o, a), c = p.init(f, i, {
|
|
69
|
+
renderer: "canvas",
|
|
70
|
+
devicePixelRatio: m,
|
|
71
|
+
width: o,
|
|
72
|
+
height: a
|
|
73
|
+
});
|
|
74
|
+
try {
|
|
75
|
+
const u = v(t), l = j(u, o, r), d = n ? P(l) : l;
|
|
76
|
+
return c.setOption(d), f.toBufferSync("png");
|
|
77
|
+
} finally {
|
|
78
|
+
c.dispose();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
export {
|
|
82
|
+
S as renderChartToImage
|
|
83
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EChartsOption } from 'echarts';
|
|
2
2
|
export interface RenderMavrikChartToImageOptions {
|
|
3
3
|
option: EChartsOption;
|
|
4
|
+
includeWatermark?: boolean;
|
|
4
5
|
width?: number;
|
|
5
6
|
height?: number;
|
|
6
7
|
devicePixelRatio?: number;
|
|
@@ -30,4 +31,4 @@ export interface RenderMavrikChartToImageOptions {
|
|
|
30
31
|
* });
|
|
31
32
|
* ```
|
|
32
33
|
*/
|
|
33
|
-
export declare function renderMavrikChartToImage({ option, width, height, devicePixelRatio, }: RenderMavrikChartToImageOptions): Buffer;
|
|
34
|
+
export declare function renderMavrikChartToImage({ option, includeWatermark, width, height, devicePixelRatio, }: RenderMavrikChartToImageOptions): Buffer;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { selectMavrikTheme as n } from "../components/echarts-renderer/mavrik-theme.js";
|
|
2
|
+
import { renderChartToImage as f } from "./render-chart-to-image.js";
|
|
3
|
+
function c({
|
|
4
|
+
option: e,
|
|
5
|
+
includeWatermark: r = !1,
|
|
6
|
+
width: t = 800,
|
|
7
|
+
height: m = 600,
|
|
8
|
+
devicePixelRatio: o = 2
|
|
9
|
+
}) {
|
|
10
|
+
const a = n(e);
|
|
11
|
+
return f({
|
|
12
|
+
option: e,
|
|
13
|
+
theme: a.config,
|
|
14
|
+
includeWatermark: r,
|
|
15
|
+
width: t,
|
|
16
|
+
height: m,
|
|
17
|
+
devicePixelRatio: o
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
c as renderMavrikChartToImage
|
|
22
|
+
};
|
package/dist/server.d.ts
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
1
|
export { renderChartToImage, type RenderChartToImageOptions } from './lib/render-chart-to-image';
|
|
2
|
+
export { renderMavrikChartToImage, type RenderMavrikChartToImageOptions } from './lib/render-mavrik-chart-to-image';
|
|
3
|
+
export { sanitizeChartOptionsForStaticRendering } from './components/echarts-renderer/sanitize-chart-options-for-static-rendering';
|
package/dist/server.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { renderChartToImage as o } from "./
|
|
1
|
+
import { renderChartToImage as o } from "./lib/render-chart-to-image.js";
|
|
2
|
+
import { renderMavrikChartToImage as a } from "./lib/render-mavrik-chart-to-image.js";
|
|
3
|
+
import { sanitizeChartOptionsForStaticRendering as n } from "./components/echarts-renderer/sanitize-chart-options-for-static-rendering.js";
|
|
2
4
|
export {
|
|
3
|
-
o as renderChartToImage
|
|
5
|
+
o as renderChartToImage,
|
|
6
|
+
a as renderMavrikChartToImage,
|
|
7
|
+
n as sanitizeChartOptionsForStaticRendering
|
|
4
8
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@validationcloud/fractal-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.57.0",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
|
-
"dist"
|
|
8
|
+
"dist",
|
|
9
|
+
"dist/fonts"
|
|
9
10
|
],
|
|
10
11
|
"license": "MIT",
|
|
11
12
|
"repository": {
|
|
@@ -27,13 +28,17 @@
|
|
|
27
28
|
"typecheck": "tsc -b --noEmit",
|
|
28
29
|
"test": "vitest run",
|
|
29
30
|
"prepublishOnly": "pnpm build",
|
|
30
|
-
"generate:theme": "node --experimental-transform-types scripts/generate-mavrik-theme.ts"
|
|
31
|
+
"generate:theme": "node --experimental-transform-types scripts/generate-mavrik-theme.ts && prettier --write src/components/echarts-renderer/mavrik-theme*.json"
|
|
31
32
|
},
|
|
32
33
|
"exports": {
|
|
33
34
|
".": {
|
|
34
35
|
"types": "./dist/index.d.ts",
|
|
35
36
|
"import": "./dist/index.js"
|
|
36
37
|
},
|
|
38
|
+
"./charts": {
|
|
39
|
+
"types": "./dist/charts.d.ts",
|
|
40
|
+
"import": "./dist/charts.js"
|
|
41
|
+
},
|
|
37
42
|
"./server": {
|
|
38
43
|
"types": "./dist/server.d.ts",
|
|
39
44
|
"import": "./dist/server.js"
|
|
@@ -45,7 +50,6 @@
|
|
|
45
50
|
"node": ">=22.14.0"
|
|
46
51
|
},
|
|
47
52
|
"dependencies": {
|
|
48
|
-
"@radix-ui/react-select": "^2.1.7",
|
|
49
53
|
"radix-ui": "^1",
|
|
50
54
|
"react": "^19",
|
|
51
55
|
"react-dom": "^19",
|
|
@@ -66,9 +70,8 @@
|
|
|
66
70
|
"@types/react": "^19",
|
|
67
71
|
"@types/react-dom": "^19",
|
|
68
72
|
"@vitejs/plugin-react": "^5.1.2",
|
|
69
|
-
"canvas": "^3.
|
|
73
|
+
"skia-canvas": "^3.0.8",
|
|
70
74
|
"culori": "^4.0.2",
|
|
71
|
-
"echarts": "^6.0.0",
|
|
72
75
|
"eslint": "^9.39.1",
|
|
73
76
|
"eslint-config-prettier": "^10.1.8",
|
|
74
77
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
@@ -92,8 +95,8 @@
|
|
|
92
95
|
},
|
|
93
96
|
"peerDependencies": {
|
|
94
97
|
"@radix-ui/react-compose-refs": "^1",
|
|
95
|
-
"canvas": "^3",
|
|
96
98
|
"echarts": "^6",
|
|
99
|
+
"skia-canvas": "^3",
|
|
97
100
|
"radix-ui": "^1",
|
|
98
101
|
"react": "^19",
|
|
99
102
|
"react-dom": "^19",
|
|
@@ -102,10 +105,7 @@
|
|
|
102
105
|
"zod": "^4"
|
|
103
106
|
},
|
|
104
107
|
"peerDependenciesMeta": {
|
|
105
|
-
"canvas": {
|
|
106
|
-
"optional": true
|
|
107
|
-
},
|
|
108
|
-
"echarts": {
|
|
108
|
+
"skia-canvas": {
|
|
109
109
|
"optional": true
|
|
110
110
|
}
|
|
111
111
|
}
|