@moda-chart/vue 0.0.0-stage → 0.1.3

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 park-taejoon
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,3 +1,13 @@
1
- # Temporary Holding Version
1
+ # @moda-chart/vue
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ `@moda-chart/core`의 Vue 3 어댑터 — composable + SFC.
4
+
5
+ ```vue
6
+ <script setup>
7
+ import { ChartView, useChart } from "@moda-chart/vue";
8
+ import "@moda-chart/vue/styles.css";
9
+ const { chart } = useChart({ type: "line", series, categories });
10
+ </script>
11
+
12
+ <template><ChartView :chart="chart" /></template>
13
+ ```
@@ -0,0 +1,19 @@
1
+ <script setup lang="ts">
2
+ import { onMounted, onUnmounted, ref } from "vue";
3
+ import { attachChartView } from "@moda-chart/core";
4
+ import type { ChartCore } from "@moda-chart/core";
5
+
6
+ // Vue 3 렌더러 — 공용 DOM 렌더러를 호스트 div에 연결한다.
7
+ const props = defineProps<{ chart: ChartCore }>();
8
+ const el = ref<HTMLDivElement>();
9
+ let detach: (() => void) | undefined;
10
+
11
+ onMounted(() => {
12
+ detach = attachChartView(el.value!, props.chart);
13
+ });
14
+ onUnmounted(() => detach?.());
15
+ </script>
16
+
17
+ <template>
18
+ <div ref="el"></div>
19
+ </template>
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=conformance.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conformance.test.d.ts","sourceRoot":"","sources":["../src/conformance.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ // @vitest-environment happy-dom
2
+ import { createApp, h, nextTick } from "vue";
3
+ import { runChartConformance } from "@moda-chart/core/conformance";
4
+ import { ChartCore } from "@moda-chart/core";
5
+ import ChartView from "./ChartView.vue";
6
+ // Vue 3 렌더러 — createApp 마운트 + nextTick flush
7
+ runChartConformance("vue", async (opts) => {
8
+ const el = document.createElement("div");
9
+ document.body.appendChild(el);
10
+ const chart = new ChartCore(opts);
11
+ const app = createApp({ render: () => h(ChartView, { chart }) });
12
+ app.mount(el);
13
+ await nextTick();
14
+ return {
15
+ el,
16
+ chart,
17
+ flush: () => nextTick(),
18
+ destroy: () => {
19
+ app.unmount();
20
+ el.remove();
21
+ },
22
+ };
23
+ });
24
+ //# sourceMappingURL=conformance.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conformance.test.js","sourceRoot":"","sources":["../src/conformance.test.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,SAAS,MAAM,iBAAiB,CAAC;AAExC,6CAA6C;AAC7C,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;IACxC,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACzC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IAC9B,MAAM,KAAK,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC;IAClC,MAAM,GAAG,GAAG,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IACjE,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACd,MAAM,QAAQ,EAAE,CAAC;IACjB,OAAO;QACL,EAAE;QACF,KAAK;QACL,KAAK,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE;QACvB,OAAO,EAAE,GAAG,EAAE;YACZ,GAAG,CAAC,OAAO,EAAE,CAAC;YACd,EAAE,CAAC,MAAM,EAAE,CAAC;QACd,CAAC;KACF,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { useChart, useChartState } from "./useChart.js";
2
+ export type { UseChartReturn } from "./useChart.js";
3
+ export { default as ChartView } from "./ChartView.vue";
4
+ export type { AnnotationInput, CategoryValue, Chart, ChartCoreOptions, ChartEventHandlers, ChartEventMap, ChartEventType, ChartChordOptions, ChartFlowLink, ChartGaugeOptions, ChartHeatmapOptions, ChartLocale, ChartMapDatum, ChartMapLine, ChartMapOptions, ChartMapPoint, ChartBoxInput, ChartMenuItem, ChartContextMenuOptions, ItemStyle, ItemStyleContext, TooltipRenderContext, ChartDrawingOptions, ChartSearchOptions, ChartPictogramOptions, ChartPyramidPopOptions, ChartState, DrawingInput, DrawingView, DrawTool, SearchLoadArgs, PictoIconView, PictoRowView, SparklineOptions, ChartPointInput, ChartSankeyOptions, ChartSeriesInput, ChartSnapshot, ChartTheme, ChartTreeNode, ChartType, DrilldownLevel, MapProjection, MarkBandInput, MarkLineInput, } from "@moda-chart/core";
5
+ export { ChartCore, mountSparkline, parseDataXml, parseText, sparklineMarkup, WORLD_TOPOLOGY, } from "@moda-chart/core";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACxD,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,YAAY,EACV,eAAe,EACf,aAAa,EACb,KAAK,EACL,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,eAAe,EACf,aAAa,EACb,aAAa,EACb,aAAa,EACb,uBAAuB,EACvB,SAAS,EACT,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,cAAc,EACd,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,aAAa,EACb,SAAS,EACT,cAAc,EACd,aAAa,EACb,aAAa,EACb,aAAa,GACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,SAAS,EACT,cAAc,EACd,YAAY,EACZ,SAAS,EACT,eAAe,EACf,cAAc,GACf,MAAM,kBAAkB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export { useChart, useChartState } from "./useChart.js";
2
+ export { default as ChartView } from "./ChartView.vue";
3
+ export { ChartCore, mountSparkline, parseDataXml, parseText, sparklineMarkup, WORLD_TOPOLOGY, } from "@moda-chart/core";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAExD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAgDvD,OAAO,EACL,SAAS,EACT,cAAc,EACd,YAAY,EACZ,SAAS,EACT,eAAe,EACf,cAAc,GACf,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1 @@
1
+ @import "@moda-chart/core/styles.css";
@@ -0,0 +1,21 @@
1
+ import type { ShallowRef } from "vue";
2
+ import { ChartCore } from "@moda-chart/core";
3
+ import type { ChartCoreOptions, ChartSnapshot } from "@moda-chart/core";
4
+ export interface UseChartReturn {
5
+ /** 헤드리스 코어 — 액션 호출용 */
6
+ chart: ChartCore;
7
+ /** 렌더용 스냅샷 (ShallowRef — 통째 교체 구조) */
8
+ state: ShallowRef<ChartSnapshot>;
9
+ unsubscribe(): void;
10
+ }
11
+ /**
12
+ * Vue 3 어댑터 composable — 코어 생성 + 스냅샷을 ShallowRef로 구독.
13
+ * 컴포넌트/이펙트 스코프 안에서 호출하면 onScopeDispose로 자동 해제된다.
14
+ */
15
+ export declare function useChart(options: ChartCoreOptions): UseChartReturn;
16
+ /** 외부에서 만든 ChartCore의 스냅샷만 구독한다 */
17
+ export declare function useChartState(chart: ChartCore): {
18
+ state: ShallowRef<ChartSnapshot>;
19
+ unsubscribe: () => void;
20
+ };
21
+ //# sourceMappingURL=useChart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChart.d.ts","sourceRoot":"","sources":["../src/useChart.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAExE,MAAM,WAAW,cAAc;IAC7B,uBAAuB;IACvB,KAAK,EAAE,SAAS,CAAC;IACjB,sCAAsC;IACtC,KAAK,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;IACjC,WAAW,IAAI,IAAI,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,gBAAgB,GAAG,cAAc,CAQlE;AAED,mCAAmC;AACnC,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,GAAG;IAC/C,KAAK,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;IACjC,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,CAOA"}
@@ -0,0 +1,25 @@
1
+ import { onScopeDispose, shallowRef } from "vue";
2
+ import { ChartCore } from "@moda-chart/core";
3
+ /**
4
+ * Vue 3 어댑터 composable — 코어 생성 + 스냅샷을 ShallowRef로 구독.
5
+ * 컴포넌트/이펙트 스코프 안에서 호출하면 onScopeDispose로 자동 해제된다.
6
+ */
7
+ export function useChart(options) {
8
+ const chart = new ChartCore(options);
9
+ const state = shallowRef(chart.getSnapshot());
10
+ const unsubscribe = chart.subscribe(() => {
11
+ state.value = chart.getSnapshot();
12
+ });
13
+ onScopeDispose(unsubscribe, true);
14
+ return { chart, state: state, unsubscribe };
15
+ }
16
+ /** 외부에서 만든 ChartCore의 스냅샷만 구독한다 */
17
+ export function useChartState(chart) {
18
+ const state = shallowRef(chart.getSnapshot());
19
+ const unsubscribe = chart.subscribe(() => {
20
+ state.value = chart.getSnapshot();
21
+ });
22
+ onScopeDispose(unsubscribe, true);
23
+ return { state: state, unsubscribe };
24
+ }
25
+ //# sourceMappingURL=useChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChart.js","sourceRoot":"","sources":["../src/useChart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAW7C;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAyB;IAChD,MAAM,KAAK,GAAG,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC;IACrC,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;IAC9C,MAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACvC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IACpC,CAAC,CAAC,CAAC;IACH,cAAc,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAClC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAkC,EAAE,WAAW,EAAE,CAAC;AAC3E,CAAC;AAED,mCAAmC;AACnC,MAAM,UAAU,aAAa,CAAC,KAAgB;IAI5C,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;IAC9C,MAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACvC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IACpC,CAAC,CAAC,CAAC;IACH,cAAc,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAClC,OAAO,EAAE,KAAK,EAAE,KAAkC,EAAE,WAAW,EAAE,CAAC;AACpE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,50 @@
1
1
  {
2
2
  "name": "@moda-chart/vue",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.3",
4
+ "description": "Vue 3 adapter for @moda-chart — useChart + ChartView",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
11
+ },
12
+ "./styles.css": "./dist/styles.css"
13
+ },
14
+ "types": "./dist/index.d.ts",
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "sideEffects": [
19
+ "**/*.css"
20
+ ],
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "keywords": [
25
+ "vue",
26
+ "adapter",
27
+ "headless",
28
+ "library"
29
+ ],
30
+ "dependencies": {
31
+ "@moda-chart/core": "0.1.3"
32
+ },
33
+ "peerDependencies": {
34
+ "vue": ">=3.3.0"
35
+ },
36
+ "devDependencies": {
37
+ "@vitejs/plugin-vue": "^5.2.4",
38
+ "happy-dom": "^20.14.5",
39
+ "typescript": "~5.9.2",
40
+ "vitest": "^3.2.7",
41
+ "vue": "^3.5.0"
42
+ },
43
+ "scripts": {
44
+ "build": "tsc -p tsconfig.json && cp src/styles.css src/ChartView.vue dist/",
45
+ "typecheck": "tsc -p tsconfig.json --noEmit",
46
+ "dev": "tsc -p tsconfig.json --watch",
47
+ "test": "vitest run"
48
+ },
49
+ "main": "./dist/index.js"
6
50
  }