@moda-chart/svelte 0.0.0-stage → 0.1.2

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/svelte
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`의 Svelte 5 어댑터 — 스토어 + SFC.
4
+
5
+ ```svelte
6
+ <script>
7
+ import { ChartView, createChartStore } from "@moda-chart/svelte";
8
+ import "@moda-chart/svelte/styles.css";
9
+ const store = createChartStore({ type: "line", series, categories });
10
+ </script>
11
+
12
+ <ChartView chart={store.chart} />
13
+ ```
@@ -0,0 +1,14 @@
1
+ <script lang="ts">
2
+ import { attachChartView } from "@moda-chart/core";
3
+ import type { ChartCore } from "@moda-chart/core";
4
+
5
+ // Svelte 5 렌더러 — 공용 DOM 렌더러를 호스트 div에 연결한다.
6
+ let { chart }: { chart: ChartCore } = $props();
7
+
8
+ function view(node: HTMLElement) {
9
+ const detach = attachChartView(node, chart);
10
+ return { destroy: detach };
11
+ }
12
+ </script>
13
+
14
+ <div use:view></div>
@@ -0,0 +1,8 @@
1
+ import type { ChartCore } from "@moda-chart/core";
2
+ type $$ComponentProps = {
3
+ chart: ChartCore;
4
+ };
5
+ declare const ChartView: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type ChartView = ReturnType<typeof ChartView>;
7
+ export default ChartView;
8
+ //# sourceMappingURL=ChartView.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartView.svelte.d.ts","sourceRoot":"","sources":["../src/lib/ChartView.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEjD,KAAK,gBAAgB,GAAI;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,CAAC;AAkB/C,QAAA,MAAM,SAAS,sDAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { Readable } from "svelte/store";
2
+ import { ChartCore } from "@moda-chart/core";
3
+ import type { ChartCoreOptions, ChartSnapshot } from "@moda-chart/core";
4
+ /** Svelte Readable 스토어 + 내부 ChartCore 인스턴스 */
5
+ export interface ChartStore extends Readable<ChartSnapshot> {
6
+ readonly chart: ChartCore;
7
+ }
8
+ /**
9
+ * ChartCore를 생성하고 Svelte 스토어 계약으로 감싼다.
10
+ * 컴포넌트에서는 `$store`로 스냅샷을, `store.chart`로 액션을 사용한다.
11
+ */
12
+ export declare function createChartStore(options: ChartCoreOptions): ChartStore;
13
+ /** 이미 생성된 ChartCore 인스턴스를 Svelte 스토어 계약으로 감싼다 */
14
+ export declare function toChartStore(chart: ChartCore): ChartStore;
15
+ //# sourceMappingURL=chartStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chartStore.d.ts","sourceRoot":"","sources":["../src/lib/chartStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAExE,8CAA8C;AAC9C,MAAM,WAAW,UAAW,SAAQ,QAAQ,CAAC,aAAa,CAAC;IACzD,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,UAAU,CAEtE;AAED,iDAAiD;AACjD,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,CAKzD"}
@@ -0,0 +1,14 @@
1
+ import { readable } from "svelte/store";
2
+ import { ChartCore } from "@moda-chart/core";
3
+ /**
4
+ * ChartCore를 생성하고 Svelte 스토어 계약으로 감싼다.
5
+ * 컴포넌트에서는 `$store`로 스냅샷을, `store.chart`로 액션을 사용한다.
6
+ */
7
+ export function createChartStore(options) {
8
+ return toChartStore(new ChartCore(options));
9
+ }
10
+ /** 이미 생성된 ChartCore 인스턴스를 Svelte 스토어 계약으로 감싼다 */
11
+ export function toChartStore(chart) {
12
+ const { subscribe } = readable(chart.getSnapshot(), (set) => chart.subscribe(() => set(chart.getSnapshot())));
13
+ return { subscribe, chart };
14
+ }
@@ -0,0 +1,7 @@
1
+ export { createChartStore, toChartStore } from "./chartStore.js";
2
+ export type { ChartViewProps } from "./types.js";
3
+ export type { ChartStore } from "./chartStore.js";
4
+ export { default as ChartView } from "./ChartView.svelte";
5
+ 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";
6
+ export { ChartCore, mountSparkline, parseDataXml, parseText, sparklineMarkup, WORLD_TOPOLOGY, } from "@moda-chart/core";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACjE,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC1D,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,3 @@
1
+ export { createChartStore, toChartStore } from "./chartStore.js";
2
+ export { default as ChartView } from "./ChartView.svelte";
3
+ export { ChartCore, mountSparkline, parseDataXml, parseText, sparklineMarkup, WORLD_TOPOLOGY, } from "@moda-chart/core";
@@ -0,0 +1 @@
1
+ @import "@moda-chart/core/styles.css";
@@ -0,0 +1,5 @@
1
+ import type { ChartCore } from "@moda-chart/core";
2
+ export interface ChartViewProps {
3
+ chart: ChartCore;
4
+ }
5
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,SAAS,CAAC;CAClB"}
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,53 @@
1
1
  {
2
2
  "name": "@moda-chart/svelte",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.2",
4
+ "description": "Svelte 5 adapter for @moda-chart — chartStore + ChartView",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "exports": {
8
+ ".": {
9
+ "svelte": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ },
13
+ "./styles.css": "./dist/styles.css"
14
+ },
15
+ "types": "./dist/index.d.ts",
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "sideEffects": [
20
+ "**/*.css"
21
+ ],
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "keywords": [
26
+ "svelte",
27
+ "adapter",
28
+ "headless",
29
+ "library"
30
+ ],
31
+ "dependencies": {
32
+ "@moda-chart/core": "0.1.2"
33
+ },
34
+ "peerDependencies": {
35
+ "svelte": "^5.0.0"
36
+ },
37
+ "devDependencies": {
38
+ "@sveltejs/package": "^2.5.0",
39
+ "@sveltejs/vite-plugin-svelte": "^5.0.0",
40
+ "svelte": "^5.0.0",
41
+ "svelte-check": "^4.0.0",
42
+ "typescript": "~5.9.2",
43
+ "happy-dom": "^20.14.5",
44
+ "vitest": "^3.2.7"
45
+ },
46
+ "scripts": {
47
+ "build": "svelte-package",
48
+ "typecheck": "svelte-check --tsconfig ./tsconfig.json",
49
+ "dev": "svelte-package --watch",
50
+ "test": "vitest run"
51
+ },
52
+ "main": "./dist/index.js"
6
53
  }