nuxt-echarts 1.0.0 → 1.1.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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2024 - present, Yue JIN
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 - present, Yue JIN
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,92 +1,93 @@
1
- ![nuxt-echarts](./docs/public/social-card.png)
2
-
3
- # Nuxt ECharts
4
-
5
- [![npm version][npm-version-src]][npm-version-href]
6
- [![npm downloads][npm-downloads-src]][npm-downloads-href]
7
- [![License][license-src]][license-href]
8
- [![Nuxt][nuxt-src]][nuxt-href]
9
-
10
- Nuxt Module for Apache ECharts™
11
-
12
- - [📖  Documentation](https://echarts.nuxt.dev)
13
-
14
- - [✨  Release Notes](/CHANGELOG.md)
15
- - [🎞️  Online Demo](https://nuxt-echarts.nuxt.dev/)
16
- - [🏀  Online Playground](https://stackblitz.com/github/kingyue737/nuxt-echarts?file=playground%2Fapp.vue)
17
-
18
- ## Features
19
-
20
- - ⛰ **SSR**: Server-side SVG Rendering with [Nuxt server components](https://nuxt.com/docs/guide/directory-structure/components#server-components)
21
-
22
- - ♾️ **Client Hydration**: lazy-loading full ECharts or [lightweight client runtime](https://echarts.apache.org/handbook/en/how-to/cross-platform/server#using-lightweight-runtime)
23
- - 🛠️ **Configurable**: import only [necessary functionality](https://echarts.apache.org/handbook/en/basics/import#shrinking-bundle-size) for shrinking bundle size
24
- - 🦾 **Type Strong**: auto-import [ECharts option type](https://echarts.apache.org/handbook/en/basics/import#creating-an-option-type-in-typescript) based on your config
25
- - 🌲 **Tree-shaking**: Components and ECharts are only included if you use them
26
-
27
- ## Quick Setup
28
-
29
- Install the module to your Nuxt application with one command:
30
-
31
- ```bash
32
- npx nuxi module add echarts
33
- ```
34
-
35
- That's it! You can now use Nuxt ECharts in your Nuxt app ✨
36
-
37
- ## Contribution
38
-
39
- <details>
40
- <summary>Local development</summary>
41
-
42
- ```bash
43
- # Install dependencies
44
- pnpm install
45
-
46
- # Generate type stubs
47
- pnpm run dev:prepare
48
-
49
- # Develop with the playground
50
- pnpm run dev
51
-
52
- # Build the playground
53
- pnpm run dev:build
54
-
55
- # Run ESLint
56
- pnpm run lint
57
-
58
- # Format with Prettier
59
- pnpm run format
60
-
61
- # Run Vitest
62
- pnpm run test
63
- pnpm run test:watch
64
-
65
- # Release new version
66
- pnpm run release
67
- ```
68
-
69
- </details>
70
-
71
- ## Credits
72
-
73
- The Nuxt ECharts module depends on [vue-echarts](https://github.com/ecomfe/vue-echarts), created by [@Justineo](https://github.com/Justineo).
74
-
75
- ## License
76
-
77
- This project is licensed under the [MIT License](./LICENSE).
78
-
79
- ## Notice
80
-
81
- The Apache Software Foundation [Apache ECharts, ECharts](https://echarts.apache.org/), Apache, the Apache feather, and the Apache ECharts project logo are either registered trademarks or trademarks of the [Apache Software Foundation](https://www.apache.org/).
82
-
83
- <!-- Badges -->
84
-
85
- [npm-version-src]: https://img.shields.io/npm/v/nuxt-echarts/latest.svg?style=flat&colorA=020420&colorB=00DC82
86
- [npm-version-href]: https://npmjs.com/package/nuxt-echarts
87
- [npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-echarts.svg?style=flat&colorA=020420&colorB=00DC82
88
- [npm-downloads-href]: https://npm.chart.dev/nuxt-echarts
89
- [license-src]: https://img.shields.io/npm/l/nuxt-echarts.svg?style=flat&colorA=020420&colorB=00DC82
90
- [license-href]: https://npmjs.com/package/nuxt-echarts
91
- [nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js
92
- [nuxt-href]: https://nuxt.com
1
+ ![nuxt-echarts](./docs/public/social-card.png)
2
+
3
+ # Nuxt ECharts
4
+
5
+ [![npm version][npm-version-src]][npm-version-href]
6
+ [![npm downloads][npm-downloads-src]][npm-downloads-href]
7
+ [![License][license-src]][license-href]
8
+ [![Nuxt][nuxt-src]][nuxt-href]
9
+
10
+ Nuxt Module for Apache ECharts™
11
+
12
+ - [📖 &nbsp;Documentation](https://echarts.nuxt.dev)
13
+
14
+ - [✨ &nbsp;Release Notes](/CHANGELOG.md)
15
+ - [🎞️ &nbsp;Online Demo](https://nuxt-echarts.nuxt.dev/)
16
+ - [🏀 &nbsp;Online Playground](https://stackblitz.com/github/kingyue737/nuxt-echarts?file=playground%2Fapp%2Fapp.vue)
17
+
18
+ ## Features
19
+
20
+ - ✌️&nbsp;**[Vue ECharts](https://github.com/ecomfe/vue-echarts)**: effortless integration with the top Vue component for ECharts
21
+
22
+ - ⛰&nbsp;**SSR**: Server-side SVG Rendering with [Nuxt server components](https://nuxt.com/docs/guide/directory-structure/components#server-components)
23
+ - ♾️&nbsp;**Client Hydration**: lazy-loading full ECharts or [lightweight client runtime](https://echarts.apache.org/handbook/en/how-to/cross-platform/server#using-lightweight-runtime)
24
+ - 🛠️&nbsp;**Configurable**: import only [necessary functionality](https://echarts.apache.org/handbook/en/basics/import#shrinking-bundle-size) for shrinking bundle size
25
+ - 🦾&nbsp;**Type Strong**: auto-import [ECharts option type](https://echarts.apache.org/handbook/en/basics/import#creating-an-option-type-in-typescript) based on your config
26
+ - 🌲&nbsp;**Tree-shaking**: Components and ECharts are only included if you use them
27
+
28
+ ## Quick Setup
29
+
30
+ Install the module to your Nuxt application with one command:
31
+
32
+ ```bash
33
+ npx nuxi module add echarts
34
+ ```
35
+
36
+ That's it! You can now use Nuxt ECharts in your Nuxt app ✨
37
+
38
+ ## Contribution
39
+
40
+ <details>
41
+ <summary>Local development</summary>
42
+
43
+ ```bash
44
+ # Install dependencies
45
+ pnpm install
46
+
47
+ # Generate type stubs
48
+ pnpm run dev:prepare
49
+
50
+ # Develop with the playground
51
+ pnpm run dev
52
+
53
+ # Build the playground
54
+ pnpm run dev:build
55
+
56
+ # Run ESLint
57
+ pnpm run lint
58
+
59
+ # Format with Prettier
60
+ pnpm run format
61
+
62
+ # Run Vitest
63
+ pnpm run test
64
+ pnpm run test:watch
65
+
66
+ # Release new version
67
+ pnpm run release
68
+ ```
69
+
70
+ </details>
71
+
72
+ ## Credits
73
+
74
+ The Nuxt ECharts module depends on [vue-echarts](https://github.com/ecomfe/vue-echarts), created by [@Justineo](https://github.com/Justineo).
75
+
76
+ ## License
77
+
78
+ This project is licensed under the [MIT License](./LICENSE).
79
+
80
+ ## Notice
81
+
82
+ The Apache Software Foundation [Apache ECharts, ECharts](https://echarts.apache.org/), Apache, the Apache feather, and the Apache ECharts project logo are either registered trademarks or trademarks of the [Apache Software Foundation](https://www.apache.org/).
83
+
84
+ <!-- Badges -->
85
+
86
+ [npm-version-src]: https://img.shields.io/npm/v/nuxt-echarts/latest.svg?style=flat&colorA=020420&colorB=00DC82
87
+ [npm-version-href]: https://npmjs.com/package/nuxt-echarts
88
+ [npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-echarts.svg?style=flat&colorA=020420&colorB=00DC82
89
+ [npm-downloads-href]: https://npm.chart.dev/nuxt-echarts
90
+ [license-src]: https://img.shields.io/npm/l/nuxt-echarts.svg?style=flat&colorA=020420&colorB=00DC82
91
+ [license-href]: https://npmjs.com/package/nuxt-echarts
92
+ [nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js
93
+ [nuxt-href]: https://nuxt.com
package/dist/module.json CHANGED
@@ -4,9 +4,9 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.2.0"
6
6
  },
7
- "version": "1.0.0",
7
+ "version": "1.1.0",
8
8
  "builder": {
9
- "@nuxt/module-builder": "1.0.2",
10
- "unbuild": "3.6.0"
9
+ "@nuxt/module-builder": "1.0.3",
10
+ "unbuild": "3.6.1"
11
11
  }
12
12
  }
package/dist/module.mjs CHANGED
@@ -1,6 +1,21 @@
1
1
  import { defineNuxtModule, createResolver, addPlugin, addComponent, addTemplate, addTypeTemplate, addImports } from '@nuxt/kit';
2
2
 
3
- const module = defineNuxtModule({
3
+ const GRAPHIC_COMPONENT_NAMES = [
4
+ "GArc",
5
+ "GBezierCurve",
6
+ "GCircle",
7
+ "GEllipse",
8
+ "GGroup",
9
+ "GImage",
10
+ "GLine",
11
+ "GPolygon",
12
+ "GPolyline",
13
+ "GRect",
14
+ "GRing",
15
+ "GSector",
16
+ "GText"
17
+ ];
18
+ const module$1 = defineNuxtModule({
4
19
  meta: {
5
20
  name: "nuxt-echarts",
6
21
  configKey: "echarts",
@@ -136,7 +151,10 @@ const module = defineNuxtModule({
136
151
  "UPDATE_OPTIONS_KEY",
137
152
  "LOADING_OPTIONS_KEY"
138
153
  ].forEach((name) => addImports({ name, from: "vue-echarts" }));
154
+ GRAPHIC_COMPONENT_NAMES.forEach(
155
+ (name) => addComponent({ name, export: name, filePath: "vue-echarts/graphic" })
156
+ );
139
157
  }
140
158
  });
141
159
 
142
- export { module as default };
160
+ export { module$1 as default };
@@ -1,28 +1,11 @@
1
1
  import VChart from "vue-echarts";
2
2
  import "#build/echarts.mjs";
3
- import { defineComponent, h, ref, toRef } from "vue";
4
- const METHOD_NAMES = [
5
- "setOption",
6
- "getWidth",
7
- "getHeight",
8
- "getDom",
9
- "getOption",
10
- "resize",
11
- "dispatchAction",
12
- "convertToPixel",
13
- "convertFromPixel",
14
- "containPixel",
15
- "getDataURL",
16
- "getConnectedDataURL",
17
- "appendData",
18
- "clear",
19
- "isDisposed",
20
- "dispose"
21
- ];
3
+ import { defineComponent, h, shallowRef, toRef } from "vue";
4
+ import { METHOD_NAMES } from "./method-names.js";
22
5
  export default defineComponent({
23
6
  inheritAttrs: false,
24
7
  setup(props, { attrs, slots, expose }) {
25
- const root = ref(null);
8
+ const root = shallowRef();
26
9
  const publicMethods = Object.fromEntries(
27
10
  METHOD_NAMES.map((name) => [
28
11
  name,
@@ -1,27 +1,10 @@
1
1
  import VChart from "./VChart.js";
2
- import { defineComponent, h, ref, toRef } from "vue";
3
- const METHOD_NAMES = [
4
- "setOption",
5
- "getWidth",
6
- "getHeight",
7
- "getDom",
8
- "getOption",
9
- "resize",
10
- "dispatchAction",
11
- "convertToPixel",
12
- "convertFromPixel",
13
- "containPixel",
14
- "getDataURL",
15
- "getConnectedDataURL",
16
- "appendData",
17
- "clear",
18
- "isDisposed",
19
- "dispose"
20
- ];
2
+ import { defineComponent, h, shallowRef, toRef } from "vue";
3
+ import { METHOD_NAMES } from "./method-names.js";
21
4
  export default defineComponent({
22
5
  inheritAttrs: false,
23
6
  setup(props, { attrs, slots, expose }) {
24
- const root = ref(null);
7
+ const root = shallowRef();
25
8
  const publicMethods = Object.fromEntries(
26
9
  METHOD_NAMES.map((name) => [
27
10
  name,
@@ -0,0 +1,18 @@
1
+ import type { Option, InitOptions, Theme } from '../types.js';
2
+ type __VLS_Props = {
3
+ option?: Option;
4
+ initOptions?: InitOptions;
5
+ theme?: Theme;
6
+ };
7
+ type __VLS_Slots = {
8
+ fallback: any;
9
+ };
10
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
14
+ type __VLS_WithSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
@@ -7,8 +7,9 @@ type __VLS_Props = {
7
7
  type __VLS_Slots = {
8
8
  fallback: any;
9
9
  };
10
- declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
- declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
10
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
+ declare const _default: typeof __VLS_export;
12
13
  export default _default;
13
14
  type __VLS_WithSlots<T, S> = T & {
14
15
  new (): {
@@ -0,0 +1,143 @@
1
+ import { type ECSSRClientEventParams, type ECSSREvent } from 'echarts/ssr/client/index';
2
+ import type { InitOptions, Option, Theme } from '../types.js';
3
+ import { nextTick, type PropType } from 'vue';
4
+ type ECSSRHandler = (params: ECSSRClientEventParams) => string | undefined;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
7
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
+ option: PropType<Option>;
9
+ theme: {
10
+ type: PropType<Theme>;
11
+ };
12
+ initOptions: PropType<InitOptions>;
13
+ }>, {
14
+ root: import("vue").ShallowRef<({
15
+ $: import("vue").ComponentInternalInstance;
16
+ $data: {};
17
+ $props: {
18
+ readonly option?: Option | undefined;
19
+ readonly theme?: Theme | undefined;
20
+ readonly initOptions?: InitOptions | undefined;
21
+ readonly onError?: ((error: unknown) => any) | undefined;
22
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
23
+ $attrs: import("vue").Attrs;
24
+ $refs: {
25
+ [x: string]: unknown;
26
+ };
27
+ $slots: Readonly<{
28
+ [name: string]: import("vue").Slot<any> | undefined;
29
+ }>;
30
+ $root: import("vue").ComponentPublicInstance | null;
31
+ $parent: import("vue").ComponentPublicInstance | null;
32
+ $host: Element | null;
33
+ $emit: (event: "error", error: unknown) => void;
34
+ $el: any;
35
+ $options: import("vue").ComponentOptionsBase<Readonly<{
36
+ option?: Option;
37
+ theme?: Theme;
38
+ initOptions?: InitOptions;
39
+ }> & Readonly<{
40
+ onError?: ((error: unknown) => any) | undefined;
41
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
42
+ error: (error: unknown) => any;
43
+ }, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
44
+ beforeCreate?: (() => void) | (() => void)[];
45
+ created?: (() => void) | (() => void)[];
46
+ beforeMount?: (() => void) | (() => void)[];
47
+ mounted?: (() => void) | (() => void)[];
48
+ beforeUpdate?: (() => void) | (() => void)[];
49
+ updated?: (() => void) | (() => void)[];
50
+ activated?: (() => void) | (() => void)[];
51
+ deactivated?: (() => void) | (() => void)[];
52
+ beforeDestroy?: (() => void) | (() => void)[];
53
+ beforeUnmount?: (() => void) | (() => void)[];
54
+ destroyed?: (() => void) | (() => void)[];
55
+ unmounted?: (() => void) | (() => void)[];
56
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
57
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
58
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
59
+ };
60
+ $forceUpdate: () => void;
61
+ $nextTick: typeof nextTick;
62
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
63
+ } & Readonly<{}> & Omit<Readonly<{
64
+ option?: Option;
65
+ theme?: Theme;
66
+ initOptions?: InitOptions;
67
+ }> & Readonly<{
68
+ onError?: ((error: unknown) => any) | undefined;
69
+ }>, never> & {} & import("vue").ComponentCustomProperties & {} & {
70
+ $slots: {
71
+ fallback?: (props: {}) => any;
72
+ };
73
+ }) | undefined, ({
74
+ $: import("vue").ComponentInternalInstance;
75
+ $data: {};
76
+ $props: {
77
+ readonly option?: Option | undefined;
78
+ readonly theme?: Theme | undefined;
79
+ readonly initOptions?: InitOptions | undefined;
80
+ readonly onError?: ((error: unknown) => any) | undefined;
81
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
82
+ $attrs: import("vue").Attrs;
83
+ $refs: {
84
+ [x: string]: unknown;
85
+ };
86
+ $slots: Readonly<{
87
+ [name: string]: import("vue").Slot<any> | undefined;
88
+ }>;
89
+ $root: import("vue").ComponentPublicInstance | null;
90
+ $parent: import("vue").ComponentPublicInstance | null;
91
+ $host: Element | null;
92
+ $emit: (event: "error", error: unknown) => void;
93
+ $el: any;
94
+ $options: import("vue").ComponentOptionsBase<Readonly<{
95
+ option?: Option;
96
+ theme?: Theme;
97
+ initOptions?: InitOptions;
98
+ }> & Readonly<{
99
+ onError?: ((error: unknown) => any) | undefined;
100
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
101
+ error: (error: unknown) => any;
102
+ }, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
103
+ beforeCreate?: (() => void) | (() => void)[];
104
+ created?: (() => void) | (() => void)[];
105
+ beforeMount?: (() => void) | (() => void)[];
106
+ mounted?: (() => void) | (() => void)[];
107
+ beforeUpdate?: (() => void) | (() => void)[];
108
+ updated?: (() => void) | (() => void)[];
109
+ activated?: (() => void) | (() => void)[];
110
+ deactivated?: (() => void) | (() => void)[];
111
+ beforeDestroy?: (() => void) | (() => void)[];
112
+ beforeUnmount?: (() => void) | (() => void)[];
113
+ destroyed?: (() => void) | (() => void)[];
114
+ unmounted?: (() => void) | (() => void)[];
115
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
116
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
117
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
118
+ };
119
+ $forceUpdate: () => void;
120
+ $nextTick: typeof nextTick;
121
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
122
+ } & Readonly<{}> & Omit<Readonly<{
123
+ option?: Option;
124
+ theme?: Theme;
125
+ initOptions?: InitOptions;
126
+ }> & Readonly<{
127
+ onError?: ((error: unknown) => any) | undefined;
128
+ }>, never> & {} & import("vue").ComponentCustomProperties & {} & {
129
+ $slots: {
130
+ fallback?: (props: {}) => any;
131
+ };
132
+ }) | undefined>;
133
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<ECSSREvent, ECSSRHandler>, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
134
+ option: PropType<Option>;
135
+ theme: {
136
+ type: PropType<Theme>;
137
+ };
138
+ initOptions: PropType<InitOptions>;
139
+ }>> & Readonly<{
140
+ onClick?: ((params: ECSSRClientEventParams) => any) | undefined;
141
+ onMouseout?: ((params: ECSSRClientEventParams) => any) | undefined;
142
+ onMouseover?: ((params: ECSSRClientEventParams) => any) | undefined;
143
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  useAttrs,
7
7
  nextTick,
8
- ref,
8
+ shallowRef,
9
9
  onMounted,
10
10
  defineComponent
11
11
  } from "vue";
@@ -20,7 +20,7 @@ export default defineComponent({
20
20
  },
21
21
  emits: {},
22
22
  setup() {
23
- const root = ref(null);
23
+ const root = shallowRef();
24
24
  const attrs = useAttrs();
25
25
  let container;
26
26
  function hydrateChart() {
@@ -54,10 +54,10 @@ export default defineComponent({
54
54
  </script>
55
55
 
56
56
  <template>
57
- <VChartServer
58
- ref="root"
59
- :option="option"
60
- :init-options="initOptions"
61
- :theme="theme"
62
- />
57
+ <VChartServer
58
+ ref="root"
59
+ :option="option"
60
+ :init-options="initOptions"
61
+ :theme="theme"
62
+ />
63
63
  </template>
@@ -2,14 +2,16 @@ import { type ECSSRClientEventParams, type ECSSREvent } from 'echarts/ssr/client
2
2
  import type { InitOptions, Option, Theme } from '../types.js';
3
3
  import { nextTick, type PropType } from 'vue';
4
4
  type ECSSRHandler = (params: ECSSRClientEventParams) => string | undefined;
5
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
7
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
8
  option: PropType<Option>;
7
9
  theme: {
8
10
  type: PropType<Theme>;
9
11
  };
10
12
  initOptions: PropType<InitOptions>;
11
13
  }>, {
12
- root: import("vue").Ref<({
14
+ root: import("vue").ShallowRef<({
13
15
  $: import("vue").ComponentInternalInstance;
14
16
  $data: {};
15
17
  $props: {
@@ -18,9 +20,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
18
20
  readonly initOptions?: InitOptions | undefined;
19
21
  readonly onError?: ((error: unknown) => any) | undefined;
20
22
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
21
- $attrs: {
22
- [x: string]: unknown;
23
- };
23
+ $attrs: import("vue").Attrs;
24
24
  $refs: {
25
25
  [x: string]: unknown;
26
26
  };
@@ -38,7 +38,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
38
38
  initOptions?: InitOptions;
39
39
  }> & Readonly<{
40
40
  onError?: ((error: unknown) => any) | undefined;
41
- }>, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
41
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
42
42
  error: (error: unknown) => any;
43
43
  }, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
44
44
  beforeCreate?: (() => void) | (() => void)[];
@@ -66,11 +66,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
66
66
  initOptions?: InitOptions;
67
67
  }> & Readonly<{
68
68
  onError?: ((error: unknown) => any) | undefined;
69
- }>, never> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
69
+ }>, never> & {} & import("vue").ComponentCustomProperties & {} & {
70
70
  $slots: {
71
71
  fallback?: (props: {}) => any;
72
72
  };
73
- }) | null, ({
73
+ }) | undefined, ({
74
74
  $: import("vue").ComponentInternalInstance;
75
75
  $data: {};
76
76
  $props: {
@@ -79,9 +79,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
79
79
  readonly initOptions?: InitOptions | undefined;
80
80
  readonly onError?: ((error: unknown) => any) | undefined;
81
81
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
82
- $attrs: {
83
- [x: string]: unknown;
84
- };
82
+ $attrs: import("vue").Attrs;
85
83
  $refs: {
86
84
  [x: string]: unknown;
87
85
  };
@@ -99,7 +97,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
99
97
  initOptions?: InitOptions;
100
98
  }> & Readonly<{
101
99
  onError?: ((error: unknown) => any) | undefined;
102
- }>, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
100
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
103
101
  error: (error: unknown) => any;
104
102
  }, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
105
103
  beforeCreate?: (() => void) | (() => void)[];
@@ -127,11 +125,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
127
125
  initOptions?: InitOptions;
128
126
  }> & Readonly<{
129
127
  onError?: ((error: unknown) => any) | undefined;
130
- }>, never> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
128
+ }>, never> & {} & import("vue").ComponentCustomProperties & {} & {
131
129
  $slots: {
132
130
  fallback?: (props: {}) => any;
133
131
  };
134
- }) | null>;
132
+ }) | undefined>;
135
133
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<ECSSREvent, ECSSRHandler>, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
136
134
  option: PropType<Option>;
137
135
  theme: {
@@ -143,4 +141,3 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
143
141
  onMouseout?: ((params: ECSSRClientEventParams) => any) | undefined;
144
142
  onMouseover?: ((params: ECSSRClientEventParams) => any) | undefined;
145
143
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
146
- export default _default;
@@ -0,0 +1,23 @@
1
+ import type { InitOptions, Option, Theme } from '../types.js';
2
+ type __VLS_Props = {
3
+ option?: Option;
4
+ theme?: Theme;
5
+ initOptions?: InitOptions;
6
+ };
7
+ declare var __VLS_12: {};
8
+ type __VLS_Slots = {} & {
9
+ fallback?: (props: typeof __VLS_12) => any;
10
+ };
11
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
12
+ error: (error: unknown) => any;
13
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
+ onError?: ((error: unknown) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
17
+ declare const _default: typeof __VLS_export;
18
+ export default _default;
19
+ type __VLS_WithSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { computed, inject, ref, toValue } from "vue";
2
+ import { computed, inject, shallowRef, toValue } from "vue";
3
3
  import { THEME_KEY, INIT_OPTIONS_KEY } from "vue-echarts";
4
4
  const defaultTheme = inject(THEME_KEY, null);
5
5
  const defaultInitOptions = inject(INIT_OPTIONS_KEY, null);
@@ -19,21 +19,21 @@ function onError(e) {
19
19
  }
20
20
  emits("error", e);
21
21
  }
22
- const root = ref(null);
22
+ const root = shallowRef();
23
23
  </script>
24
24
 
25
25
  <template>
26
- <div class="vue-echarts-server">
27
- <VChartIsland
28
- ref="root"
29
- :theme="realTheme"
30
- :option="option"
31
- :init-options="realInitOptions"
32
- @error="onError"
33
- >
34
- <template #fallback>
35
- <slot name="fallback" />
36
- </template>
37
- </VChartIsland>
38
- </div>
26
+ <div class="vue-echarts-server">
27
+ <VChartIsland
28
+ ref="root"
29
+ :theme="realTheme"
30
+ :option="option"
31
+ :init-options="realInitOptions"
32
+ @error="onError"
33
+ >
34
+ <template #fallback>
35
+ <slot name="fallback" />
36
+ </template>
37
+ </VChartIsland>
38
+ </div>
39
39
  </template>
@@ -8,12 +8,13 @@ declare var __VLS_12: {};
8
8
  type __VLS_Slots = {} & {
9
9
  fallback?: (props: typeof __VLS_12) => any;
10
10
  };
11
- declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
11
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
12
12
  error: (error: unknown) => any;
13
13
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
14
  onError?: ((error: unknown) => any) | undefined;
15
15
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
- declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
16
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
17
+ declare const _default: typeof __VLS_export;
17
18
  export default _default;
18
19
  type __VLS_WithSlots<T, S> = T & {
19
20
  new (): {
@@ -0,0 +1 @@
1
+ export declare const METHOD_NAMES: readonly ["setOption", "getWidth", "getHeight", "getDom", "getZr", "getId", "isSSR", "getDevicePixelRatio", "getOption", "resize", "makeActionFromEvent", "dispatchAction", "updateLabelLayout", "convertToPixel", "convertToLayout", "convertFromPixel", "containPixel", "getVisual", "renderToCanvas", "renderToSVGString", "getSvgDataURL", "getDataURL", "getConnectedDataURL", "appendData", "clear", "isDisposed", "dispose"];
@@ -0,0 +1,30 @@
1
+ export const METHOD_NAMES = [
2
+ "setOption",
3
+ "getWidth",
4
+ "getHeight",
5
+ "getDom",
6
+ "getZr",
7
+ "getId",
8
+ "isSSR",
9
+ "getDevicePixelRatio",
10
+ "getOption",
11
+ "resize",
12
+ "makeActionFromEvent",
13
+ "dispatchAction",
14
+ "updateLabelLayout",
15
+ "convertToPixel",
16
+ "convertToLayout",
17
+ "convertFromPixel",
18
+ "containPixel",
19
+ "getVisual",
20
+ "renderToCanvas",
21
+ "renderToSVGString",
22
+ "getSvgDataURL",
23
+ "getDataURL",
24
+ "getConnectedDataURL",
25
+ "appendData",
26
+ "clear",
27
+ "isDisposed",
28
+ "dispose"
29
+ ];
30
+ const _assertListedNamesExist = METHOD_NAMES;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-echarts",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Nuxt Module for Apache ECharts™",
5
5
  "keywords": [
6
6
  "vue",
@@ -11,9 +11,13 @@
11
11
  "ssr"
12
12
  ],
13
13
  "author": "Yue JIN <yuejin13@fudan.edu.cn>",
14
- "repository": "kingyue737/nuxt-echarts",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "kingyue737/nuxt-echarts"
17
+ },
15
18
  "license": "MIT",
16
19
  "type": "module",
20
+ "types": "dist/types.d.mts",
17
21
  "exports": {
18
22
  ".": {
19
23
  "types": "./dist/types.d.mts",
@@ -26,32 +30,30 @@
26
30
  "dist"
27
31
  ],
28
32
  "dependencies": {
29
- "@nuxt/kit": "^4.0.3"
33
+ "@nuxt/kit": "^4.5.2"
30
34
  },
31
35
  "devDependencies": {
32
- "@nuxt/eslint-config": "^1.8.0",
33
- "@nuxt/module-builder": "^1.0.2",
34
- "@nuxt/schema": "^4.0.3",
35
- "@nuxt/test-utils": "^3.19.2",
36
- "@nuxthub/core": "^0.9.0",
37
- "@types/node": "^22.17.1",
36
+ "@nuxt/eslint-config": "^1.17.0",
37
+ "@nuxt/module-builder": "^1.0.3",
38
+ "@nuxt/schema": "^4.5.2",
39
+ "@nuxt/test-utils": "^4.3.2",
40
+ "@types/node": "^24.13.4",
38
41
  "changelogen": "^0.6.2",
39
- "echarts": "^6.0.0",
40
- "embla-carousel": "^8.6.0",
41
- "eslint": "^9.33.0",
42
- "nuxt": "^4.0.3",
43
- "prettier": "^3.6.2",
44
- "prettier-plugin-tailwindcss": "^0.6.14",
45
- "typescript": "^5.9.2",
46
- "vite": "^7.1.1",
47
- "vitest": "^3.2.4",
48
- "vue-echarts": "^8.0.0-beta.1",
49
- "vue-tsc": "^3.0.5",
50
- "wrangler": "^4.28.1"
42
+ "echarts": "^6.1.0",
43
+ "eslint": "^10.10.0",
44
+ "nuxt": "^4.5.2",
45
+ "prettier": "^3.9.6",
46
+ "prettier-plugin-tailwindcss": "^0.8.1",
47
+ "typescript": "^6.0.3",
48
+ "vite": "^8.3.0",
49
+ "vitest": "^5.0.0",
50
+ "vue-echarts": "^8.3.0",
51
+ "vue-tsc": "^3.3.11",
52
+ "wrangler": "^4.131.1"
51
53
  },
52
54
  "peerDependencies": {
53
- "echarts": "^6.0.0",
54
- "vue-echarts": "^8.0.0-beta.1"
55
+ "echarts": "^6.1.0",
56
+ "vue-echarts": "^8.3.0"
55
57
  },
56
58
  "stackblitz": {
57
59
  "startCommand": "pnpm run dev:prepare && pnpm run dev"
@@ -60,8 +62,7 @@
60
62
  "dev": "nuxi dev playground",
61
63
  "dev:build": "nuxi build playground",
62
64
  "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
63
- "release": "pnpm run lint && pnpm run test && pnpm run prepack && changelogen --release && npm publish --registry=\"https://registry.npmjs.org/\" && git push --follow-tags",
64
- "release:nightly": "pnpm changelogen --canary --publish --publishTag nightly",
65
+ "release": "changelogen --release --push",
65
66
  "docs:dev": "nuxi dev docs",
66
67
  "docs:build": "nuxi build docs",
67
68
  "docs:types": "nuxi typecheck docs",